diff options
author | Robert Griebl <robert.griebl@nokia.com> | 2010-06-21 15:59:23 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2010-06-25 06:41:15 (GMT) |
commit | 156cabe79a64ffca8d6e1a2df99f35b413a48a39 (patch) | |
tree | 2c4868d95038c9d6a91ac6d3db269a993ef1feb1 /tools/qml/loggerwidget.cpp | |
parent | 543bbe2e122d1d3394ec589c32f9640d1fd88f3b (diff) | |
download | Qt-156cabe79a64ffca8d6e1a2df99f35b413a48a39.zip Qt-156cabe79a64ffca8d6e1a2df99f35b413a48a39.tar.gz Qt-156cabe79a64ffca8d6e1a2df99f35b413a48a39.tar.bz2 |
Make the QML viewer usable on the N900
Diffstat (limited to 'tools/qml/loggerwidget.cpp')
-rw-r--r-- | tools/qml/loggerwidget.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index 3ae2b5e..71d20e8 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -39,29 +39,48 @@ ** ****************************************************************************/ -#include "loggerwidget.h" #include <qglobal.h> #include <QDebug> #include <QSettings> #include <QActionGroup> #include <QMenu> +#include <QPlainTextEdit> +#ifdef Q_WS_MAEMO_5 +# include <QScrollArea> +# include <QVBoxLayout> +# include "texteditautoresizer_maemo5.h" +#endif + +#include "loggerwidget.h" QT_BEGIN_NAMESPACE LoggerWidget::LoggerWidget(QWidget *parent) : - QPlainTextEdit(parent), + QMainWindow(parent), m_visibilityOrigin(SettingsOrigin) { setAttribute(Qt::WA_QuitOnClose, false); setWindowTitle(tr("Warnings")); + m_plainTextEdit = new QPlainTextEdit(); + +#ifdef Q_WS_MAEMO_5 + new TextEditAutoResizer(m_plainTextEdit); + setAttribute(Qt::WA_Maemo5StackedWindow); + QScrollArea *area = new QScrollArea(); + area->setWidget(m_plainTextEdit); + area->setWidgetResizable(true); + setCentralWidget(area); +#else + setCentralWidget(m_plainTextEdit); +#endif readSettings(); setupPreferencesMenu(); } void LoggerWidget::append(const QString &msg) { - appendPlainText(msg); + m_plainTextEdit->appendPlainText(msg); if (!isVisible() && (defaultVisibility() == AutoShowWarnings)) setVisible(true); |