diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-01-10 05:29:03 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2011-01-10 05:43:38 (GMT) |
commit | 7aae8a569809208318ad06017eda39c860c1b2a9 (patch) | |
tree | 00381cbde57e5ee69dd8f0d9871997e3934ff204 /tools/qml/loggerwidget.cpp | |
parent | cbf6bfbff8c0643bc82bb2456214994931052bd6 (diff) | |
download | Qt-7aae8a569809208318ad06017eda39c860c1b2a9.zip Qt-7aae8a569809208318ad06017eda39c860c1b2a9.tar.gz Qt-7aae8a569809208318ad06017eda39c860c1b2a9.tar.bz2 |
Add no warnings label to qmlviewer warnings window
Small developer usability improvement
Task-number:
Reviewed-by: Bea Lam
Diffstat (limited to 'tools/qml/loggerwidget.cpp')
-rw-r--r-- | tools/qml/loggerwidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index f601d95..fb4fedc 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -45,6 +45,8 @@ #include <QActionGroup> #include <QMenu> #include <QPlainTextEdit> +#include <QLabel> +#include <QVBoxLayout> #ifdef Q_WS_MAEMO_5 # include <QScrollArea> # include <QVBoxLayout> @@ -83,6 +85,14 @@ LoggerWidget::LoggerWidget(QWidget *parent) : setCentralWidget(m_plainTextEdit); #endif + m_noWarningsLabel = new QLabel(m_plainTextEdit); + m_noWarningsLabel->setText(tr("(No warnings)")); + m_noWarningsLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter); + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(m_noWarningsLabel); + m_plainTextEdit->setLayout(layout); + connect(m_plainTextEdit, SIGNAL(textChanged()), this, SLOT(updateNoWarningsLabel())); + readSettings(); setupPreferencesMenu(); } @@ -207,4 +217,9 @@ void LoggerWidget::setupPreferencesMenu() } } +void LoggerWidget::updateNoWarningsLabel() +{ + m_noWarningsLabel->setVisible(m_plainTextEdit->toPlainText().length() == 0); +} + QT_END_NAMESPACE |