From e86dcc14481b2be48227c83ac19f5ef55eeba084 Mon Sep 17 00:00:00 2001 From: AG3 Date: Tue, 14 Oct 2014 20:57:41 +0800 Subject: [PATCH] Bug fix & add title bar UI is still ugly --- MainUI.qml | 38 +++++++++++++++++++++++++++++++++++--- WechatAudioManager.pro | 3 +-- backend.cpp | 8 ++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/MainUI.qml b/MainUI.qml index 4cdaccd..f00f892 100644 --- a/MainUI.qml +++ b/MainUI.qml @@ -4,13 +4,15 @@ Rectangle { width:RootWidth height:RootHeight id:root; + + ListView{ id:listview width:parent.width - height:parent.height/8*7 + height:parent.height/4*3 + y:parent.height/8 x:0 - y:0 model:AFIM delegate: Rectangle{ width:listview.width @@ -137,7 +139,7 @@ Rectangle { text:"设置" color: "white" font.family: "微软雅黑" - font.bold: true + //font.bold: true verticalAlignment: Text.AlignVCenter font.pointSize: 15 styleColor: "#ffffff" @@ -152,4 +154,34 @@ Rectangle { } } } + + Rectangle{ + width:parent.width + height:parent.height/8 + color:"lightblue" + Text{ + height: parent.height + width:parent.width/2 + text:"持续时间" + font.family: "微软雅黑" + font.bold: true + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + + font.pointSize: 19 + color: "purple" + } + Text{ + height: parent.height + width:parent.width/2 + x:parent.width/2 + text:"创建时间" + font.family: "微软雅黑" + font.bold: true + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + font.pointSize: 19 + color: "purple" + } + } } diff --git a/WechatAudioManager.pro b/WechatAudioManager.pro index 3214e62..6623971 100644 --- a/WechatAudioManager.pro +++ b/WechatAudioManager.pro @@ -28,8 +28,7 @@ MOBILITY = ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android OTHER_FILES += \ - android/AndroidManifest.xml \ - MainUI.qml + android/AndroidManifest.xml RESOURCES += \ source.qrc diff --git a/backend.cpp b/backend.cpp index d202f09..45d5e9a 100644 --- a/backend.cpp +++ b/backend.cpp @@ -8,7 +8,7 @@ Backend::Backend(QObject *parent) : flag=false; ind=0; AFIM=new AudioFileInfoModel(); - AFIM->addAudioFileInfo(AudioFileInfo("时长 ","创建日期",0)); + //AFIM->addAudioFileInfo(AudioFileInfo("时长 ","创建日期",0)); player=new QMediaPlayer(); connect(player,SIGNAL(durationChanged(qint64)),this,SLOT(getDuration(qint64)),Qt::DirectConnection); } @@ -113,7 +113,7 @@ void Backend::addItems() if(q.front()<10) t="0"+QString::number(q.front()); else t=QString::number(q.front()); q.pop_front(); - AFIM->addAudioFileInfo(AudioFileInfo(t+"秒",resList[ind].created().toString("mm月yy年 hh:mm:ss"),ind+1)); + AFIM->addAudioFileInfo(AudioFileInfo(t+"秒",resList[ind].created().toString("MM月dd日 hh:mm:ss"),ind+1)); ind++; } } @@ -122,11 +122,11 @@ void Backend::copyFile(QString ind) { qDebug()<<"!!!"; int index=ind.toInt()-1; - QDir myDir("D:/sdcard/"); + QDir myDir("/sdcard/"); if(!QDir(myDir.absolutePath()+"WeChatAudioManager").exists()) myDir.mkdir("WeChatAudioManager"); myDir.setPath("/sdcard/WeChatAudioManager/"); QFile::copy(resList[index].absoluteFilePath(),myDir.absolutePath()+"/"+resList[index].fileName()); - //QMessageBox::warning(this,"文件拷贝成功","当前语音消息已拷贝至"+myDir.absolutePath()+"中!请用文件管理器查看!"); + //QMessageBox::information(0,"文件拷贝成功","当前语音消息已拷贝至"+myDir.absolutePath()+"中!请用文件管理器查看!",QMessageBox::Yes); }