diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qdrawutil.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qgtkstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle.qdoc | 38 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 12 | ||||
-rw-r--r-- | src/widgets/styles/qproxystyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 20 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsmobilestyle.cpp | 124 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 28 |
11 files changed, 119 insertions, 119 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 269b887909..e2c5bab47f 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -3003,7 +3003,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, case SE_ToolBarHandle: if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { if (tbopt->features & QStyleOptionToolBar::Movable) { - ///we need to access the widget here because the style option doesn't + ///we need to access the widget here because the style option doesn't //have all the information we need (ie. the layout's margin) const QToolBar *tb = qobject_cast<const QToolBar*>(widget); const int margin = tb && tb->layout() ? tb->layout()->margin() : 2; diff --git a/src/widgets/styles/qcommonstyle.h b/src/widgets/styles/qcommonstyle.h index d11f57dac0..01eca4664f 100644 --- a/src/widgets/styles/qcommonstyle.h +++ b/src/widgets/styles/qcommonstyle.h @@ -51,7 +51,7 @@ class QCommonStylePrivate; class Q_WIDGETS_EXPORT QCommonStyle: public QStyle { Q_OBJECT - + public: QCommonStyle(); ~QCommonStyle(); diff --git a/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp index 0f73a16bcb..1c154650c8 100644 --- a/src/widgets/styles/qdrawutil.cpp +++ b/src/widgets/styles/qdrawutil.cpp @@ -748,10 +748,10 @@ void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &c, \since 4.6 \inmodule QtWidgets - + \brief The QTileRules class provides the rules used to draw a pixmap or image split into nine segments. - + Spliiting is similar to \l{http://www.w3.org/TR/css3-background/}{CSS3 border-images}. \sa Qt::TileRule, QMargins diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp index 9ebab8d52d..8c9fc93288 100644 --- a/src/widgets/styles/qgtkstyle.cpp +++ b/src/widgets/styles/qgtkstyle.cpp @@ -2121,7 +2121,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom label.state = bflags; GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton"); QPalette pal = toolbutton->palette; - if (option->state & State_Enabled && + if (option->state & State_Enabled && option->state & State_MouseOver && !(widget && widget->testAttribute(Qt::WA_SetPalette))) { GdkColor gdkText = d->gtk_widget_get_style(gtkButton)->fg[GTK_STATE_PRELIGHT]; QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); @@ -2971,7 +2971,7 @@ void QGtkStyle::drawControl(ControlElement element, if (option->state & State_Sunken) shadow = GTK_SHADOW_IN; - + gtkPainter->paintBox(gtkTreeHeader, "button", option->rect.adjusted(-1, 0, 0, 0), state, shadow, d->gtk_widget_get_style(gtkTreeHeader)); } diff --git a/src/widgets/styles/qmacstyle.qdoc b/src/widgets/styles/qmacstyle.qdoc index 9f5299032f..9ee464667a 100644 --- a/src/widgets/styles/qmacstyle.qdoc +++ b/src/widgets/styles/qmacstyle.qdoc @@ -104,43 +104,43 @@ */ /*! \fn void QMacStyle::polish(QPalette &pal) - \reimp + \reimp */ /*! \fn void QMacStyle::polish(QApplication *) - \reimp + \reimp */ /*! \fn void QMacStyle::unpolish(QApplication *) - \reimp + \reimp */ /*! \fn void QMacStyle::polish(QWidget* w) - \reimp + \reimp */ /*! \fn void QMacStyle::unpolish(QWidget* w) - \reimp + \reimp */ /*! \fn int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const - \reimp + \reimp */ /*! \fn QPalette QMacStyle::standardPalette() const - \reimp + \reimp */ /*! \fn int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const - \reimp + \reimp */ /*! \fn QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const - \reimp + \reimp */ /*! \fn QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const - \reimp + \reimp */ /*! @@ -199,41 +199,41 @@ /*! \fn void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const - \reimp + \reimp */ /*! \fn void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const - \reimp + \reimp */ /*! \fn QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget) const - \reimp + \reimp */ /*! \fn void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const - \reimp + \reimp */ /*! \fn QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const - \reimp + \reimp */ /*! \fn QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const - \reimp + \reimp */ /*! \fn QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const - \reimp + \reimp */ /*! \fn void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const - \reimp + \reimp */ /*! \fn bool QMacStyle::event(QEvent *e) - \reimp + \reimp */ /*! \fn QIcon QMacStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 9a8d768e2a..18eb5e6c44 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -41,7 +41,7 @@ /* Note: The qdoc comments for QMacStyle are contained in - .../doc/src/qstyles.qdoc. + .../doc/src/qstyles.qdoc. */ #include <Cocoa/Cocoa.h> @@ -3402,7 +3402,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter } else { pr.setHeight(pixmap.size().height() + 6); cr.adjust(0, pr.bottom(), 0, -3); - } + } alignment |= Qt::AlignCenter; } else { pr.setWidth(pixmap.width() + 8); @@ -5292,7 +5292,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex else x += br.width() / 2 - p->fontMetrics().width(titlebar->text) / 2; if (iw) - p->drawPixmap(x - iw, y, + p->drawPixmap(x - iw, y, titlebar->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), QIcon::Normal)); drawItemText(p, br, Qt::AlignCenter, opt->palette, tds == kThemeStateActive, titlebar->text, QPalette::Text); @@ -6002,12 +6002,12 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, ------------------------------ <- top of stack widget - To summarize: - * 2 is the distance between the pane and the contentsRect + To summarize: + * 2 is the distance between the pane and the contentsRect * The 14 and the 1's are the distance from the contentsRect to the stack widget. (same value as used in SE_TabWidgetTabContents) * overlap is how much the pane should overlap the tab bar - */ + */ // then add the size between the stackwidget and the "contentsRect" if (const QStyleOptionTabWidgetFrame *twf diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp index 911223cae2..d89390cb01 100644 --- a/src/widgets/styles/qproxystyle.cpp +++ b/src/widgets/styles/qproxystyle.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE \since 4.6 \inmodule QtWidgets - + A QProxyStyle wraps a QStyle (usually the default system style) for the purpose of dynamically overriding painting or other specific style behavior. diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 1d4e4bd570..c3f22994ca 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -137,7 +137,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C state. \endtable - + For more information about widget styling and appearance, see the \l{Styles and Style Aware Widgets}. */ diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index eff6837c5a..6eb81e8fb8 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -374,7 +374,7 @@ QStyleOption &QStyleOption::operator=(const QStyleOption &other) parameters for drawing a focus rectangle with QStyle. \inmodule QtWidgets - + For performance reasons, the access to the member variables is direct (i.e., using the \c . or \c -> operator). This low-level feel makes the structures straightforward to use and emphasizes that @@ -458,7 +458,7 @@ QStyleOptionFocusRect::QStyleOptionFocusRect(int version) parameters for drawing a frame. \inmodule QtWidgets - + QStyleOptionFrame is used for drawing several built-in Qt widgets, including QFrame, QGroupBox, QLineEdit, and QMenu. @@ -738,7 +738,7 @@ QStyleOptionGroupBox::QStyleOptionGroupBox(int version) parameters for drawing a header. \inmodule QtWidgets - + QStyleOptionHeader contains all the information that QStyle functions need to draw the item views' header pane, header sort arrow, and header label. @@ -925,7 +925,7 @@ QStyleOptionHeader::QStyleOptionHeader(int version) parameters for drawing buttons. \inmodule QtWidgets - + QStyleOptionButton contains all the information that QStyle functions need to draw graphical elements like QPushButton, QCheckBox, and QRadioButton. @@ -1237,7 +1237,7 @@ QStyleOptionToolBar::QStyleOptionToolBar(int version) parameters for drawing a tab bar. \inmodule QtWidgets - + The QStyleOptionTab class is used for drawing several built-in Qt widgets including \l QTabBar and the panel for \l QTabWidget. @@ -1662,7 +1662,7 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version) parameter necessary for drawing a menu item. \inmodule QtWidgets - + QStyleOptionMenuItem contains all the information that QStyle functions need to draw the menu items from \l QMenu. It is also used for drawing other menu-related widgets. @@ -1862,7 +1862,7 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version) common to all complex controls. \inmodule QtWidgets - + This class is not used on its own. Instead it is used to derive other complex control options, for example QStyleOptionSlider and QStyleOptionSpinBox. @@ -1953,7 +1953,7 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type) parameters needed for drawing a slider. \inmodule QtWidgets - + QStyleOptionSlider contains all the information that QStyle functions need to draw QSlider and QScrollBar. @@ -2152,7 +2152,7 @@ QStyleOptionSlider::QStyleOptionSlider(int version) parameters necessary for drawing a spin box. \inmodule QtWidgets - + QStyleOptionSpinBox contains all the information that QStyle functions need to draw QSpinBox and QDateTimeEdit. @@ -2257,7 +2257,7 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version) parameters for drawing a dock widget. \inmodule QtWidgets - + QStyleOptionDockWidget contains all the information that QStyle functions need to draw graphical elements like QDockWidget. diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp index 2b30bf5a2d..55c9495b1a 100644 --- a/src/widgets/styles/qwindowsmobilestyle.cpp +++ b/src/widgets/styles/qwindowsmobilestyle.cpp @@ -90,7 +90,7 @@ static const int windowsMobileExclusiveIndicatorSize = 14; static const int windowsMobileSliderThickness = 6; static const int windowsMobileIconSize = 16; static const int PE_IndicatorArrowUpBig = 0xf000101; -static const int PE_IndicatorArrowDownBig = 0xf000102; +static const int PE_IndicatorArrowDownBig = 0xf000102; static const int PE_IndicatorArrowLeftBig = 0xf000103; static const int PE_IndicatorArrowRightBig = 0xf000104; @@ -241,7 +241,7 @@ static const char *const radiochecked_xpm[] = { static const char * const radiochecked_low_xpm[] = { "9 9 2 1", " c None", - ". c #000000", + ". c #000000", " ... ", " ....... ", " ....... ", @@ -3904,39 +3904,39 @@ QColor fromHsl(QColor c) qreal ca[3] = {0, 0, 0}; if (s == 0 || h == 1) { - // achromatic case + // achromatic case ca[0] = ca[1] = ca[2] = l; - } else { - // chromatic case - qreal temp2; - if (l < qreal(0.5)) - temp2 = l * (qreal(1.0) + s); - else - temp2 = l + s - (l * s); - - const qreal temp1 = (qreal(2.0) * l) - temp2; - qreal temp3[3] = { h + (qreal(1.0) / qreal(3.0)), - h, - h - (qreal(1.0) / qreal(3.0)) }; - - for (int i = 0; i != 3; ++i) { - if (temp3[i] < qreal(0.0)) - temp3[i] += qreal(1.0); - else if (temp3[i] > qreal(1.0)) + } else { + // chromatic case + qreal temp2; + if (l < qreal(0.5)) + temp2 = l * (qreal(1.0) + s); + else + temp2 = l + s - (l * s); + + const qreal temp1 = (qreal(2.0) * l) - temp2; + qreal temp3[3] = { h + (qreal(1.0) / qreal(3.0)), + h, + h - (qreal(1.0) / qreal(3.0)) }; + + for (int i = 0; i != 3; ++i) { + if (temp3[i] < qreal(0.0)) + temp3[i] += qreal(1.0); + else if (temp3[i] > qreal(1.0)) temp3[i] -= qreal(1.0); const qreal sixtemp3 = temp3[i] * qreal(6.0); - if (sixtemp3 < qreal(1.0)) - ca[i] = ((temp1 + (temp2 - temp1) * sixtemp3)); - else if ((temp3[i] * qreal(2.0)) < qreal(1.0)) - ca[i] = (temp2); - else if ((temp3[i] * qreal(3.0)) < qreal(2.0)) + if (sixtemp3 < qreal(1.0)) + ca[i] = ((temp1 + (temp2 - temp1) * sixtemp3)); + else if ((temp3[i] * qreal(2.0)) < qreal(1.0)) + ca[i] = (temp2); + else if ((temp3[i] * qreal(3.0)) < qreal(2.0)) ca[i] = temp1 + (temp2 -temp1) * (qreal(2.0) /qreal(3.0) - temp3[i]) * qreal(6.0); else ca[i] = temp1; } } - + return QColor::fromRgbF(ca[0], ca[1], ca[2]); } @@ -3945,7 +3945,7 @@ QColor fromHsl(QColor c) QColor toHsl(QColor c) { - QColor color; + QColor color; qreal h; qreal s; qreal l; @@ -3953,36 +3953,36 @@ QColor toHsl(QColor c) const qreal r = c.redF(); const qreal g = c.greenF(); const qreal b = c.blueF(); - const qreal max = Q_MAX_3(r, g, b); - const qreal min = Q_MIN_3(r, g, b); - const qreal delta = max - min; - const qreal delta2 = max + min; - const qreal lightness = qreal(0.5) * delta2; + const qreal max = Q_MAX_3(r, g, b); + const qreal min = Q_MIN_3(r, g, b); + const qreal delta = max - min; + const qreal delta2 = max + min; + const qreal lightness = qreal(0.5) * delta2; l = (lightness); - if (qFuzzyIsNull(delta)) { - // achromatic case, hue is undefined + if (qFuzzyIsNull(delta)) { + // achromatic case, hue is undefined h = 0; - s = 0; + s = 0; } else { - // chromatic case - qreal hue = 0; - if (lightness < qreal(0.5)) - s = ((delta / delta2)); - else - s = ((delta / (qreal(2.0) - delta2))); - if (qFuzzyCompare(r, max)) { - hue = ((g - b) /delta); - } else if (qFuzzyCompare(g, max)) { - hue = (2.0 + (b - r) / delta); - } else if (qFuzzyCompare(b, max)) { - hue = (4.0 + (r - g) / delta); - } else { - Q_ASSERT_X(false, "QColor::toHsv", "internal error"); + // chromatic case + qreal hue = 0; + if (lightness < qreal(0.5)) + s = ((delta / delta2)); + else + s = ((delta / (qreal(2.0) - delta2))); + if (qFuzzyCompare(r, max)) { + hue = ((g - b) /delta); + } else if (qFuzzyCompare(g, max)) { + hue = (2.0 + (b - r) / delta); + } else if (qFuzzyCompare(b, max)) { + hue = (4.0 + (r - g) / delta); + } else { + Q_ASSERT_X(false, "QColor::toHsv", "internal error"); } - hue *= 60.0; - if (hue < 0.0) - hue += 360.0; - h = (hue * 100); + hue *= 60.0; + if (hue < 0.0) + hue += 360.0; + h = (hue * 100); } h = h / 36000; @@ -4083,7 +4083,7 @@ void QWindowsMobileStylePrivate::tintListViewHighlight(QColor color) imageListViewHighlightMiddle = QImage(listviewhighmiddle_xpm); tintImage(&imageListViewHighlightMiddle, color, qreal(0.0)); - + int height = imageListViewHighlightMiddle.height(); if (!doubleControls) { height = height / 2; @@ -4218,7 +4218,7 @@ void QWindowsMobileStylePrivate::drawPanelItemViewSelected(QPainter *painter, co QRect r; if (rect.isValid()) r = rect; - else + else r = option->rect; tintImagesHigh(option->palette.highlight().color()); @@ -4892,7 +4892,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp } else { QRect r = QRect(option->rect.x(), option->rect.y(), windowsMobileitemViewCheckBoxSize, windowsMobileitemViewCheckBoxSize); qDrawPlainRect(painter, r, option->palette.shadow().color(), 1); - } + } if (option->state & State_Enabled) d->imageChecked.setColor(1, option->palette.shadow().color().rgba()); else @@ -5129,7 +5129,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp image.setColor(1, color.rgba()); painter->drawImage(option->rect.x() + xoffset, option->rect.y() + yoffset, image); } - else { + else { QPoint points[7]; switch (element) { case PE_IndicatorArrowUp: @@ -5194,7 +5194,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp painter->drawLine(points[2], points[3]); painter->drawLine(points[4], points[5]); painter->drawPoint(points[6]); - } + } } painter->restore(); break; } @@ -5432,7 +5432,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption QWindowsMobileStylePrivate *d = const_cast<QWindowsMobileStylePrivate*>(d_func()); - + painter->setClipping(false); switch (element) { case CE_MenuBarEmptyArea: @@ -5527,7 +5527,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption break; case CE_TabBarTabShape: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { - + if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) { d->drawTabBarTab(painter, tab); @@ -5564,7 +5564,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption proxy()->drawControl(CE_HeaderSection, header, painter, widget); QStyleOptionHeader subopt = *header; subopt.rect = proxy()->subElementRect(SE_HeaderLabel, header, widget); - if (header->state & State_Sunken) + if (header->state & State_Sunken) subopt.palette.setColor(QPalette::ButtonText, header->palette.brightText().color()); subopt.state |= QStyle::State_On; if (subopt.rect.isValid()) @@ -7079,7 +7079,7 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co } break; case PM_ScrollBarExtent: { - + if (d->smartphone) ret = 9; else diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index e9bc17f78f..0102bc2b7d 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -273,15 +273,15 @@ void QWindowsVistaAnimation::paint(QPainter *painter, const QStyleOption *option /*! \internal - + Animations are used for some state transitions on specific widgets. - + Only one running animation can exist for a widget at any specific time. Animations can be added through QWindowsVistaStylePrivate::startAnimation(Animation *) and any existing animation on a widget can be retrieved with QWindowsVistaStylePrivate::widgetAnimation(Widget *). - + Once an animation has been started, QWindowsVistaStylePrivate::timerEvent(QTimerEvent *) will continuously call update() on the widget until it is stopped, @@ -798,17 +798,17 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt || vopt->viewItemPosition == QStyleOptionViewItem::Invalid) painter->drawPixmap(pixmapRect.topLeft(), pixmap); else if (reverse ? rightSection : leftSection){ - painter->drawPixmap(QRect(pixmapRect.topLeft(), - QSize(frame, pixmapRect.height())), pixmap, + painter->drawPixmap(QRect(pixmapRect.topLeft(), + QSize(frame, pixmapRect.height())), pixmap, QRect(QPoint(0, 0), QSize(frame, pixmapRect.height()))); - painter->drawPixmap(pixmapRect.adjusted(frame, 0, 0, 0), + painter->drawPixmap(pixmapRect.adjusted(frame, 0, 0, 0), pixmap, srcRect.adjusted(frame, 0, -frame, 0)); } else if (reverse ? leftSection : rightSection) { - painter->drawPixmap(QRect(pixmapRect.topRight() - QPoint(frame - 1, 0), - QSize(frame, pixmapRect.height())), pixmap, - QRect(QPoint(pixmapRect.width() - frame, 0), + painter->drawPixmap(QRect(pixmapRect.topRight() - QPoint(frame - 1, 0), + QSize(frame, pixmapRect.height())), pixmap, + QRect(QPoint(pixmapRect.width() - frame, 0), QSize(frame, pixmapRect.height()))); - painter->drawPixmap(pixmapRect.adjusted(0, 0, -frame, 0), + painter->drawPixmap(pixmapRect.adjusted(0, 0, -frame, 0), pixmap, srcRect.adjusted(frame, 0, -frame, 0)); } else if (vopt->viewItemPosition == QStyleOptionViewItem::Middle) painter->drawPixmap(pixmapRect, pixmap, @@ -1110,7 +1110,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } else { animRect = QRect(rect.left() - glowSize + animOffset, rect.top(), glowSize, rect.height()); - animRect = QStyle::visualRect(reverse ? Qt::RightToLeft : Qt::LeftToRight, + animRect = QStyle::visualRect(reverse ? Qt::RightToLeft : Qt::LeftToRight, option->rect, animRect); pixmapSize.setWidth(animRect.width()); } @@ -1156,7 +1156,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption double vc6_workaround = ((progress - qint64(bar->minimum)) / qMax(double(1.0), double(qint64(bar->maximum) - qint64(bar->minimum))) * maxWidth); int width = isIndeterminate ? maxWidth : qMax(int(vc6_workaround), minWidth); theme.rect.setWidth(width); - theme.rect = QStyle::visualRect(reverse ? Qt::RightToLeft : Qt::LeftToRight, + theme.rect = QStyle::visualRect(reverse ? Qt::RightToLeft : Qt::LeftToRight, option->rect, theme.rect); } d->drawBackground(theme); @@ -1522,7 +1522,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QStyleOptionViewItem adjustedOption = *vopt; adjustedOption.palette = palette; // We hide the focusrect in singleselection as it is not required - if ((view->selectionMode() == QAbstractItemView::SingleSelection) + if ((view->selectionMode() == QAbstractItemView::SingleSelection) && !(vopt->state & State_KeyboardFocusChange)) adjustedOption.state &= ~State_HasFocus; QWindowsXPStyle::drawControl(element, &adjustedOption, painter, widget); @@ -1944,7 +1944,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption minimumHeight = qMax<qint32>(size.cy + margins.cyBottomHeight+ margins.cyTopHeight, sz.height()); sz.rwidth() += size.cx + margins.cxLeftWidth + margins.cxRightWidth; } - + if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { if (menuitem->menuItemType != QStyleOptionMenuItem::Separator) sz.setHeight(minimumHeight); |