summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 12:48:01 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 15:31:45 +0200
commit143c4d3e13a430b951f4f4f8c28db14303f80605 (patch)
tree2b89637b93fc7d81c674106008566010f986d67c /src/widgets
parenta7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff)
parente5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp9
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/dialogs/qmessagebox.qrc2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp7
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp26
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp6
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp184
-rw-r--r--src/widgets/kernel/qwidget.cpp10
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp304
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qstyle.qrc4
-rw-r--r--src/widgets/styles/qstyle_wince.qrc2
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp175
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p.h5
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp226
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p.h42
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp16
-rw-r--r--src/widgets/widgets/qcombobox.cpp6
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp3
-rw-r--r--src/widgets/widgets/qlineedit_p.h6
-rw-r--r--src/widgets/widgets/qmenubar.cpp10
-rw-r--r--src/widgets/widgets/qprogressbar.cpp8
-rw-r--r--src/widgets/widgets/qprogressbar.h6
-rw-r--r--src/widgets/widgets/qslider.cpp14
-rw-r--r--src/widgets/widgets/qtextedit.cpp13
-rw-r--r--src/widgets/widgets/qtoolbar.cpp16
-rw-r--r--src/widgets/widgets/qtoolbar.h2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp34
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h31
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp19
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p_p.h1
34 files changed, 622 insertions, 577 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 263d3a623c..569a10653f 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -2000,12 +2000,3 @@ QT_END_NAMESPACE
#endif // QT_NO_COLORDIALOG
-/*!
- \fn QColor QColorDialog::getColor(const QColor &init, QWidget *parent, const char *name)
- \compat
-*/
-
-/*!
- \fn QRgb QColorDialog::getRgba(QRgb rgba, bool *ok, QWidget *parent, const char *name)
- \compat
-*/
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index f7125b7af1..ea33dc8d0b 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1771,7 +1771,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
msgBox->setText(translatedTextAboutQtCaption);
msgBox->setInformativeText(translatedTextAboutQtText);
- QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png"));
+ QPixmap pm(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
if (!pm.isNull())
msgBox->setIconPixmap(pm);
#if defined(Q_OS_WINCE)
diff --git a/src/widgets/dialogs/qmessagebox.qrc b/src/widgets/dialogs/qmessagebox.qrc
index 8e6d7af671..de217773ec 100644
--- a/src/widgets/dialogs/qmessagebox.qrc
+++ b/src/widgets/dialogs/qmessagebox.qrc
@@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/trolltech/qmessagebox">
+<qresource prefix="/qt-project.org/qmessagebox">
<file>images/qtlogo-64.png</file>
</qresource>
</RCC>
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 8d1795c3c2..583e6da90a 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -815,20 +815,19 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
lastFocusItem = focusItem;
#ifndef QT_NO_IM
- if (lastFocusItem
- && (lastFocusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) {
+ if (lastFocusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod) {
// Close any external input method panel. This happens
// automatically by removing WA_InputMethodEnabled on
// the views, but if we are changing focus, we have to
// do it ourselves.
if (qApp)
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
}
+#endif //QT_NO_IM
focusItem = 0;
QFocusEvent event(QEvent::FocusOut, focusReason);
sendEvent(lastFocusItem, &event);
-#endif //QT_NO_IM
}
// This handles the case that the item has been removed from the
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index ea692f6f67..d7e7cb3ebc 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -370,8 +370,6 @@ QListView::LayoutMode QListView::layoutMode() const
\sa viewMode
*/
-// ### Qt5: Use same semantic as layouts (spacing is the size of space
-// *between* items)
void QListView::setSpacing(int space)
{
Q_D(QListView);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 22589a4170..b910d21cb8 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1965,12 +1965,11 @@ void QApplication::syncX()
void QApplicationPrivate::notifyLayoutDirectionChange()
{
- Q_Q(QApplication);
- QWidgetList list = q->topLevelWidgets();
+ QWidgetList list = QApplication::topLevelWidgets();
for (int i = 0; i < list.size(); ++i) {
QWidget *w = list.at(i);
QEvent ev(QEvent::ApplicationLayoutDirectionChange);
- q->sendEvent(w, &ev);
+ QCoreApplication::sendEvent(w, &ev);
}
}
@@ -2030,7 +2029,7 @@ void QApplication::setActiveWindow(QWidget* act)
if (QApplicationPrivate::focus_widget) {
if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled))
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason);
QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange);
@@ -3913,13 +3912,6 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
*/
/*!
- \typedef QApplication::ColorMode
- \compat
-
- Use ColorSpec instead.
-*/
-
-/*!
\fn Qt::MacintoshVersion QApplication::macVersion()
Use QSysInfo::MacintoshVersion instead.
@@ -4011,18 +4003,6 @@ bool QApplicationPrivate::inPopupMode() const
return QApplicationPrivate::popupWidgets != 0;
}
-/*! \variable QApplication::NormalColors
- \compat
-
- Use \l NormalColor instead.
-*/
-
-/*! \variable QApplication::CustomColors
- \compat
-
- Use \l CustomColor instead.
-*/
-
#ifdef QT_KEYPAD_NAVIGATION
/*!
Sets the kind of focus navigation Qt should use to \a mode.
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index da6a02a41d..74a299ba54 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -162,12 +162,11 @@ QWidget *qt_tlw_for_window(QWindow *wnd)
void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous)
{
Q_UNUSED(previous);
- Q_Q(QApplication);
QWindow *wnd = QGuiApplicationPrivate::focus_window;
if (inPopupMode()) // some delayed focus event to ignore
return;
QWidget *tlw = qt_tlw_for_window(wnd);
- q->setActiveWindow(tlw);
+ QApplication::setActiveWindow(tlw);
}
static void ungrabKeyboardForPopup(QWidget *popup)
@@ -201,7 +200,6 @@ static void grabForPopup(QWidget *popup)
void QApplicationPrivate::closePopup(QWidget *popup)
{
- Q_Q(QApplication);
if (!popupWidgets)
return;
popupWidgets->removeAll(popup);
@@ -241,7 +239,7 @@ void QApplicationPrivate::closePopup(QWidget *popup)
fw->setFocus(Qt::PopupFocusReason);
} else {
QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason);
- q->sendEvent(fw, &e);
+ QCoreApplication::sendEvent(fw, &e);
}
}
}
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 296d8d31e7..f4bf667ef8 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -285,106 +285,104 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
}
}
}
- if (triggeredGestures.isEmpty() && finishedGestures.isEmpty()
- && newMaybeGestures.isEmpty() && notGestures.isEmpty())
- return consumeEventHint;
-
- QSet<QGesture *> startedGestures = triggeredGestures - m_activeGestures;
- triggeredGestures &= m_activeGestures;
-
- // check if a running gesture switched back to maybe state
- QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures;
-
- // check if a maybe gesture switched to canceled - reset it but don't send an event
- QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures;
-
- // check if a running gesture switched back to not gesture state,
- // i.e. were canceled
- QSet<QGesture *> canceledGestures = m_activeGestures & notGestures;
-
- // new gestures in maybe state
- m_maybeGestures += newMaybeGestures;
-
- // gestures that were in maybe state
- QSet<QGesture *> notMaybeGestures = (startedGestures | triggeredGestures
- | finishedGestures | canceledGestures
- | notGestures);
- m_maybeGestures -= notMaybeGestures;
-
- Q_ASSERT((startedGestures & finishedGestures).isEmpty());
- Q_ASSERT((startedGestures & newMaybeGestures).isEmpty());
- Q_ASSERT((startedGestures & canceledGestures).isEmpty());
- Q_ASSERT((finishedGestures & newMaybeGestures).isEmpty());
- Q_ASSERT((finishedGestures & canceledGestures).isEmpty());
- Q_ASSERT((canceledGestures & newMaybeGestures).isEmpty());
-
- QSet<QGesture *> notStarted = finishedGestures - m_activeGestures;
- if (!notStarted.isEmpty()) {
- // there are some gestures that claim to be finished, but never started.
- // probably those are "singleshot" gestures so we'll fake the started state.
- foreach (QGesture *gesture, notStarted)
+ if (!triggeredGestures.isEmpty() || !finishedGestures.isEmpty()
+ || !newMaybeGestures.isEmpty() || !notGestures.isEmpty()) {
+ QSet<QGesture *> startedGestures = triggeredGestures - m_activeGestures;
+ triggeredGestures &= m_activeGestures;
+
+ // check if a running gesture switched back to maybe state
+ QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures;
+
+ // check if a maybe gesture switched to canceled - reset it but don't send an event
+ QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures;
+
+ // check if a running gesture switched back to not gesture state,
+ // i.e. were canceled
+ QSet<QGesture *> canceledGestures = m_activeGestures & notGestures;
+
+ // new gestures in maybe state
+ m_maybeGestures += newMaybeGestures;
+
+ // gestures that were in maybe state
+ QSet<QGesture *> notMaybeGestures = (startedGestures | triggeredGestures
+ | finishedGestures | canceledGestures
+ | notGestures);
+ m_maybeGestures -= notMaybeGestures;
+
+ Q_ASSERT((startedGestures & finishedGestures).isEmpty());
+ Q_ASSERT((startedGestures & newMaybeGestures).isEmpty());
+ Q_ASSERT((startedGestures & canceledGestures).isEmpty());
+ Q_ASSERT((finishedGestures & newMaybeGestures).isEmpty());
+ Q_ASSERT((finishedGestures & canceledGestures).isEmpty());
+ Q_ASSERT((canceledGestures & newMaybeGestures).isEmpty());
+
+ QSet<QGesture *> notStarted = finishedGestures - m_activeGestures;
+ if (!notStarted.isEmpty()) {
+ // there are some gestures that claim to be finished, but never started.
+ // probably those are "singleshot" gestures so we'll fake the started state.
+ foreach (QGesture *gesture, notStarted)
+ gesture->d_func()->state = Qt::GestureStarted;
+ QSet<QGesture *> undeliveredGestures;
+ deliverEvents(notStarted, &undeliveredGestures);
+ finishedGestures -= undeliveredGestures;
+ }
+
+ m_activeGestures += startedGestures;
+ // sanity check: all triggered gestures should already be in active gestures list
+ Q_ASSERT((m_activeGestures & triggeredGestures).size() == triggeredGestures.size());
+ m_activeGestures -= finishedGestures;
+ m_activeGestures -= activeToMaybeGestures;
+ m_activeGestures -= canceledGestures;
+
+ // set the proper gesture state on each gesture
+ foreach (QGesture *gesture, startedGestures)
gesture->d_func()->state = Qt::GestureStarted;
- QSet<QGesture *> undeliveredGestures;
- deliverEvents(notStarted, &undeliveredGestures);
- finishedGestures -= undeliveredGestures;
- }
+ foreach (QGesture *gesture, triggeredGestures)
+ gesture->d_func()->state = Qt::GestureUpdated;
+ foreach (QGesture *gesture, finishedGestures)
+ gesture->d_func()->state = Qt::GestureFinished;
+ foreach (QGesture *gesture, canceledGestures)
+ gesture->d_func()->state = Qt::GestureCanceled;
+ foreach (QGesture *gesture, activeToMaybeGestures)
+ gesture->d_func()->state = Qt::GestureFinished;
+
+ if (!m_activeGestures.isEmpty() || !m_maybeGestures.isEmpty() ||
+ !startedGestures.isEmpty() || !triggeredGestures.isEmpty() ||
+ !finishedGestures.isEmpty() || !canceledGestures.isEmpty()) {
+ DEBUG() << "QGestureManager::filterEventThroughContexts:"
+ << "\n\tactiveGestures:" << m_activeGestures
+ << "\n\tmaybeGestures:" << m_maybeGestures
+ << "\n\tstarted:" << startedGestures
+ << "\n\ttriggered:" << triggeredGestures
+ << "\n\tfinished:" << finishedGestures
+ << "\n\tcanceled:" << canceledGestures
+ << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
+ }
- m_activeGestures += startedGestures;
- // sanity check: all triggered gestures should already be in active gestures list
- Q_ASSERT((m_activeGestures & triggeredGestures).size() == triggeredGestures.size());
- m_activeGestures -= finishedGestures;
- m_activeGestures -= activeToMaybeGestures;
- m_activeGestures -= canceledGestures;
-
- // set the proper gesture state on each gesture
- foreach (QGesture *gesture, startedGestures)
- gesture->d_func()->state = Qt::GestureStarted;
- foreach (QGesture *gesture, triggeredGestures)
- gesture->d_func()->state = Qt::GestureUpdated;
- foreach (QGesture *gesture, finishedGestures)
- gesture->d_func()->state = Qt::GestureFinished;
- foreach (QGesture *gesture, canceledGestures)
- gesture->d_func()->state = Qt::GestureCanceled;
- foreach (QGesture *gesture, activeToMaybeGestures)
- gesture->d_func()->state = Qt::GestureFinished;
-
- if (!m_activeGestures.isEmpty() || !m_maybeGestures.isEmpty() ||
- !startedGestures.isEmpty() || !triggeredGestures.isEmpty() ||
- !finishedGestures.isEmpty() || !canceledGestures.isEmpty()) {
- DEBUG() << "QGestureManager::filterEventThroughContexts:"
- << "\n\tactiveGestures:" << m_activeGestures
- << "\n\tmaybeGestures:" << m_maybeGestures
- << "\n\tstarted:" << startedGestures
- << "\n\ttriggered:" << triggeredGestures
- << "\n\tfinished:" << finishedGestures
- << "\n\tcanceled:" << canceledGestures
- << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
- }
+ QSet<QGesture *> undeliveredGestures;
+ deliverEvents(startedGestures+triggeredGestures+finishedGestures+canceledGestures,
+ &undeliveredGestures);
- QSet<QGesture *> undeliveredGestures;
- deliverEvents(startedGestures+triggeredGestures+finishedGestures+canceledGestures,
- &undeliveredGestures);
-
- foreach (QGesture *g, startedGestures) {
- if (undeliveredGestures.contains(g))
- continue;
- if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) {
- DEBUG() << "lets try to cancel some";
- // find gestures in context in Qt::GestureStarted or Qt::GestureUpdated state and cancel them
- cancelGesturesForChildren(g);
+ foreach (QGesture *g, startedGestures) {
+ if (undeliveredGestures.contains(g))
+ continue;
+ if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) {
+ DEBUG() << "lets try to cancel some";
+ // find gestures in context in Qt::GestureStarted or Qt::GestureUpdated state and cancel them
+ cancelGesturesForChildren(g);
+ }
}
- }
- m_activeGestures -= undeliveredGestures;
+ m_activeGestures -= undeliveredGestures;
- // reset gestures that ended
- QSet<QGesture *> endedGestures =
- finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures;
- foreach (QGesture *gesture, endedGestures) {
- recycle(gesture);
- m_gestureTargets.remove(gesture);
+ // reset gestures that ended
+ QSet<QGesture *> endedGestures =
+ finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures;
+ foreach (QGesture *gesture, endedGestures) {
+ recycle(gesture);
+ m_gestureTargets.remove(gesture);
+ }
}
-
//Clean up the Gestures
qDeleteAll(m_gesturesToDelete);
m_gesturesToDelete.clear();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 8e6e4368e8..3ab777ad60 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -3090,7 +3090,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled))
qApp->inputMethod()->update(Qt::ImEnabled);
} else {
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
qApp->inputMethod()->update(Qt::ImEnabled);
}
}
@@ -5948,7 +5948,7 @@ void QWidget::setFocus(Qt::FocusReason reason)
if (prev) {
if (reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason
&& prev->testAttribute(Qt::WA_InputMethodEnabled)) {
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
}
if (reason != Qt::NoFocusReason) {
@@ -6057,7 +6057,7 @@ void QWidget::clearFocus()
{
if (hasFocus()) {
if (testAttribute(Qt::WA_InputMethodEnabled))
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);
QApplication::sendEvent(this, &focusAboutToChange);
@@ -10087,7 +10087,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
QWidget *focusWidget = d->effectiveFocusWidget();
if (on && !internalWinId() && hasFocus()
&& focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) {
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
qApp->inputMethod()->update(Qt::ImEnabled);
}
if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget()
@@ -10137,7 +10137,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
#ifndef QT_NO_IM
if (qApp->focusObject() == this) {
if (!on)
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
qApp->inputMethod()->update(Qt::ImEnabled);
}
#endif //QT_NO_IM
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 4723901625..40b6f486be 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -374,7 +374,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QPoint mapped = widget->mapFrom(m_widget, event->pos());
- QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->pixelDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers());
+ QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers());
QGuiApplication::sendSpontaneousEvent(widget, &translated);
}
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 148d7bcfb5..b2b1d3fec5 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -374,13 +374,13 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
case PE_IndicatorTabClose: {
if (d->tabBarcloseButtonIcon.isNull()) {
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
- QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-closetab-16.png")),
+ QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")),
QIcon::Normal, QIcon::Off);
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
- QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-closetab-down-16.png")),
+ QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-16.png")),
QIcon::Normal, QIcon::On);
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
- QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-closetab-hover-16.png")),
+ QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png")),
QIcon::Active, QIcon::Off);
}
@@ -5094,99 +5094,99 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
return proxy()->standardPixmap(SP_ArrowRight, option, widget);
return proxy()->standardPixmap(SP_ArrowLeft, option, widget);
case SP_ArrowLeft:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/left-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png"));
case SP_ArrowRight:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/right-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png"));
case SP_ArrowUp:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/up-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png"));
case SP_ArrowDown:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/down-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png"));
case SP_FileDialogToParent:
return proxy()->standardPixmap(SP_ArrowUp, option, widget);
case SP_FileDialogNewFolder:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"));
case SP_FileDialogDetailedView:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/viewdetailed-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"));
case SP_FileDialogInfoView:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/fileinfo-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"));
case SP_FileDialogContentsView:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/filecontents-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"));
case SP_FileDialogListView:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"));
case SP_FileDialogBack:
return proxy()->standardPixmap(SP_ArrowBack, option, widget);
case SP_DriveHDIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/harddrive-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/harddrive-16.png"));
case SP_TrashIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/trash-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png"));
case SP_DriveFDIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/floppy-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/floppy-16.png"));
case SP_DriveNetIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/networkdrive-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/networkdrive-16.png"));
case SP_DesktopIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/desktop-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/desktop-16.png"));
case SP_ComputerIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/computer-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/computer-16.png"));
case SP_DriveCDIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/cdr-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png"));
case SP_DriveDVDIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/dvd-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png"));
case SP_DirHomeIcon:
case SP_DirOpenIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/diropen-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png"));
case SP_DirIcon:
case SP_DirClosedIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/dirclosed-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"));
case SP_DirLinkIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/dirlink-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirlink-16.png"));
case SP_FileIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/file-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));
case SP_FileLinkIcon:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/filelink-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png"));
case SP_DialogOkButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-ok-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"));
case SP_DialogCancelButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-cancel-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"));
case SP_DialogHelpButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-help-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"));
case SP_DialogOpenButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"));
case SP_DialogSaveButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"));
case SP_DialogCloseButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-close-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"));
case SP_DialogApplyButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-apply-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"));
case SP_DialogResetButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-clear-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"));
case SP_DialogDiscardButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-delete-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"));
case SP_DialogYesButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-yes-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"));
case SP_DialogNoButton:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-no-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"));
case SP_BrowserReload:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/refresh-24.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png"));
case SP_BrowserStop:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/stop-24.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png"));
case SP_MediaPlay:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-play-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png"));
case SP_MediaPause:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png"));
case SP_MediaStop:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png"));
case SP_MediaSeekForward:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"));
case SP_MediaSeekBackward:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"));
case SP_MediaSkipForward:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"));
case SP_MediaSkipBackward:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-32.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"));
case SP_MediaVolume:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
case SP_MediaVolumeMuted:
- return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/media-volume-muted-16.png"));
+ return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
#endif // QT_NO_IMAGEFORMAT_PNG
default:
break;
@@ -5444,11 +5444,11 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons
case SP_TitleBarCloseButton: {
QIcon titleBarIcon;
if (standardIcon == SP_TitleBarCloseButton) {
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-16.png"));
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
+ titleBarIcon.addFile(QLatin1String(":/qt-project.org/styles/macstyle/images/closedock-16.png"));
+ titleBarIcon.addFile(QLatin1String(":/qt-project.org/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
} else {
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-16.png"));
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
+ titleBarIcon.addFile(QLatin1String(":/qt-project.org/styles/macstyle/images/dockdock-16.png"));
+ titleBarIcon.addFile(QLatin1String(":/qt-project.org/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
}
return titleBarIcon;
}
@@ -5485,88 +5485,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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-128.png"), QSize(128, 128));
break;
case SP_FileDialogInfoView:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-128.png"), QSize(128, 128));
break;
case SP_FileDialogContentsView:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-128.png"), QSize(128, 128));
break;
case SP_FileDialogListView:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-128.png"), QSize(128, 128));
break;
case SP_DialogOkButton:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-128.png"), QSize(128, 128));
break;
case SP_ArrowForward:
if (rtl)
@@ -5577,106 +5577,106 @@ 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"), 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-128.png"), QSize(128, 128));
break;
case SP_ArrowRight:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-128.png"), QSize(128, 128));
break;
case SP_ArrowUp:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-128.png"), QSize(128, 128));
break;
case SP_ArrowDown:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-128.png"), QSize(128, 128));
break;
case SP_DirHomeIcon:
case SP_DirIcon:
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dirclosed-16.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"),
QSize(), QIcon::Normal, QIcon::Off);
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/diropen-16.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png"),
QSize(), QIcon::Normal, QIcon::On);
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dirclosed-32.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-32.png"),
QSize(32, 32), QIcon::Normal, QIcon::Off);
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/diropen-32.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-32.png"),
QSize(32, 32), QIcon::Normal, QIcon::On);
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/dirclosed-128.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-128.png"),
QSize(128, 128), QIcon::Normal, QIcon::Off);
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/diropen-128.png"),
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-128.png"),
QSize(128, 128), QIcon::Normal, QIcon::On);
break;
case SP_DriveCDIcon:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-128.png"), QSize(128, 128));
break;
case SP_DriveDVDIcon:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-128.png"), QSize(128, 128));
break;
case SP_FileIcon:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-128.png"), QSize(128, 128));
break;
case SP_FileLinkIcon:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-128.png"), QSize(128, 128));
break;
case SP_TrashIcon:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-128.png"), QSize(128, 128));
break;
case SP_BrowserReload:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png"), QSize(24, 24));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-32.png"), QSize(32, 32));
break;
case SP_BrowserStop:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png"), QSize(24, 24));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-32.png"), QSize(32, 32));
break;
case SP_MediaPlay:
- 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));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-pause-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-stop-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-forward-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-seek-backward-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-forward-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
- icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/media-skip-backward-32.png"), QSize(32, 32));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-16.png"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/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"), QSize(16, 16));
+ icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"), QSize(16, 16));
break;
#endif // QT_NO_IMAGEFORMAT_PNG
default:
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index ef6947088e..05bd90abef 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -5153,7 +5153,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
if (tb->state & State_On) {
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
- static QPixmap pm(QLatin1String(":/trolltech/mac/style/images/leopard-unified-toolbar-on.png"));
+ static QPixmap pm(QLatin1String(":/qt-project.org/mac/style/images/leopard-unified-toolbar-on.png"));
p->setRenderHint(QPainter::SmoothPixmapTransform);
QStyleHelper::drawBorderPixmap(pm, p, tb->rect, 2, 2, 2, 2);
} else {
diff --git a/src/widgets/styles/qstyle.qrc b/src/widgets/styles/qstyle.qrc
index 8654e66a37..6e04540f51 100644
--- a/src/widgets/styles/qstyle.qrc
+++ b/src/widgets/styles/qstyle.qrc
@@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/trolltech/styles/commonstyle">
+<qresource prefix="/qt-project.org/styles/commonstyle">
<file>images/filelink-16.png</file>
<file>images/filelink-32.png</file>
<file>images/filelink-128.png</file>
@@ -126,7 +126,7 @@
<file>images/media-volume-16.png</file>
<file>images/media-volume-muted-16.png</file>
</qresource>
-<qresource prefix="/trolltech/styles/macstyle">
+<qresource prefix="/qt-project.org/styles/macstyle">
<file>images/closedock-16.png</file>
<file>images/closedock-down-16.png</file>
<file>images/dockdock-16.png</file>
diff --git a/src/widgets/styles/qstyle_wince.qrc b/src/widgets/styles/qstyle_wince.qrc
index bdcf604625..c3d643fac7 100644
--- a/src/widgets/styles/qstyle_wince.qrc
+++ b/src/widgets/styles/qstyle_wince.qrc
@@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/trolltech/styles/commonstyle">
+<qresource prefix="/qt-project.org/styles/commonstyle">
<file>images/filelink-16.png</file>
<file>images/filelink-32.png</file>
<file>images/file-16.png</file>
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 78d4e7b9ce..86574f2587 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -482,16 +482,18 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
int stateId = HSAS_SORTEDDOWN;
if (header->sortIndicator & QStyleOptionHeader::SortDown)
stateId = HSAS_SORTEDUP; //note that the uxtheme sort down indicator is the inverse of ours
- XPThemeData theme(widget, painter, QLatin1String("HEADER"), HP_HEADERSORTARROW, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::HeaderTheme,
+ HP_HEADERSORTARROW, stateId, option->rect);
d->drawBackground(theme);
}
break;
case PE_IndicatorBranch:
{
- XPThemeData theme(d->treeViewHelper(), painter, QLatin1String("TREEVIEW"));
+ XPThemeData theme(0, painter, QWindowsXPStylePrivate::TreeViewTheme);
static int decoration_size = 0;
- if (theme.isValid() && !decoration_size) {
+ if (d->initTreeViewTheming() && theme.isValid() && !decoration_size) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, TVP_HOTGLYPH, GLPS_OPENED, 0, TS_TRUE, &size);
decoration_size = qMax(size.cx, size.cy);
@@ -546,7 +548,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
case PE_FrameMenu:
{
int stateId = option->state & State_Active ? MB_ACTIVE : MB_INACTIVE;
- XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_POPUPBORDERS, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPBORDERS, stateId, option->rect);
d->drawBackground(theme);
}
break;
@@ -561,7 +565,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
stateId = ETS_READONLY;
else if (state & State_HasFocus)
stateId = ETS_SELECTED;
- XPThemeData theme(widget, painter, QLatin1String("EDIT"), EP_EDITBORDER_HVSCROLL, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::EditTheme,
+ EP_EDITBORDER_HVSCROLL, stateId, option->rect);
uint resolve_mask = option->palette.resolve();
if (resolve_mask & (1 << QPalette::Base)) {
// Since EP_EDITBORDER_HVSCROLL does not us borderfill, theme.noContent cannot be used for clipping
@@ -611,7 +617,8 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
else if (state & State_MouseOver)
stateId = EBS_HOT;
- XPThemeData theme(0, painter, QLatin1String("EDIT"), partId, stateId, rect);
+ XPThemeData theme(0, painter, QWindowsXPStylePrivate::EditTheme,
+ partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawPrimitive(element, option, painter, widget);
return;
@@ -678,7 +685,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
stateId = ETS_HOT;
else if (state & State_HasFocus)
stateId = ETS_SELECTED;
- XPThemeData theme(widget, painter, QLatin1String("EDIT"), EP_EDITBORDER_NOSCROLL, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::EditTheme,
+ EP_EDITBORDER_NOSCROLL, stateId, option->rect);
painter->save();
QRegion clipRegion = option->rect;
clipRegion -= option->rect.adjusted(2, 2, -2, -2);
@@ -694,11 +703,14 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
XPThemeData theme;
QRect rect;
if (option->state & State_Horizontal) {
- theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPER, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));
+ theme = XPThemeData(widget, painter,
+ QWindowsXPStylePrivate::RebarTheme,
+ RP_GRIPPER, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));
rect = option->rect.adjusted(0, 1, 0, -2);
rect.setWidth(4);
} else {
- theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPERVERT, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));
+ theme = XPThemeData(widget, painter, QWindowsXPStylePrivate::RebarTheme,
+ RP_GRIPPERVERT, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));
rect = option->rect.adjusted(1, 0, -1, 0);
rect.setHeight(4);
}
@@ -724,7 +736,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
break;
case PE_PanelTipLabel: {
- XPThemeData theme(widget, painter, QLatin1String("TOOLTIP"), TTP_STANDARD, TTSS_NORMAL, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::ToolTipTheme,
+ TTP_STANDARD, TTSS_NORMAL, option->rect);
d->drawBackground(theme);
break;
}
@@ -788,9 +802,10 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
state = LISS_HOT;
QPainter pixmapPainter(&pixmap);
- XPThemeData theme(d->treeViewHelper(), &pixmapPainter, QLatin1String("TREEVIEW"),
+ XPThemeData theme(0, &pixmapPainter,
+ QWindowsXPStylePrivate::TreeViewTheme,
LVP_LISTITEM, state, QRect(0, 0, sectionSize.width(), sectionSize.height()));
- if (theme.isValid()) {
+ if (d->initTreeViewTheming() && theme.isValid()) {
d->drawBackground(theme);
} else {
QWindowsXPStyle::drawPrimitive(PE_PanelItemViewItem, option, painter, widget);
@@ -849,7 +864,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (buttonBox) {
//draw white panel part
- XPThemeData theme(widget, painter, QLatin1String("TASKDIALOG"), TDLG_PRIMARYPANEL, 0, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::TaskDialogTheme,
+ TDLG_PRIMARYPANEL, 0, option->rect);
QRect toprect = option->rect;
toprect.setBottom(buttonBox->geometry().top());
theme.rect = toprect;
@@ -891,7 +908,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
bool disabled = !(option->state & State_Enabled);
int state = option->state;
- QString name;
+ int themeNumber = -1;
QRect rect(option->rect);
State flags = option->state;
@@ -971,12 +988,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
case CE_PushButtonBevel:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option))
{
-
QWindowsVistaAnimation *anim = d->widgetAnimation(widget);
if (anim && (btn->state & State_Enabled)) {
anim->paint(painter, option);
} else {
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_PUSHBUTTON;
if (btn->features & QStyleOptionButton::CommandLinkButton)
partId = BP_COMMANDLINK;
@@ -1011,7 +1027,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
QPainter startPainter(&startImage);
stateId = PBS_DEFAULTED;
- XPThemeData theme(widget, &startPainter, name, partId, stateId, rect);
+ XPThemeData theme(widget, &startPainter, themeNumber, partId, stateId, rect);
d->drawBackground(theme);
QPainter alternatePainter(&alternateImage);
@@ -1029,20 +1045,21 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (anim)
anim->paint(painter, option);
else {
- XPThemeData theme(widget, painter, name, partId, stateId, rect);
+ XPThemeData theme(widget, painter, themeNumber, partId, stateId, rect);
d->drawBackground(theme);
}
}
else {
d->stopAnimation(widget);
- XPThemeData theme(widget, painter, name, partId, stateId, rect);
+ XPThemeData theme(widget, painter, themeNumber, partId, stateId, rect);
d->drawBackground(theme);
}
}
}
if (btn->features & QStyleOptionButton::HasMenu) {
int mbiw = 0, mbih = 0;
- XPThemeData theme(widget, 0, QLatin1String("TOOLBAR"), TP_DROPDOWNBUTTON);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ToolBarTheme,
+ TP_DROPDOWNBUTTON);
if (theme.isValid()) {
SIZE size;
if (pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size) == S_OK) {
@@ -1086,7 +1103,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
}
- XPThemeData theme(widget, painter, QLatin1String("PROGRESS"), vertical ? PP_FILLVERT : PP_FILL);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::ProgressTheme,
+ vertical ? PP_FILLVERT : PP_FILL);
theme.rect = option->rect;
bool reverse = (bar->direction == Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted);
QTime current = QTime::currentTime();
@@ -1208,7 +1227,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
alignment |= Qt::TextHideMnemonic;
//The rect adjustment is a workaround for the menu not really filling its background.
- XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 0, 2, 1));
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 0, 2, 1));
d->drawBackground(theme);
int stateId = MBI_NORMAL;
@@ -1219,7 +1240,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
else if (selected)
stateId = MBI_HOT;
- XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_BARITEM, stateId, option->rect);
+ XPThemeData theme2(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_BARITEM, stateId, option->rect);
d->drawBackground(theme2);
if (!pix.isNull())
@@ -1237,7 +1260,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
{
SIZE size;
MARGINS margins;
- XPThemeData theme(widget, 0, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND, MBI_HOT);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPCHECKBACKGROUND, MBI_HOT);
pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size);
pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins);
checkcol = qMax(menuitem->maxIconWidth, int(6 + size.cx + margins.cxLeftWidth + margins.cxRightWidth));
@@ -1248,7 +1272,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
QPoint p1 = QStyle::visualPos(option->direction, menuitem->rect, QPoint(checkcol, rect.top()));
QPoint p2 = QStyle::visualPos(option->direction, menuitem->rect, QPoint(checkcol, rect.bottom()));
QRect gutterRect(p1.x(), p1.y(), 3, p2.y() - p1.y() + 1);
- XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_POPUPGUTTER, stateId, gutterRect);
+ XPThemeData theme2(widget, painter, QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPGUTTER, stateId, gutterRect);
d->drawBackground(theme2);
int x, y, w, h;
@@ -1266,7 +1291,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
stateId = MBI_HOT;
QRect subRect(p1.x(), p1.y(), p2.x() - p1.x(), 6);
subRect = QStyle::visualRect(option->direction, option->rect, subRect );
- XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_POPUPSEPARATOR, stateId, subRect);
+ XPThemeData theme2(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPSEPARATOR, stateId, subRect);
d->drawBackground(theme2);
return;
}
@@ -1276,12 +1303,16 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (act) {
stateId = MBI_HOT;
- XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_POPUPITEM, stateId, option->rect);
+ XPThemeData theme2(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPITEM, stateId, option->rect);
d->drawBackground(theme2);
}
if (checked) {
- XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND,
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPCHECKBACKGROUND,
menuitem->icon.isNull() ? MBI_HOT : MBI_PUSHED, vCheckRect);
SIZE size;
MARGINS margins;
@@ -1377,7 +1408,6 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
#endif // QT_NO_MENU
case CE_HeaderSection:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
- name = QLatin1String("HEADER");
partId = HP_HEADERITEM;
if (flags & State_Sunken)
stateId = HIS_PRESSED;
@@ -1389,7 +1419,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (header->sortIndicator != QStyleOptionHeader::None)
stateId += 3;
- XPThemeData theme(widget, painter, name, partId, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::HeaderTheme,
+ partId, stateId, option->rect);
d->drawBackground(theme);
}
break;
@@ -1398,7 +1430,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
stateId = MBI_NORMAL;
if (!(state & State_Enabled))
stateId = MBI_DISABLED;
- XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_BARBACKGROUND, stateId, option->rect);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_BARBACKGROUND, stateId, option->rect);
d->drawBackground(theme);
}
break;
@@ -1669,13 +1703,15 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
else
stateId = ETS_NORMAL;
- XPThemeData theme(widget, painter, QLatin1String("EDIT"), partId, stateId, r);
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::EditTheme,
+ partId, stateId, r);
d->drawBackground(theme);
}
if (sub & SC_ComboBoxArrow) {
QRect subRect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);
- XPThemeData theme(widget, painter, QLatin1String("COMBOBOX"));
+ XPThemeData theme(widget, painter, QWindowsXPStylePrivate::ComboboxTheme);
theme.rect = subRect;
partId = option->direction == Qt::RightToLeft ? CP_DROPDOWNBUTTONLEFT : CP_DROPDOWNBUTTONRIGHT;
@@ -1708,8 +1744,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
- XPThemeData theme(widget, painter, QLatin1String("SCROLLBAR"));
-
+ XPThemeData theme(widget, painter, QWindowsXPStylePrivate::ScrollBarTheme);
bool maxedOut = (scrollbar->maximum == scrollbar->minimum);
if (maxedOut)
flags &= ~State_Enabled;
@@ -1855,7 +1890,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
{
- XPThemeData theme(widget, painter, QLatin1String("SPIN"));
+ XPThemeData theme(widget, painter, QWindowsXPStylePrivate::SpinTheme);
if (sb->frame && (sub & SC_SpinBoxFrame)) {
partId = EP_EDITBORDER_NOSCROLL;
if (!(flags & State_Enabled))
@@ -1867,7 +1902,9 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
else
stateId = ETS_NORMAL;
- XPThemeData ftheme(widget, painter, QLatin1String("EDIT"), partId, stateId, r);
+ XPThemeData ftheme(widget, painter,
+ QWindowsXPStylePrivate::EditTheme,
+ partId, stateId, r);
ftheme.noContent = true;
d->drawBackground(ftheme);
}
@@ -1927,7 +1964,9 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption
{
SIZE size;
MARGINS margins;
- XPThemeData theme(widget, 0, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND, MBI_HOT);
+ XPThemeData theme(widget, 0,
+ QWindowsXPStylePrivate::MenuTheme,
+ MENU_POPUPCHECKBACKGROUND, MBI_HOT);
pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size);
pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins);
minimumHeight = qMax<qint32>(size.cy + margins.cyBottomHeight+ margins.cyTopHeight, sz.height());
@@ -2019,7 +2058,9 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
int y = option->rect.y();
int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget);
- XPThemeData theme(widget, 0, QLatin1String("HEADER"), HP_HEADERSORTARROW, HSAS_SORTEDDOWN, option->rect);
+ XPThemeData theme(widget, 0,
+ QWindowsXPStylePrivate::HeaderTheme,
+ HP_HEADERSORTARROW, HSAS_SORTEDDOWN, option->rect);
int arrowWidth = 13;
int arrowHeight = 5;
@@ -2148,7 +2189,9 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co
if (option) {
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) {
ret = true;
- XPThemeData themeData(widget, 0, QLatin1String("TOOLTIP"), TTP_STANDARD, TTSS_NORMAL, option->rect);
+ XPThemeData themeData(widget, 0,
+ QWindowsXPStylePrivate::ToolTipTheme,
+ TTP_STANDARD, TTSS_NORMAL, option->rect);
mask->region = d->region(themeData);
}
}
@@ -2489,7 +2532,8 @@ QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() :
QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate()
{
qDeleteAll(animations);
- delete m_treeViewHelper;
+ if (m_treeViewHelper)
+ DestroyWindow(m_treeViewHelper);
}
void QWindowsVistaStylePrivate::timerEvent()
@@ -2597,19 +2641,48 @@ bool QWindowsVistaStylePrivate::resolveSymbols()
}
/*
- * We need to set the windows explorer theme explicitly on a native widget
- * in order to get Vista-style item view themes
+ * We need to set the windows "explorer" theme explicitly on a native
+ * window and open the "TREEVIEW" theme handle passing its window handle
+ * in order to get Vista-style item view themes (particulary drawBackground()
+ * for selected items needs this).
+ * We invoke a service of the native Windows interface to create
+ * a non-visible window handle, open the theme on it and insert it into
+ * the cache so that it is found by XPThemeData::handle() first.
*/
-QWidget *QWindowsVistaStylePrivate::treeViewHelper()
+
+static inline HWND createTreeViewHelperWindow()
{
- if (!m_treeViewHelper) {
- m_treeViewHelper = new QWidget(0);
- HWND handle = QApplicationPrivate::getHWNDForWidget(m_treeViewHelper);
- pSetWindowTheme(handle, L"explorer", NULL);
+ if (QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) {
+ void *hwnd = 0;
+ void *wndProc = reinterpret_cast<void *>(DefWindowProc);
+ if (QMetaObject::invokeMethod(ni, "createMessageWindow", Qt::DirectConnection,
+ Q_RETURN_ARG(void *, hwnd),
+ Q_ARG(QString, QStringLiteral("QTreeViewThemeHelperWindowClass")),
+ Q_ARG(QString, QStringLiteral("QTreeViewThemeHelperWindow")),
+ Q_ARG(void *, wndProc)) && hwnd) {
+ return reinterpret_cast<HWND>(hwnd);
+ }
}
- return m_treeViewHelper;
+ return 0;
}
+bool QWindowsVistaStylePrivate::initTreeViewTheming()
+{
+ if (m_treeViewHelper)
+ return true;
+
+ m_treeViewHelper = createTreeViewHelperWindow();
+ if (!m_treeViewHelper) {
+ qWarning("%s: Unable to create the treeview helper window.", Q_FUNC_INFO);
+ return false;
+ }
+ const HRESULT hr = pSetWindowTheme(m_treeViewHelper, L"explorer", NULL);
+ if (hr != S_OK) {
+ qErrnoWarning("%s: SetWindowTheme() failed.", Q_FUNC_INFO);
+ return false;
+ }
+ return QWindowsXPStylePrivate::createTheme(QWindowsXPStylePrivate::TreeViewTheme, m_treeViewHelper);
+}
/*!
\internal
@@ -2626,7 +2699,9 @@ QIcon QWindowsVistaStyle::standardIconImplementation(StandardPixmap standardIcon
switch(standardIcon) {
case SP_CommandLink:
{
- XPThemeData theme(0, 0, QLatin1String("BUTTON"), BP_COMMANDLINKGLYPH, CMDLGS_NORMAL);
+ XPThemeData theme(0, 0,
+ QWindowsXPStylePrivate::ButtonTheme,
+ BP_COMMANDLINKGLYPH, CMDLGS_NORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
diff --git a/src/widgets/styles/qwindowsvistastyle_p.h b/src/widgets/styles/qwindowsvistastyle_p.h
index 7205ad2d19..78282d01ef 100644
--- a/src/widgets/styles/qwindowsvistastyle_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p.h
@@ -205,12 +205,13 @@ public:
QWindowsVistaAnimation* widgetAnimation(const QWidget *) const;
void timerEvent();
bool transitionsEnabled() const;
- QWidget *treeViewHelper();
private:
+ bool initTreeViewTheming();
+
QList <QWindowsVistaAnimation*> animations;
QBasicTimer animationTimer;
- QWidget *m_treeViewHelper;
+ HWND m_treeViewHelper;
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 9af57ce894..c911670442 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -136,6 +136,15 @@ static const int windowsRightBorder = 12; // right border on windows
extern Q_WIDGETS_EXPORT HDC qt_win_display_dc();
extern QRegion qt_region_from_HRGN(HRGN rgn);
+// Theme names matching the QWindowsXPStylePrivate::Theme enumeration.
+static const wchar_t *themeNames[QWindowsXPStylePrivate::NThemes] =
+{
+ L"BUTTON", L"COMBOBOX", L"EDIT", L"HEADER", L"LISTVIEW",
+ L"MENU", L"PROGRESS", L"REBAR", L"SCROLLBAR", L"SPIN",
+ L"TAB", L"TASKDIALOG", L"TOOLBAR", L"TOOLTIP", L"TRACKBAR",
+ L"TREEVIEW", L"WINDOW", L"STATUS"
+};
+
static inline QBackingStore *backingStoreForWidget(const QWidget *widget)
{
if (QBackingStore *backingStore = widget->backingStore())
@@ -161,7 +170,7 @@ static inline HDC hdcForWidgetBackingStore(const QWidget *widget)
*/
bool XPThemeData::isValid()
{
- return QWindowsXPStylePrivate::useXP() && name.size() && handle();
+ return QWindowsXPStylePrivate::useXP() && theme >= 0 && handle();
}
@@ -175,18 +184,8 @@ HTHEME XPThemeData::handle()
if (!QWindowsXPStylePrivate::useXP())
return 0;
- if (!htheme && QWindowsXPStylePrivate::handleMap)
- htheme = QWindowsXPStylePrivate::handleMap->value(name);
-
- if (!htheme) {
- htheme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), (wchar_t*)name.utf16());
- if (htheme) {
- if (!QWindowsXPStylePrivate::handleMap)
- QWindowsXPStylePrivate::handleMap = new QWindowsXPStylePrivate::ThemeHandleMap;
- QWindowsXPStylePrivate::handleMap->insert(name, htheme);
- }
- }
-
+ if (!htheme)
+ htheme = QWindowsXPStylePrivate::createTheme(theme, QWindowsXPStylePrivate::winId(widget));
return htheme;
}
@@ -224,7 +223,7 @@ HRGN XPThemeData::mask(QWidget *widget)
// QWindowsXPStylePrivate -------------------------------------------------------------------------
// Static initializations
QPixmap *QWindowsXPStylePrivate::tabbody = 0;
-QMap<QString,HTHEME> *QWindowsXPStylePrivate::handleMap = 0;
+HTHEME QWindowsXPStylePrivate::m_themes[NThemes];
bool QWindowsXPStylePrivate::use_xp = false;
QBasicAtomicInt QWindowsXPStylePrivate::ref = Q_BASIC_ATOMIC_INITIALIZER(-1); // -1 based refcounting
@@ -277,6 +276,7 @@ void QWindowsXPStylePrivate::init(bool force)
ref.ref();
useXP(true);
+ qFill(m_themes, m_themes + NThemes, HTHEME(0));
}
/* \internal
@@ -313,16 +313,34 @@ void QWindowsXPStylePrivate::cleanup(bool force)
*/
void QWindowsXPStylePrivate::cleanupHandleMap()
{
- typedef ThemeHandleMap::const_iterator ConstIterator;
+ for (int i = 0; i < NThemes; ++i)
+ if (m_themes[i]) {
+ pCloseThemeData(m_themes[i]);
+ m_themes[i] = 0;
+ }
+}
- if (!handleMap)
- return;
+HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd)
+{
+ if (theme < 0 || theme >= NThemes || !hwnd) {
+ qWarning("%s: Invalid parameters #%d, %p", theme, hwnd);
+ return 0;
+ }
+ if (!m_themes[theme]) {
+ const wchar_t *name = themeNames[theme];
+ m_themes[theme] = pOpenThemeData(hwnd, name);
+ if (!m_themes[theme])
+ qErrnoWarning("%s: OpenThemeData() failed for theme %d (%s).",
+ Q_FUNC_INFO, theme, qPrintable(themeName(theme)));
+ }
+ return m_themes[theme];
+}
- const ConstIterator cend = handleMap->constEnd();
- for (ConstIterator it = handleMap->constBegin(); it != cend; ++it)
- pCloseThemeData(it.value());
- delete handleMap;
- handleMap = 0;
+QString QWindowsXPStylePrivate::themeName(int theme)
+{
+ return theme >= 0 && theme < NThemes ?
+ QString::fromWCharArray(themeNames[theme]) :
+ QString();
}
/*! \internal
@@ -361,7 +379,7 @@ const QPixmap *QWindowsXPStylePrivate::tabBody(QWidget *)
{
if (!tabbody) {
SIZE sz;
- XPThemeData theme(0, 0, QLatin1String("TAB"), TABP_BODY);
+ XPThemeData theme(0, 0, QWindowsXPStylePrivate::TabTheme, TABP_BODY);
pGetThemePartSize(theme.handle(), qt_win_display_dc(), TABP_BODY, 0, 0, TS_TRUE, &sz);
tabbody = new QPixmap(sz.cx, QApplication::desktop()->screenGeometry().height());
@@ -828,9 +846,21 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
bool inspectData;
bool potentialInvalidAlpha;
- QString pixmapCacheKey = QString::fromLatin1("$qt_xp_%1p%2s%3s%4b%5c%6w%7h").arg(themeData.name)
- .arg(partId).arg(stateId).arg(!themeData.noBorder).arg(!themeData.noContent)
- .arg(w).arg(h);
+ QString pixmapCacheKey = QStringLiteral("$qt_xp_");
+ pixmapCacheKey.append(themeName(themeData.theme));
+ pixmapCacheKey.append(QLatin1Char('p'));
+ pixmapCacheKey.append(QString::number(partId));
+ pixmapCacheKey.append(QLatin1Char('s'));
+ pixmapCacheKey.append(QString::number(stateId));
+ pixmapCacheKey.append(QLatin1Char('s'));
+ pixmapCacheKey.append(themeData.noBorder ? QLatin1Char('0') : QLatin1Char('1'));
+ pixmapCacheKey.append(QLatin1Char('b'));
+ pixmapCacheKey.append(themeData.noContent ? QLatin1Char('0') : QLatin1Char('1'));
+ pixmapCacheKey.append(QString::number(w));
+ pixmapCacheKey.append(QLatin1Char('w'));
+ pixmapCacheKey.append(QString::number(h));
+ pixmapCacheKey.append(QLatin1Char('h'));
+
QPixmap cachedPixmap;
ThemeMapKey key(themeData);
ThemeMapData data = alphaCache.value(key);
@@ -1195,7 +1225,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
if (!d->hasInitColors) {
// Get text color for group box labels
COLORREF cref;
- XPThemeData theme(0, 0, QLatin1String("BUTTON"), 0, 0);
+ XPThemeData theme(0, 0, QWindowsXPStylePrivate::ButtonTheme, 0, 0);
pGetThemeColor(theme.handle(), BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);
d->groupBoxTextColor = qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
pGetThemeColor(theme.handle(), BP_GROUPBOX, GBS_DISABLED, TMT_TEXTCOLOR, &cref);
@@ -1305,7 +1335,7 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
MARGINS borderSize;
if (widget) {
- XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ XPThemeData buttontheme(widget, 0, QWindowsXPStylePrivate::ButtonTheme);
HTHEME theme = buttontheme.handle();
if (theme) {
int stateId;
@@ -1366,7 +1396,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
return;
}
- QString name;
+ int themeNumber = -1;
int partId = 0;
int stateId = 0;
QRect rect = option->rect;
@@ -1412,7 +1442,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
}
return;
case PE_PanelButtonBevel:
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_PUSHBUTTON;
if (!(flags & State_Enabled))
stateId = PBS_DISABLED;
@@ -1432,7 +1462,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
if (dw->isWindow())
return;
}
- name = QLatin1String("TOOLBAR");
+ themeNumber = QWindowsXPStylePrivate::ToolBarTheme;
partId = TP_BUTTON;
if (!(flags & State_Enabled))
stateId = TS_DISABLED;
@@ -1449,7 +1479,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
break;
case PE_IndicatorButtonDropDown:
- name = QLatin1String("TOOLBAR");
+ themeNumber = QWindowsXPStylePrivate::ToolBarTheme;
partId = TP_SPLITBUTTONDROPDOWN;
if (!(flags & State_Enabled))
stateId = TS_DISABLED;
@@ -1468,7 +1498,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
break;
case PE_IndicatorCheckBox:
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_CHECKBOX;
if (!(flags & State_Enabled))
stateId = CBS_UNCHECKEDDISABLED;
@@ -1487,7 +1517,7 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
break;
case PE_IndicatorRadioButton:
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_RADIOBUTTON;
if (!(flags & State_Enabled))
stateId = RBS_UNCHECKEDDISABLED;
@@ -1509,9 +1539,9 @@ case PE_Frame:
{
if (flags & State_Raised)
return;
- name = QLatin1String("LISTVIEW");
+ themeNumber = QWindowsXPStylePrivate::ListViewTheme;
partId = LVP_LISTGROUP;
- XPThemeData theme(0, 0, name, partId, 0);
+ XPThemeData theme(0, 0, themeNumber, partId, 0);
if (!(flags & State_Enabled))
stateId = ETS_DISABLED;
@@ -1561,7 +1591,7 @@ case PE_Frame:
p->setPen(oldPen);
return;
} else if (qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- name = QLatin1String("EDIT");
+ themeNumber = QWindowsXPStylePrivate::EditTheme;
partId = EP_EDITTEXT;
noContent = true;
if (!(flags & State_Enabled))
@@ -1574,7 +1604,7 @@ case PE_Frame:
case PE_PanelLineEdit:
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- name = QLatin1String("EDIT");
+ themeNumber = QWindowsXPStylePrivate::EditTheme;
partId = EP_EDITTEXT;
noBorder = true;
QBrush bg;
@@ -1602,7 +1632,7 @@ case PE_Frame:
if (usePalette) {
p->fillRect(panel->rect, bg);
} else {
- XPThemeData theme(0, p, name, partId, stateId, rect);
+ XPThemeData theme(0, p, themeNumber, partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawPrimitive(pe, option, p, widget);
return;
@@ -1646,7 +1676,7 @@ case PE_Frame:
case PE_FrameTabWidget:
if (const QStyleOptionTabWidgetFrame *tab = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option))
{
- name = QLatin1String("TAB");
+ themeNumber = QWindowsXPStylePrivate::TabTheme;
partId = TABP_PANE;
if (widget) {
@@ -1673,7 +1703,7 @@ case PE_Frame:
QRegion reg = option->rect;
reg -= contentsRect;
p->setClipRegion(reg);
- XPThemeData theme(widget, p, name, partId, stateId, rect);
+ XPThemeData theme(widget, p, themeNumber, partId, stateId, rect);
theme.mirrorHorizontally = hMirrored;
theme.mirrorVertically = vMirrored;
d->drawBackground(theme);
@@ -1717,7 +1747,7 @@ case PE_Frame:
case PE_FrameDockWidget:
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option))
{
- name = QLatin1String("WINDOW");
+ themeNumber = QWindowsXPStylePrivate::WindowTheme;
if (flags & State_Active)
stateId = FS_ACTIVE;
else
@@ -1725,7 +1755,7 @@ case PE_Frame:
int fwidth = proxy()->pixelMetric(PM_DockWidgetFrameWidth, frm, widget);
- XPThemeData theme(widget, p, name, 0, stateId);
+ XPThemeData theme(widget, p, themeNumber, 0, stateId);
if (!theme.isValid())
break;
theme.rect = QRect(frm->rect.x(), frm->rect.y(), frm->rect.x()+fwidth, frm->rect.height()-fwidth); theme.partId = WP_SMALLFRAMELEFT;
@@ -1743,7 +1773,7 @@ case PE_Frame:
case PE_IndicatorHeaderArrow:
{
#if 0 // XP theme engine doesn't know about this :(
- name = QLatin1String("HEADER");
+ name = QWindowsXPStylePrivate::HEADER");
partId = HP_HEADERSORTARROW;
if (flags & State_Down)
stateId = HSAS_SORTEDDOWN;
@@ -1775,12 +1805,12 @@ case PE_Frame:
break;
case PE_FrameStatusBarItem:
- name = QLatin1String("STATUS");
+ themeNumber = QWindowsXPStylePrivate::StatusTheme;
partId = SP_PANE;
break;
case PE_FrameGroupBox:
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_GROUPBOX;
if (!(flags & State_Enabled))
stateId = GBS_DISABLED;
@@ -1794,7 +1824,7 @@ case PE_Frame:
QPoint p1(fr.x(), fr.y() + 1);
QPoint p2(fr.x() + fr.width(), p1.y() + 1);
rect = QRect(p1, p2);
- name = QLatin1String("");
+ themeNumber = -1;
}
}
break;
@@ -1817,7 +1847,7 @@ case PE_Frame:
partId = PP_CHUNKVERT;
rect = QRect(option->rect.x(), option->rect.y(), option->rect.width(), option->rect.height());
}
- name = QLatin1String("PROGRESS");
+ themeNumber = QWindowsXPStylePrivate::ProgressTheme;
stateId = 1;
}
break;
@@ -1825,7 +1855,7 @@ case PE_Frame:
case PE_FrameWindow:
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option))
{
- name = QLatin1String("WINDOW");
+ themeNumber = QWindowsXPStylePrivate::WindowTheme;
if (flags & State_Active)
stateId = FS_ACTIVE;
else
@@ -1833,7 +1863,7 @@ case PE_Frame:
int fwidth = frm->lineWidth + frm->midLineWidth;
- XPThemeData theme(0, p, name, 0, stateId);
+ XPThemeData theme(0, p, themeNumber, 0, stateId);
if (!theme.isValid())
break;
@@ -1879,7 +1909,7 @@ case PE_Frame:
bef_v -= delta;
aft_h += delta;
aft_v += delta;
- XPThemeData theme(0, p, QLatin1String("TREEVIEW"));
+ XPThemeData theme(0, p, QWindowsXPStylePrivate::TreeViewTheme);
theme.rect = QRect(bef_h, bef_v, decoration_size, decoration_size);
theme.partId = TVP_GLYPH;
theme.stateId = flags & QStyle::State_Open ? GLPS_OPENED : GLPS_CLOSED;
@@ -1895,7 +1925,7 @@ case PE_Frame:
QWindowsStyle::drawPrimitive(pe, option, p, widget);
return;
}
- name = QLatin1String("TOOLBAR");
+ themeNumber = QWindowsXPStylePrivate::ToolBarTheme;
partId = TP_SEPARATOR;
if (option->state & State_Horizontal)
@@ -1907,7 +1937,7 @@ case PE_Frame:
case PE_IndicatorToolBarHandle:
- name = QLatin1String("REBAR");
+ themeNumber = QWindowsXPStylePrivate::RebarTheme;
partId = RP_GRIPPER;
if (option->state & State_Horizontal) {
partId = RP_GRIPPER;
@@ -1931,7 +1961,7 @@ case PE_Frame:
break;
}
- XPThemeData theme(0, p, name, partId, stateId, rect);
+ XPThemeData theme(0, p, themeNumber, partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawPrimitive(pe, option, p, widget);
return;
@@ -1963,16 +1993,16 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
bool hMirrored = false;
bool vMirrored = false;
- QString name;
+ int themeNumber = -1;
int partId = 0;
int stateId = 0;
switch (element) {
case CE_SizeGrip:
{
- name = QLatin1String("STATUS");
+ themeNumber = QWindowsXPStylePrivate::StatusTheme;
partId = SP_GRIPPER;
SIZE sz;
- XPThemeData theme(0, p, name, partId, 0);
+ XPThemeData theme(0, p, themeNumber, partId, 0);
pGetThemePartSize(theme.handle(), 0, partId, 0, 0, TS_TRUE, &sz);
--sz.cy;
if (const QStyleOptionSizeGrip *sg = qstyleoption_cast<const QStyleOptionSizeGrip *>(option)) {
@@ -1997,7 +2027,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
break;
case CE_HeaderSection:
- name = QLatin1String("HEADER");
+ themeNumber = QWindowsXPStylePrivate::HeaderTheme;
partId = HP_HEADERITEM;
if (flags & State_Sunken)
stateId = HIS_PRESSED;
@@ -2014,7 +2044,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
case CE_PushButtonBevel:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option))
{
- name = QLatin1String("BUTTON");
+ themeNumber = QWindowsXPStylePrivate::ButtonTheme;
partId = BP_PUSHBUTTON;
bool justFlat = ((btn->features & QStyleOptionButton::Flat) && !(flags & (State_On|State_Sunken)))
|| ((btn->features & QStyleOptionButton::CommandLinkButton)
@@ -2034,13 +2064,15 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
stateId = PBS_NORMAL;
if (!justFlat) {
- XPThemeData theme(widget, p, name, partId, stateId, rect);
+ XPThemeData theme(widget, p, themeNumber, partId, stateId, rect);
d->drawBackground(theme);
}
if (btn->features & QStyleOptionButton::HasMenu) {
int mbiw = 0, mbih = 0;
- XPThemeData theme(widget, 0, QLatin1String("TOOLBAR"), TP_SPLITBUTTONDROPDOWN);
+ XPThemeData theme(widget, 0,
+ QWindowsXPStylePrivate::ToolBarTheme,
+ TP_SPLITBUTTONDROPDOWN);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -2066,7 +2098,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
case CE_TabBarTabShape:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option))
{
- name = QLatin1String("TAB");
+ themeNumber = QWindowsXPStylePrivate::TabTheme;
bool isDisabled = !(tab->state & State_Enabled);
bool hasFocus = tab->state & State_HasFocus;
bool isHot = tab->state & State_MouseOver;
@@ -2145,7 +2177,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
}
break;
default:
- name = QLatin1String(""); // Do our own painting for triangular
+ themeNumber = -1; // Do our own painting for triangular
break;
}
@@ -2176,7 +2208,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
orient = pb2->orientation;
partId = (orient == Qt::Horizontal) ? PP_BAR : PP_BARVERT;
- name = QLatin1String("PROGRESS");
+ themeNumber = QWindowsXPStylePrivate::ProgressTheme;
stateId = 1;
}
break;
@@ -2398,7 +2430,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
p->setPen(oldPen);
} else {
- name = QLatin1String("WINDOW");
+ themeNumber = QWindowsXPStylePrivate::WindowTheme;
if (isActive)
stateId = CS_ACTIVE;
else
@@ -2407,7 +2439,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
int titleHeight = rect.height() - 2;
rect = rect.adjusted(-fw, -fw, fw, 0);
- XPThemeData theme(widget, p, name, 0, stateId);
+ XPThemeData theme(widget, p, themeNumber, 0, stateId);
if (!theme.isValid())
break;
@@ -2483,7 +2515,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
case CE_HeaderEmptyArea:
if (option->state & State_Horizontal)
{
- name = QLatin1String("HEADER");
+ themeNumber = QWindowsXPStylePrivate::HeaderTheme;
stateId = HIS_NORMAL;
}
else {
@@ -2495,7 +2527,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
break;
}
- XPThemeData theme(widget, p, name, partId, stateId, rect);
+ XPThemeData theme(widget, p, themeNumber, partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawControl(element, option, p, widget);
return;
@@ -2535,7 +2567,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
{
- XPThemeData theme(widget, p, QLatin1String("SPIN"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::SpinTheme);
if (sb->frame && (sub & SC_SpinBoxFrame)) {
partId = EP_EDITTEXT;
@@ -2546,7 +2578,8 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
else
stateId = ETS_NORMAL;
- XPThemeData ftheme(widget, p, QLatin1String("EDIT"), partId, stateId, r);
+ XPThemeData ftheme(widget, p, QWindowsXPStylePrivate::EditTheme,
+ partId, stateId, r);
ftheme.noContent = true;
d->drawBackground(ftheme);
}
@@ -2596,7 +2629,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
stateId = ETS_FOCUSED;
else
stateId = ETS_NORMAL;
- XPThemeData theme(widget, p, QLatin1String("EDIT"), partId, stateId, r);
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::EditTheme, partId, stateId, r);
d->drawBackground(theme);
} else {
QBrush editBrush = cmb->palette.brush(QPalette::Base);
@@ -2617,7 +2650,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
if (sub & SC_ComboBoxArrow) {
- XPThemeData theme(widget, p, QLatin1String("COMBOBOX"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::ComboboxTheme);
theme.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);
partId = CP_DROPDOWNBUTTON;
if (!(flags & State_Enabled))
@@ -2638,7 +2671,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
- XPThemeData theme(widget, p, QLatin1String("SCROLLBAR"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::ScrollBarTheme);
bool maxedOut = (scrollbar->maximum == scrollbar->minimum);
if (maxedOut)
flags &= ~State_Enabled;
@@ -2776,7 +2809,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
- XPThemeData theme(widget, p, QLatin1String("TRACKBAR"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::TrackBarTheme);
QRect slrect = slider->rect;
QRegion tickreg = slrect;
if (sub & SC_SliderGroove) {
@@ -2939,7 +2972,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
if (toolbutton->subControls & SC_ToolButton) {
if (flags & (State_Sunken | State_On | State_Raised) || !autoRaise) {
if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup && autoRaise) {
- XPThemeData theme(widget, p, QLatin1String("TOOLBAR"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::ToolBarTheme);
theme.partId = TP_SPLITBUTTON;
theme.rect = button;
if (!(bflags & State_Enabled))
@@ -3029,7 +3062,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option))
{
bool isActive = tb->titleBarState & QStyle::State_Active;
- XPThemeData theme(widget, p, QLatin1String("WINDOW"));
+ XPThemeData theme(widget, p, QWindowsXPStylePrivate::WindowTheme);
if (sub & SC_TitleBarLabel) {
partId = (tb->titleBarState & Qt::WindowMinimized) ? WP_MINCAPTION : WP_CAPTION;
@@ -3298,7 +3331,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
case PM_IndicatorWidth:
case PM_IndicatorHeight:
{
- XPThemeData theme(widget, 0, QLatin1String("BUTTON"), BP_CHECKBOX, CBS_UNCHECKEDNORMAL);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_CHECKBOX, CBS_UNCHECKEDNORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3310,7 +3343,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
case PM_ExclusiveIndicatorWidth:
case PM_ExclusiveIndicatorHeight:
{
- XPThemeData theme(widget, 0, QLatin1String("BUTTON"), BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3324,7 +3357,8 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
Qt::Orientation orient = Qt::Horizontal;
if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
orient = pb2->orientation;
- XPThemeData theme(widget, 0, QLatin1String("PROGRESS"), (orient == Qt::Horizontal) ? PP_CHUNK : PP_CHUNKVERT);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ProgressTheme,
+ (orient == Qt::Horizontal) ? PP_CHUNK : PP_CHUNKVERT);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3335,7 +3369,8 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
case PM_SliderThickness:
{
- XPThemeData theme(widget, 0, QLatin1String("TRACKBAR"), TKP_THUMB);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::TrackBarTheme,
+ TKP_THUMB);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3355,7 +3390,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
case PM_MdiSubWindowFrameWidth:
{
- XPThemeData theme(widget, 0, QLatin1String("WINDOW"), WP_FRAMELEFT, FS_ACTIVE);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_FRAMELEFT, FS_ACTIVE);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, WP_FRAMELEFT, FS_ACTIVE, 0, TS_TRUE, &size);
@@ -3376,7 +3411,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
#endif // QT_NO_TOOLBAR
case PM_DockWidgetFrameWidth:
{
- XPThemeData theme(widget, 0, QLatin1String("WINDOW"), WP_SMALLFRAMERIGHT, FS_ACTIVE);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_SMALLFRAMERIGHT, FS_ACTIVE);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3635,7 +3670,7 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt
case CT_LineEdit:
case CT_ComboBox:
{
- XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ XPThemeData buttontheme(widget, 0, QWindowsXPStylePrivate::ButtonTheme);
HTHEME theme = buttontheme.handle();
MARGINS borderSize;
if (theme) {
@@ -3761,9 +3796,13 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
titleBarRect.setHeight(tbHeight);
XPThemeData themeData;
if (titlebar->titleBarState & Qt::WindowMinimized) {
- themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_MINCAPTION, CS_ACTIVE, titleBarRect);
+ themeData = XPThemeData(widget, 0,
+ QWindowsXPStylePrivate::WindowTheme,
+ WP_MINCAPTION, CS_ACTIVE, titleBarRect);
} else
- themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_CAPTION, CS_ACTIVE, titleBarRect);
+ themeData = XPThemeData(widget, 0,
+ QWindowsXPStylePrivate::WindowTheme,
+ WP_CAPTION, CS_ACTIVE, titleBarRect);
mask->region = d->region(themeData) +
QRect(0, tbHeight, option->rect.width(), option->rect.height() - tbHeight);
}
@@ -3812,7 +3851,7 @@ QPixmap QWindowsXPStyle::standardPixmap(StandardPixmap standardPixmap, const QSt
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (widget && widget->isWindow()) {
- XPThemeData theme(widget, 0, QLatin1String("WINDOW"), WP_SMALLCLOSEBUTTON, CBS_NORMAL);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL);
if (theme.isValid()) {
SIZE sz;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &sz);
@@ -3844,8 +3883,10 @@ QIcon QWindowsXPStyle::standardIconImplementation(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockFloat.isNull()) {
- XPThemeData themeSize(0, 0, QLatin1String("WINDOW"), WP_SMALLCLOSEBUTTON, CBS_NORMAL);
- XPThemeData theme(0, 0, QLatin1String("WINDOW"), WP_MAXBUTTON, MAXBS_NORMAL);
+ XPThemeData themeSize(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ WP_SMALLCLOSEBUTTON, CBS_NORMAL);
+ XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ WP_MAXBUTTON, MAXBS_NORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(themeSize.handle(), 0, themeSize.partId, themeSize.stateId, 0, TS_TRUE, &size);
@@ -3879,7 +3920,8 @@ QIcon QWindowsXPStyle::standardIconImplementation(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockClose.isNull()) {
- XPThemeData theme(0, 0, QLatin1String("WINDOW"), WP_SMALLCLOSEBUTTON, CBS_NORMAL);
+ XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ WP_SMALLCLOSEBUTTON, CBS_NORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
@@ -3913,8 +3955,10 @@ QIcon QWindowsXPStyle::standardIconImplementation(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockFloat.isNull()) {
- XPThemeData themeSize(0, 0, QLatin1String("WINDOW"), WP_SMALLCLOSEBUTTON, CBS_NORMAL);
- XPThemeData theme(0, 0, QLatin1String("WINDOW"), WP_RESTOREBUTTON, RBS_NORMAL);
+ XPThemeData themeSize(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ WP_SMALLCLOSEBUTTON, CBS_NORMAL);
+ XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ WP_RESTOREBUTTON, RBS_NORMAL);
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(themeSize.handle(), 0, themeSize.partId, themeSize.stateId, 0, TS_TRUE, &size);
diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/widgets/styles/qwindowsxpstyle_p.h
index 0e42bbfa39..058668d3fb 100644
--- a/src/widgets/styles/qwindowsxpstyle_p.h
+++ b/src/widgets/styles/qwindowsxpstyle_p.h
@@ -209,9 +209,9 @@ QT_BEGIN_NAMESPACE
class XPThemeData
{
public:
- XPThemeData(const QWidget *w = 0, QPainter *p = 0, const QString &theme = QString(),
+ XPThemeData(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
int part = 0, int state = 0, const QRect &r = QRect())
- : widget(w), painter(p), name(theme), htheme(0), partId(part), stateId(state),
+ : widget(w), painter(p), theme(themeIn), htheme(0), partId(part), stateId(state),
mirrorHorizontally(false), mirrorVertically(false), noBorder(false),
noContent(false), rotate(0), rect(r)
{}
@@ -224,7 +224,8 @@ public:
const QWidget *widget;
QPainter *painter;
- QString name;
+
+ int theme;
HTHEME htheme;
int partId;
int stateId;
@@ -238,7 +239,7 @@ public:
};
struct ThemeMapKey {
- QString name;
+ int theme;
int partId;
int stateId;
bool noBorder;
@@ -246,17 +247,17 @@ struct ThemeMapKey {
ThemeMapKey() : partId(-1), stateId(-1) {}
ThemeMapKey(const XPThemeData &data)
- : name(data.name), partId(data.partId), stateId(data.stateId),
+ : theme(data.theme), partId(data.partId), stateId(data.stateId),
noBorder(data.noBorder), noContent(data.noContent) {}
};
inline uint qHash(const ThemeMapKey &key)
-{ return qHash(key.name) ^ key.partId ^ key.stateId; }
+{ return key.theme ^ key.partId ^ key.stateId; }
inline bool operator==(const ThemeMapKey &k1, const ThemeMapKey &k2)
{
- return k1.name == k2.name
+ return k1.theme == k2.theme
&& k1.partId == k2.partId
&& k1.stateId == k2.stateId;
}
@@ -286,7 +287,27 @@ class QWindowsXPStylePrivate : public QWindowsStylePrivate
{
Q_DECLARE_PUBLIC(QWindowsXPStyle)
public:
- typedef QMap<QString, HTHEME> ThemeHandleMap;
+ enum Theme {
+ ButtonTheme,
+ ComboboxTheme,
+ EditTheme,
+ HeaderTheme,
+ ListViewTheme,
+ MenuTheme,
+ ProgressTheme,
+ RebarTheme,
+ ScrollBarTheme,
+ SpinTheme,
+ TabTheme,
+ TaskDialogTheme,
+ ToolBarTheme,
+ ToolTipTheme,
+ TrackBarTheme,
+ TreeViewTheme,
+ WindowTheme,
+ StatusTheme,
+ NThemes
+ };
QWindowsXPStylePrivate()
: QWindowsStylePrivate(), hasInitColors(false), bufferDC(0), bufferBitmap(0), nullBitmap(0),
@@ -328,7 +349,8 @@ public:
QRgb sliderTickColor;
bool hasInitColors;
- static ThemeHandleMap *handleMap;
+ static HTHEME createTheme(int theme, HWND hwnd);
+ static QString themeName(int theme);
QIcon dockFloat, dockClose;
@@ -348,6 +370,8 @@ private:
HBITMAP nullBitmap;
uchar *bufferPixels;
int bufferW, bufferH;
+
+ static HTHEME m_themes[NThemes];
};
#endif // QT_NO_STYLE_WINDOWS
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index 8c0bcc098f..5f75bd3913 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -1178,11 +1178,11 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
}
break;
case Qt::Key_Up:
- case Qt::Key_Left:
next = false;
// fall through
+ case Qt::Key_Left:
case Qt::Key_Right:
- case Qt::Key_Down:
+ case Qt::Key_Down: {
#ifdef QT_KEYPAD_NAVIGATION
if ((QApplication::keypadNavigationEnabled()
&& (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))
@@ -1192,13 +1192,13 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
return;
}
#endif
- QWidget *pw;
+ QWidget *pw = parentWidget();
if (d->autoExclusive
#ifndef QT_NO_BUTTONGROUP
|| d->group
#endif
#ifndef QT_NO_ITEMVIEWS
- || ((pw = parentWidget()) && qobject_cast<QAbstractItemView *>(pw->parentWidget()))
+ || (pw && qobject_cast<QAbstractItemView *>(pw->parentWidget()))
#endif
) {
// ### Using qobject_cast to check if the parent is a viewport of
@@ -1209,9 +1209,17 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
if (hasFocus()) // nothing happend, propagate
e->ignore();
} else {
+ // Prefer parent widget, use this if parent is absent
+ QWidget *w = pw ? pw : this;
+ bool reverse = (w->layoutDirection() == Qt::RightToLeft);
+ if ((e->key() == Qt::Key_Left && !reverse)
+ || (e->key() == Qt::Key_Right && reverse)) {
+ next = false;
+ }
focusNextPrevChild(next);
}
break;
+ }
case Qt::Key_Escape:
if (d->down) {
setDown(false);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index dc1e0dbfab..bea4061076 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -2468,7 +2468,7 @@ void QComboBox::showPopup()
}
container->setGeometry(listRect);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
const bool updatesEnabled = container->updatesEnabled();
#endif
@@ -2484,7 +2484,7 @@ void QComboBox::showPopup()
// If updates are disabled at this point we'll miss our chance at painting the popup
// menu before it's shown, causing flicker since the window then displays the standard gray
// background.
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
container->setUpdatesEnabled(false);
#endif
@@ -2498,7 +2498,7 @@ void QComboBox::showPopup()
? QAbstractItemView::PositionAtCenter
: QAbstractItemView::EnsureVisible);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
container->setUpdatesEnabled(updatesEnabled);
#endif
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index 5a8e083e44..09cbfd663d 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -120,8 +120,8 @@ public:
QFontFamilyDelegate::QFontFamilyDelegate(QObject *parent)
: QAbstractItemDelegate(parent)
{
- truetype = QIcon(QLatin1String(":/trolltech/styles/commonstyle/images/fonttruetype-16.png"));
- bitmap = QIcon(QLatin1String(":/trolltech/styles/commonstyle/images/fontbitmap-16.png"));
+ truetype = QIcon(QLatin1String(":/qt-project.org/styles/commonstyle/images/fonttruetype-16.png"));
+ bitmap = QIcon(QLatin1String(":/qt-project.org/styles/commonstyle/images/fontbitmap-16.png"));
writingSystem = QFontDatabase::Any;
}
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 07843136ff..1ea636ffb2 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1669,7 +1669,7 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const
case Qt::ImCursorPosition:
return QVariant(d->control->cursor());
case Qt::ImSurroundingText:
- return QVariant(d->control->realText());
+ return QVariant(d->control->text());
case Qt::ImCurrentSelection:
return QVariant(selectedText());
case Qt::ImMaximumTextLength:
@@ -1748,7 +1748,6 @@ void QLineEdit::focusOutEvent(QFocusEvent *e)
reason != Qt::PopupFocusReason)
deselect();
- d->control->commitPreedit();
d->setCursorVisible(false);
d->control->setCursorBlinkPeriod(0);
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 3b7a0d1b91..d6af91fd65 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -70,7 +70,7 @@
QT_BEGIN_NAMESPACE
-class QLineEditPrivate : public QWidgetPrivate
+class Q_AUTOTEST_EXPORT QLineEditPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QLineEdit)
public:
@@ -109,6 +109,10 @@ public:
return !control->isReadOnly();
}
+ static inline QLineEditPrivate *get(QLineEdit *lineEdit) {
+ return lineEdit->d_func();
+ }
+
QPoint tripleClick;
QBasicTimer tripleClickTimer;
uint frame : 1;
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 5ec41b8ba6..c9818e056c 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1906,16 +1906,6 @@ QAction *QMenuBar::defaultAction() const
*/
/*!
- \enum QMenuBar::Separator
-
- \compat
-
- \value Never
- \value InWindowsStyle
-
-*/
-
-/*!
\fn void QMenuBar::addAction(QAction *action)
\overload
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 3e5b78fe2b..c02aa0e875 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -526,9 +526,9 @@ void QProgressBar::setInvertedAppearance(bool invert)
update();
}
-bool QProgressBar::invertedAppearance()
+bool QProgressBar::invertedAppearance() const
{
- Q_D(QProgressBar);
+ Q_D(const QProgressBar);
return d->invertedAppearance;
}
@@ -549,9 +549,9 @@ void QProgressBar::setTextDirection(QProgressBar::Direction textDirection)
update();
}
-QProgressBar::Direction QProgressBar::textDirection()
+QProgressBar::Direction QProgressBar::textDirection() const
{
- Q_D(QProgressBar);
+ Q_D(const QProgressBar);
return d->textDirection;
}
diff --git a/src/widgets/widgets/qprogressbar.h b/src/widgets/widgets/qprogressbar.h
index fad1ee4e0b..65ec5fa404 100644
--- a/src/widgets/widgets/qprogressbar.h
+++ b/src/widgets/widgets/qprogressbar.h
@@ -92,11 +92,9 @@ public:
Qt::Orientation orientation() const;
void setInvertedAppearance(bool invert);
- bool invertedAppearance(); //### Qt5 make const
- bool invertedAppearance() const { return const_cast<QProgressBar *>(this)->invertedAppearance(); }
+ bool invertedAppearance() const;
void setTextDirection(QProgressBar::Direction textDirection);
- QProgressBar::Direction textDirection(); //### Qt5 make const
- QProgressBar::Direction textDirection() const { return const_cast<QProgressBar *>(this)->textDirection(); }
+ QProgressBar::Direction textDirection() const;
void setFormat(const QString &format);
QString format() const;
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 7f77bc9d03..5f37240d67 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -536,20 +536,6 @@ QSlider::TickPosition QSlider::tickPosition() const
}
/*!
- \fn TickPosition QSlider::tickmarks() const
- \compat
-
- Use tickPosition() instead.
-*/
-
-/*!
- \fn QSlider::setTickmarks(TickPosition position)
- \compat
-
- Use setTickPosition() instead.
-*/
-
-/*!
\property QSlider::tickInterval
\brief the interval between tickmarks
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 4b7e1b5978..217fda61dc 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -2491,19 +2491,6 @@ void QTextEdit::ensureCursorVisible()
}
/*!
- \enum QTextEdit::KeyboardAction
-
- \compat
-
- \value ActionBackspace
- \value ActionDelete
- \value ActionReturn
- \value ActionKill
- \value ActionWordBackspace
- \value ActionWordDelete
-*/
-
-/*!
\fn bool QTextEdit::find(const QString &exp, bool cs, bool wo)
Use the find() overload that takes a QTextDocument::FindFlags
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 84cb5fd10c..6ba29c13b8 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -1279,22 +1279,6 @@ void QToolBar::initStyleOption(QStyleOptionToolBar *option) const
layout->getStyleOptionInfo(option, const_cast<QToolBar *>(this));
}
-/*!
- \reimp
-*/
-void QToolBar::childEvent(QChildEvent *event) // ### remove me in 5.0
-{
- QWidget::childEvent(event);
-}
-
-/*!
- \reimp
-*/
-void QToolBar::resizeEvent(QResizeEvent *event) // ### remove me in 5.0
-{
- QWidget::resizeEvent(event);
-}
-
QT_END_NAMESPACE
#include "moc_qtoolbar.cpp"
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index ac59d9803a..1fd5da797b 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -147,9 +147,7 @@ Q_SIGNALS:
protected:
void actionEvent(QActionEvent *event);
void changeEvent(QEvent *event);
- void childEvent(QChildEvent *event);
void paintEvent(QPaintEvent *event);
- void resizeEvent(QResizeEvent *event);
bool event(QEvent *event);
void initStyleOption(QStyleOptionToolBar *option) const;
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index b4a7007190..c9300d3cdd 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -184,21 +184,15 @@ void QWidgetLineControl::paste(QClipboard::Mode clipboardMode)
/*!
\internal
-
- Exits preedit mode and commits parts marked as tentative commit
*/
void QWidgetLineControl::commitPreedit()
{
if (!composeMode())
return;
- qApp->inputMethod()->reset();
-
- if (!m_tentativeCommit.isEmpty()) {
- internalInsert(m_tentativeCommit);
- m_tentativeCommit.clear();
- finishChange(-1, true/*not used, not documented*/, false);
- }
+ qApp->inputMethod()->commit();
+ if (!composeMode())
+ return;
m_preeditCursor = 0;
setPreeditArea(-1, QString());
@@ -573,13 +567,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
else if (m_preeditCursor != oldPreeditCursor)
emit updateMicroFocus();
- bool tentativeCommitChanged = (m_tentativeCommit != event->tentativeCommitString());
- if (tentativeCommitChanged) {
- m_textDirty = true;
- m_tentativeCommit = event->tentativeCommitString();
- }
-
- if (isGettingInput || tentativeCommitChanged)
+ if (isGettingInput)
finishChange(priorState);
if (selectionChange)
@@ -687,15 +675,6 @@ bool QWidgetLineControl::finishChange(int validateFromState, bool update, bool e
return true;
}
m_cursor = cursorCopy;
-
- if (!m_tentativeCommit.isEmpty()) {
- textCopy.insert(m_cursor, m_tentativeCommit);
- bool validInput = (m_validator->validate(textCopy, cursorCopy) != QValidator::Invalid);
- if (!validInput)
- m_tentativeCommit.clear();
- }
- } else {
- m_tentativeCommit.clear();
}
}
#endif
@@ -806,6 +785,11 @@ void QWidgetLineControl::internalInsert(const QString &s)
if (m_passwordEchoTimer != 0)
killTimer(m_passwordEchoTimer);
int delay = qGuiApp->styleHints()->passwordMaskDelay();
+#ifdef QT_BUILD_INTERNAL
+ if (m_passwordMaskDelayOverride >= 0)
+ delay = m_passwordMaskDelayOverride;
+#endif
+
if (delay > 0)
m_passwordEchoTimer = startTimer(delay);
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 62184a27bb..ba3b202bda 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -98,6 +98,9 @@ public:
, m_threadChecks(false)
, m_textLayoutThread(0)
#endif
+#if defined(QT_BUILD_INTERNAL)
+ , m_passwordMaskDelayOverride(-1)
+#endif
, m_keyboardScheme(0)
{
init(txt);
@@ -217,22 +220,13 @@ public:
QString text() const
{
QString content = m_text;
- if (!m_tentativeCommit.isEmpty())
- content.insert(m_cursor, m_tentativeCommit);
QString res = m_maskData ? stripString(content) : content;
return (res.isNull() ? QString::fromLatin1("") : res);
}
- // like text() but doesn't include preedit
- QString realText() const
- {
- QString res = m_maskData ? stripString(m_text) : m_text;
- return (res.isNull() ? QString::fromLatin1("") : res);
- }
void setText(const QString &txt)
{
if (composeMode())
qApp->inputMethod()->reset();
- m_tentativeCommit.clear();
internalSetText(txt, -1, false);
}
void commitPreedit();
@@ -286,7 +280,18 @@ public:
bool hasAcceptableInput() const { return hasAcceptableInput(m_text); }
bool fixup();
- QString inputMask() const { return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString(); }
+ QString inputMask() const
+ {
+ QString mask;
+ if (m_maskData) {
+ mask = m_inputMask;
+ if (m_blank != QLatin1Char(' ')) {
+ mask += QLatin1Char(';');
+ mask += m_blank;
+ }
+ }
+ return mask;
+ }
void setInputMask(const QString &mask)
{
parseInputMask(mask);
@@ -402,7 +407,6 @@ private:
int m_cursor;
int m_preeditCursor;
int m_cursorWidth;
- QString m_tentativeCommit;
Qt::LayoutDirection m_layoutDirection;
uint m_hideCursor : 1; // used to hide the m_cursor inside preedit areas
uint m_separator : 1;
@@ -495,6 +499,11 @@ private:
mutable QThread *m_textLayoutThread;
#endif
+public:
+#if defined(QT_BUILD_INTERNAL)
+ int m_passwordMaskDelayOverride;
+#endif
+
Q_SIGNALS:
void cursorPositionChanged(int, int);
void selectionChanged();
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 86dfb30389..d602d6daa5 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -2000,7 +2000,6 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
}
}
layout->setAdditionalFormats(overrides);
- tentativeCommit = e->tentativeCommitString();
cursor.endEditBlock();
@@ -2057,7 +2056,6 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e)
}
#endif
} else {
- commitPreedit();
setBlinkingCursorEnabled(false);
if (cursorIsFocusIndicator
@@ -2758,14 +2756,12 @@ void QWidgetTextControlPrivate::commitPreedit()
if (!isPreediting())
return;
- cursor.beginEditBlock();
- qApp->inputMethod()->reset();
+ qApp->inputMethod()->commit();
- if (!tentativeCommit.isEmpty()) {
- cursor.insertText(tentativeCommit);
- tentativeCommit.clear();
- }
+ if (!isPreediting())
+ return;
+ cursor.beginEditBlock();
preeditCursor = 0;
QTextBlock block = cursor.block();
QTextLayout *layout = block.layout();
@@ -2936,17 +2932,12 @@ bool QWidgetTextControl::find(const QString &exp, QTextDocument::FindFlags optio
QString QWidgetTextControl::toPlainText() const
{
- Q_D(const QWidgetTextControl);
- QString plainText = document()->toPlainText();
- if (!d->tentativeCommit.isEmpty())
- plainText.insert(textCursor().position(), d->tentativeCommit);
- return plainText;
+ return document()->toPlainText();
}
#ifndef QT_NO_TEXTHTMLPARSER
QString QWidgetTextControl::toHtml() const
{
- // note: currently not including tentative commit
return document()->toHtml();
}
#endif
diff --git a/src/widgets/widgets/qwidgettextcontrol_p_p.h b/src/widgets/widgets/qwidgettextcontrol_p_p.h
index d0d940e521..4efb59152a 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p_p.h
@@ -209,7 +209,6 @@ public:
int preeditCursor;
bool hideCursor; // used to hide the cursor in the preedit area
- QString tentativeCommit;
QVector<QAbstractTextDocumentLayout::Selection> extraSelections;