修訂 | 5d1a352096bf3cd80e0b09176f6c7e6d51f30ae7 (tree) |
---|---|
時間 | 2013-02-06 23:32:17 |
作者 | alucky4416 <alucky4416@user...> |
Commiter | alucky4416 |
CHG: lost display text on statusbar, statusbar->showMessage change to addWidget(label)+label->setText().
@@ -23,6 +23,9 @@ MainWindow::MainWindow(QWidget *parent) : | ||
23 | 23 | QCoreApplication::setApplicationName("QtUSBRH-Logger-win32"); |
24 | 24 | QCoreApplication::setApplicationVersion("0.1"); |
25 | 25 | |
26 | + label_statusbar = new QLabel; | |
27 | + ui->statusBar->addWidget(label_statusbar); | |
28 | + | |
26 | 29 | IniFilepath = QCoreApplication::applicationDirPath() + QDir::separator() + QCoreApplication::applicationName() + ".ini"; |
27 | 30 | // Load Setting |
28 | 31 | LoadSaveSetting(IniFilepath, false); |
@@ -71,6 +74,8 @@ MainWindow::~MainWindow() | ||
71 | 74 | daqTh->wait(); |
72 | 75 | delete daqTh; |
73 | 76 | |
77 | + delete label_statusbar; | |
78 | + | |
74 | 79 | delete ui; |
75 | 80 | } |
76 | 81 |
@@ -118,7 +123,8 @@ void MainWindow::slotGetData(QDateTime timestamp, double tmpr, double humid) | ||
118 | 123 | } |
119 | 124 | void MainWindow::slotChangeLogFilename(QString filename) |
120 | 125 | { |
121 | - ui->statusBar->showMessage(QString(tr("logfile: %1")).arg(filename)); | |
126 | +// ui->statusBar->showMessage(QString(tr("logfile: %1")).arg(filename)); | |
127 | + label_statusbar->setText(QString(tr("logfile: %1")).arg(filename)); | |
122 | 128 | } |
123 | 129 | |
124 | 130 | void MainWindow::slotLogStarted() |
@@ -2,6 +2,7 @@ | ||
2 | 2 | #define MAINWINDOW_H |
3 | 3 | |
4 | 4 | #include <QMainWindow> |
5 | +#include <QLabel> | |
5 | 6 | #include <QDateTime> |
6 | 7 | |
7 | 8 | #include "daqthread.h" |
@@ -39,6 +40,7 @@ private slots: | ||
39 | 40 | private: |
40 | 41 | Ui::MainWindow *ui; |
41 | 42 | |
43 | + QLabel *label_statusbar; | |
42 | 44 | QString IniFilepath; |
43 | 45 | void LoadSaveSetting(QString inifilepath, bool store); |
44 | 46 |