From adc6d4776e6570fa6e6d5d2e4e40fe7eab0ebb99 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 4 Nov 2010 13:45:46 +1000 Subject: Fix bearermonitor when building for Maemo in scratchbox. Use the correct ui file when building in scratchbox. Remove use of message boxes. --- examples/network/bearermonitor/bearermonitor.cpp | 22 +- examples/network/bearermonitor/bearermonitor.h | 4 +- examples/network/bearermonitor/bearermonitor.pro | 3 +- .../network/bearermonitor/bearermonitor_maemo.ui | 601 +++++++++++---------- examples/network/bearermonitor/main.cpp | 9 +- examples/network/bearermonitor/sessionwidget.cpp | 4 +- examples/network/bearermonitor/sessionwidget.h | 5 +- 7 files changed, 353 insertions(+), 295 deletions(-) diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 2c976ff..75ffb01 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -41,8 +41,8 @@ #include "bearermonitor.h" #include "sessionwidget.h" -#include -#include +#include + #ifdef Q_OS_WIN #include #undef interface @@ -56,20 +56,18 @@ BearerMonitor::BearerMonitor(QWidget *parent) : QWidget(parent) { setupUi(this); -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#ifdef MAEMO_UI newSessionButton->hide(); deleteSessionButton->hide(); #else delete tabWidget->currentWidget(); sessionGroup->hide(); #endif -#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) setWindowState(Qt::WindowMaximized); #endif updateConfigurations(); -#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) onlineStateChanged(!manager.allConfigurations(QNetworkConfiguration::Active).isEmpty()); -#endif QNetworkConfiguration defaultConfiguration = manager.defaultConfiguration(); for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) { QTreeWidgetItem *item = treeWidget->topLevelItem(i); @@ -104,7 +102,7 @@ BearerMonitor::BearerMonitor(QWidget *parent) connect(newSessionButton, SIGNAL(clicked()), this, SLOT(createNewSession())); -#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) +#ifndef MAEMO_UI connect(deleteSessionButton, SIGNAL(clicked()), this, SLOT(deleteSession())); #endif @@ -257,15 +255,9 @@ void BearerMonitor::updateConfigurations() void BearerMonitor::onlineStateChanged(bool isOnline) { if (isOnline) -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) - QMessageBox::information(this, "Connection state changed", "Online", QMessageBox::Close); - else - QMessageBox::information(this, "Connection state changed", "Offline", QMessageBox::Close); -#else onlineState->setText(tr("Online")); else onlineState->setText(tr("Offline")); -#endif } #ifdef Q_OS_WIN @@ -393,7 +385,7 @@ void BearerMonitor::createSessionFor(QTreeWidgetItem *item) tabWidget->addTab(session, conf.name()); -#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) +#ifndef MAEMO_UI sessionGroup->show(); #endif @@ -408,7 +400,7 @@ void BearerMonitor::createNewSession() createSessionFor(item); } -#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) +#ifndef MAEMO_UI void BearerMonitor::deleteSession() { SessionWidget *session = qobject_cast(tabWidget->currentWidget()); diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h index 45e7275..df1c78b 100644 --- a/examples/network/bearermonitor/bearermonitor.h +++ b/examples/network/bearermonitor/bearermonitor.h @@ -45,7 +45,7 @@ #include #if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) #include "ui_bearermonitor_240_320.h" -#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#elif defined(MAEMO_UI) #include "ui_bearermonitor_maemo.h" #else #include "ui_bearermonitor_640_480.h" @@ -81,7 +81,7 @@ private slots: void createSessionFor(QTreeWidgetItem *item); void createNewSession(); -#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) +#ifndef MAEMO_UI void deleteSession(); #endif void performScan(); diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro index 4b2c35b..bd9bd68 100644 --- a/examples/network/bearermonitor/bearermonitor.pro +++ b/examples/network/bearermonitor/bearermonitor.pro @@ -8,7 +8,8 @@ SOURCES = main.cpp \ bearermonitor.cpp \ sessionwidget.cpp -maemo5|maemo6 { +maemo5|maemo6|linux-g++-maemo { + DEFINES += MAEMO_UI FORMS = bearermonitor_maemo.ui \ sessionwidget_maemo.ui } else { diff --git a/examples/network/bearermonitor/bearermonitor_maemo.ui b/examples/network/bearermonitor/bearermonitor_maemo.ui index a7940c6..9c72bfd 100644 --- a/examples/network/bearermonitor/bearermonitor_maemo.ui +++ b/examples/network/bearermonitor/bearermonitor_maemo.ui @@ -7,300 +7,359 @@ 0 0 612 - 495 + 555 BearerMonitor - + - - - - 0 - 0 - + + + System State - - 0 + + true - - false + + + 0 + + + + + Online State: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Configurations && Sessions - - - Configurations - - - - - - - 0 - 0 - - - - false + + true + + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + 0 + + + false + + + + Configurations - - - 1 - - - - - - - - - - - - Name: - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - State: - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - Type: - - - - - - - - 0 - 0 - - - - Invalid - - - - - - - - - - - Purpose: - - - - - - - - 0 - 0 - - - - Unknown - - - - - - - - - - - Identifier: - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - Roaming: - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - Children: - - - - - - - - 0 - 0 - - + + + + + + 0 + 0 + + + + false + + + false + + - + 1 - - - - - - - - Network Location Awareness - - + + + + + + + + + + + Name: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + State: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Type: + + + + + + + + 0 + 0 + + + + Invalid + + + + + + + + + + + Purpose: + + + + + + + + 0 + 0 + + + + Unknown + + + + + + + + + + + Identifier: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Roaming: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Children: + + + + + + + + 0 + 0 + + + + + + + + + + + + + Network Location Awareness + + + + + + Register + + + + + + + Unregister + + + + + + - + - Register + New Session - + - Unregister + Delete Session + + + + Scan + + + + + + + 0 + + + 23280 + + + false + + + false + + + %p% + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - - - New Session - - - - - - - Delete Session - - - - - - - Scan - - - - - - - 0 - - - 23280 - - - false - - - false - - - %p% - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - + + + + + + diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp index 1a22c13..11399e4 100644 --- a/examples/network/bearermonitor/main.cpp +++ b/examples/network/bearermonitor/main.cpp @@ -38,7 +38,8 @@ ** ****************************************************************************/ -#include +#include +#include #include "bearermonitor.h" @@ -46,8 +47,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); + QMainWindow mainWindow; + BearerMonitor monitor; - monitor.show(); + + mainWindow.setCentralWidget(&monitor); + mainWindow.show(); return app.exec(); } diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp index 5ec9d53..51de0f2 100644 --- a/examples/network/bearermonitor/sessionwidget.cpp +++ b/examples/network/bearermonitor/sessionwidget.cpp @@ -74,7 +74,7 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren this, SLOT(closeSession())); connect(stopSessionButton, SIGNAL(clicked()), this, SLOT(stopSession())); -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#ifdef MAEMO_UI connect(deleteSessionButton, SIGNAL(clicked()), this, SLOT(deleteSession())); #endif @@ -94,7 +94,7 @@ void SessionWidget::timerEvent(QTimerEvent *e) } } -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#ifdef MAEMO_UI void SessionWidget::deleteSession() { delete this; diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h index c92db44..846a1af 100644 --- a/examples/network/bearermonitor/sessionwidget.h +++ b/examples/network/bearermonitor/sessionwidget.h @@ -42,7 +42,8 @@ #define SESSIONWIDGET_H #include -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + +#ifdef MAEMO_UI #include "ui_sessionwidget_maemo.h" #else #include "ui_sessionwidget.h" @@ -71,7 +72,7 @@ private Q_SLOTS: void stopSession(); void updateSession(); void updateSessionError(QNetworkSession::SessionError error); -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#ifdef MAEMO_UI void deleteSession(); #endif -- cgit v0.12 From 564058a1bbfb1c67bc3d68b7c7a2ebfe83481334 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 4 Nov 2010 12:23:54 +0200 Subject: Use qtmain.lib to provide entry point for all Symbian applications Using Open C's libcrt0.lib to provide entry point caused problems for applications that launched other processes, as Open C retains a handle to all launched processes even after said processes terminate. Task-number: QTBUG-14735 Reviewed-by: axis --- mkspecs/common/symbian/symbian.conf | 3 ++- mkspecs/features/symbian/default_post.prf | 3 --- mkspecs/features/symbian/symbian_building.prf | 20 +++++--------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index decec14..6d1f708 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -79,7 +79,6 @@ QMAKE_LIBS_OPENGL_ES2_QT = -llibglesv2 -lcone -lws32 QMAKE_LIBS_OPENVG = -llibOpenVG -lfbscli -lbitgdi -lgdi QMAKE_LIBS_THREAD = -llibpthread QMAKE_LIBS_COMPAT = -QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon -leikcoctl exists($${EPOCROOT}epoc32/include/platform/sgresource/sgimage.h) { @@ -127,6 +126,8 @@ QT_ARCH = symbian load(qt_config) +QMAKE_LIBS_QT_ENTRY = -lqtmain$${QT_LIBINFIX}.lib + # These directories must match what configure uses for QT_INSTALL_PLUGINS and QT_INSTALL_IMPORTS QT_PLUGINS_BASE_DIR = /resource/qt$${QT_LIBINFIX}/plugins QT_IMPORTS_BASE_DIR = /resource/qt/imports diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf index 0564e9b..348c366 100644 --- a/mkspecs/features/symbian/default_post.prf +++ b/mkspecs/features/symbian/default_post.prf @@ -3,9 +3,6 @@ load(default_post) contains(TEMPLATE, ".*app") { contains(CONFIG, stdbinary) { QMAKE_LIBS += - } else:contains(QT, gui):contains(CONFIG,qt) { - S60MAIN_LIBS = -leuser - QMAKE_LIBS += -lqtmain$${QT_LIBINFIX}.lib $$S60MAIN_LIBS } else { QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY } diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 1a51cb2..20bc3a3 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -187,26 +187,16 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { linux-armcc: { QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\) QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\) - contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore - QMAKE_LIBS -= -lqtmain$${QT_LIBINFIX}.lib - QMAKE_LIBS += -lqtmain$${QT_LIBINFIX}.lib - } else { - QMAKE_LIBS -= -llibcrt0.lib - QMAKE_LIBS += -llibcrt0.lib - } + QMAKE_LIBS -= $$QMAKE_LIBS_QT_ENTRY + QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY } else :linux-gcce { # notice that we can't merge these as ordering of arguments is important. QMAKE_LIBS += \ -l:eexe.lib \ -l:usrt2_2.lib - contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore - QMAKE_LIBS -= -l:qtmain$${QT_LIBINFIX}.lib - QMAKE_LIBS += -l:qtmain$${QT_LIBINFIX}.lib - } else { - QMAKE_LIBS -= -l:libcrt0.lib - QMAKE_LIBS -= -l:libcrt0_gcce.lib - QMAKE_LIBS += -l:libcrt0_gcce.lib - } + modified_entry = $$replace(QMAKE_LIBS_QT_ENTRY, "^-l", "-l:") + QMAKE_LIBS -= $$modified_entry + QMAKE_LIBS += $$modified_entry QMAKE_LIBS += \ -l:dfpaeabi.dso \ -l:drtaeabi.dso \ -- cgit v0.12 From 5a79d8e83d1f62e365e179b84fa7be1112eb8a52 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Thu, 4 Nov 2010 14:47:20 +0200 Subject: Wordwrap QInputDialog label in Symbian Enable wordwrapping for QInputDialog in Symbian to allow longer texts to be displayed without cutting them off. Fixes issue with javascript prompt not showing long texts. Task-number: QT-4008 Reviewed-by: Sami Merila --- src/gui/dialogs/qinputdialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index abaaa49..ce27bd3 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -561,6 +561,9 @@ void QInputDialog::setLabelText(const QString &text) } else { d->label->setText(text); } +#ifdef Q_OS_SYMBIAN + d->label->setWordWrap(true); +#endif } QString QInputDialog::labelText() const -- cgit v0.12 From a52f572d513e2002e442769a46664009f45bc74a Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 4 Nov 2010 15:27:39 +0200 Subject: Remove code changes that were NOT intended as part of the fix For some unknown reasons (read: missed git checkout -f), few code line changes which were NOT part of fix for QTBUG-14331 crept into the commit. These are now removed with this fix. Task-number: QTBUG-14331 Reviewed-by: Janne Anttila --- src/gui/styles/qs60style.cpp | 18 ------------------ src/gui/styles/qs60style_p.h | 1 - 2 files changed, 19 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 53ca28c..f3fb2f5 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -112,8 +112,6 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** End of generated data *** }; -QSet *QS60StylePrivate::m_autoFillDisabledWidgets = 0; - const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; // theme background texture @@ -154,8 +152,6 @@ const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { - delete m_autoFillDisabledWidgets; - m_autoFillDisabledWidgets = 0; clearCaches(); //deletes also background image deleteThemePalette(); #ifdef Q_WS_S60 @@ -3188,13 +3184,6 @@ void QS60Style::polish(QWidget *widget) } d->setThemePalette(widget); d->setFont(widget); - - if (widget->autoFillBackground()) { - if (!d->m_autoFillDisabledWidgets) - d->m_autoFillDisabledWidgets = new QSet; - widget->setAutoFillBackground(false); - d->m_autoFillDisabledWidgets->insert(widget); - } } /*! @@ -3229,13 +3218,6 @@ void QS60Style::unpolish(QWidget *widget) if (widget) widget->setPalette(QPalette()); - - if (d->m_autoFillDisabledWidgets && - !d->m_autoFillDisabledWidgets->isEmpty() && - d->m_autoFillDisabledWidgets->contains(widget)) { - widget->setAutoFillBackground(true); - d->m_autoFillDisabledWidgets->remove(widget); - } #if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR) if (QProgressBar *bar = qobject_cast(widget)) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 3d66c40..b46f75e 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -625,7 +625,6 @@ private: static qint64 m_webPaletteKey; static QPointer m_pressedWidget; - static QSet *m_autoFillDisabledWidgets; #ifdef Q_WS_S60 //list of progress bars having animation running -- cgit v0.12