diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-14 23:08:01 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-14 23:08:01 (GMT) |
commit | 2d23e45c94b6115db2b1efadfe77841f481545ca (patch) | |
tree | 0e6ff89dbcc410dd2ef5b0e873473971f3dd1b07 /src/gui | |
parent | 65e0628bd0cdcb43226dad05582a97a6ef218124 (diff) | |
parent | 42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff) | |
download | Qt-2d23e45c94b6115db2b1efadfe77841f481545ca.zip Qt-2d23e45c94b6115db2b1efadfe77841f481545ca.tar.gz Qt-2d23e45c94b6115db2b1efadfe77841f481545ca.tar.bz2 |
Merge remote branch 'origin/master' into bearermanagement/integration
Conflicts:
tests/auto/qlineedit/tst_qlineedit.cpp
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 9 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 14 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60.cpp | 16 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 190 | ||||
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 8 | ||||
-rw-r--r-- | src/gui/text/qzipreader_p.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/qvalidator.h | 5 |
9 files changed, 133 insertions, 116 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 39c41c4..63b0ec7 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -319,7 +319,7 @@ QGraphicsItem::keyPressEvent() and QGraphicsItem::keyReleaseEvent(). \value ItemClipsToShape The item clips to its own shape. The item cannot - draw or receive mouse, tablet, drag and drop or hover events outside ts + draw or receive mouse, tablet, drag and drop or hover events outside its shape. It is disabled by default. This behavior is enforced by QGraphicsView::drawItems() or QGraphicsScene::drawItems(). This flag was introduced in Qt 4.3. @@ -668,6 +668,7 @@ #include <QtCore/qtimer.h> #include <QtCore/qvariant.h> #include <QtCore/qvarlengtharray.h> +#include <QtCore/qnumeric.h> #include <QtGui/qapplication.h> #include <QtGui/qbitmap.h> #include <QtGui/qpainter.h> @@ -3442,6 +3443,9 @@ void QGraphicsItem::setX(qreal x) if (d_ptr->inDestructor) return; + if (qIsNaN(x)) + return; + d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y())); } @@ -3466,6 +3470,9 @@ void QGraphicsItem::setY(qreal y) if (d_ptr->inDestructor) return; + if (qIsNaN(y)) + return; + d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y)); } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index bb6aca9..336be91 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5264,10 +5264,20 @@ QInputContext *QApplication::inputContext() const qic = QInputContextFactory::create(QLatin1String("xim"), that); that->d_func()->inputContext = qic; } -#elif defined(Q_WS_S60) +#elif defined(Q_OS_SYMBIAN) if (!d->inputContext) { QApplication *that = const_cast<QApplication *>(this); - that->d_func()->inputContext = QInputContextFactory::create(QString::fromLatin1("coefep"), that); + const QStringList keys = QInputContextFactory::keys(); + // Try hbim and coefep first, then try others. + if (keys.contains("hbim")) { + that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("hbim"), that); + } else if (keys.contains("coefep")) { + that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("coefep"), that); + } else { + for (int c = 0; c < keys.size() && !d->inputContext; ++c) { + that->d_func()->inputContext = QInputContextFactory::create(keys[c], that); + } + } } #endif return d->inputContext; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index af84a8f..8ac1e31 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -66,17 +66,18 @@ QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60() cachedCbaIconSize[1] = QSize(0,0); cachedCbaIconSize[2] = QSize(0,0); cachedCbaIconSize[3] = QSize(0,0); - skipNextUpdate = false; } bool QSoftKeyManagerPrivateS60::skipCbaUpdate() { - // lets not update softkeys if + // Lets not update softkeys if // 1. We don't have application panes, i.e. cba - // 2. S60 native dialog or menu is shown - if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) || - CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || skipNextUpdate) { - skipNextUpdate = false; + // 2. Our CBA is not active, i.e. S60 native dialog or menu with custom CBA is shown + // Note: Cannot use IsDisplayingMenuOrDialog since CBA update can be triggered before + // menu/dialog CBA is actually displayed i.e. it is being costructed. + CEikButtonGroupContainer *appUiCba = S60->buttonGroupContainer(); + CEikButtonGroupContainer *currentCba = CEikButtonGroupContainer::Current(); + if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) || appUiCba != currentCba) { return true; } return false; @@ -384,9 +385,6 @@ bool QSoftKeyManagerPrivateS60::handleCommand(int command) } qt_symbian_next_menu_from_action(actionContainer); QT_TRAP_THROWING(S60->menuBar()->TryDisplayMenuBarL()); - // TODO: hack remove, it can happen that IsDisplayingMenuOrDialog return false - // in updateSoftKeys_sys, and we will override menu CBA with our own - skipNextUpdate = true; } else { Q_ASSERT(action->softKeyRole() != QAction::NoSoftKey); QWidget *actionParent = action->parentWidget(); diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h index f8bd6d9..823a2db 100644 --- a/src/gui/kernel/qsoftkeymanager_s60_p.h +++ b/src/gui/kernel/qsoftkeymanager_s60_p.h @@ -98,7 +98,6 @@ private: private: QHash<int, QAction*> realSoftKeyActions; QSize cachedCbaIconSize[4]; - bool skipNextUpdate; }; diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 1e92507..d433048 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8277,7 +8277,7 @@ bool QWidget::event(QEvent *event) } #ifdef QT_SOFTKEYS_ENABLED - if (isWindow() && isActiveWindow()) + if (isWindow()) QSoftKeyManager::updateSoftKeys(); #endif diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 7f9b058..f8464cc 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5761,88 +5761,88 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons switch (standardIcon) { #ifndef QT_NO_IMAGEFORMAT_PNG case SP_FileDialogNewFolder: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-128.png"), QSize(128, 128)); break; case SP_FileDialogBack: return standardIconImplementation(SP_ArrowBack, option, widget); case SP_FileDialogToParent: return standardIconImplementation(SP_ArrowUp, option, widget); case SP_FileDialogDetailedView: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-128.png"), QSize(128, 128)); break; case SP_FileDialogInfoView: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-128.png"), QSize(128, 128)); break; case SP_FileDialogContentsView: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-128.png"), QSize(128, 128)); break; case SP_FileDialogListView: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-128.png"), QSize(128, 128)); break; case SP_DialogOkButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-128.png"), QSize(128, 128)); break; case SP_DialogCancelButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-128.png"), QSize(128, 128)); break; case SP_DialogHelpButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-128.png"), QSize(128, 128)); break; case SP_DialogOpenButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-128.png"), QSize(128, 128)); break; case SP_DialogSaveButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png"), QSize(128, 128)); break; case SP_DialogCloseButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-128.png"), QSize(128, 128)); break; case SP_DialogApplyButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-128.png"), QSize(128, 128)); break; case SP_DialogResetButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-128.png"), QSize(128, 128)); break; case SP_DialogDiscardButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-128.png"), QSize(128, 128)); break; case SP_DialogYesButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-128.png"), QSize(128, 128)); break; case SP_DialogNoButton: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-128.png"), QSize(128, 128)); break; case SP_ArrowForward: if (rtl) @@ -5853,24 +5853,24 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons return standardIconImplementation(SP_ArrowRight, option, widget); return standardIconImplementation(SP_ArrowLeft, option, widget); case SP_ArrowLeft: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/left-128.png"), QSize(128, 128)); break; case SP_ArrowRight: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/right-128.png"), QSize(128, 128)); break; case SP_ArrowUp: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/up-128.png"), QSize(128, 128)); break; case SP_ArrowDown: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/down-128.png"), QSize(128, 128)); break; case SP_DirHomeIcon: case SP_DirIcon: @@ -5888,71 +5888,71 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons QSize(128, 128), QIcon::Normal, QIcon::On); break; case SP_DriveCDIcon: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-128.png"), QSize(128, 128)); break; case SP_DriveDVDIcon: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-128.png"), QSize(128, 128)); break; case SP_FileIcon: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/file-128.png"), QSize(128, 128)); break; case SP_FileLinkIcon: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-128.png"), QSize(128, 128)); break; case SP_TrashIcon: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-32.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-128.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-32.png"), QSize(32, 32)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/trash-128.png"), QSize(128, 128)); break; case SP_BrowserReload: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/refresh-24.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/refresh-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/refresh-24.png"), QSize(24, 24)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/refresh-32.png"), QSize(32, 32)); break; case SP_BrowserStop: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/stop-24.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/stop-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/stop-24.png"), QSize(24, 24)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/stop-32.png"), QSize(32, 32)); break; case SP_MediaPlay: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-play-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-play-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-play-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-play-32.png"), QSize(32, 32)); break; case SP_MediaPause: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-32.png"), QSize(32, 32)); break; case SP_MediaStop: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-32.png"), QSize(32, 32)); break; case SP_MediaSeekForward: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-32.png"), QSize(32, 32)); break; case SP_MediaSeekBackward: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-32.png"), QSize(32, 32)); break; case SP_MediaSkipForward: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-32.png"), QSize(32, 32)); break; case SP_MediaSkipBackward: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-16.png")); - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-32.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-16.png"), QSize(16, 16)); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-32.png"), QSize(32, 32)); break; case SP_MediaVolume: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-16.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-16.png"), QSize(16, 16)); break; case SP_MediaVolumeMuted: - icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-muted-16.png")); + icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-muted-16.png"), QSize(16, 16)); break; #endif // QT_NO_IMAGEFORMAT_PNG default: diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 8d3923f..f345cd1 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -441,7 +441,6 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(_q_documentLayoutChanged())); // convenience signal forwards - QObject::connect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged())); QObject::connect(doc, SIGNAL(undoAvailable(bool)), q, SIGNAL(undoAvailable(bool))); QObject::connect(doc, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool))); QObject::connect(doc, SIGNAL(modificationChanged(bool)), q, SIGNAL(modificationChanged(bool))); @@ -452,8 +451,11 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, if (!document) doc->setUndoRedoEnabled(false); + //Saving the index save some time. + static int contentsChangedIndex = QTextDocument::staticMetaObject.indexOfSignal("contentsChanged()"); + static int textChangedIndex = QTextControl::staticMetaObject.indexOfSignal("textChanged()"); // avoid multiple textChanged() signals being emitted - QObject::disconnect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged())); + QMetaObject::disconnect(doc, contentsChangedIndex, q, textChangedIndex); if (!text.isEmpty()) { // clear 'our' cursor for insertion to prevent @@ -488,7 +490,7 @@ void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, } cursor.setCharFormat(charFormatForInsertion); - QObject::connect(doc, SIGNAL(contentsChanged()), q, SIGNAL(textChanged())); + QMetaObject::connect(doc, contentsChangedIndex, q, textChangedIndex); emit q->textChanged(); if (!document) doc->setUndoRedoEnabled(previousUndoRedoState); diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h index 67a2ace..9b73373 100644 --- a/src/gui/text/qzipreader_p.h +++ b/src/gui/text/qzipreader_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QZipReaderPrivate; -class Q_AUTOTEST_EXPORT QZipReader +class Q_GUI_EXPORT QZipReader { public: QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly ); @@ -73,7 +73,7 @@ public: bool isReadable() const; bool exists() const; - struct Q_AUTOTEST_EXPORT FileInfo + struct Q_GUI_EXPORT FileInfo { FileInfo(); FileInfo(const FileInfo &other); diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h index e996a01..63734ca 100644 --- a/src/gui/widgets/qvalidator.h +++ b/src/gui/widgets/qvalidator.h @@ -137,10 +137,11 @@ class Q_GUI_EXPORT QDoubleValidator : public QValidator Q_PROPERTY(double bottom READ bottom WRITE setBottom) Q_PROPERTY(double top READ top WRITE setTop) Q_PROPERTY(int decimals READ decimals WRITE setDecimals) + Q_ENUMS(Notation) Q_PROPERTY(Notation notation READ notation WRITE setNotation) public: - explicit QDoubleValidator(QObject * parent); + explicit QDoubleValidator(QObject * parent = 0); QDoubleValidator(double bottom, double top, int decimals, QObject * parent); ~QDoubleValidator(); @@ -184,7 +185,7 @@ class Q_GUI_EXPORT QRegExpValidator : public QValidator Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp) public: - explicit QRegExpValidator(QObject *parent); + explicit QRegExpValidator(QObject *parent = 0); QRegExpValidator(const QRegExp& rx, QObject *parent); ~QRegExpValidator(); |