| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/styles/qwindowsstyle.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; | - | ||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | QWindowsStylePrivate::QWindowsStylePrivate() | - | ||||||||||||||||||||||||
| 20 | : alt_down(false), menuBarTimer(0) | - | ||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||
| 29 | } | - | ||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||
| 31 | qreal QWindowsStylePrivate::appDevicePixelRatio() | - | ||||||||||||||||||||||||
| 32 | { | - | ||||||||||||||||||||||||
| 33 | return (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio(); | - | ||||||||||||||||||||||||
| 34 | } | - | ||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | bool QWindowsStylePrivate::hasSeenAlt(const QWidget *widget) const | - | ||||||||||||||||||||||||
| 38 | { | - | ||||||||||||||||||||||||
| 39 | widget = widget->window(); | - | ||||||||||||||||||||||||
| 40 | return seenAlt.contains(widget); | - | ||||||||||||||||||||||||
| 41 | } | - | ||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||
| 46 | bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) | - | ||||||||||||||||||||||||
| 47 | { | - | ||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | if (!o->isWidgetType()
| 0 | ||||||||||||||||||||||||
| 50 | return never executed: QObject::eventFilter(o, e);return QObject::eventFilter(o, e);never executed: return QObject::eventFilter(o, e); | 0 | ||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | QWidget *widget = qobject_cast<QWidget*>(o); | - | ||||||||||||||||||||||||
| 53 | QWindowsStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 54 | switch(e->type()) { | - | ||||||||||||||||||||||||
| 55 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 56 | if (static_cast<
| 0 | ||||||||||||||||||||||||
| 57 | widget = widget->window(); | - | ||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | QList<QWidget *> l = widget->findChildren<QWidget *>(); | - | ||||||||||||||||||||||||
| 61 | for (int posauto ignorable = 0 ; pos < l.size() ; ++pos) {[](QWidget *w= l.at(pos); | - | ||||||||||||||||||||||||
| if () { | ||||||||||||||||||||||||||
| 62 | return never executed: return w->isWindow() || !w->isVisible() || w->style()->styleHint(SH_UnderlineShortcut, 0, w);never executed: return w->isWindow() || !w->isVisible() || w->style()->styleHint(SH_UnderlineShortcut, 0, w);never executed: w->isWindow() || !w->isVisible()return w->isWindow() || !w->isVisible() || w->style()->styleHint(SH_UnderlineShortcut, 0, w);never executed: return w->isWindow() || !w->isVisible() || w->style()->styleHint(SH_UnderlineShortcut, 0, w); | 0 | ||||||||||||||||||||||||
| 63 | || w->style()->styleHint(SH_UnderlineShortcut, 0, w))); never executed: return w->isWindow() || !w->isVisible() || w->style()->styleHint(SH_UnderlineShortcut, 0, w); | 0 | ||||||||||||||||||||||||
| 64 | }; | - | ||||||||||||||||||||||||
| 65 | l.removeAterase(pos); | - | ||||||||||||||||||||||||
| }std::remove_if(l.begin(), l.end(), ignorable), l.end()); | ||||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | d->seenAlt.append(widget); | - | ||||||||||||||||||||||||
| 68 | d->alt_down = true; | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | for (int pos = 0; pos < l.size()
| 0 | ||||||||||||||||||||||||
| 72 | l.at(pos)->update(); never executed: l.at(pos)->update(); | 0 | ||||||||||||||||||||||||
| 73 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 74 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 75 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
| 76 | if (static_cast<
| 0 | ||||||||||||||||||||||||
| 77 | widget = widget->window(); | - | ||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | d->alt_down = false; | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | QList<QMenuBar *> l = widget->findChildren<QMenuBar *>(); | - | ||||||||||||||||||||||||
| 83 | for (int i = 0; i < l.size()
| 0 | ||||||||||||||||||||||||
| 84 | l.at(i)->update(); never executed: l.at(i)->update(); | 0 | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 87 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 88 | case never executed: QEvent::Close:case QEvent::Close:never executed: case QEvent::Close: | 0 | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | d->seenAlt.removeAll(widget); | - | ||||||||||||||||||||||||
| 91 | d->seenAlt.removeAll(widget->window()); | - | ||||||||||||||||||||||||
| 92 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 93 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 94 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 95 | } | - | ||||||||||||||||||||||||
| 96 | return never executed: QCommonStyle::eventFilter(o, e);return QCommonStyle::eventFilter(o, e);never executed: return QCommonStyle::eventFilter(o, e); | 0 | ||||||||||||||||||||||||
| 97 | } | - | ||||||||||||||||||||||||
| 98 | QWindowsStyle::QWindowsStyle() : QCommonStyle(*new QWindowsStylePrivate) | - | ||||||||||||||||||||||||
| 99 | { | - | ||||||||||||||||||||||||
| 100 | } | - | ||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | QWindowsStyle::QWindowsStyle(QWindowsStylePrivate &dd) : QCommonStyle(dd) | - | ||||||||||||||||||||||||
| 108 | { | - | ||||||||||||||||||||||||
| 109 | } | - | ||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||
| 111 | - | |||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | QWindowsStyle::~QWindowsStyle() | - | ||||||||||||||||||||||||
| 114 | { | - | ||||||||||||||||||||||||
| 115 | } | - | ||||||||||||||||||||||||
| 116 | void QWindowsStyle::polish(QApplication *app) | - | ||||||||||||||||||||||||
| 117 | { | - | ||||||||||||||||||||||||
| 118 | QCommonStyle::polish(app); | - | ||||||||||||||||||||||||
| 119 | QWindowsStylePrivate *d = const_cast<QWindowsStylePrivate*>(d_func()); | - | ||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | if (!proxy()->styleHint(SH_UnderlineShortcut, 0) && app) | - | ||||||||||||||||||||||||
| 122 | app->installEventFilter(this); | - | ||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||
| 124 | d->activeCaptionColor = app->palette().highlight().color(); | - | ||||||||||||||||||||||||
| 125 | d->activeGradientCaptionColor = app->palette().highlight() .color(); | - | ||||||||||||||||||||||||
| 126 | d->inactiveCaptionColor = app->palette().dark().color(); | - | ||||||||||||||||||||||||
| 127 | d->inactiveGradientCaptionColor = app->palette().dark().color(); | - | ||||||||||||||||||||||||
| 128 | d->inactiveCaptionText = app->palette().background().color(); | - | ||||||||||||||||||||||||
| 129 | } | - | ||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | void QWindowsStyle::unpolish(QApplication *app) | - | ||||||||||||||||||||||||
| 133 | { | - | ||||||||||||||||||||||||
| 134 | QCommonStyle::unpolish(app); | - | ||||||||||||||||||||||||
| 135 | app->removeEventFilter(this); | - | ||||||||||||||||||||||||
| 136 | } | - | ||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||
| 139 | void QWindowsStyle::polish(QWidget *widget) | - | ||||||||||||||||||||||||
| 140 | { | - | ||||||||||||||||||||||||
| 141 | QCommonStyle::polish(widget); | - | ||||||||||||||||||||||||
| 142 | } | - | ||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||
| 145 | void QWindowsStyle::unpolish(QWidget *widget) | - | ||||||||||||||||||||||||
| 146 | { | - | ||||||||||||||||||||||||
| 147 | QCommonStyle::unpolish(widget); | - | ||||||||||||||||||||||||
| 148 | } | - | ||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | void QWindowsStyle::polish(QPalette &pal) | - | ||||||||||||||||||||||||
| 154 | { | - | ||||||||||||||||||||||||
| 155 | QCommonStyle::polish(pal); | - | ||||||||||||||||||||||||
| 156 | } | - | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *, const QWidget *widget) | - | ||||||||||||||||||||||||
| 159 | { | - | ||||||||||||||||||||||||
| 160 | (void)pm;; | - | ||||||||||||||||||||||||
| 161 | (void)widget;; | - | ||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||
| 163 | return QWindowsStylePrivate::InvalidMetric; | - | ||||||||||||||||||||||||
| 164 | } | - | ||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||
| 166 | int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm) | - | ||||||||||||||||||||||||
| 167 | { | - | ||||||||||||||||||||||||
| 168 | switch (pm) { | - | ||||||||||||||||||||||||
| 169 | case QStyle::PM_ToolBarItemSpacing: | - | ||||||||||||||||||||||||
| 170 | return 0; | - | ||||||||||||||||||||||||
| 171 | case QStyle::PM_ButtonDefaultIndicator: | - | ||||||||||||||||||||||||
| 172 | case QStyle::PM_ButtonShiftHorizontal: | - | ||||||||||||||||||||||||
| 173 | case QStyle::PM_ButtonShiftVertical: | - | ||||||||||||||||||||||||
| 174 | case QStyle::PM_MenuHMargin: | - | ||||||||||||||||||||||||
| 175 | case QStyle::PM_MenuVMargin: | - | ||||||||||||||||||||||||
| 176 | case QStyle::PM_ToolBarItemMargin: | - | ||||||||||||||||||||||||
| 177 | return 1; | - | ||||||||||||||||||||||||
| 178 | break; dead code: break; | - | ||||||||||||||||||||||||
| 179 | case QStyle::PM_DockWidgetSeparatorExtent: | - | ||||||||||||||||||||||||
| 180 | return 4; | - | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | case QStyle::PM_TabBarTabShiftHorizontal: | - | ||||||||||||||||||||||||
| 183 | return 0; | - | ||||||||||||||||||||||||
| 184 | case QStyle::PM_TabBarTabShiftVertical: | - | ||||||||||||||||||||||||
| 185 | return 2; | - | ||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||
| 189 | case QStyle::PM_SliderLength: | - | ||||||||||||||||||||||||
| 190 | return 11; | - | ||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||
| 194 | case QStyle::PM_MenuBarHMargin: | - | ||||||||||||||||||||||||
| 195 | case QStyle::PM_MenuBarVMargin: | - | ||||||||||||||||||||||||
| 196 | case QStyle::PM_MenuBarPanelWidth: | - | ||||||||||||||||||||||||
| 197 | return 0; | - | ||||||||||||||||||||||||
| 198 | case QStyle::PM_SmallIconSize: | - | ||||||||||||||||||||||||
| 199 | return 16; | - | ||||||||||||||||||||||||
| 200 | case QStyle::PM_LargeIconSize: | - | ||||||||||||||||||||||||
| 201 | return 32; | - | ||||||||||||||||||||||||
| 202 | case QStyle::PM_DockWidgetTitleMargin: | - | ||||||||||||||||||||||||
| 203 | return 2; | - | ||||||||||||||||||||||||
| 204 | case QStyle::PM_DockWidgetTitleBarButtonMargin: | - | ||||||||||||||||||||||||
| 205 | case QStyle::PM_DockWidgetFrameWidth: | - | ||||||||||||||||||||||||
| 206 | return 4; | - | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||
| 209 | case QStyle::PM_ToolBarHandleExtent: | - | ||||||||||||||||||||||||
| 210 | return 10; | - | ||||||||||||||||||||||||
| 211 | default: | - | ||||||||||||||||||||||||
| 212 | break; | - | ||||||||||||||||||||||||
| 213 | } | - | ||||||||||||||||||||||||
| 214 | return QWindowsStylePrivate::InvalidMetric; | - | ||||||||||||||||||||||||
| 215 | } | - | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | static QWindow *windowOf(const QWidget *w) | - | ||||||||||||||||||||||||
| 218 | { | - | ||||||||||||||||||||||||
| 219 | QWindow *result = nullptr; | - | ||||||||||||||||||||||||
| 220 | if (w) { | - | ||||||||||||||||||||||||
| 221 | result = w->windowHandle(); | - | ||||||||||||||||||||||||
| 222 | if (!result) { | - | ||||||||||||||||||||||||
| 223 | if (const QWidget *np = w->nativeParentWidget()) | - | ||||||||||||||||||||||||
| 224 | result = np->windowHandle(); | - | ||||||||||||||||||||||||
| 225 | } | - | ||||||||||||||||||||||||
| 226 | } | - | ||||||||||||||||||||||||
| 227 | return result; | - | ||||||||||||||||||||||||
| 228 | } | - | ||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||
| 230 | static QScreen *screenOf(const QWidget *w) | - | ||||||||||||||||||||||||
| 231 | { | - | ||||||||||||||||||||||||
| 232 | if (const QWindow *window = windowOf(w)) | - | ||||||||||||||||||||||||
| 233 | return window->screen(); | - | ||||||||||||||||||||||||
| 234 | return QGuiApplication::primaryScreen(); | - | ||||||||||||||||||||||||
| 235 | } | - | ||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||
| 240 | qreal QWindowsStylePrivate::nativeMetricScaleFactor(const QWidget *widget) | - | ||||||||||||||||||||||||
| 241 | { | - | ||||||||||||||||||||||||
| 242 | if (!QHighDpiScaling::isActive()) | - | ||||||||||||||||||||||||
| 243 | return 1; | - | ||||||||||||||||||||||||
| 244 | qreal result = qreal(1) / QWindowsStylePrivate::devicePixelRatio(widget); | - | ||||||||||||||||||||||||
| 245 | if (QGuiApplicationPrivate::screen_list.size() > 1) { | - | ||||||||||||||||||||||||
| 246 | const QScreen *primaryScreen = QGuiApplication::primaryScreen(); | - | ||||||||||||||||||||||||
| 247 | const QScreen *screen = screenOf(widget); | - | ||||||||||||||||||||||||
| 248 | if (screen != primaryScreen) { | - | ||||||||||||||||||||||||
| 249 | const qreal primaryLogicalDpi = primaryScreen->handle()->logicalDpi().first; | - | ||||||||||||||||||||||||
| 250 | const qreal logicalDpi = screen->handle()->logicalDpi().first; | - | ||||||||||||||||||||||||
| 251 | if (!qFuzzyCompare(primaryLogicalDpi, logicalDpi)) | - | ||||||||||||||||||||||||
| 252 | result *= logicalDpi / primaryLogicalDpi; | - | ||||||||||||||||||||||||
| 253 | } | - | ||||||||||||||||||||||||
| 254 | } | - | ||||||||||||||||||||||||
| 255 | return result; | - | ||||||||||||||||||||||||
| 256 | } | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QWidget *widget) const | - | ||||||||||||||||||||||||
| 262 | { | - | ||||||||||||||||||||||||
| 263 | int ret = QWindowsStylePrivate::pixelMetricFromSystemDp(pm, opt, widget); | - | ||||||||||||||||||||||||
| 264 | if (ret != QWindowsStylePrivate::InvalidMetric) | - | ||||||||||||||||||||||||
| 265 | return qRound(qreal(ret) * QWindowsStylePrivate::nativeMetricScaleFactor(widget)); | - | ||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||
| 267 | ret = QWindowsStylePrivate::fixedPixelMetric(pm); | - | ||||||||||||||||||||||||
| 268 | if (ret != QWindowsStylePrivate::InvalidMetric) | - | ||||||||||||||||||||||||
| 269 | return int(QStyleHelper::dpiScaled(ret)); | - | ||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | ret = 0; | - | ||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | switch (pm) { | - | ||||||||||||||||||||||||
| 274 | case PM_MaximumDragDistance: | - | ||||||||||||||||||||||||
| 275 | ret = QCommonStyle::pixelMetric(PM_MaximumDragDistance); | - | ||||||||||||||||||||||||
| 276 | if (ret == -1) | - | ||||||||||||||||||||||||
| 277 | ret = 60; | - | ||||||||||||||||||||||||
| 278 | break; | - | ||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||
| 284 | case PM_SliderControlThickness: | - | ||||||||||||||||||||||||
| 285 | if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { | - | ||||||||||||||||||||||||
| 286 | int space = (sl->orientation == Qt::Horizontal) ? sl->rect.height() : sl->rect.width(); | - | ||||||||||||||||||||||||
| 287 | int ticks = sl->tickPosition; | - | ||||||||||||||||||||||||
| 288 | int n = 0; | - | ||||||||||||||||||||||||
| 289 | if (ticks & QSlider::TicksAbove) | - | ||||||||||||||||||||||||
| 290 | ++n; | - | ||||||||||||||||||||||||
| 291 | if (ticks & QSlider::TicksBelow) | - | ||||||||||||||||||||||||
| 292 | ++n; | - | ||||||||||||||||||||||||
| 293 | if (!n) { | - | ||||||||||||||||||||||||
| 294 | ret = space; | - | ||||||||||||||||||||||||
| 295 | break; | - | ||||||||||||||||||||||||
| 296 | } | - | ||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | int thick = 6; | - | ||||||||||||||||||||||||
| 299 | if (ticks != QSlider::TicksBothSides && ticks != QSlider::NoTicks) | - | ||||||||||||||||||||||||
| 300 | thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4; | - | ||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||
| 302 | space -= thick; | - | ||||||||||||||||||||||||
| 303 | if (space > 0) | - | ||||||||||||||||||||||||
| 304 | thick += (space * 2) / (n + 2); | - | ||||||||||||||||||||||||
| 305 | ret = thick; | - | ||||||||||||||||||||||||
| 306 | } | - | ||||||||||||||||||||||||
| 307 | break; | - | ||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | case PM_IconViewIconSize: | - | ||||||||||||||||||||||||
| 311 | ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); | - | ||||||||||||||||||||||||
| 312 | break; | - | ||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | case PM_SplitterWidth: | - | ||||||||||||||||||||||||
| 315 | ret = qMax(int(QStyleHelper::dpiScaled(4)), QApplication::globalStrut().width()); | - | ||||||||||||||||||||||||
| 316 | break; | - | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | default: | - | ||||||||||||||||||||||||
| 319 | ret = QCommonStyle::pixelMetric(pm, opt, widget); | - | ||||||||||||||||||||||||
| 320 | break; | - | ||||||||||||||||||||||||
| 321 | } | - | ||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | return ret; | - | ||||||||||||||||||||||||
| 324 | } | - | ||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||
| 329 | QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, | - | ||||||||||||||||||||||||
| 330 | const QWidget *widget) const | - | ||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||
| 332 | return QCommonStyle::standardPixmap(standardPixmap, opt, widget); | - | ||||||||||||||||||||||||
| 333 | } | - | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||
| 336 | int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *widget, | - | ||||||||||||||||||||||||
| 337 | QStyleHintReturn *returnData) const | - | ||||||||||||||||||||||||
| 338 | { | - | ||||||||||||||||||||||||
| 339 | int ret = 0; | - | ||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||
| 341 | switch (hint) { | - | ||||||||||||||||||||||||
| 342 | case SH_EtchDisabledText: | - | ||||||||||||||||||||||||
| 343 | case SH_Slider_SnapToValue: | - | ||||||||||||||||||||||||
| 344 | case SH_PrintDialog_RightAlignButtons: | - | ||||||||||||||||||||||||
| 345 | case SH_FontDialog_SelectAssociatedText: | - | ||||||||||||||||||||||||
| 346 | case SH_Menu_AllowActiveAndDisabled: | - | ||||||||||||||||||||||||
| 347 | case SH_MenuBar_AltKeyNavigation: | - | ||||||||||||||||||||||||
| 348 | case SH_MenuBar_MouseTracking: | - | ||||||||||||||||||||||||
| 349 | case SH_Menu_MouseTracking: | - | ||||||||||||||||||||||||
| 350 | case SH_ComboBox_ListMouseTracking: | - | ||||||||||||||||||||||||
| 351 | case SH_ScrollBar_StopMouseOverSlider: | - | ||||||||||||||||||||||||
| 352 | case SH_MainWindow_SpaceBelowMenuBar: | - | ||||||||||||||||||||||||
| 353 | ret = 1; | - | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | break; | - | ||||||||||||||||||||||||
| 356 | case SH_ItemView_ShowDecorationSelected: | - | ||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | if (qobject_cast<const QListView*>(widget)) | - | ||||||||||||||||||||||||
| 359 | ret = 1; | - | ||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||
| 361 | break; | - | ||||||||||||||||||||||||
| 362 | case SH_ItemView_ChangeHighlightOnFocus: | - | ||||||||||||||||||||||||
| 363 | ret = 1; | - | ||||||||||||||||||||||||
| 364 | break; | - | ||||||||||||||||||||||||
| 365 | case SH_ToolBox_SelectedPageTitleBold: | - | ||||||||||||||||||||||||
| 366 | ret = 0; | - | ||||||||||||||||||||||||
| 367 | break; | - | ||||||||||||||||||||||||
| 368 | case SH_Menu_SubMenuSloppyCloseTimeout: | - | ||||||||||||||||||||||||
| 369 | case SH_Menu_SubMenuPopupDelay: { | - | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||
| 376 | ret = 400; | - | ||||||||||||||||||||||||
| 377 | break; | - | ||||||||||||||||||||||||
| 378 | } | - | ||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||
| 380 | case SH_RubberBand_Mask: | - | ||||||||||||||||||||||||
| 381 | if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) { | - | ||||||||||||||||||||||||
| 382 | ret = 0; | - | ||||||||||||||||||||||||
| 383 | if (rbOpt->shape == QRubberBand::Rectangle) { | - | ||||||||||||||||||||||||
| 384 | ret = true; | - | ||||||||||||||||||||||||
| 385 | if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) { | - | ||||||||||||||||||||||||
| 386 | mask->region = opt->rect; | - | ||||||||||||||||||||||||
| 387 | int size = 1; | - | ||||||||||||||||||||||||
| 388 | if (widget && widget->isWindow()) | - | ||||||||||||||||||||||||
| 389 | size = 4; | - | ||||||||||||||||||||||||
| 390 | mask->region -= opt->rect.adjusted(size, size, -size, -size); | - | ||||||||||||||||||||||||
| 391 | } | - | ||||||||||||||||||||||||
| 392 | } | - | ||||||||||||||||||||||||
| 393 | } | - | ||||||||||||||||||||||||
| 394 | break; | - | ||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | case SH_WizardStyle: | - | ||||||||||||||||||||||||
| 398 | ret = QWizard::ModernStyle; | - | ||||||||||||||||||||||||
| 399 | break; | - | ||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | case SH_ItemView_ArrowKeysNavigateIntoChildren: | - | ||||||||||||||||||||||||
| 402 | ret = true; | - | ||||||||||||||||||||||||
| 403 | break; | - | ||||||||||||||||||||||||
| 404 | case SH_DialogButtonBox_ButtonsHaveIcons: | - | ||||||||||||||||||||||||
| 405 | ret = 0; | - | ||||||||||||||||||||||||
| 406 | break; | - | ||||||||||||||||||||||||
| 407 | default: | - | ||||||||||||||||||||||||
| 408 | ret = QCommonStyle::styleHint(hint, opt, widget, returnData); | - | ||||||||||||||||||||||||
| 409 | break; | - | ||||||||||||||||||||||||
| 410 | } | - | ||||||||||||||||||||||||
| 411 | return ret; | - | ||||||||||||||||||||||||
| 412 | } | - | ||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | - | |||||||||||||||||||||||||
| 415 | void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, | - | ||||||||||||||||||||||||
| 416 | const QWidget *w) const | - | ||||||||||||||||||||||||
| 417 | { | - | ||||||||||||||||||||||||
| 418 | - | |||||||||||||||||||||||||
| 419 | bool doRestore = false; | - | ||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||
| 421 | switch (pe) { | - | ||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | case PE_IndicatorToolBarSeparator: | - | ||||||||||||||||||||||||
| 424 | { | - | ||||||||||||||||||||||||
| 425 | QRect rect = opt->rect; | - | ||||||||||||||||||||||||
| 426 | const int margin = 2; | - | ||||||||||||||||||||||||
| 427 | QPen oldPen = p->pen(); | - | ||||||||||||||||||||||||
| 428 | if(opt->state & State_Horizontal){ | - | ||||||||||||||||||||||||
| 429 | const int offset = rect.width()/2; | - | ||||||||||||||||||||||||
| 430 | p->setPen(QPen(opt->palette.dark().color())); | - | ||||||||||||||||||||||||
| 431 | p->drawLine(rect.bottomLeft().x() + offset, | - | ||||||||||||||||||||||||
| 432 | rect.bottomLeft().y() - margin, | - | ||||||||||||||||||||||||
| 433 | rect.topLeft().x() + offset, | - | ||||||||||||||||||||||||
| 434 | rect.topLeft().y() + margin); | - | ||||||||||||||||||||||||
| 435 | p->setPen(QPen(opt->palette.light().color())); | - | ||||||||||||||||||||||||
| 436 | p->drawLine(rect.bottomLeft().x() + offset + 1, | - | ||||||||||||||||||||||||
| 437 | rect.bottomLeft().y() - margin, | - | ||||||||||||||||||||||||
| 438 | rect.topLeft().x() + offset + 1, | - | ||||||||||||||||||||||||
| 439 | rect.topLeft().y() + margin); | - | ||||||||||||||||||||||||
| 440 | } | - | ||||||||||||||||||||||||
| 441 | else{ | - | ||||||||||||||||||||||||
| 442 | const int offset = rect.height()/2; | - | ||||||||||||||||||||||||
| 443 | p->setPen(QPen(opt->palette.dark().color())); | - | ||||||||||||||||||||||||
| 444 | p->drawLine(rect.topLeft().x() + margin , | - | ||||||||||||||||||||||||
| 445 | rect.topLeft().y() + offset, | - | ||||||||||||||||||||||||
| 446 | rect.topRight().x() - margin, | - | ||||||||||||||||||||||||
| 447 | rect.topRight().y() + offset); | - | ||||||||||||||||||||||||
| 448 | p->setPen(QPen(opt->palette.light().color())); | - | ||||||||||||||||||||||||
| 449 | p->drawLine(rect.topLeft().x() + margin , | - | ||||||||||||||||||||||||
| 450 | rect.topLeft().y() + offset + 1, | - | ||||||||||||||||||||||||
| 451 | rect.topRight().x() - margin, | - | ||||||||||||||||||||||||
| 452 | rect.topRight().y() + offset + 1); | - | ||||||||||||||||||||||||
| 453 | } | - | ||||||||||||||||||||||||
| 454 | p->setPen(oldPen); | - | ||||||||||||||||||||||||
| 455 | } | - | ||||||||||||||||||||||||
| 456 | break; | - | ||||||||||||||||||||||||
| 457 | case PE_IndicatorToolBarHandle: | - | ||||||||||||||||||||||||
| 458 | p->save(); | - | ||||||||||||||||||||||||
| 459 | p->translate(opt->rect.x(), opt->rect.y()); | - | ||||||||||||||||||||||||
| 460 | if (opt->state & State_Horizontal) { | - | ||||||||||||||||||||||||
| 461 | int x = opt->rect.width() / 2 - 4; | - | ||||||||||||||||||||||||
| 462 | if (opt->direction == Qt::RightToLeft) | - | ||||||||||||||||||||||||
| 463 | x -= 2; | - | ||||||||||||||||||||||||
| 464 | if (opt->rect.height() > 4) { | - | ||||||||||||||||||||||||
| 465 | qDrawShadePanel(p, x, 2, 3, opt->rect.height() - 4, | - | ||||||||||||||||||||||||
| 466 | opt->palette, false, 1, 0); | - | ||||||||||||||||||||||||
| 467 | qDrawShadePanel(p, x + 3, 2, 3, opt->rect.height() - 4, | - | ||||||||||||||||||||||||
| 468 | opt->palette, false, 1, 0); | - | ||||||||||||||||||||||||
| 469 | } | - | ||||||||||||||||||||||||
| 470 | } else { | - | ||||||||||||||||||||||||
| 471 | if (opt->rect.width() > 4) { | - | ||||||||||||||||||||||||
| 472 | int y = opt->rect.height() / 2 - 4; | - | ||||||||||||||||||||||||
| 473 | qDrawShadePanel(p, 2, y, opt->rect.width() - 4, 3, | - | ||||||||||||||||||||||||
| 474 | opt->palette, false, 1, 0); | - | ||||||||||||||||||||||||
| 475 | qDrawShadePanel(p, 2, y + 3, opt->rect.width() - 4, 3, | - | ||||||||||||||||||||||||
| 476 | opt->palette, false, 1, 0); | - | ||||||||||||||||||||||||
| 477 | } | - | ||||||||||||||||||||||||
| 478 | } | - | ||||||||||||||||||||||||
| 479 | p->restore(); | - | ||||||||||||||||||||||||
| 480 | break; | - | ||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | case PE_FrameButtonTool: | - | ||||||||||||||||||||||||
| 484 | case PE_PanelButtonTool: { | - | ||||||||||||||||||||||||
| 485 | QPen oldPen = p->pen(); | - | ||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||
| 487 | if (w && w->inherits("QDockWidgetTitleButton")) { | - | ||||||||||||||||||||||||
| 488 | if (const QWidget *dw = w->parentWidget()) | - | ||||||||||||||||||||||||
| 489 | if (dw->isWindow()){ | - | ||||||||||||||||||||||||
| 490 | qDrawWinButton(p, opt->rect.adjusted(1, 1, 0, 0), opt->palette, opt->state & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 491 | &opt->palette.button()); | - | ||||||||||||||||||||||||
| 492 | - | |||||||||||||||||||||||||
| 493 | return; | - | ||||||||||||||||||||||||
| 494 | } | - | ||||||||||||||||||||||||
| 495 | } | - | ||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||
| 497 | QBrush fill; | - | ||||||||||||||||||||||||
| 498 | bool stippled; | - | ||||||||||||||||||||||||
| 499 | bool panel = (pe == PE_PanelButtonTool); | - | ||||||||||||||||||||||||
| 500 | if ((!(opt->state & State_Sunken )) | - | ||||||||||||||||||||||||
| 501 | && (!(opt->state & State_Enabled) | - | ||||||||||||||||||||||||
| 502 | || !(opt->state & State_MouseOver && opt->state & State_AutoRaise)) | - | ||||||||||||||||||||||||
| 503 | && (opt->state & State_On)) { | - | ||||||||||||||||||||||||
| 504 | fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 505 | stippled = true; | - | ||||||||||||||||||||||||
| 506 | } else { | - | ||||||||||||||||||||||||
| 507 | fill = opt->palette.brush(QPalette::Button); | - | ||||||||||||||||||||||||
| 508 | stippled = false; | - | ||||||||||||||||||||||||
| 509 | } | - | ||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||
| 511 | if (opt->state & (State_Raised | State_Sunken | State_On)) { | - | ||||||||||||||||||||||||
| 512 | if (opt->state & State_AutoRaise) { | - | ||||||||||||||||||||||||
| 513 | if(opt->state & (State_Enabled | State_Sunken | State_On)){ | - | ||||||||||||||||||||||||
| 514 | if (panel) | - | ||||||||||||||||||||||||
| 515 | qDrawShadePanel(p, opt->rect, opt->palette, | - | ||||||||||||||||||||||||
| 516 | opt->state & (State_Sunken | State_On), 1, &fill); | - | ||||||||||||||||||||||||
| 517 | else | - | ||||||||||||||||||||||||
| 518 | qDrawShadeRect(p, opt->rect, opt->palette, | - | ||||||||||||||||||||||||
| 519 | opt->state & (State_Sunken | State_On), 1); | - | ||||||||||||||||||||||||
| 520 | } | - | ||||||||||||||||||||||||
| 521 | if (stippled) { | - | ||||||||||||||||||||||||
| 522 | p->setPen(opt->palette.button().color()); | - | ||||||||||||||||||||||||
| 523 | p->drawRect(opt->rect.adjusted(1,1,-2,-2)); | - | ||||||||||||||||||||||||
| 524 | } | - | ||||||||||||||||||||||||
| 525 | } else { | - | ||||||||||||||||||||||||
| 526 | qDrawWinButton(p, opt->rect, opt->palette, | - | ||||||||||||||||||||||||
| 527 | opt->state & (State_Sunken | State_On), panel ? &fill : 0); | - | ||||||||||||||||||||||||
| 528 | } | - | ||||||||||||||||||||||||
| 529 | } else { | - | ||||||||||||||||||||||||
| 530 | p->fillRect(opt->rect, fill); | - | ||||||||||||||||||||||||
| 531 | } | - | ||||||||||||||||||||||||
| 532 | p->setPen(oldPen); | - | ||||||||||||||||||||||||
| 533 | break; } | - | ||||||||||||||||||||||||
| 534 | case PE_PanelButtonCommand: | - | ||||||||||||||||||||||||
| 535 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { | - | ||||||||||||||||||||||||
| 536 | QBrush fill; | - | ||||||||||||||||||||||||
| 537 | State flags = opt->state; | - | ||||||||||||||||||||||||
| 538 | QPalette pal = opt->palette; | - | ||||||||||||||||||||||||
| 539 | QRect r = opt->rect; | - | ||||||||||||||||||||||||
| 540 | if (! (flags & State_Sunken) && (flags & State_On)) | - | ||||||||||||||||||||||||
| 541 | fill = QBrush(pal.light().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 542 | else | - | ||||||||||||||||||||||||
| 543 | fill = pal.brush(QPalette::Button); | - | ||||||||||||||||||||||||
| 544 | - | |||||||||||||||||||||||||
| 545 | if (btn->features & QStyleOptionButton::DefaultButton && flags & State_Sunken) { | - | ||||||||||||||||||||||||
| 546 | p->setPen(pal.dark().color()); | - | ||||||||||||||||||||||||
| 547 | p->setBrush(fill); | - | ||||||||||||||||||||||||
| 548 | p->drawRect(r.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||
| 549 | } else if (flags & (State_Raised | State_On | State_Sunken)) { | - | ||||||||||||||||||||||||
| 550 | qDrawWinButton(p, r, pal, flags & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 551 | &fill); | - | ||||||||||||||||||||||||
| 552 | } else { | - | ||||||||||||||||||||||||
| 553 | p->fillRect(r, fill); | - | ||||||||||||||||||||||||
| 554 | } | - | ||||||||||||||||||||||||
| 555 | } | - | ||||||||||||||||||||||||
| 556 | break; | - | ||||||||||||||||||||||||
| 557 | case PE_FrameDefaultButton: { | - | ||||||||||||||||||||||||
| 558 | QPen oldPen = p->pen(); | - | ||||||||||||||||||||||||
| 559 | p->setPen(opt->palette.shadow().color()); | - | ||||||||||||||||||||||||
| 560 | QRect rect = opt->rect; | - | ||||||||||||||||||||||||
| 561 | rect.adjust(0, 0, -1, -1); | - | ||||||||||||||||||||||||
| 562 | p->drawRect(rect); | - | ||||||||||||||||||||||||
| 563 | p->setPen(oldPen); | - | ||||||||||||||||||||||||
| 564 | break; | - | ||||||||||||||||||||||||
| 565 | } | - | ||||||||||||||||||||||||
| 566 | case PE_IndicatorCheckBox: { | - | ||||||||||||||||||||||||
| 567 | QBrush fill; | - | ||||||||||||||||||||||||
| 568 | if (opt->state & State_NoChange) | - | ||||||||||||||||||||||||
| 569 | fill = QBrush(opt->palette.base().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 570 | else if (opt->state & State_Sunken) | - | ||||||||||||||||||||||||
| 571 | fill = opt->palette.button(); | - | ||||||||||||||||||||||||
| 572 | else if (opt->state & State_Enabled) | - | ||||||||||||||||||||||||
| 573 | fill = opt->palette.base(); | - | ||||||||||||||||||||||||
| 574 | else | - | ||||||||||||||||||||||||
| 575 | fill = opt->palette.background(); | - | ||||||||||||||||||||||||
| 576 | p->save(); | - | ||||||||||||||||||||||||
| 577 | doRestore = true; | - | ||||||||||||||||||||||||
| 578 | qDrawWinPanel(p, opt->rect, opt->palette, true, &fill); | - | ||||||||||||||||||||||||
| 579 | if (opt->state & State_NoChange) | - | ||||||||||||||||||||||||
| 580 | p->setPen(opt->palette.dark().color()); | - | ||||||||||||||||||||||||
| 581 | else | - | ||||||||||||||||||||||||
| 582 | p->setPen(opt->palette.text().color()); | - | ||||||||||||||||||||||||
| 583 | } | - | ||||||||||||||||||||||||
| 584 | case PE_IndicatorViewItemCheck: | - | ||||||||||||||||||||||||
| 585 | if (!doRestore) { | - | ||||||||||||||||||||||||
| 586 | p->save(); | - | ||||||||||||||||||||||||
| 587 | doRestore = true; | - | ||||||||||||||||||||||||
| 588 | } | - | ||||||||||||||||||||||||
| 589 | if (pe == PE_IndicatorViewItemCheck) { | - | ||||||||||||||||||||||||
| 590 | const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt); | - | ||||||||||||||||||||||||
| 591 | p->setPen(itemViewOpt | - | ||||||||||||||||||||||||
| 592 | && itemViewOpt->showDecorationSelected | - | ||||||||||||||||||||||||
| 593 | && opt->state & State_Selected | - | ||||||||||||||||||||||||
| 594 | ? opt->palette.highlightedText().color() | - | ||||||||||||||||||||||||
| 595 | : opt->palette.text().color()); | - | ||||||||||||||||||||||||
| 596 | if (opt->state & State_NoChange) | - | ||||||||||||||||||||||||
| 597 | p->setBrush(opt->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 598 | p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11); | - | ||||||||||||||||||||||||
| 599 | } | - | ||||||||||||||||||||||||
| 600 | if (!(opt->state & State_Off)) { | - | ||||||||||||||||||||||||
| 601 | QLineF lines[7]; | - | ||||||||||||||||||||||||
| 602 | int i, xx, yy; | - | ||||||||||||||||||||||||
| 603 | xx = opt->rect.x() + 3; | - | ||||||||||||||||||||||||
| 604 | yy = opt->rect.y() + 5; | - | ||||||||||||||||||||||||
| 605 | for (i = 0; i < 3; ++i) { | - | ||||||||||||||||||||||||
| 606 | lines[i] = QLineF(xx, yy, xx, yy + 2); | - | ||||||||||||||||||||||||
| 607 | ++xx; | - | ||||||||||||||||||||||||
| 608 | ++yy; | - | ||||||||||||||||||||||||
| 609 | } | - | ||||||||||||||||||||||||
| 610 | yy -= 2; | - | ||||||||||||||||||||||||
| 611 | for (i = 3; i < 7; ++i) { | - | ||||||||||||||||||||||||
| 612 | lines[i] = QLineF(xx, yy, xx, yy + 2); | - | ||||||||||||||||||||||||
| 613 | ++xx; | - | ||||||||||||||||||||||||
| 614 | --yy; | - | ||||||||||||||||||||||||
| 615 | } | - | ||||||||||||||||||||||||
| 616 | p->drawLines(lines, 7); | - | ||||||||||||||||||||||||
| 617 | } | - | ||||||||||||||||||||||||
| 618 | if (doRestore) | - | ||||||||||||||||||||||||
| 619 | p->restore(); | - | ||||||||||||||||||||||||
| 620 | break; | - | ||||||||||||||||||||||||
| 621 | case PE_FrameFocusRect: | - | ||||||||||||||||||||||||
| 622 | if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) { | - | ||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||
| 624 | if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt)) | - | ||||||||||||||||||||||||
| 625 | return; | - | ||||||||||||||||||||||||
| 626 | QRect r = opt->rect; | - | ||||||||||||||||||||||||
| 627 | p->save(); | - | ||||||||||||||||||||||||
| 628 | p->setBackgroundMode(Qt::TransparentMode); | - | ||||||||||||||||||||||||
| 629 | QColor bg_col = fropt->backgroundColor; | - | ||||||||||||||||||||||||
| 630 | if (!bg_col.isValid()) | - | ||||||||||||||||||||||||
| 631 | bg_col = p->background().color(); | - | ||||||||||||||||||||||||
| 632 | - | |||||||||||||||||||||||||
| 633 | QColor patternCol((bg_col.red() ^ 0xff) & 0xff, | - | ||||||||||||||||||||||||
| 634 | (bg_col.green() ^ 0xff) & 0xff, | - | ||||||||||||||||||||||||
| 635 | (bg_col.blue() ^ 0xff) & 0xff); | - | ||||||||||||||||||||||||
| 636 | p->setBrush(QBrush(patternCol, Qt::Dense4Pattern)); | - | ||||||||||||||||||||||||
| 637 | p->setBrushOrigin(r.topLeft()); | - | ||||||||||||||||||||||||
| 638 | p->setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 639 | p->drawRect(r.left(), r.top(), r.width(), 1); | - | ||||||||||||||||||||||||
| 640 | p->drawRect(r.left(), r.bottom(), r.width(), 1); | - | ||||||||||||||||||||||||
| 641 | p->drawRect(r.left(), r.top(), 1, r.height()); | - | ||||||||||||||||||||||||
| 642 | p->drawRect(r.right(), r.top(), 1, r.height()); | - | ||||||||||||||||||||||||
| 643 | p->restore(); | - | ||||||||||||||||||||||||
| 644 | } | - | ||||||||||||||||||||||||
| 645 | break; | - | ||||||||||||||||||||||||
| 646 | case PE_IndicatorRadioButton: | - | ||||||||||||||||||||||||
| 647 | { | - | ||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||
| 649 | static const QPoint pts1[] = { | - | ||||||||||||||||||||||||
| 650 | QPoint(1, 9), QPoint(1, 8), QPoint(0, 7), QPoint(0, 4), QPoint(1, 3), QPoint(1, 2), | - | ||||||||||||||||||||||||
| 651 | QPoint(2, 1), QPoint(3, 1), QPoint(4, 0), QPoint(7, 0), QPoint(8, 1), QPoint(9, 1) | - | ||||||||||||||||||||||||
| 652 | }; | - | ||||||||||||||||||||||||
| 653 | static const QPoint pts2[] = { | - | ||||||||||||||||||||||||
| 654 | QPoint(2, 8), QPoint(1, 7), QPoint(1, 4), QPoint(2, 3), QPoint(2, 2), QPoint(3, 2), | - | ||||||||||||||||||||||||
| 655 | QPoint(4, 1), QPoint(7, 1), QPoint(8, 2), QPoint(9, 2) | - | ||||||||||||||||||||||||
| 656 | }; | - | ||||||||||||||||||||||||
| 657 | static const QPoint pts3[] = { | - | ||||||||||||||||||||||||
| 658 | QPoint(2, 9), QPoint(3, 9), QPoint(4, 10), QPoint(7, 10), QPoint(8, 9), QPoint(9, 9), | - | ||||||||||||||||||||||||
| 659 | QPoint(9, 8), QPoint(10, 7), QPoint(10, 4), QPoint(9, 3) | - | ||||||||||||||||||||||||
| 660 | }; | - | ||||||||||||||||||||||||
| 661 | static const QPoint pts4[] = { | - | ||||||||||||||||||||||||
| 662 | QPoint(2, 10), QPoint(3, 10), QPoint(4, 11), QPoint(7, 11), QPoint(8, 10), | - | ||||||||||||||||||||||||
| 663 | QPoint(9, 10), QPoint(10, 9), QPoint(10, 8), QPoint(11, 7), QPoint(11, 4), | - | ||||||||||||||||||||||||
| 664 | QPoint(10, 3), QPoint(10, 2) | - | ||||||||||||||||||||||||
| 665 | }; | - | ||||||||||||||||||||||||
| 666 | static const QPoint pts5[] = { | - | ||||||||||||||||||||||||
| 667 | QPoint(4, 2), QPoint(7, 2), QPoint(9, 4), QPoint(9, 7), QPoint(7, 9), QPoint(4, 9), | - | ||||||||||||||||||||||||
| 668 | QPoint(2, 7), QPoint(2, 4) | - | ||||||||||||||||||||||||
| 669 | }; | - | ||||||||||||||||||||||||
| 670 | - | |||||||||||||||||||||||||
| 671 | - | |||||||||||||||||||||||||
| 672 | QRect ir = opt->rect; | - | ||||||||||||||||||||||||
| 673 | - | |||||||||||||||||||||||||
| 674 | if (opt->rect.width() < opt->rect.height()) { | - | ||||||||||||||||||||||||
| 675 | ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2); | - | ||||||||||||||||||||||||
| 676 | ir.setHeight(opt->rect.width()); | - | ||||||||||||||||||||||||
| 677 | } else if (opt->rect.height() < opt->rect.width()) { | - | ||||||||||||||||||||||||
| 678 | ir.setLeft(opt->rect.left() + (opt->rect.width() - opt->rect.height()) / 2); | - | ||||||||||||||||||||||||
| 679 | ir.setWidth(opt->rect.height()); | - | ||||||||||||||||||||||||
| 680 | } | - | ||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||
| 682 | p->save(); | - | ||||||||||||||||||||||||
| 683 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - | ||||||||||||||||||||||||
| 684 | bool down = opt->state & State_Sunken; | - | ||||||||||||||||||||||||
| 685 | bool enabled = opt->state & State_Enabled; | - | ||||||||||||||||||||||||
| 686 | bool on = opt->state & State_On; | - | ||||||||||||||||||||||||
| 687 | QPolygon a; | - | ||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||
| 690 | int xOffset = 0; | - | ||||||||||||||||||||||||
| 691 | int yOffset = 0; | - | ||||||||||||||||||||||||
| 692 | int indicatorWidth = proxy()->pixelMetric(PM_ExclusiveIndicatorWidth); | - | ||||||||||||||||||||||||
| 693 | int indicatorHeight = proxy()->pixelMetric(PM_ExclusiveIndicatorHeight); | - | ||||||||||||||||||||||||
| 694 | if (ir.width() > indicatorWidth) | - | ||||||||||||||||||||||||
| 695 | xOffset += (ir.width() - indicatorWidth)/2; | - | ||||||||||||||||||||||||
| 696 | if (ir.height() > indicatorHeight) | - | ||||||||||||||||||||||||
| 697 | yOffset += (ir.height() - indicatorHeight)/2; | - | ||||||||||||||||||||||||
| 698 | p->translate(xOffset, yOffset); | - | ||||||||||||||||||||||||
| 699 | - | |||||||||||||||||||||||||
| 700 | p->translate(ir.x(), ir.y()); | - | ||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||
| 702 | p->setPen(opt->palette.dark().color()); | - | ||||||||||||||||||||||||
| 703 | p->drawPolyline(pts1, sizeof(pts1)/(sizeof(QPoint))); | - | ||||||||||||||||||||||||
| 704 | - | |||||||||||||||||||||||||
| 705 | p->setPen(opt->palette.shadow().color()); | - | ||||||||||||||||||||||||
| 706 | p->drawPolyline(pts2, sizeof(pts2)/(sizeof(QPoint))); | - | ||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||
| 708 | p->setPen(opt->palette.midlight().color()); | - | ||||||||||||||||||||||||
| 709 | p->drawPolyline(pts3, sizeof(pts3)/(sizeof(QPoint))); | - | ||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | p->setPen(opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 712 | p->drawPolyline(pts4, sizeof(pts4)/(sizeof(QPoint))); | - | ||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||
| 714 | QColor fillColor = (down || !enabled) | - | ||||||||||||||||||||||||
| 715 | ? opt->palette.button().color() | - | ||||||||||||||||||||||||
| 716 | : opt->palette.base().color(); | - | ||||||||||||||||||||||||
| 717 | p->setPen(fillColor); | - | ||||||||||||||||||||||||
| 718 | p->setBrush(fillColor) ; | - | ||||||||||||||||||||||||
| 719 | p->drawPolygon(pts5, sizeof(pts5)/(sizeof(QPoint))); | - | ||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||
| 721 | p->translate(-ir.x(), -ir.y()); | - | ||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||
| 723 | if (on) { | - | ||||||||||||||||||||||||
| 724 | p->setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 725 | p->setBrush(opt->palette.text()); | - | ||||||||||||||||||||||||
| 726 | p->drawRect(ir.x() + 5, ir.y() + 4, 2, 4); | - | ||||||||||||||||||||||||
| 727 | p->drawRect(ir.x() + 4, ir.y() + 5, 4, 2); | - | ||||||||||||||||||||||||
| 728 | } | - | ||||||||||||||||||||||||
| 729 | p->restore(); | - | ||||||||||||||||||||||||
| 730 | break; | - | ||||||||||||||||||||||||
| 731 | } | - | ||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||
| 733 | case PE_Frame: | - | ||||||||||||||||||||||||
| 734 | case PE_FrameMenu: | - | ||||||||||||||||||||||||
| 735 | if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { | - | ||||||||||||||||||||||||
| 736 | if (frame->lineWidth == 2 || pe == PE_Frame) { | - | ||||||||||||||||||||||||
| 737 | QPalette popupPal = frame->palette; | - | ||||||||||||||||||||||||
| 738 | if (pe == PE_FrameMenu) { | - | ||||||||||||||||||||||||
| 739 | popupPal.setColor(QPalette::Light, frame->palette.background().color()); | - | ||||||||||||||||||||||||
| 740 | popupPal.setColor(QPalette::Midlight, frame->palette.light().color()); | - | ||||||||||||||||||||||||
| 741 | } | - | ||||||||||||||||||||||||
| 742 | if (pe == PE_Frame && (frame->state & State_Raised)) | - | ||||||||||||||||||||||||
| 743 | qDrawWinButton(p, frame->rect, popupPal, frame->state & State_Sunken); | - | ||||||||||||||||||||||||
| 744 | else if (pe == PE_Frame && (frame->state & State_Sunken)) | - | ||||||||||||||||||||||||
| 745 | { | - | ||||||||||||||||||||||||
| 746 | popupPal.setColor(QPalette::Midlight, frame->palette.background().color()); | - | ||||||||||||||||||||||||
| 747 | qDrawWinPanel(p, frame->rect, popupPal, frame->state & State_Sunken); | - | ||||||||||||||||||||||||
| 748 | } | - | ||||||||||||||||||||||||
| 749 | else | - | ||||||||||||||||||||||||
| 750 | qDrawWinPanel(p, frame->rect, popupPal, frame->state & State_Sunken); | - | ||||||||||||||||||||||||
| 751 | } else { | - | ||||||||||||||||||||||||
| 752 | QCommonStyle::drawPrimitive(pe, opt, p, w); | - | ||||||||||||||||||||||||
| 753 | } | - | ||||||||||||||||||||||||
| 754 | } else { | - | ||||||||||||||||||||||||
| 755 | QPalette popupPal = opt->palette; | - | ||||||||||||||||||||||||
| 756 | popupPal.setColor(QPalette::Light, opt->palette.background().color()); | - | ||||||||||||||||||||||||
| 757 | popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 758 | qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); | - | ||||||||||||||||||||||||
| 759 | } | - | ||||||||||||||||||||||||
| 760 | break; | - | ||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||
| 762 | case PE_FrameButtonBevel: | - | ||||||||||||||||||||||||
| 763 | case PE_PanelButtonBevel: { | - | ||||||||||||||||||||||||
| 764 | QBrush fill; | - | ||||||||||||||||||||||||
| 765 | bool panel = pe != PE_FrameButtonBevel; | - | ||||||||||||||||||||||||
| 766 | p->setBrushOrigin(opt->rect.topLeft()); | - | ||||||||||||||||||||||||
| 767 | if (!(opt->state & State_Sunken) && (opt->state & State_On)) | - | ||||||||||||||||||||||||
| 768 | fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 769 | else | - | ||||||||||||||||||||||||
| 770 | fill = opt->palette.brush(QPalette::Button); | - | ||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||
| 772 | if (opt->state & (State_Raised | State_On | State_Sunken)) { | - | ||||||||||||||||||||||||
| 773 | qDrawWinButton(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 774 | panel ? &fill : 0); | - | ||||||||||||||||||||||||
| 775 | } else { | - | ||||||||||||||||||||||||
| 776 | if (panel) | - | ||||||||||||||||||||||||
| 777 | p->fillRect(opt->rect, fill); | - | ||||||||||||||||||||||||
| 778 | else | - | ||||||||||||||||||||||||
| 779 | p->drawRect(opt->rect); | - | ||||||||||||||||||||||||
| 780 | } | - | ||||||||||||||||||||||||
| 781 | break; } | - | ||||||||||||||||||||||||
| 782 | case PE_FrameWindow: { | - | ||||||||||||||||||||||||
| 783 | QPalette popupPal = opt->palette; | - | ||||||||||||||||||||||||
| 784 | popupPal.setColor(QPalette::Light, opt->palette.background().color()); | - | ||||||||||||||||||||||||
| 785 | popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 786 | qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); | - | ||||||||||||||||||||||||
| 787 | break; } | - | ||||||||||||||||||||||||
| 788 | - | |||||||||||||||||||||||||
| 789 | case PE_IndicatorDockWidgetResizeHandle: | - | ||||||||||||||||||||||||
| 790 | break; | - | ||||||||||||||||||||||||
| 791 | case PE_FrameDockWidget: | - | ||||||||||||||||||||||||
| 792 | if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) { | - | ||||||||||||||||||||||||
| 793 | proxy()->drawPrimitive(QStyle::PE_FrameWindow, opt, p, w); | - | ||||||||||||||||||||||||
| 794 | } | - | ||||||||||||||||||||||||
| 795 | break; | - | ||||||||||||||||||||||||
| 796 | - | |||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | case PE_FrameStatusBarItem: | - | ||||||||||||||||||||||||
| 799 | qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 0); | - | ||||||||||||||||||||||||
| 800 | break; | - | ||||||||||||||||||||||||
| 801 | - | |||||||||||||||||||||||||
| 802 | case PE_IndicatorProgressChunk: | - | ||||||||||||||||||||||||
| 803 | { | - | ||||||||||||||||||||||||
| 804 | bool vertical = false, inverted = false; | - | ||||||||||||||||||||||||
| 805 | if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { | - | ||||||||||||||||||||||||
| 806 | vertical = pb->orientation == Qt::Vertical; | - | ||||||||||||||||||||||||
| 807 | inverted = pb->invertedAppearance; | - | ||||||||||||||||||||||||
| 808 | } | - | ||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||
| 810 | int space = 2; | - | ||||||||||||||||||||||||
| 811 | int chunksize = proxy()->pixelMetric(PM_ProgressBarChunkWidth, opt, w) - space; | - | ||||||||||||||||||||||||
| 812 | if (!vertical) { | - | ||||||||||||||||||||||||
| 813 | if (opt->rect.width() <= chunksize) | - | ||||||||||||||||||||||||
| 814 | space = 0; | - | ||||||||||||||||||||||||
| 815 | - | |||||||||||||||||||||||||
| 816 | if (inverted) | - | ||||||||||||||||||||||||
| 817 | p->fillRect(opt->rect.x() + space, opt->rect.y(), opt->rect.width() - space, opt->rect.height(), | - | ||||||||||||||||||||||||
| 818 | opt->palette.brush(QPalette::Highlight)); | - | ||||||||||||||||||||||||
| 819 | else | - | ||||||||||||||||||||||||
| 820 | p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width() - space, opt->rect.height(), | - | ||||||||||||||||||||||||
| 821 | opt->palette.brush(QPalette::Highlight)); | - | ||||||||||||||||||||||||
| 822 | } else { | - | ||||||||||||||||||||||||
| 823 | if (opt->rect.height() <= chunksize) | - | ||||||||||||||||||||||||
| 824 | space = 0; | - | ||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||
| 826 | if (inverted) | - | ||||||||||||||||||||||||
| 827 | p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width(), opt->rect.height() - space, | - | ||||||||||||||||||||||||
| 828 | opt->palette.brush(QPalette::Highlight)); | - | ||||||||||||||||||||||||
| 829 | else | - | ||||||||||||||||||||||||
| 830 | p->fillRect(opt->rect.x(), opt->rect.y() + space, opt->rect.width(), opt->rect.height() - space, | - | ||||||||||||||||||||||||
| 831 | opt->palette.brush(QPalette::Highlight)); | - | ||||||||||||||||||||||||
| 832 | } | - | ||||||||||||||||||||||||
| 833 | } | - | ||||||||||||||||||||||||
| 834 | break; | - | ||||||||||||||||||||||||
| 835 | - | |||||||||||||||||||||||||
| 836 | case PE_FrameTabWidget: { | - | ||||||||||||||||||||||||
| 837 | qDrawWinButton(p, opt->rect, opt->palette, false, 0); | - | ||||||||||||||||||||||||
| 838 | break; | - | ||||||||||||||||||||||||
| 839 | } | - | ||||||||||||||||||||||||
| 840 | default: | - | ||||||||||||||||||||||||
| 841 | QCommonStyle::drawPrimitive(pe, opt, p, w); | - | ||||||||||||||||||||||||
| 842 | } | - | ||||||||||||||||||||||||
| 843 | } | - | ||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||
| 845 | - | |||||||||||||||||||||||||
| 846 | void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, | - | ||||||||||||||||||||||||
| 847 | const QWidget *widget) const | - | ||||||||||||||||||||||||
| 848 | { | - | ||||||||||||||||||||||||
| 849 | switch (ce) { | - | ||||||||||||||||||||||||
| 850 | - | |||||||||||||||||||||||||
| 851 | case never executed: CE_RubberBand:case CE_RubberBand:never executed: case CE_RubberBand: | 0 | ||||||||||||||||||||||||
| 852 | if (qstyleoption_cast<const QStyleOptionRubberBand *>(opt)
| 0 | ||||||||||||||||||||||||
| 853 | - | |||||||||||||||||||||||||
| 854 | QPixmap tiledPixmap(16, 16); | - | ||||||||||||||||||||||||
| 855 | QPainter pixmapPainter(&tiledPixmap); | - | ||||||||||||||||||||||||
| 856 | pixmapPainter.setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 857 | pixmapPainter.setBrush(Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 858 | pixmapPainter.setBackground(Qt::white); | - | ||||||||||||||||||||||||
| 859 | pixmapPainter.setBackgroundMode(Qt::OpaqueMode); | - | ||||||||||||||||||||||||
| 860 | pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height()); | - | ||||||||||||||||||||||||
| 861 | pixmapPainter.end(); | - | ||||||||||||||||||||||||
| 862 | tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage()); | - | ||||||||||||||||||||||||
| 863 | p->save(); | - | ||||||||||||||||||||||||
| 864 | QRect r = opt->rect; | - | ||||||||||||||||||||||||
| 865 | QStyleHintReturnMask mask; | - | ||||||||||||||||||||||||
| 866 | if (proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask)
| 0 | ||||||||||||||||||||||||
| 867 | p->setClipRegion(mask.region); never executed: p->setClipRegion(mask.region); | 0 | ||||||||||||||||||||||||
| 868 | p->drawTiledPixmap(r.x(), r.y(), r.width(), r.height(), tiledPixmap); | - | ||||||||||||||||||||||||
| 869 | p->restore(); | - | ||||||||||||||||||||||||
| 870 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 871 | } | - | ||||||||||||||||||||||||
| 872 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | case never executed: CE_MenuBarEmptyArea:case CE_MenuBarEmptyArea:never executed: case CE_MenuBarEmptyArea: | 0 | ||||||||||||||||||||||||
| 877 | if (widget
| 0 | ||||||||||||||||||||||||
| 878 | p->fillRect(opt->rect, opt->palette.button()); | - | ||||||||||||||||||||||||
| 879 | QPen oldPen = p->pen(); | - | ||||||||||||||||||||||||
| 880 | p->setPen(QPen(opt->palette.dark().color())); | - | ||||||||||||||||||||||||
| 881 | p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight()); | - | ||||||||||||||||||||||||
| 882 | p->setPen(oldPen); | - | ||||||||||||||||||||||||
| 883 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 884 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||
| 887 | case never executed: CE_MenuItem:case CE_MenuItem:never executed: case CE_MenuItem: | 0 | ||||||||||||||||||||||||
| 888 | if (const
| 0 | ||||||||||||||||||||||||
| 889 | int x, y, w, h; | - | ||||||||||||||||||||||||
| 890 | menuitem->rect.getRect(&x, &y, &w, &h); | - | ||||||||||||||||||||||||
| 891 | int tab = menuitem->tabWidth; | - | ||||||||||||||||||||||||
| 892 | bool dis = !(menuitem->state & State_Enabled); | - | ||||||||||||||||||||||||
| 893 | bool checked = menuitem->checkType != QStyleOptionMenuItem::NotCheckable
| 0 | ||||||||||||||||||||||||
| 894 | ? menuitem->checked : false; | - | ||||||||||||||||||||||||
| 895 | bool act = menuitem->state & State_Selected; | - | ||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||
| 897 | - | |||||||||||||||||||||||||
| 898 | int checkcol = qMax<int>(menuitem->maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth); | - | ||||||||||||||||||||||||
| 899 | - | |||||||||||||||||||||||||
| 900 | QBrush fill = menuitem->palette.brush(act ? QPalette::Highlight : QPalette::Button); | - | ||||||||||||||||||||||||
| 901 | p->fillRect(menuitem->rect.adjusted(0, 0, -1, 0), fill); | - | ||||||||||||||||||||||||
| 902 | - | |||||||||||||||||||||||||
| 903 | if (menuitem->menuItemType == QStyleOptionMenuItem::Separator
| 0 | ||||||||||||||||||||||||
| 904 | int yoff = y-1 + h / 2; | - | ||||||||||||||||||||||||
| 905 | p->setPen(menuitem->palette.dark().color()); | - | ||||||||||||||||||||||||
| 906 | p->drawLine(x + 2, yoff, x + w - 4, yoff); | - | ||||||||||||||||||||||||
| 907 | p->setPen(menuitem->palette.light().color()); | - | ||||||||||||||||||||||||
| 908 | p->drawLine(x + 2, yoff + 1, x + w - 4, yoff + 1); | - | ||||||||||||||||||||||||
| 909 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 910 | } | - | ||||||||||||||||||||||||
| 911 | - | |||||||||||||||||||||||||
| 912 | QRect vCheckRect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x(), menuitem->rect.y(), checkcol, menuitem->rect.height())); | - | ||||||||||||||||||||||||
| 913 | if (!menuitem->icon.isNull()
| 0 | ||||||||||||||||||||||||
| 914 | if (act
| 0 | ||||||||||||||||||||||||
| 915 | qDrawShadePanel(p, vCheckRect, | - | ||||||||||||||||||||||||
| 916 | menuitem->palette, true, 1, | - | ||||||||||||||||||||||||
| 917 | &menuitem->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 918 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 919 | QBrush fill(menuitem->palette.light().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 920 | qDrawShadePanel(p, vCheckRect, menuitem->palette, true, 1, &fill); | - | ||||||||||||||||||||||||
| 921 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 922 | } else if (!act
| 0 | ||||||||||||||||||||||||
| 923 | p->fillRect(vCheckRect, menuitem->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 924 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||
| 928 | - | |||||||||||||||||||||||||
| 929 | if (!menuitem->icon.isNull()
| 0 | ||||||||||||||||||||||||
| 930 | QIcon::Mode mode = dis
| 0 | ||||||||||||||||||||||||
| 931 | if (act
| 0 | ||||||||||||||||||||||||
| 932 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 | ||||||||||||||||||||||||
| 933 | QPixmap pixmap; | - | ||||||||||||||||||||||||
| 934 | if (checked
| 0 | ||||||||||||||||||||||||
| 935 | pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On); never executed: pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On); | 0 | ||||||||||||||||||||||||
| 936 | else | - | ||||||||||||||||||||||||
| 937 | pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode); never executed: pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode); | 0 | ||||||||||||||||||||||||
| 938 | const int pixw = pixmap.width() / pixmap.devicePixelRatio(); | - | ||||||||||||||||||||||||
| 939 | const int pixh = pixmap.height() / pixmap.devicePixelRatio(); | - | ||||||||||||||||||||||||
| 940 | if (act
| 0 | ||||||||||||||||||||||||
| 941 | qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1, never executed: qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1, &menuitem->palette.brush(QPalette::Button)); | 0 | ||||||||||||||||||||||||
| 942 | &menuitem->palette.brush(QPalette::Button)); never executed: qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1, &menuitem->palette.brush(QPalette::Button)); | 0 | ||||||||||||||||||||||||
| 943 | QRect pmr(0, 0, pixw, pixh); | - | ||||||||||||||||||||||||
| 944 | pmr.moveCenter(vCheckRect.center()); | - | ||||||||||||||||||||||||
| 945 | p->setPen(menuitem->palette.text().color()); | - | ||||||||||||||||||||||||
| 946 | p->drawPixmap(pmr.topLeft(), pixmap); | - | ||||||||||||||||||||||||
| 947 | } never executed: else if (checkedend of block
| 0 | ||||||||||||||||||||||||
| 948 | QStyleOptionMenuItem newMi = *menuitem; | - | ||||||||||||||||||||||||
| 949 | newMi.state = State_None; | - | ||||||||||||||||||||||||
| 950 | if (!dis
| 0 | ||||||||||||||||||||||||
| 951 | newMi.state |= State_Enabled; never executed: newMi.state |= State_Enabled; | 0 | ||||||||||||||||||||||||
| 952 | if (act
| 0 | ||||||||||||||||||||||||
| 953 | newMi.state |= State_On; never executed: newMi.state |= State_On; | 0 | ||||||||||||||||||||||||
| 954 | newMi.rect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x() + QWindowsStylePrivate::windowsItemFrame, | - | ||||||||||||||||||||||||
| 955 | menuitem->rect.y() + QWindowsStylePrivate::windowsItemFrame, | - | ||||||||||||||||||||||||
| 956 | checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, | - | ||||||||||||||||||||||||
| 957 | menuitem->rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); | - | ||||||||||||||||||||||||
| 958 | proxy()->drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget); | - | ||||||||||||||||||||||||
| 959 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 960 | p->setPen(act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color()); | - | ||||||||||||||||||||||||
| 961 | - | |||||||||||||||||||||||||
| 962 | QColor discol; | - | ||||||||||||||||||||||||
| 963 | if (dis
| 0 | ||||||||||||||||||||||||
| 964 | discol = menuitem->palette.text().color(); | - | ||||||||||||||||||||||||
| 965 | p->setPen(discol); | - | ||||||||||||||||||||||||
| 966 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 967 | - | |||||||||||||||||||||||||
| 968 | int xm = int(QWindowsStylePrivate::windowsItemFrame) + checkcol + int(QWindowsStylePrivate::windowsItemHMargin); | - | ||||||||||||||||||||||||
| 969 | int xpos = menuitem->rect.x() + xm; | - | ||||||||||||||||||||||||
| 970 | QRect textRect(xpos, y + QWindowsStylePrivate::windowsItemVMargin, | - | ||||||||||||||||||||||||
| 971 | w - xm - QWindowsStylePrivate::windowsRightBorder - tab + 1, h - 2 * QWindowsStylePrivate::windowsItemVMargin); | - | ||||||||||||||||||||||||
| 972 | QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); | - | ||||||||||||||||||||||||
| 973 | QStringQStringRef s= menuitem(&menuitem->text;); | - | ||||||||||||||||||||||||
| 974 | if (!s.isEmpty()
| 0 | ||||||||||||||||||||||||
| 975 | p->save(); | - | ||||||||||||||||||||||||
| 976 | int t = s.indexOf(QLatin1Char('\t')); | - | ||||||||||||||||||||||||
| 977 | int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; | - | ||||||||||||||||||||||||
| 978 | if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)
| 0 | ||||||||||||||||||||||||
| 979 | text_flags |= Qt::TextHideMnemonic; never executed: text_flags |= Qt::TextHideMnemonic; | 0 | ||||||||||||||||||||||||
| 980 | text_flags |= Qt::AlignLeft; | - | ||||||||||||||||||||||||
| 981 | if (t >= 0
| 0 | ||||||||||||||||||||||||
| 982 | QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, | - | ||||||||||||||||||||||||
| 983 | QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); | - | ||||||||||||||||||||||||
| 984 | const QString textToDraw = s.mid(t + 1).toString(); | - | ||||||||||||||||||||||||
| 985 | if (dis
| 0 | ||||||||||||||||||||||||
| 986 | p->setPen(menuitem->palette.light().color()); | - | ||||||||||||||||||||||||
| 987 | p->drawText(vShortcutRect.adjusted(1, 1, 1, 1), text_flags, s.mid(t + 1));textToDraw); | - | ||||||||||||||||||||||||
| 988 | p->setPen(discol); | - | ||||||||||||||||||||||||
| 989 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 990 | p->drawText(vShortcutRect, text_flags, s.mid(t + 1));textToDraw); | - | ||||||||||||||||||||||||
| 991 | s = s.left(t); | - | ||||||||||||||||||||||||
| 992 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 993 | QFont font = menuitem->font; | - | ||||||||||||||||||||||||
| 994 | if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem
| 0 | ||||||||||||||||||||||||
| 995 | font.setBold(true); never executed: font.setBold(true); | 0 | ||||||||||||||||||||||||
| 996 | p->setFont(font); | - | ||||||||||||||||||||||||
| 997 | const QString textToDraw = s.left(t).toString(); | - | ||||||||||||||||||||||||
| 998 | if (dis
| 0 | ||||||||||||||||||||||||
| 999 | p->setPen(menuitem->palette.light().color()); | - | ||||||||||||||||||||||||
| 1000 | p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, s.left(t));textToDraw); | - | ||||||||||||||||||||||||
| 1001 | p->setPen(discol); | - | ||||||||||||||||||||||||
| 1002 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1003 | p->drawText(vTextRect, text_flags, s.left(t));textToDraw); | - | ||||||||||||||||||||||||
| 1004 | p->restore(); | - | ||||||||||||||||||||||||
| 1005 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1006 | if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu
| 0 | ||||||||||||||||||||||||
| 1007 | int dim = (h - 2 * QWindowsStylePrivate::windowsItemFrame) / 2; | - | ||||||||||||||||||||||||
| 1008 | PrimitiveElement arrow; | - | ||||||||||||||||||||||||
| 1009 | arrow = (
| 0 | ||||||||||||||||||||||||
| 1010 | xpos = x + w - QWindowsStylePrivate::windowsArrowHMargin - QWindowsStylePrivate::windowsItemFrame - dim; | - | ||||||||||||||||||||||||
| 1011 | QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect, QRect(xpos, y + h / 2 - dim / 2, dim, dim)); | - | ||||||||||||||||||||||||
| 1012 | QStyleOptionMenuItem newMI = *menuitem; | - | ||||||||||||||||||||||||
| 1013 | newMI.rect = vSubMenuRect; | - | ||||||||||||||||||||||||
| 1014 | newMI.state = dis
| 0 | ||||||||||||||||||||||||
| 1015 | if (act
| 0 | ||||||||||||||||||||||||
| 1016 | newMI.palette.setColor(QPalette::ButtonText, never executed: newMI.palette.setColor(QPalette::ButtonText, newMI.palette.highlightedText().color()); | 0 | ||||||||||||||||||||||||
| 1017 | newMI.palette.highlightedText().color()); never executed: newMI.palette.setColor(QPalette::ButtonText, newMI.palette.highlightedText().color()); | 0 | ||||||||||||||||||||||||
| 1018 | proxy()->drawPrimitive(arrow, &newMI, p, widget); | - | ||||||||||||||||||||||||
| 1019 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1020 | - | |||||||||||||||||||||||||
| 1021 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1022 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1023 | - | |||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||
| 1025 | case never executed: CE_MenuBarItem:case CE_MenuBarItem:never executed: case CE_MenuBarItem: | 0 | ||||||||||||||||||||||||
| 1026 | if (const
| 0 | ||||||||||||||||||||||||
| 1027 | bool active = mbi->state & State_Selected; | - | ||||||||||||||||||||||||
| 1028 | bool hasFocus = mbi->state & State_HasFocus; | - | ||||||||||||||||||||||||
| 1029 | bool down = mbi->state & State_Sunken; | - | ||||||||||||||||||||||||
| 1030 | QStyleOptionMenuItem newMbi = *mbi; | - | ||||||||||||||||||||||||
| 1031 | p->fillRect(mbi->rect, mbi->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1032 | if (active
| 0 | ||||||||||||||||||||||||
| 1033 | QBrush b = mbi->palette.brush(QPalette::Button); | - | ||||||||||||||||||||||||
| 1034 | if (active
| 0 | ||||||||||||||||||||||||
| 1035 | p->setBrushOrigin(p->brushOrigin() + QPoint(1, 1)); never executed: p->setBrushOrigin(p->brushOrigin() + QPoint(1, 1)); | 0 | ||||||||||||||||||||||||
| 1036 | if (active
| 0 | ||||||||||||||||||||||||
| 1037 | qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(), never executed: qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(), mbi->rect.height(), mbi->palette, active && down, 1, 0, &b); | 0 | ||||||||||||||||||||||||
| 1038 | mbi->rect.height(), mbi->palette, active && down, 1, 0, &b); never executed: qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(), mbi->rect.height(), mbi->palette, active && down, 1, 0, &b); | 0 | ||||||||||||||||||||||||
| 1039 | if (active
| 0 | ||||||||||||||||||||||||
| 1040 | newMbi.rect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, mbi, widget), | - | ||||||||||||||||||||||||
| 1041 | proxy()->pixelMetric(PM_ButtonShiftVertical, mbi, widget)); | - | ||||||||||||||||||||||||
| 1042 | p->setBrushOrigin(p->brushOrigin() - QPoint(1, 1)); | - | ||||||||||||||||||||||||
| 1043 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1045 | QCommonStyle::drawControl(ce, &newMbi, p, widget); | - | ||||||||||||||||||||||||
| 1046 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1047 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||
| 1050 | case never executed: CE_TabBarTabShape:case CE_TabBarTabShape:never executed: case CE_TabBarTabShape: | 0 | ||||||||||||||||||||||||
| 1051 | if (const
| 0 | ||||||||||||||||||||||||
| 1052 | bool rtlHorTabs = (tab->direction == Qt::RightToLeft
| 0 | ||||||||||||||||||||||||
| 1053 | && (tab->shape == QTabBar::RoundedNorth
| 0 | ||||||||||||||||||||||||
| 1054 | || tab->shape == QTabBar::RoundedSouth
| 0 | ||||||||||||||||||||||||
| 1055 | bool selected = tab->state & State_Selected; | - | ||||||||||||||||||||||||
| 1056 | bool lastTab = ((!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1057 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1058 | && tab->position == QStyleOptionTab::Beginning
| 0 | ||||||||||||||||||||||||
| 1059 | bool firstTab = ((!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1060 | && tab->position == QStyleOptionTab::Beginning
| 0 | ||||||||||||||||||||||||
| 1061 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1062 | && tab->position == QStyleOptionTab::End
| 0 | ||||||||||||||||||||||||
| 1063 | bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; | - | ||||||||||||||||||||||||
| 1064 | bool previousSelected = | - | ||||||||||||||||||||||||
| 1065 | ((!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1066 | && tab->selectedPosition == QStyleOptionTab::PreviousIsSelected
| 0 | ||||||||||||||||||||||||
| 1067 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1068 | && tab->selectedPosition == QStyleOptionTab::NextIsSelected
| 0 | ||||||||||||||||||||||||
| 1069 | bool nextSelected = | - | ||||||||||||||||||||||||
| 1070 | ((!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1071 | && tab->selectedPosition == QStyleOptionTab::NextIsSelected
| 0 | ||||||||||||||||||||||||
| 1072 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1073 | && tab->selectedPosition
| 0 | ||||||||||||||||||||||||
| 1074 | == QStyleOptionTab::PreviousIsSelected
| 0 | ||||||||||||||||||||||||
| 1075 | int tabBarAlignment = proxy()->styleHint(SH_TabBar_Alignment, tab, widget); | - | ||||||||||||||||||||||||
| 1076 | bool leftAligned = (!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1077 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1078 | && tabBarAlignment == Qt::AlignRight
| 0 | ||||||||||||||||||||||||
| 1079 | - | |||||||||||||||||||||||||
| 1080 | bool rightAligned = (!rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1081 | || (rtlHorTabs
| 0 | ||||||||||||||||||||||||
| 1082 | && tabBarAlignment == Qt::AlignLeft
| 0 | ||||||||||||||||||||||||
| 1083 | - | |||||||||||||||||||||||||
| 1084 | QColor light = tab->palette.light().color(); | - | ||||||||||||||||||||||||
| 1085 | QColor dark = tab->palette.dark().color(); | - | ||||||||||||||||||||||||
| 1086 | QColor shadow = tab->palette.shadow().color(); | - | ||||||||||||||||||||||||
| 1087 | int borderThinkness = proxy()->pixelMetric(PM_TabBarBaseOverlap, tab, widget); | - | ||||||||||||||||||||||||
| 1088 | if (selected
| 0 | ||||||||||||||||||||||||
| 1089 | borderThinkness /= 2; never executed: borderThinkness /= 2; | 0 | ||||||||||||||||||||||||
| 1090 | QRect r2(opt->rect); | - | ||||||||||||||||||||||||
| 1091 | int x1 = r2.left(); | - | ||||||||||||||||||||||||
| 1092 | int x2 = r2.right(); | - | ||||||||||||||||||||||||
| 1093 | int y1 = r2.top(); | - | ||||||||||||||||||||||||
| 1094 | int y2 = r2.bottom(); | - | ||||||||||||||||||||||||
| 1095 | switch (tab->shape) { | - | ||||||||||||||||||||||||
| 1096 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1097 | QCommonStyle::drawControl(ce, tab, p, widget); | - | ||||||||||||||||||||||||
| 1098 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1099 | case never executed: QTabBar::RoundedNorth:case QTabBar::RoundedNorth:never executed: {case QTabBar::RoundedNorth: | 0 | ||||||||||||||||||||||||
| 1100 | if (!selected
| 0 | ||||||||||||||||||||||||
| 1101 | y1 += 2; | - | ||||||||||||||||||||||||
| 1102 | x1 += onlyOne
| 0 | ||||||||||||||||||||||||
| 1103 | x2 -= onlyOne
| 0 | ||||||||||||||||||||||||
| 1104 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1105 | - | |||||||||||||||||||||||||
| 1106 | p->fillRect(QRect(x1 + 1, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 2), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||
| 1108 | - | |||||||||||||||||||||||||
| 1109 | if (selected
| 0 | ||||||||||||||||||||||||
| 1110 | p->fillRect(QRect(x1,y2-1,x2-x1,1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1111 | p->fillRect(QRect(x1,y2,x2-x1,1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1112 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1113 | - | |||||||||||||||||||||||||
| 1114 | if (firstTab
| 0 | ||||||||||||||||||||||||
| 1115 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1116 | p->drawLine(x1, y1 + 2, x1, y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1117 | p->drawPoint(x1 + 1, y1 + 1); | - | ||||||||||||||||||||||||
| 1118 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1119 | - | |||||||||||||||||||||||||
| 1120 | { | - | ||||||||||||||||||||||||
| 1121 | int beg = x1 + (previousSelected
| 0 | ||||||||||||||||||||||||
| 1122 | int end = x2 - (nextSelected
| 0 | ||||||||||||||||||||||||
| 1123 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1124 | p->drawLine(beg, y1, end, y1); | - | ||||||||||||||||||||||||
| 1125 | } | - | ||||||||||||||||||||||||
| 1126 | - | |||||||||||||||||||||||||
| 1127 | if (lastTab
| 0 | ||||||||||||||||||||||||
| 1128 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1129 | p->drawLine(x2, y1 + 2, x2, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1130 | p->drawPoint(x2 - 1, y1 + 1); | - | ||||||||||||||||||||||||
| 1131 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1132 | p->drawLine(x2 - 1, y1 + 2, x2 - 1, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1133 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1134 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1135 | case never executed: QTabBar::RoundedSouth:case QTabBar::RoundedSouth:never executed: {case QTabBar::RoundedSouth: | 0 | ||||||||||||||||||||||||
| 1136 | if (!selected
| 0 | ||||||||||||||||||||||||
| 1137 | y2 -= 2; | - | ||||||||||||||||||||||||
| 1138 | x1 += firstTab
| 0 | ||||||||||||||||||||||||
| 1139 | x2 -= lastTab
| 0 | ||||||||||||||||||||||||
| 1140 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1141 | - | |||||||||||||||||||||||||
| 1142 | p->fillRect(QRect(x1 + 1, y1 + 2, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1143 | - | |||||||||||||||||||||||||
| 1144 | - | |||||||||||||||||||||||||
| 1145 | if (selected
| 0 | ||||||||||||||||||||||||
| 1146 | p->fillRect(QRect(x1, y1 + 1, (x2 - 1)-x1, 1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1147 | p->fillRect(QRect(x1, y1, (x2 - 1)-x1, 1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1148 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1149 | - | |||||||||||||||||||||||||
| 1150 | if (firstTab
| 0 | ||||||||||||||||||||||||
| 1151 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1152 | p->drawLine(x1, y2 - 2, x1, y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1153 | p->drawPoint(x1 + 1, y2 - 1); | - | ||||||||||||||||||||||||
| 1154 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1155 | - | |||||||||||||||||||||||||
| 1156 | { | - | ||||||||||||||||||||||||
| 1157 | int beg = x1 + (previousSelected
| 0 | ||||||||||||||||||||||||
| 1158 | int end = x2 - (nextSelected
| 0 | ||||||||||||||||||||||||
| 1159 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1160 | p->drawLine(beg, y2, end, y2); | - | ||||||||||||||||||||||||
| 1161 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1162 | p->drawLine(beg, y2 - 1, end, y2 - 1); | - | ||||||||||||||||||||||||
| 1163 | } | - | ||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||
| 1165 | if (lastTab
| 0 | ||||||||||||||||||||||||
| 1166 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1167 | p->drawLine(x2, y2 - 2, x2, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1168 | p->drawPoint(x2 - 1, y2 - 1); | - | ||||||||||||||||||||||||
| 1169 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1170 | p->drawLine(x2 - 1, y2 - 2, x2 - 1, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); | - | ||||||||||||||||||||||||
| 1171 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1172 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1173 | case never executed: QTabBar::RoundedWest:case QTabBar::RoundedWest:never executed: {case QTabBar::RoundedWest: | 0 | ||||||||||||||||||||||||
| 1174 | if (!selected
| 0 | ||||||||||||||||||||||||
| 1175 | x1 += 2; | - | ||||||||||||||||||||||||
| 1176 | y1 += firstTab
| 0 | ||||||||||||||||||||||||
| 1177 | y2 -= lastTab
| 0 | ||||||||||||||||||||||||
| 1178 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1179 | - | |||||||||||||||||||||||||
| 1180 | p->fillRect(QRect(x1 + 1, y1 + 1, (x2 - x1) - 2, (y2 - y1) - 1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1181 | - | |||||||||||||||||||||||||
| 1182 | - | |||||||||||||||||||||||||
| 1183 | if (selected
| 0 | ||||||||||||||||||||||||
| 1184 | p->fillRect(QRect(x2 - 1, y1, 1, y2-y1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1185 | p->fillRect(QRect(x2, y1, 1, y2-y1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1186 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1187 | - | |||||||||||||||||||||||||
| 1188 | if (firstTab
| 0 | ||||||||||||||||||||||||
| 1189 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1190 | p->drawLine(x1 + 2, y1, x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); | - | ||||||||||||||||||||||||
| 1191 | p->drawPoint(x1 + 1, y1 + 1); | - | ||||||||||||||||||||||||
| 1192 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||
| 1194 | { | - | ||||||||||||||||||||||||
| 1195 | int beg = y1 + (previousSelected
| 0 | ||||||||||||||||||||||||
| 1196 | int end = y2 - (nextSelected
| 0 | ||||||||||||||||||||||||
| 1197 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1198 | p->drawLine(x1, beg, x1, end); | - | ||||||||||||||||||||||||
| 1199 | } | - | ||||||||||||||||||||||||
| 1200 | - | |||||||||||||||||||||||||
| 1201 | if (lastTab
| 0 | ||||||||||||||||||||||||
| 1202 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1203 | p->drawLine(x1 + 3, y2, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2); | - | ||||||||||||||||||||||||
| 1204 | p->drawPoint(x1 + 2, y2 - 1); | - | ||||||||||||||||||||||||
| 1205 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1206 | p->drawLine(x1 + 3, y2 - 1, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1); | - | ||||||||||||||||||||||||
| 1207 | p->drawPoint(x1 + 1, y2 - 1); | - | ||||||||||||||||||||||||
| 1208 | p->drawPoint(x1 + 2, y2); | - | ||||||||||||||||||||||||
| 1209 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1210 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1211 | case never executed: QTabBar::RoundedEast:case QTabBar::RoundedEast:never executed: {case QTabBar::RoundedEast: | 0 | ||||||||||||||||||||||||
| 1212 | if (!selected
| 0 | ||||||||||||||||||||||||
| 1213 | x2 -= 2; | - | ||||||||||||||||||||||||
| 1214 | y1 += firstTab
| 0 | ||||||||||||||||||||||||
| 1215 | y2 -= lastTab
| 0 | ||||||||||||||||||||||||
| 1216 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||
| 1218 | p->fillRect(QRect(x1 + 2, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1219 | - | |||||||||||||||||||||||||
| 1220 | - | |||||||||||||||||||||||||
| 1221 | if (selected
| 0 | ||||||||||||||||||||||||
| 1222 | p->fillRect(QRect(x1 + 1, y1, 1, (y2 - 1)-y1),tab->palette.background()); | - | ||||||||||||||||||||||||
| 1223 | p->fillRect(QRect(x1, y1, 1, (y2-1)-y1), tab->palette.background()); | - | ||||||||||||||||||||||||
| 1224 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||
| 1226 | if (firstTab
| 0 | ||||||||||||||||||||||||
| 1227 | p->setPen(light); | - | ||||||||||||||||||||||||
| 1228 | p->drawLine(x2 - 2, y1, x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); | - | ||||||||||||||||||||||||
| 1229 | p->drawPoint(x2 - 1, y1 + 1); | - | ||||||||||||||||||||||||
| 1230 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1231 | - | |||||||||||||||||||||||||
| 1232 | { | - | ||||||||||||||||||||||||
| 1233 | int beg = y1 + (previousSelected
| 0 | ||||||||||||||||||||||||
| 1234 | int end = y2 - (nextSelected
| 0 | ||||||||||||||||||||||||
| 1235 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1236 | p->drawLine(x2, beg, x2, end); | - | ||||||||||||||||||||||||
| 1237 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1238 | p->drawLine(x2 - 1, beg, x2 - 1, end); | - | ||||||||||||||||||||||||
| 1239 | } | - | ||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||
| 1241 | if (lastTab
| 0 | ||||||||||||||||||||||||
| 1242 | p->setPen(shadow); | - | ||||||||||||||||||||||||
| 1243 | p->drawLine(x2 - 2, y2, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2); | - | ||||||||||||||||||||||||
| 1244 | p->drawPoint(x2 - 1, y2 - 1); | - | ||||||||||||||||||||||||
| 1245 | p->setPen(dark); | - | ||||||||||||||||||||||||
| 1246 | p->drawLine(x2 - 2, y2 - 1, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1); | - | ||||||||||||||||||||||||
| 1247 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1248 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1249 | } | - | ||||||||||||||||||||||||
| 1250 | } | - | ||||||||||||||||||||||||
| 1251 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1252 | - | |||||||||||||||||||||||||
| 1253 | case never executed: CE_ToolBoxTabShape:case CE_ToolBoxTabShape:never executed: case CE_ToolBoxTabShape: | 0 | ||||||||||||||||||||||||
| 1254 | qDrawShadePanel(p, opt->rect, opt->palette, | - | ||||||||||||||||||||||||
| 1255 | opt->state & (State_Sunken | State_On), 1, | - | ||||||||||||||||||||||||
| 1256 | &opt->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1257 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1258 | - | |||||||||||||||||||||||||
| 1259 | case never executed: CE_Splitter:case CE_Splitter:never executed: case CE_Splitter: | 0 | ||||||||||||||||||||||||
| 1260 | p->eraseRect(opt->rect); | - | ||||||||||||||||||||||||
| 1261 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1262 | - | |||||||||||||||||||||||||
| 1263 | - | |||||||||||||||||||||||||
| 1264 | case never executed: CE_ScrollBarSubLine:case CE_ScrollBarSubLine:never executed: case CE_ScrollBarSubLine: | 0 | ||||||||||||||||||||||||
| 1265 | case never executed: CE_ScrollBarAddLine:case CE_ScrollBarAddLine:never executed: {case CE_ScrollBarAddLine: | 0 | ||||||||||||||||||||||||
| 1266 | if ((
| 0 | ||||||||||||||||||||||||
| 1267 | p->setPen(opt->palette.dark().color()); | - | ||||||||||||||||||||||||
| 1268 | p->setBrush(opt->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1269 | p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||
| 1270 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1271 | QStyleOption buttonOpt = *opt; | - | ||||||||||||||||||||||||
| 1272 | if (!(buttonOpt.state & State_Sunken)
| 0 | ||||||||||||||||||||||||
| 1273 | buttonOpt.state |= State_Raised; never executed: buttonOpt.state |= State_Raised; | 0 | ||||||||||||||||||||||||
| 1274 | QPalette pal(opt->palette); | - | ||||||||||||||||||||||||
| 1275 | pal.setColor(QPalette::Button, opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 1276 | pal.setColor(QPalette::Light, opt->palette.button().color()); | - | ||||||||||||||||||||||||
| 1277 | qDrawWinButton(p, opt->rect, pal, opt->state & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 1278 | &opt->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1279 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1280 | PrimitiveElement arrow; | - | ||||||||||||||||||||||||
| 1281 | if (opt->state & State_Horizontal
| 0 | ||||||||||||||||||||||||
| 1282 | if (ce == CE_ScrollBarAddLine
| 0 | ||||||||||||||||||||||||
| 1283 | arrow = opt->direction == Qt::LeftToRight
never executed: arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowRight : PE_IndicatorArrowLeft; | 0 | ||||||||||||||||||||||||
| 1284 | else | - | ||||||||||||||||||||||||
| 1285 | arrow = opt->direction == Qt::LeftToRight
never executed: arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight; | 0 | ||||||||||||||||||||||||
| 1286 | } else { | - | ||||||||||||||||||||||||
| 1287 | if (ce == CE_ScrollBarAddLine
| 0 | ||||||||||||||||||||||||
| 1288 | arrow = PE_IndicatorArrowDown; never executed: arrow = PE_IndicatorArrowDown; | 0 | ||||||||||||||||||||||||
| 1289 | else | - | ||||||||||||||||||||||||
| 1290 | arrow = PE_IndicatorArrowUp; never executed: arrow = PE_IndicatorArrowUp; | 0 | ||||||||||||||||||||||||
| 1291 | } | - | ||||||||||||||||||||||||
| 1292 | QStyleOption arrowOpt = *opt; | - | ||||||||||||||||||||||||
| 1293 | arrowOpt.rect = opt->rect.adjusted(4, 4, -4, -4); | - | ||||||||||||||||||||||||
| 1294 | proxy()->drawPrimitive(arrow, &arrowOpt, p, widget); | - | ||||||||||||||||||||||||
| 1295 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1296 | case never executed: CE_ScrollBarAddPage:case CE_ScrollBarAddPage:never executed: case CE_ScrollBarAddPage: | 0 | ||||||||||||||||||||||||
| 1297 | case never executed: CE_ScrollBarSubPage:case CE_ScrollBarSubPage:never executed: {case CE_ScrollBarSubPage: | 0 | ||||||||||||||||||||||||
| 1298 | QBrush br; | - | ||||||||||||||||||||||||
| 1299 | QBrush bg = p->background(); | - | ||||||||||||||||||||||||
| 1300 | Qt::BGMode bg_mode = p->backgroundMode(); | - | ||||||||||||||||||||||||
| 1301 | p->setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 1302 | p->setBackgroundMode(Qt::OpaqueMode); | - | ||||||||||||||||||||||||
| 1303 | - | |||||||||||||||||||||||||
| 1304 | if (opt->state & State_Sunken
| 0 | ||||||||||||||||||||||||
| 1305 | br = QBrush(opt->palette.shadow().color(), Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 1306 | p->setBackground(opt->palette.dark().color()); | - | ||||||||||||||||||||||||
| 1307 | p->setBrush(br); | - | ||||||||||||||||||||||||
| 1308 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1309 | const QBrush paletteBrush = opt->palette.brush(QPalette::Light); | - | ||||||||||||||||||||||||
| 1310 | if (paletteBrush.style() == Qt::TexturePattern
| 0 | ||||||||||||||||||||||||
| 1311 | if (qHasPixmapTexture(paletteBrush)
| 0 | ||||||||||||||||||||||||
| 1312 | br = QBrush(paletteBrush.texture()); never executed: br = QBrush(paletteBrush.texture()); | 0 | ||||||||||||||||||||||||
| 1313 | else | - | ||||||||||||||||||||||||
| 1314 | br = QBrush(paletteBrush.textureImage()); never executed: br = QBrush(paletteBrush.textureImage()); | 0 | ||||||||||||||||||||||||
| 1315 | } else | - | ||||||||||||||||||||||||
| 1316 | br = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); never executed: br = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); | 0 | ||||||||||||||||||||||||
| 1317 | p->setBackground(opt->palette.background().color()); | - | ||||||||||||||||||||||||
| 1318 | p->setBrush(br); | - | ||||||||||||||||||||||||
| 1319 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1320 | p->drawRect(opt->rect); | - | ||||||||||||||||||||||||
| 1321 | p->setBackground(bg); | - | ||||||||||||||||||||||||
| 1322 | p->setBackgroundMode(bg_mode); | - | ||||||||||||||||||||||||
| 1323 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1324 | case never executed: CE_ScrollBarSlider:case CE_ScrollBarSlider:never executed: case CE_ScrollBarSlider: | 0 | ||||||||||||||||||||||||
| 1325 | if (!(opt->state & State_Enabled)
| 0 | ||||||||||||||||||||||||
| 1326 | QBrush br; | - | ||||||||||||||||||||||||
| 1327 | const QBrush paletteBrush = opt->palette.brush(QPalette::Light); | - | ||||||||||||||||||||||||
| 1328 | if (paletteBrush.style() == Qt::TexturePattern
| 0 | ||||||||||||||||||||||||
| 1329 | if (qHasPixmapTexture(paletteBrush)
| 0 | ||||||||||||||||||||||||
| 1330 | br = QBrush(paletteBrush.texture()); never executed: br = QBrush(paletteBrush.texture()); | 0 | ||||||||||||||||||||||||
| 1331 | else | - | ||||||||||||||||||||||||
| 1332 | br = QBrush(paletteBrush.textureImage()); never executed: br = QBrush(paletteBrush.textureImage()); | 0 | ||||||||||||||||||||||||
| 1333 | } else | - | ||||||||||||||||||||||||
| 1334 | br = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); never executed: br = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); | 0 | ||||||||||||||||||||||||
| 1335 | p->setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 1336 | p->setBrush(br); | - | ||||||||||||||||||||||||
| 1337 | p->setBackgroundMode(Qt::OpaqueMode); | - | ||||||||||||||||||||||||
| 1338 | p->drawRect(opt->rect); | - | ||||||||||||||||||||||||
| 1339 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1340 | QStyleOptionButton buttonOpt; | - | ||||||||||||||||||||||||
| 1341 | buttonOpt.QStyleOption::operator=(*opt); | - | ||||||||||||||||||||||||
| 1342 | buttonOpt.state = State_Enabled | State_Raised; | - | ||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||
| 1344 | QPalette pal(opt->palette); | - | ||||||||||||||||||||||||
| 1345 | pal.setColor(QPalette::Button, opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 1346 | pal.setColor(QPalette::Light, opt->palette.button().color()); | - | ||||||||||||||||||||||||
| 1347 | qDrawWinButton(p, opt->rect, pal, false, &opt->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1348 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1349 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1350 | - | |||||||||||||||||||||||||
| 1351 | case never executed: CE_HeaderSection:case CE_HeaderSection:never executed: {case CE_HeaderSection: | 0 | ||||||||||||||||||||||||
| 1352 | QBrush fill; | - | ||||||||||||||||||||||||
| 1353 | if (opt->state & State_On
| 0 | ||||||||||||||||||||||||
| 1354 | fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); never executed: fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); | 0 | ||||||||||||||||||||||||
| 1355 | else | - | ||||||||||||||||||||||||
| 1356 | fill = opt->palette.brush(QPalette::Button); never executed: fill = opt->palette.brush(QPalette::Button); | 0 | ||||||||||||||||||||||||
| 1357 | - | |||||||||||||||||||||||||
| 1358 | if (opt->state & (State_Raised | State_Sunken)
| 0 | ||||||||||||||||||||||||
| 1359 | qDrawWinButton(p, opt->rect, opt->palette, opt->state & State_Sunken, &fill); | - | ||||||||||||||||||||||||
| 1360 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1361 | p->fillRect(opt->rect, fill); | - | ||||||||||||||||||||||||
| 1362 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1363 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
| 1364 | - | |||||||||||||||||||||||||
| 1365 | case never executed: CE_ToolBar:case CE_ToolBar:never executed: case CE_ToolBar: | 0 | ||||||||||||||||||||||||
| 1366 | if (const
| 0 | ||||||||||||||||||||||||
| 1367 | - | |||||||||||||||||||||||||
| 1368 | if (!(widget
| 0 | ||||||||||||||||||||||||
| 1369 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1370 | - | |||||||||||||||||||||||||
| 1371 | QRect rect = opt->rect; | - | ||||||||||||||||||||||||
| 1372 | bool paintLeftBorder = true; | - | ||||||||||||||||||||||||
| 1373 | bool paintRightBorder = true; | - | ||||||||||||||||||||||||
| 1374 | bool paintBottomBorder = true; | - | ||||||||||||||||||||||||
| 1375 | - | |||||||||||||||||||||||||
| 1376 | switch (toolbar->toolBarArea){ | - | ||||||||||||||||||||||||
| 1377 | case never executed: Qt::BottomToolBarArea :case Qt::BottomToolBarArea :never executed: case Qt::BottomToolBarArea : | 0 | ||||||||||||||||||||||||
| 1378 | switch(toolbar->positionOfLine){ | - | ||||||||||||||||||||||||
| 1379 | case never executed: QStyleOptionToolBar::Beginning:case QStyleOptionToolBar::Beginning:never executed: case QStyleOptionToolBar::Beginning: | 0 | ||||||||||||||||||||||||
| 1380 | case never executed: QStyleOptionToolBar::OnlyOne:case QStyleOptionToolBar::OnlyOne:never executed: case QStyleOptionToolBar::OnlyOne: | 0 | ||||||||||||||||||||||||
| 1381 | paintBottomBorder = false; | - | ||||||||||||||||||||||||
| 1382 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
| 1383 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1384 | } | - | ||||||||||||||||||||||||
| 1385 | case never executed: Qt::TopToolBarArea :case Qt::TopToolBarArea :never executed: case Qt::TopToolBarArea :code before this statement never executed: case Qt::TopToolBarArea : | 0 | ||||||||||||||||||||||||
| 1386 | switch(toolbar->positionWithinLine){ | - | ||||||||||||||||||||||||
| 1387 | case never executed: QStyleOptionToolBar::Beginning:case QStyleOptionToolBar::Beginning:never executed: case QStyleOptionToolBar::Beginning: | 0 | ||||||||||||||||||||||||
| 1388 | paintLeftBorder = false; | - | ||||||||||||||||||||||||
| 1389 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1390 | case never executed: QStyleOptionToolBar::End:case QStyleOptionToolBar::End:never executed: case QStyleOptionToolBar::End: | 0 | ||||||||||||||||||||||||
| 1391 | paintRightBorder = false; | - | ||||||||||||||||||||||||
| 1392 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1393 | case never executed: QStyleOptionToolBar::OnlyOne:case QStyleOptionToolBar::OnlyOne:never executed: case QStyleOptionToolBar::OnlyOne: | 0 | ||||||||||||||||||||||||
| 1394 | paintRightBorder = false; | - | ||||||||||||||||||||||||
| 1395 | paintLeftBorder = false; | - | ||||||||||||||||||||||||
| 1396 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
| 1397 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1398 | } | - | ||||||||||||||||||||||||
| 1399 | if(opt->direction == Qt::RightToLeft
| 0 | ||||||||||||||||||||||||
| 1400 | bool tmp = paintLeftBorder; | - | ||||||||||||||||||||||||
| 1401 | paintRightBorder=paintLeftBorder; | - | ||||||||||||||||||||||||
| 1402 | paintLeftBorder=tmp; | - | ||||||||||||||||||||||||
| 1403 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1404 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1405 | case never executed: Qt::RightToolBarArea :case Qt::RightToolBarArea :never executed: case Qt::RightToolBarArea : | 0 | ||||||||||||||||||||||||
| 1406 | switch (toolbar->positionOfLine){ | - | ||||||||||||||||||||||||
| 1407 | case never executed: QStyleOptionToolBar::Beginning:case QStyleOptionToolBar::Beginning:never executed: case QStyleOptionToolBar::Beginning: | 0 | ||||||||||||||||||||||||
| 1408 | case never executed: QStyleOptionToolBar::OnlyOne:case QStyleOptionToolBar::OnlyOne:never executed: case QStyleOptionToolBar::OnlyOne: | 0 | ||||||||||||||||||||||||
| 1409 | paintRightBorder = false; | - | ||||||||||||||||||||||||
| 1410 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1411 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1412 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1413 | } | - | ||||||||||||||||||||||||
| 1414 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1415 | case never executed: Qt::LeftToolBarArea :case Qt::LeftToolBarArea :never executed: case Qt::LeftToolBarArea : | 0 | ||||||||||||||||||||||||
| 1416 | switch (toolbar->positionOfLine){ | - | ||||||||||||||||||||||||
| 1417 | case never executed: QStyleOptionToolBar::Beginning:case QStyleOptionToolBar::Beginning:never executed: case QStyleOptionToolBar::Beginning: | 0 | ||||||||||||||||||||||||
| 1418 | case never executed: QStyleOptionToolBar::OnlyOne:case QStyleOptionToolBar::OnlyOne:never executed: case QStyleOptionToolBar::OnlyOne: | 0 | ||||||||||||||||||||||||
| 1419 | paintLeftBorder = false; | - | ||||||||||||||||||||||||
| 1420 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1421 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1422 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1423 | } | - | ||||||||||||||||||||||||
| 1424 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1425 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1426 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1427 | } | - | ||||||||||||||||||||||||
| 1428 | - | |||||||||||||||||||||||||
| 1429 | - | |||||||||||||||||||||||||
| 1430 | - | |||||||||||||||||||||||||
| 1431 | p->setPen(QPen(opt->palette.light().color())); | - | ||||||||||||||||||||||||
| 1432 | p->drawLine(rect.topLeft().x(), | - | ||||||||||||||||||||||||
| 1433 | rect.topLeft().y(), | - | ||||||||||||||||||||||||
| 1434 | rect.topRight().x(), | - | ||||||||||||||||||||||||
| 1435 | rect.topRight().y()); | - | ||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||
| 1437 | if (paintLeftBorder
| 0 | ||||||||||||||||||||||||
| 1438 | p->setPen(QPen(opt->palette.light().color())); | - | ||||||||||||||||||||||||
| 1439 | p->drawLine(rect.topLeft().x(), | - | ||||||||||||||||||||||||
| 1440 | rect.topLeft().y(), | - | ||||||||||||||||||||||||
| 1441 | rect.bottomLeft().x(), | - | ||||||||||||||||||||||||
| 1442 | rect.bottomLeft().y()); | - | ||||||||||||||||||||||||
| 1443 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||
| 1445 | if (paintRightBorder
| 0 | ||||||||||||||||||||||||
| 1446 | p->setPen(QPen(opt->palette.dark().color())); | - | ||||||||||||||||||||||||
| 1447 | p->drawLine(rect.topRight().x(), | - | ||||||||||||||||||||||||
| 1448 | rect.topRight().y(), | - | ||||||||||||||||||||||||
| 1449 | rect.bottomRight().x(), | - | ||||||||||||||||||||||||
| 1450 | rect.bottomRight().y()); | - | ||||||||||||||||||||||||
| 1451 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1452 | - | |||||||||||||||||||||||||
| 1453 | if (paintBottomBorder
| 0 | ||||||||||||||||||||||||
| 1454 | p->setPen(QPen(opt->palette.dark().color())); | - | ||||||||||||||||||||||||
| 1455 | p->drawLine(rect.bottomLeft().x(), | - | ||||||||||||||||||||||||
| 1456 | rect.bottomLeft().y(), | - | ||||||||||||||||||||||||
| 1457 | rect.bottomRight().x(), | - | ||||||||||||||||||||||||
| 1458 | rect.bottomRight().y()); | - | ||||||||||||||||||||||||
| 1459 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1460 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1461 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1462 | - | |||||||||||||||||||||||||
| 1463 | - | |||||||||||||||||||||||||
| 1464 | - | |||||||||||||||||||||||||
| 1465 | - | |||||||||||||||||||||||||
| 1466 | case never executed: CE_ProgressBarContents:case CE_ProgressBarContents:never executed: case CE_ProgressBarContents: | 0 | ||||||||||||||||||||||||
| 1467 | if (const
| 0 | ||||||||||||||||||||||||
| 1468 | QRect rect = pb->rect; | - | ||||||||||||||||||||||||
| 1469 | if (!rect.isValid()
| 0 | ||||||||||||||||||||||||
| 1470 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||
| 1472 | const bool vertical = pb->orientation == Qt::Vertical; | - | ||||||||||||||||||||||||
| 1473 | const bool inverted = pb->invertedAppearance; | - | ||||||||||||||||||||||||
| 1474 | - | |||||||||||||||||||||||||
| 1475 | QMatrix m; | - | ||||||||||||||||||||||||
| 1476 | if (vertical
| 0 | ||||||||||||||||||||||||
| 1477 | rect = QRect(rect.y(), rect.x(), rect.height(), rect.width()); | - | ||||||||||||||||||||||||
| 1478 | m.rotate(90); | - | ||||||||||||||||||||||||
| 1479 | m.translate(0, -(rect.height() + rect.y()*2)); | - | ||||||||||||||||||||||||
| 1480 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1481 | QPalette pal2 = pb->palette; | - | ||||||||||||||||||||||||
| 1482 | - | |||||||||||||||||||||||||
| 1483 | if (pal2.highlight() == pal2.background()
| 0 | ||||||||||||||||||||||||
| 1484 | pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, never executed: pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, QPalette::Highlight)); | 0 | ||||||||||||||||||||||||
| 1485 | QPalette::Highlight)); never executed: pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, QPalette::Highlight)); | 0 | ||||||||||||||||||||||||
| 1486 | bool reverse = ((!vertical
| 0 | ||||||||||||||||||||||||
| 1487 | if (inverted
| 0 | ||||||||||||||||||||||||
| 1488 | reverse = !reverse; never executed: reverse = !reverse; | 0 | ||||||||||||||||||||||||
| 1489 | int w = rect.width(); | - | ||||||||||||||||||||||||
| 1490 | const QWindowsStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1491 | if (pb->minimum == 0
| 0 | ||||||||||||||||||||||||
| 1492 | const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget); | - | ||||||||||||||||||||||||
| 1493 | QStyleOptionProgressBar pbBits = *pb; | - | ||||||||||||||||||||||||
| 1494 | ((!(unit_width >0)) ? qt_assert("unit_width >0",__FILE__,17551764) : qt_noop()); | - | ||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||
| 1496 | pbBits.rect = rect; | - | ||||||||||||||||||||||||
| 1497 | pbBits.palette = pal2; | - | ||||||||||||||||||||||||
| 1498 | - | |||||||||||||||||||||||||
| 1499 | int step = 0; | - | ||||||||||||||||||||||||
| 1500 | int chunkCount = w / unit_width + 1; | - | ||||||||||||||||||||||||
| 1501 | if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))
| 0 | ||||||||||||||||||||||||
| 1502 | step = (animation->animationStep() / 3) % chunkCount; never executed: step = (animation->animationStep() / 3) % chunkCount; | 0 | ||||||||||||||||||||||||
| 1503 | else | - | ||||||||||||||||||||||||
| 1504 | d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); never executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); | 0 | ||||||||||||||||||||||||
| 1505 | int chunksInRow = 5; | - | ||||||||||||||||||||||||
| 1506 | int myY = pbBits.rect.y(); | - | ||||||||||||||||||||||||
| 1507 | int myHeight = pbBits.rect.height(); | - | ||||||||||||||||||||||||
| 1508 | int chunksToDraw = chunksInRow; | - | ||||||||||||||||||||||||
| 1509 | - | |||||||||||||||||||||||||
| 1510 | if(step > chunkCount - 5
never executed: chunksToDraw = (chunkCount - step); | 0 | ||||||||||||||||||||||||
| 1511 | p->save(); | - | ||||||||||||||||||||||||
| 1512 | p->setClipRect(m.mapRect(QRectF(rect)).toRect()); | - | ||||||||||||||||||||||||
| 1513 | - | |||||||||||||||||||||||||
| 1514 | int x0 = reverse
| 0 | ||||||||||||||||||||||||
| 1515 | int x = 0; | - | ||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||
| 1517 | for (int i = 0; i < chunksToDraw
| 0 | ||||||||||||||||||||||||
| 1518 | pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); | - | ||||||||||||||||||||||||
| 1519 | pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); | - | ||||||||||||||||||||||||
| 1520 | proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); | - | ||||||||||||||||||||||||
| 1521 | x += reverse
| 0 | ||||||||||||||||||||||||
| 1522 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1523 | - | |||||||||||||||||||||||||
| 1524 | if( step > chunkCount-5
| 0 | ||||||||||||||||||||||||
| 1525 | x0 = reverse
| 0 | ||||||||||||||||||||||||
| 1526 | x = 0; | - | ||||||||||||||||||||||||
| 1527 | int chunksToDraw = step - (chunkCount - chunksInRow); | - | ||||||||||||||||||||||||
| 1528 | for (int i = 0; i < chunksToDraw
| 0 | ||||||||||||||||||||||||
| 1529 | pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); | - | ||||||||||||||||||||||||
| 1530 | pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); | - | ||||||||||||||||||||||||
| 1531 | proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); | - | ||||||||||||||||||||||||
| 1532 | x += reverse
| 0 | ||||||||||||||||||||||||
| 1533 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1534 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1535 | p->restore(); | - | ||||||||||||||||||||||||
| 1536 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1537 | else { | - | ||||||||||||||||||||||||
| 1538 | d->stopAnimation(opt->styleObject); | - | ||||||||||||||||||||||||
| 1539 | QCommonStyle::drawControl(ce, opt, p, widget); | - | ||||||||||||||||||||||||
| 1540 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1541 | } | - | ||||||||||||||||||||||||
| 1542 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1543 | - | |||||||||||||||||||||||||
| 1544 | - | |||||||||||||||||||||||||
| 1545 | case never executed: CE_DockWidgetTitle:case CE_DockWidgetTitle:never executed: case CE_DockWidgetTitle: | 0 | ||||||||||||||||||||||||
| 1546 | - | |||||||||||||||||||||||||
| 1547 | if (const
| 0 | ||||||||||||||||||||||||
| 1548 | const QWindowsStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1549 | - | |||||||||||||||||||||||||
| 1550 | const bool verticalTitleBar = dwOpt->verticalTitleBar; | - | ||||||||||||||||||||||||
| 1551 | - | |||||||||||||||||||||||||
| 1552 | QRect rect = dwOpt->rect; | - | ||||||||||||||||||||||||
| 1553 | QRect r = rect; | - | ||||||||||||||||||||||||
| 1554 | - | |||||||||||||||||||||||||
| 1555 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||
| 1556 | r .setSize(= r.size().transposed());(); | - | ||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||
| 1558 | p->save(); | - | ||||||||||||||||||||||||
| 1559 | p->translate(r.left(), r.top() + r.width()); | - | ||||||||||||||||||||||||
| 1560 | p->rotate(-90); | - | ||||||||||||||||||||||||
| 1561 | p->translate(-r.left(), -r.top()); | - | ||||||||||||||||||||||||
| 1562 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1563 | - | |||||||||||||||||||||||||
| 1564 | bool floating = false; | - | ||||||||||||||||||||||||
| 1565 | bool active = dwOpt->state & State_Active; | - | ||||||||||||||||||||||||
| 1566 | QColor inactiveCaptionTextColor = d->inactiveCaptionText; | - | ||||||||||||||||||||||||
| 1567 | if (dwOpt->movable
| 0 | ||||||||||||||||||||||||
| 1568 | QColor left, right; | - | ||||||||||||||||||||||||
| 1569 | - | |||||||||||||||||||||||||
| 1570 | - | |||||||||||||||||||||||||
| 1571 | if (opt->state & QStyle::State_Window
| 0 | ||||||||||||||||||||||||
| 1572 | floating = true; | - | ||||||||||||||||||||||||
| 1573 | if (active
| 0 | ||||||||||||||||||||||||
| 1574 | left = d->activeCaptionColor; | - | ||||||||||||||||||||||||
| 1575 | right = d->activeGradientCaptionColor; | - | ||||||||||||||||||||||||
| 1576 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1577 | left = d->inactiveCaptionColor; | - | ||||||||||||||||||||||||
| 1578 | right = d->inactiveGradientCaptionColor; | - | ||||||||||||||||||||||||
| 1579 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1580 | QBrush fillBrush(left); | - | ||||||||||||||||||||||||
| 1581 | if (left != right
| 0 | ||||||||||||||||||||||||
| 1582 | QPoint p1(r.x(), r.top() + r.height()/2); | - | ||||||||||||||||||||||||
| 1583 | QPoint p2(rect.right(), r.top() + r.height()/2); | - | ||||||||||||||||||||||||
| 1584 | QLinearGradient lg(p1, p2); | - | ||||||||||||||||||||||||
| 1585 | lg.setColorAt(0, left); | - | ||||||||||||||||||||||||
| 1586 | lg.setColorAt(1, right); | - | ||||||||||||||||||||||||
| 1587 | fillBrush = lg; | - | ||||||||||||||||||||||||
| 1588 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1589 | p->fillRect(r.adjusted(0, 0, 0, -3), fillBrush); | - | ||||||||||||||||||||||||
| 1590 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1591 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1592 | if (!dwOpt->title.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1593 | QFont oldFont = p->font(); | - | ||||||||||||||||||||||||
| 1594 | if (floating
| 0 | ||||||||||||||||||||||||
| 1595 | QFont font = oldFont; | - | ||||||||||||||||||||||||
| 1596 | font.setBold(true); | - | ||||||||||||||||||||||||
| 1597 | p->setFont(font); | - | ||||||||||||||||||||||||
| 1598 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1599 | QPalette palette = dwOpt->palette; | - | ||||||||||||||||||||||||
| 1600 | palette.setColor(QPalette::Window, inactiveCaptionTextColor); | - | ||||||||||||||||||||||||
| 1601 | QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, opt, widget); | - | ||||||||||||||||||||||||
| 1602 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||
| 1603 | titleRect = QRect(r.left() + rect.bottom() | - | ||||||||||||||||||||||||
| 1604 | - titleRect.bottom(), | - | ||||||||||||||||||||||||
| 1605 | r.top() + titleRect.left() - rect.left(), | - | ||||||||||||||||||||||||
| 1606 | titleRect.height(), titleRect.width()); | - | ||||||||||||||||||||||||
| 1607 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1608 | proxy()->drawItemText(p, titleRect, | - | ||||||||||||||||||||||||
| 1609 | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, palette, | - | ||||||||||||||||||||||||
| 1610 | dwOpt->state & State_Enabled, dwOpt->title, | - | ||||||||||||||||||||||||
| 1611 | floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); | - | ||||||||||||||||||||||||
| 1612 | p->setFont(oldFont); | - | ||||||||||||||||||||||||
| 1613 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1614 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||
| 1615 | p->restore(); never executed: p->restore(); | 0 | ||||||||||||||||||||||||
| 1616 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1617 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||
| 1619 | - | |||||||||||||||||||||||||
| 1620 | case never executed: CE_ComboBoxLabel:case CE_ComboBoxLabel:never executed: case CE_ComboBoxLabel: | 0 | ||||||||||||||||||||||||
| 1621 | if (const
| 0 | ||||||||||||||||||||||||
| 1622 | if (cb->state & State_HasFocus
| 0 | ||||||||||||||||||||||||
| 1623 | p->setPen(cb->palette.highlightedText().color()); | - | ||||||||||||||||||||||||
| 1624 | p->setBackground(cb->palette.highlight()); | - | ||||||||||||||||||||||||
| 1625 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1626 | p->setPen(cb->palette.text().color()); | - | ||||||||||||||||||||||||
| 1627 | p->setBackground(cb->palette.background()); | - | ||||||||||||||||||||||||
| 1628 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1629 | } | - | ||||||||||||||||||||||||
| 1630 | QCommonStyle::drawControl(ce, opt, p, widget); | - | ||||||||||||||||||||||||
| 1631 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1632 | - | |||||||||||||||||||||||||
| 1633 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1634 | QCommonStyle::drawControl(ce, opt, p, widget); | - | ||||||||||||||||||||||||
| 1635 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1636 | } | - | ||||||||||||||||||||||||
| 1637 | - | |||||||||||||||||||||||||
| 1638 | - | |||||||||||||||||||||||||
| 1639 | QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const | - | ||||||||||||||||||||||||
| 1640 | { | - | ||||||||||||||||||||||||
| 1641 | QRect r; | - | ||||||||||||||||||||||||
| 1642 | switch (sr) { | - | ||||||||||||||||||||||||
| 1643 | case SE_SliderFocusRect: | - | ||||||||||||||||||||||||
| 1644 | case SE_ToolBoxTabContents: | - | ||||||||||||||||||||||||
| 1645 | r = visualRect(opt->direction, opt->rect, opt->rect); | - | ||||||||||||||||||||||||
| 1646 | break; | - | ||||||||||||||||||||||||
| 1647 | case SE_DockWidgetTitleBarText: { | - | ||||||||||||||||||||||||
| 1648 | r = QCommonStyle::subElementRect(sr, opt, w); | - | ||||||||||||||||||||||||
| 1649 | const QStyleOptionDockWidget *dwOpt | - | ||||||||||||||||||||||||
| 1650 | = qstyleoption_cast<const QStyleOptionDockWidget*>(opt); | - | ||||||||||||||||||||||||
| 1651 | const bool verticalTitleBar = dwOpt && dwOpt->verticalTitleBar; | - | ||||||||||||||||||||||||
| 1652 | int m = proxy()->pixelMetric(PM_DockWidgetTitleMargin, opt, w); | - | ||||||||||||||||||||||||
| 1653 | if (verticalTitleBar) { | - | ||||||||||||||||||||||||
| 1654 | r.adjust(0, 0, 0, -m); | - | ||||||||||||||||||||||||
| 1655 | } else { | - | ||||||||||||||||||||||||
| 1656 | if (opt->direction == Qt::LeftToRight) | - | ||||||||||||||||||||||||
| 1657 | r.adjust(m, 0, 0, 0); | - | ||||||||||||||||||||||||
| 1658 | else | - | ||||||||||||||||||||||||
| 1659 | r.adjust(0, 0, -m, 0); | - | ||||||||||||||||||||||||
| 1660 | } | - | ||||||||||||||||||||||||
| 1661 | break; | - | ||||||||||||||||||||||||
| 1662 | } | - | ||||||||||||||||||||||||
| 1663 | case SE_ProgressBarContents: | - | ||||||||||||||||||||||||
| 1664 | r = QCommonStyle::subElementRect(SE_ProgressBarGroove, opt, w); | - | ||||||||||||||||||||||||
| 1665 | r.adjust(3, 3, -3, -3); | - | ||||||||||||||||||||||||
| 1666 | break; | - | ||||||||||||||||||||||||
| 1667 | default: | - | ||||||||||||||||||||||||
| 1668 | r = QCommonStyle::subElementRect(sr, opt, w); | - | ||||||||||||||||||||||||
| 1669 | } | - | ||||||||||||||||||||||||
| 1670 | return r; | - | ||||||||||||||||||||||||
| 1671 | } | - | ||||||||||||||||||||||||
| 1672 | - | |||||||||||||||||||||||||
| 1673 | - | |||||||||||||||||||||||||
| 1674 | - | |||||||||||||||||||||||||
| 1675 | void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - | ||||||||||||||||||||||||
| 1676 | QPainter *p, const QWidget *widget) const | - | ||||||||||||||||||||||||
| 1677 | { | - | ||||||||||||||||||||||||
| 1678 | switch (cc) { | - | ||||||||||||||||||||||||
| 1679 | - | |||||||||||||||||||||||||
| 1680 | case CC_Slider: | - | ||||||||||||||||||||||||
| 1681 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { | - | ||||||||||||||||||||||||
| 1682 | int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); | - | ||||||||||||||||||||||||
| 1683 | int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); | - | ||||||||||||||||||||||||
| 1684 | int ticks = slider->tickPosition; | - | ||||||||||||||||||||||||
| 1685 | QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget); | - | ||||||||||||||||||||||||
| 1686 | QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget); | - | ||||||||||||||||||||||||
| 1687 | - | |||||||||||||||||||||||||
| 1688 | if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { | - | ||||||||||||||||||||||||
| 1689 | int mid = thickness / 2; | - | ||||||||||||||||||||||||
| 1690 | - | |||||||||||||||||||||||||
| 1691 | if (ticks & QSlider::TicksAbove) | - | ||||||||||||||||||||||||
| 1692 | mid += len / 8; | - | ||||||||||||||||||||||||
| 1693 | if (ticks & QSlider::TicksBelow) | - | ||||||||||||||||||||||||
| 1694 | mid -= len / 8; | - | ||||||||||||||||||||||||
| 1695 | - | |||||||||||||||||||||||||
| 1696 | p->setPen(slider->palette.shadow().color()); | - | ||||||||||||||||||||||||
| 1697 | if (slider->orientation == Qt::Horizontal) { | - | ||||||||||||||||||||||||
| 1698 | qDrawWinPanel(p, groove.x(), groove.y() + mid - 2, | - | ||||||||||||||||||||||||
| 1699 | groove.width(), 4, slider->palette, true); | - | ||||||||||||||||||||||||
| 1700 | p->drawLine(groove.x() + 1, groove.y() + mid - 1, | - | ||||||||||||||||||||||||
| 1701 | groove.x() + groove.width() - 3, groove.y() + mid - 1); | - | ||||||||||||||||||||||||
| 1702 | } else { | - | ||||||||||||||||||||||||
| 1703 | qDrawWinPanel(p, groove.x() + mid - 2, groove.y(), | - | ||||||||||||||||||||||||
| 1704 | 4, groove.height(), slider->palette, true); | - | ||||||||||||||||||||||||
| 1705 | p->drawLine(groove.x() + mid - 1, groove.y() + 1, | - | ||||||||||||||||||||||||
| 1706 | groove.x() + mid - 1, groove.y() + groove.height() - 3); | - | ||||||||||||||||||||||||
| 1707 | } | - | ||||||||||||||||||||||||
| 1708 | } | - | ||||||||||||||||||||||||
| 1709 | - | |||||||||||||||||||||||||
| 1710 | if (slider->subControls & SC_SliderTickmarks) { | - | ||||||||||||||||||||||||
| 1711 | QStyleOptionSlider tmpSlider = *slider; | - | ||||||||||||||||||||||||
| 1712 | tmpSlider.subControls = SC_SliderTickmarks; | - | ||||||||||||||||||||||||
| 1713 | QCommonStyle::drawComplexControl(cc, &tmpSlider, p, widget); | - | ||||||||||||||||||||||||
| 1714 | } | - | ||||||||||||||||||||||||
| 1715 | - | |||||||||||||||||||||||||
| 1716 | if (slider->subControls & SC_SliderHandle) { | - | ||||||||||||||||||||||||
| 1717 | const QColor c0 = slider->palette.shadow().color(); | - | ||||||||||||||||||||||||
| 1718 | const QColor c1 = slider->palette.dark().color(); | - | ||||||||||||||||||||||||
| 1719 | - | |||||||||||||||||||||||||
| 1720 | const QColor c3 = slider->palette.midlight().color(); | - | ||||||||||||||||||||||||
| 1721 | const QColor c4 = slider->palette.light().color(); | - | ||||||||||||||||||||||||
| 1722 | QBrush handleBrush; | - | ||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||
| 1724 | if (slider->state & State_Enabled) { | - | ||||||||||||||||||||||||
| 1725 | handleBrush = slider->palette.color(QPalette::Button); | - | ||||||||||||||||||||||||
| 1726 | } else { | - | ||||||||||||||||||||||||
| 1727 | handleBrush = QBrush(slider->palette.color(QPalette::Button), | - | ||||||||||||||||||||||||
| 1728 | Qt::Dense4Pattern); | - | ||||||||||||||||||||||||
| 1729 | } | - | ||||||||||||||||||||||||
| 1730 | - | |||||||||||||||||||||||||
| 1731 | - | |||||||||||||||||||||||||
| 1732 | int x = handle.x(), y = handle.y(), | - | ||||||||||||||||||||||||
| 1733 | wi = handle.width(), he = handle.height(); | - | ||||||||||||||||||||||||
| 1734 | - | |||||||||||||||||||||||||
| 1735 | int x1 = x; | - | ||||||||||||||||||||||||
| 1736 | int x2 = x+wi-1; | - | ||||||||||||||||||||||||
| 1737 | int y1 = y; | - | ||||||||||||||||||||||||
| 1738 | int y2 = y+he-1; | - | ||||||||||||||||||||||||
| 1739 | - | |||||||||||||||||||||||||
| 1740 | Qt::Orientation orient = slider->orientation; | - | ||||||||||||||||||||||||
| 1741 | bool tickAbove = slider->tickPosition == QSlider::TicksAbove; | - | ||||||||||||||||||||||||
| 1742 | bool tickBelow = slider->tickPosition == QSlider::TicksBelow; | - | ||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||
| 1744 | if (slider->state & State_HasFocus) { | - | ||||||||||||||||||||||||
| 1745 | QStyleOptionFocusRect fropt; | - | ||||||||||||||||||||||||
| 1746 | fropt.QStyleOption::operator=(*slider); | - | ||||||||||||||||||||||||
| 1747 | fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); | - | ||||||||||||||||||||||||
| 1748 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - | ||||||||||||||||||||||||
| 1749 | } | - | ||||||||||||||||||||||||
| 1750 | - | |||||||||||||||||||||||||
| 1751 | if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) { | - | ||||||||||||||||||||||||
| 1752 | Qt::BGMode oldMode = p->backgroundMode(); | - | ||||||||||||||||||||||||
| 1753 | p->setBackgroundMode(Qt::OpaqueMode); | - | ||||||||||||||||||||||||
| 1754 | qDrawWinButton(p, QRect(x, y, wi, he), slider->palette, false, | - | ||||||||||||||||||||||||
| 1755 | &handleBrush); | - | ||||||||||||||||||||||||
| 1756 | p->setBackgroundMode(oldMode); | - | ||||||||||||||||||||||||
| 1757 | return; | - | ||||||||||||||||||||||||
| 1758 | } | - | ||||||||||||||||||||||||
| 1759 | - | |||||||||||||||||||||||||
| 1760 | QSliderDirection dir; | - | ||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||
| 1762 | if (orient == Qt::Horizontal) | - | ||||||||||||||||||||||||
| 1763 | if (tickAbove) | - | ||||||||||||||||||||||||
| 1764 | dir = SlUp; | - | ||||||||||||||||||||||||
| 1765 | else | - | ||||||||||||||||||||||||
| 1766 | dir = SlDown; | - | ||||||||||||||||||||||||
| 1767 | else | - | ||||||||||||||||||||||||
| 1768 | if (tickAbove) | - | ||||||||||||||||||||||||
| 1769 | dir = SlLeft; | - | ||||||||||||||||||||||||
| 1770 | else | - | ||||||||||||||||||||||||
| 1771 | dir = SlRight; | - | ||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||
| 1773 | QPolygon a; | - | ||||||||||||||||||||||||
| 1774 | - | |||||||||||||||||||||||||
| 1775 | int d = 0; | - | ||||||||||||||||||||||||
| 1776 | switch (dir) { | - | ||||||||||||||||||||||||
| 1777 | case SlUp: | - | ||||||||||||||||||||||||
| 1778 | y1 = y1 + wi/2; | - | ||||||||||||||||||||||||
| 1779 | d = (wi + 1) / 2 - 1; | - | ||||||||||||||||||||||||
| 1780 | a.setPoints(5, x1,y1, x1,y2, x2,y2, x2,y1, x1+d,y1-d); | - | ||||||||||||||||||||||||
| 1781 | break; | - | ||||||||||||||||||||||||
| 1782 | case SlDown: | - | ||||||||||||||||||||||||
| 1783 | y2 = y2 - wi/2; | - | ||||||||||||||||||||||||
| 1784 | d = (wi + 1) / 2 - 1; | - | ||||||||||||||||||||||||
| 1785 | a.setPoints(5, x1,y1, x1,y2, x1+d,y2+d, x2,y2, x2,y1); | - | ||||||||||||||||||||||||
| 1786 | break; | - | ||||||||||||||||||||||||
| 1787 | case SlLeft: | - | ||||||||||||||||||||||||
| 1788 | d = (he + 1) / 2 - 1; | - | ||||||||||||||||||||||||
| 1789 | x1 = x1 + he/2; | - | ||||||||||||||||||||||||
| 1790 | a.setPoints(5, x1,y1, x1-d,y1+d, x1,y2, x2,y2, x2,y1); | - | ||||||||||||||||||||||||
| 1791 | break; | - | ||||||||||||||||||||||||
| 1792 | case SlRight: | - | ||||||||||||||||||||||||
| 1793 | d = (he + 1) / 2 - 1; | - | ||||||||||||||||||||||||
| 1794 | x2 = x2 - he/2; | - | ||||||||||||||||||||||||
| 1795 | a.setPoints(5, x1,y1, x1,y2, x2,y2, x2+d,y1+d, x2,y1); | - | ||||||||||||||||||||||||
| 1796 | break; | - | ||||||||||||||||||||||||
| 1797 | } | - | ||||||||||||||||||||||||
| 1798 | - | |||||||||||||||||||||||||
| 1799 | QBrush oldBrush = p->brush(); | - | ||||||||||||||||||||||||
| 1800 | bool oldQt4CompatiblePainting = p->testRenderHint(QPainter::Qt4CompatiblePainting); | - | ||||||||||||||||||||||||
| 1801 | p->setPen(Qt::NoPen); | - | ||||||||||||||||||||||||
| 1802 | p->setBrush(handleBrush); | - | ||||||||||||||||||||||||
| 1803 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - | ||||||||||||||||||||||||
| 1804 | Qt::BGMode oldMode = p->backgroundMode(); | - | ||||||||||||||||||||||||
| 1805 | p->setBackgroundMode(Qt::OpaqueMode); | - | ||||||||||||||||||||||||
| 1806 | p->drawRect(x1, y1, x2-x1+1, y2-y1+1); | - | ||||||||||||||||||||||||
| 1807 | p->drawPolygon(a); | - | ||||||||||||||||||||||||
| 1808 | p->setBrush(oldBrush); | - | ||||||||||||||||||||||||
| 1809 | p->setBackgroundMode(oldMode); | - | ||||||||||||||||||||||||
| 1810 | - | |||||||||||||||||||||||||
| 1811 | if (dir != SlUp) { | - | ||||||||||||||||||||||||
| 1812 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1813 | p->drawLine(x1, y1, x2, y1); | - | ||||||||||||||||||||||||
| 1814 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1815 | p->drawLine(x1, y1+1, x2, y1+1); | - | ||||||||||||||||||||||||
| 1816 | } | - | ||||||||||||||||||||||||
| 1817 | if (dir != SlLeft) { | - | ||||||||||||||||||||||||
| 1818 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1819 | p->drawLine(x1+1, y1+1, x1+1, y2); | - | ||||||||||||||||||||||||
| 1820 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1821 | p->drawLine(x1, y1, x1, y2); | - | ||||||||||||||||||||||||
| 1822 | } | - | ||||||||||||||||||||||||
| 1823 | if (dir != SlRight) { | - | ||||||||||||||||||||||||
| 1824 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1825 | p->drawLine(x2, y1, x2, y2); | - | ||||||||||||||||||||||||
| 1826 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1827 | p->drawLine(x2-1, y1+1, x2-1, y2-1); | - | ||||||||||||||||||||||||
| 1828 | } | - | ||||||||||||||||||||||||
| 1829 | if (dir != SlDown) { | - | ||||||||||||||||||||||||
| 1830 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1831 | p->drawLine(x1, y2, x2, y2); | - | ||||||||||||||||||||||||
| 1832 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1833 | p->drawLine(x1+1, y2-1, x2-1, y2-1); | - | ||||||||||||||||||||||||
| 1834 | } | - | ||||||||||||||||||||||||
| 1835 | - | |||||||||||||||||||||||||
| 1836 | switch (dir) { | - | ||||||||||||||||||||||||
| 1837 | case SlUp: | - | ||||||||||||||||||||||||
| 1838 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1839 | p->drawLine(x1, y1, x1+d, y1-d); | - | ||||||||||||||||||||||||
| 1840 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1841 | d = wi - d - 1; | - | ||||||||||||||||||||||||
| 1842 | p->drawLine(x2, y1, x2-d, y1-d); | - | ||||||||||||||||||||||||
| 1843 | d--; | - | ||||||||||||||||||||||||
| 1844 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1845 | p->drawLine(x1+1, y1, x1+1+d, y1-d); | - | ||||||||||||||||||||||||
| 1846 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1847 | p->drawLine(x2-1, y1, x2-1-d, y1-d); | - | ||||||||||||||||||||||||
| 1848 | break; | - | ||||||||||||||||||||||||
| 1849 | case SlDown: | - | ||||||||||||||||||||||||
| 1850 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1851 | p->drawLine(x1, y2, x1+d, y2+d); | - | ||||||||||||||||||||||||
| 1852 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1853 | d = wi - d - 1; | - | ||||||||||||||||||||||||
| 1854 | p->drawLine(x2, y2, x2-d, y2+d); | - | ||||||||||||||||||||||||
| 1855 | d--; | - | ||||||||||||||||||||||||
| 1856 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1857 | p->drawLine(x1+1, y2, x1+1+d, y2+d); | - | ||||||||||||||||||||||||
| 1858 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1859 | p->drawLine(x2-1, y2, x2-1-d, y2+d); | - | ||||||||||||||||||||||||
| 1860 | break; | - | ||||||||||||||||||||||||
| 1861 | case SlLeft: | - | ||||||||||||||||||||||||
| 1862 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1863 | p->drawLine(x1, y1, x1-d, y1+d); | - | ||||||||||||||||||||||||
| 1864 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1865 | d = he - d - 1; | - | ||||||||||||||||||||||||
| 1866 | p->drawLine(x1, y2, x1-d, y2-d); | - | ||||||||||||||||||||||||
| 1867 | d--; | - | ||||||||||||||||||||||||
| 1868 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1869 | p->drawLine(x1, y1+1, x1-d, y1+1+d); | - | ||||||||||||||||||||||||
| 1870 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1871 | p->drawLine(x1, y2-1, x1-d, y2-1-d); | - | ||||||||||||||||||||||||
| 1872 | break; | - | ||||||||||||||||||||||||
| 1873 | case SlRight: | - | ||||||||||||||||||||||||
| 1874 | p->setPen(c4); | - | ||||||||||||||||||||||||
| 1875 | p->drawLine(x2, y1, x2+d, y1+d); | - | ||||||||||||||||||||||||
| 1876 | p->setPen(c0); | - | ||||||||||||||||||||||||
| 1877 | d = he - d - 1; | - | ||||||||||||||||||||||||
| 1878 | p->drawLine(x2, y2, x2+d, y2-d); | - | ||||||||||||||||||||||||
| 1879 | d--; | - | ||||||||||||||||||||||||
| 1880 | p->setPen(c3); | - | ||||||||||||||||||||||||
| 1881 | p->drawLine(x2, y1+1, x2+d, y1+1+d); | - | ||||||||||||||||||||||||
| 1882 | p->setPen(c1); | - | ||||||||||||||||||||||||
| 1883 | p->drawLine(x2, y2-1, x2+d, y2-1-d); | - | ||||||||||||||||||||||||
| 1884 | break; | - | ||||||||||||||||||||||||
| 1885 | } | - | ||||||||||||||||||||||||
| 1886 | p->setRenderHint(QPainter::Qt4CompatiblePainting, oldQt4CompatiblePainting); | - | ||||||||||||||||||||||||
| 1887 | } | - | ||||||||||||||||||||||||
| 1888 | } | - | ||||||||||||||||||||||||
| 1889 | break; | - | ||||||||||||||||||||||||
| 1890 | - | |||||||||||||||||||||||||
| 1891 | - | |||||||||||||||||||||||||
| 1892 | case CC_ScrollBar: | - | ||||||||||||||||||||||||
| 1893 | if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { | - | ||||||||||||||||||||||||
| 1894 | QStyleOptionSlider newScrollbar = *scrollbar; | - | ||||||||||||||||||||||||
| 1895 | if (scrollbar->minimum == scrollbar->maximum) | - | ||||||||||||||||||||||||
| 1896 | newScrollbar.state &= ~State_Enabled; | - | ||||||||||||||||||||||||
| 1897 | QCommonStyle::drawComplexControl(cc, &newScrollbar, p, widget); | - | ||||||||||||||||||||||||
| 1898 | } | - | ||||||||||||||||||||||||
| 1899 | break; | - | ||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||
| 1901 | - | |||||||||||||||||||||||||
| 1902 | case CC_ComboBox: | - | ||||||||||||||||||||||||
| 1903 | if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { | - | ||||||||||||||||||||||||
| 1904 | QBrush editBrush = cmb->palette.brush(QPalette::Base); | - | ||||||||||||||||||||||||
| 1905 | if ((cmb->subControls & SC_ComboBoxFrame)) { | - | ||||||||||||||||||||||||
| 1906 | if (cmb->frame) { | - | ||||||||||||||||||||||||
| 1907 | QPalette shadePal = opt->palette; | - | ||||||||||||||||||||||||
| 1908 | shadePal.setColor(QPalette::Midlight, shadePal.button().color()); | - | ||||||||||||||||||||||||
| 1909 | qDrawWinPanel(p, opt->rect, shadePal, true, &editBrush); | - | ||||||||||||||||||||||||
| 1910 | } | - | ||||||||||||||||||||||||
| 1911 | else { | - | ||||||||||||||||||||||||
| 1912 | p->fillRect(opt->rect, editBrush); | - | ||||||||||||||||||||||||
| 1913 | } | - | ||||||||||||||||||||||||
| 1914 | } | - | ||||||||||||||||||||||||
| 1915 | if (cmb->subControls & SC_ComboBoxArrow) { | - | ||||||||||||||||||||||||
| 1916 | State flags = State_None; | - | ||||||||||||||||||||||||
| 1917 | - | |||||||||||||||||||||||||
| 1918 | QRect ar = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); | - | ||||||||||||||||||||||||
| 1919 | bool sunkenArrow = cmb->activeSubControls == SC_ComboBoxArrow | - | ||||||||||||||||||||||||
| 1920 | && cmb->state & State_Sunken; | - | ||||||||||||||||||||||||
| 1921 | if (sunkenArrow) { | - | ||||||||||||||||||||||||
| 1922 | p->setPen(cmb->palette.dark().color()); | - | ||||||||||||||||||||||||
| 1923 | p->setBrush(cmb->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1924 | p->drawRect(ar.adjusted(0,0,-1,-1)); | - | ||||||||||||||||||||||||
| 1925 | } else { | - | ||||||||||||||||||||||||
| 1926 | - | |||||||||||||||||||||||||
| 1927 | QPalette pal(cmb->palette); | - | ||||||||||||||||||||||||
| 1928 | pal.setColor(QPalette::Button, cmb->palette.light().color()); | - | ||||||||||||||||||||||||
| 1929 | pal.setColor(QPalette::Light, cmb->palette.button().color()); | - | ||||||||||||||||||||||||
| 1930 | qDrawWinButton(p, ar, pal, false, | - | ||||||||||||||||||||||||
| 1931 | &cmb->palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 1932 | } | - | ||||||||||||||||||||||||
| 1933 | - | |||||||||||||||||||||||||
| 1934 | ar.adjust(2, 2, -2, -2); | - | ||||||||||||||||||||||||
| 1935 | if (opt->state & State_Enabled) | - | ||||||||||||||||||||||||
| 1936 | flags |= State_Enabled; | - | ||||||||||||||||||||||||
| 1937 | if (opt->state & State_HasFocus) | - | ||||||||||||||||||||||||
| 1938 | flags |= State_HasFocus; | - | ||||||||||||||||||||||||
| 1939 | - | |||||||||||||||||||||||||
| 1940 | if (sunkenArrow) | - | ||||||||||||||||||||||||
| 1941 | flags |= State_Sunken; | - | ||||||||||||||||||||||||
| 1942 | QStyleOption arrowOpt = *cmb; | - | ||||||||||||||||||||||||
| 1943 | arrowOpt.rect = ar.adjusted(1, 1, -1, -1); | - | ||||||||||||||||||||||||
| 1944 | arrowOpt.state = flags; | - | ||||||||||||||||||||||||
| 1945 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); | - | ||||||||||||||||||||||||
| 1946 | } | - | ||||||||||||||||||||||||
| 1947 | - | |||||||||||||||||||||||||
| 1948 | if (cmb->subControls & SC_ComboBoxEditField) { | - | ||||||||||||||||||||||||
| 1949 | QRect re = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); | - | ||||||||||||||||||||||||
| 1950 | if (cmb->state & State_HasFocus && !cmb->editable) | - | ||||||||||||||||||||||||
| 1951 | p->fillRect(re.x(), re.y(), re.width(), re.height(), | - | ||||||||||||||||||||||||
| 1952 | cmb->palette.brush(QPalette::Highlight)); | - | ||||||||||||||||||||||||
| 1953 | - | |||||||||||||||||||||||||
| 1954 | if (cmb->state & State_HasFocus) { | - | ||||||||||||||||||||||||
| 1955 | p->setPen(cmb->palette.highlightedText().color()); | - | ||||||||||||||||||||||||
| 1956 | p->setBackground(cmb->palette.highlight()); | - | ||||||||||||||||||||||||
| 1957 | - | |||||||||||||||||||||||||
| 1958 | } else { | - | ||||||||||||||||||||||||
| 1959 | p->setPen(cmb->palette.text().color()); | - | ||||||||||||||||||||||||
| 1960 | p->setBackground(cmb->palette.background()); | - | ||||||||||||||||||||||||
| 1961 | } | - | ||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||
| 1963 | if (cmb->state & State_HasFocus && !cmb->editable) { | - | ||||||||||||||||||||||||
| 1964 | QStyleOptionFocusRect focus; | - | ||||||||||||||||||||||||
| 1965 | focus.QStyleOption::operator=(*cmb); | - | ||||||||||||||||||||||||
| 1966 | focus.rect = subElementRect(SE_ComboBoxFocusRect, cmb, widget); | - | ||||||||||||||||||||||||
| 1967 | focus.state |= State_FocusAtBorder; | - | ||||||||||||||||||||||||
| 1968 | focus.backgroundColor = cmb->palette.highlight().color(); | - | ||||||||||||||||||||||||
| 1969 | proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); | - | ||||||||||||||||||||||||
| 1970 | } | - | ||||||||||||||||||||||||
| 1971 | } | - | ||||||||||||||||||||||||
| 1972 | } | - | ||||||||||||||||||||||||
| 1973 | break; | - | ||||||||||||||||||||||||
| 1974 | - | |||||||||||||||||||||||||
| 1975 | - | |||||||||||||||||||||||||
| 1976 | case CC_SpinBox: | - | ||||||||||||||||||||||||
| 1977 | if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { | - | ||||||||||||||||||||||||
| 1978 | QStyleOptionSpinBox copy = *sb; | - | ||||||||||||||||||||||||
| 1979 | PrimitiveElement pe; | - | ||||||||||||||||||||||||
| 1980 | bool enabled = opt->state & State_Enabled; | - | ||||||||||||||||||||||||
| 1981 | if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) { | - | ||||||||||||||||||||||||
| 1982 | QBrush editBrush = sb->palette.brush(QPalette::Base); | - | ||||||||||||||||||||||||
| 1983 | QRect r = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget); | - | ||||||||||||||||||||||||
| 1984 | QPalette shadePal = sb->palette; | - | ||||||||||||||||||||||||
| 1985 | shadePal.setColor(QPalette::Midlight, shadePal.button().color()); | - | ||||||||||||||||||||||||
| 1986 | qDrawWinPanel(p, r, shadePal, true, &editBrush); | - | ||||||||||||||||||||||||
| 1987 | } | - | ||||||||||||||||||||||||
| 1988 | - | |||||||||||||||||||||||||
| 1989 | QPalette shadePal(opt->palette); | - | ||||||||||||||||||||||||
| 1990 | shadePal.setColor(QPalette::Button, opt->palette.light().color()); | - | ||||||||||||||||||||||||
| 1991 | shadePal.setColor(QPalette::Light, opt->palette.button().color()); | - | ||||||||||||||||||||||||
| 1992 | - | |||||||||||||||||||||||||
| 1993 | if (sb->subControls & SC_SpinBoxUp) { | - | ||||||||||||||||||||||||
| 1994 | copy.subControls = SC_SpinBoxUp; | - | ||||||||||||||||||||||||
| 1995 | QPalette pal2 = sb->palette; | - | ||||||||||||||||||||||||
| 1996 | if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)) { | - | ||||||||||||||||||||||||
| 1997 | pal2.setCurrentColorGroup(QPalette::Disabled); | - | ||||||||||||||||||||||||
| 1998 | copy.state &= ~State_Enabled; | - | ||||||||||||||||||||||||
| 1999 | } | - | ||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||
| 2001 | copy.palette = pal2; | - | ||||||||||||||||||||||||
| 2002 | - | |||||||||||||||||||||||||
| 2003 | if (sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken)) { | - | ||||||||||||||||||||||||
| 2004 | copy.state |= State_On; | - | ||||||||||||||||||||||||
| 2005 | copy.state |= State_Sunken; | - | ||||||||||||||||||||||||
| 2006 | } else { | - | ||||||||||||||||||||||||
| 2007 | copy.state |= State_Raised; | - | ||||||||||||||||||||||||
| 2008 | copy.state &= ~State_Sunken; | - | ||||||||||||||||||||||||
| 2009 | } | - | ||||||||||||||||||||||||
| 2010 | pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus | - | ||||||||||||||||||||||||
| 2011 | : PE_IndicatorSpinUp); | - | ||||||||||||||||||||||||
| 2012 | - | |||||||||||||||||||||||||
| 2013 | copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); | - | ||||||||||||||||||||||||
| 2014 | qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 2015 | ©.palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 2016 | copy.rect.adjust(4, 1, -5, -1); | - | ||||||||||||||||||||||||
| 2017 | if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)) | - | ||||||||||||||||||||||||
| 2018 | && proxy()->styleHint(SH_EtchDisabledText, opt, widget) ) | - | ||||||||||||||||||||||||
| 2019 | { | - | ||||||||||||||||||||||||
| 2020 | QStyleOptionSpinBox lightCopy = copy; | - | ||||||||||||||||||||||||
| 2021 | lightCopy.rect.adjust(1, 1, 1, 1); | - | ||||||||||||||||||||||||
| 2022 | lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); | - | ||||||||||||||||||||||||
| 2023 | proxy()->drawPrimitive(pe, &lightCopy, p, widget); | - | ||||||||||||||||||||||||
| 2024 | } | - | ||||||||||||||||||||||||
| 2025 | proxy()->drawPrimitive(pe, ©, p, widget); | - | ||||||||||||||||||||||||
| 2026 | } | - | ||||||||||||||||||||||||
| 2027 | - | |||||||||||||||||||||||||
| 2028 | if (sb->subControls & SC_SpinBoxDown) { | - | ||||||||||||||||||||||||
| 2029 | copy.subControls = SC_SpinBoxDown; | - | ||||||||||||||||||||||||
| 2030 | copy.state = sb->state; | - | ||||||||||||||||||||||||
| 2031 | QPalette pal2 = sb->palette; | - | ||||||||||||||||||||||||
| 2032 | if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)) { | - | ||||||||||||||||||||||||
| 2033 | pal2.setCurrentColorGroup(QPalette::Disabled); | - | ||||||||||||||||||||||||
| 2034 | copy.state &= ~State_Enabled; | - | ||||||||||||||||||||||||
| 2035 | } | - | ||||||||||||||||||||||||
| 2036 | copy.palette = pal2; | - | ||||||||||||||||||||||||
| 2037 | - | |||||||||||||||||||||||||
| 2038 | if (sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken)) { | - | ||||||||||||||||||||||||
| 2039 | copy.state |= State_On; | - | ||||||||||||||||||||||||
| 2040 | copy.state |= State_Sunken; | - | ||||||||||||||||||||||||
| 2041 | } else { | - | ||||||||||||||||||||||||
| 2042 | copy.state |= State_Raised; | - | ||||||||||||||||||||||||
| 2043 | copy.state &= ~State_Sunken; | - | ||||||||||||||||||||||||
| 2044 | } | - | ||||||||||||||||||||||||
| 2045 | pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus | - | ||||||||||||||||||||||||
| 2046 | : PE_IndicatorSpinDown); | - | ||||||||||||||||||||||||
| 2047 | - | |||||||||||||||||||||||||
| 2048 | copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); | - | ||||||||||||||||||||||||
| 2049 | qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), | - | ||||||||||||||||||||||||
| 2050 | ©.palette.brush(QPalette::Button)); | - | ||||||||||||||||||||||||
| 2051 | copy.rect.adjust(4, 0, -5, -1); | - | ||||||||||||||||||||||||
| 2052 | if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)) | - | ||||||||||||||||||||||||
| 2053 | && proxy()->styleHint(SH_EtchDisabledText, opt, widget) ) | - | ||||||||||||||||||||||||
| 2054 | { | - | ||||||||||||||||||||||||
| 2055 | QStyleOptionSpinBox lightCopy = copy; | - | ||||||||||||||||||||||||
| 2056 | lightCopy.rect.adjust(1, 1, 1, 1); | - | ||||||||||||||||||||||||
| 2057 | lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); | - | ||||||||||||||||||||||||
| 2058 | proxy()->drawPrimitive(pe, &lightCopy, p, widget); | - | ||||||||||||||||||||||||
| 2059 | } | - | ||||||||||||||||||||||||
| 2060 | proxy()->drawPrimitive(pe, ©, p, widget); | - | ||||||||||||||||||||||||
| 2061 | } | - | ||||||||||||||||||||||||
| 2062 | } | - | ||||||||||||||||||||||||
| 2063 | break; | - | ||||||||||||||||||||||||
| 2064 | - | |||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||
| 2066 | default: | - | ||||||||||||||||||||||||
| 2067 | QCommonStyle::drawComplexControl(cc, opt, p, widget); | - | ||||||||||||||||||||||||
| 2068 | } | - | ||||||||||||||||||||||||
| 2069 | } | - | ||||||||||||||||||||||||
| 2070 | - | |||||||||||||||||||||||||
| 2071 | - | |||||||||||||||||||||||||
| 2072 | QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, | - | ||||||||||||||||||||||||
| 2073 | const QSize &csz, const QWidget *widget) const | - | ||||||||||||||||||||||||
| 2074 | { | - | ||||||||||||||||||||||||
| 2075 | QSize sz(csz); | - | ||||||||||||||||||||||||
| 2076 | switch (ct) { | - | ||||||||||||||||||||||||
| 2077 | case CT_PushButton: | - | ||||||||||||||||||||||||
| 2078 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { | - | ||||||||||||||||||||||||
| 2079 | sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); | - | ||||||||||||||||||||||||
| 2080 | int w = sz.width(), | - | ||||||||||||||||||||||||
| 2081 | h = sz.height(); | - | ||||||||||||||||||||||||
| 2082 | int defwidth = 0; | - | ||||||||||||||||||||||||
| 2083 | if (btn->features & QStyleOptionButton::AutoDefaultButton) | - | ||||||||||||||||||||||||
| 2084 | defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); | - | ||||||||||||||||||||||||
| 2085 | int minwidth = int(QStyleHelper::dpiScaled(75.)); | - | ||||||||||||||||||||||||
| 2086 | int minheight = int(QStyleHelper::dpiScaled(23.)); | - | ||||||||||||||||||||||||
| 2087 | - | |||||||||||||||||||||||||
| 2088 | - | |||||||||||||||||||||||||
| 2089 | if (w < minwidth + defwidth && !btn->text.isEmpty()) | - | ||||||||||||||||||||||||
| 2090 | w = minwidth + defwidth; | - | ||||||||||||||||||||||||
| 2091 | if (h < minheight + defwidth) | - | ||||||||||||||||||||||||
| 2092 | h = minheight + defwidth; | - | ||||||||||||||||||||||||
| 2093 | - | |||||||||||||||||||||||||
| 2094 | sz = QSize(w, h); | - | ||||||||||||||||||||||||
| 2095 | } | - | ||||||||||||||||||||||||
| 2096 | break; | - | ||||||||||||||||||||||||
| 2097 | - | |||||||||||||||||||||||||
| 2098 | case CT_MenuItem: | - | ||||||||||||||||||||||||
| 2099 | if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { | - | ||||||||||||||||||||||||
| 2100 | int w = sz.width(); | - | ||||||||||||||||||||||||
| 2101 | sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); | - | ||||||||||||||||||||||||
| 2102 | - | |||||||||||||||||||||||||
| 2103 | if (mi->menuItemType == QStyleOptionMenuItem::Separator) { | - | ||||||||||||||||||||||||
| 2104 | sz = QSize(10, QWindowsStylePrivate::windowsSepHeight); | - | ||||||||||||||||||||||||
| 2105 | } | - | ||||||||||||||||||||||||
| 2106 | else if (mi->icon.isNull()) { | - | ||||||||||||||||||||||||
| 2107 | sz.setHeight(sz.height() - 2); | - | ||||||||||||||||||||||||
| 2108 | w -= 6; | - | ||||||||||||||||||||||||
| 2109 | } | - | ||||||||||||||||||||||||
| 2110 | - | |||||||||||||||||||||||||
| 2111 | if (mi->menuItemType != QStyleOptionMenuItem::Separator && !mi->icon.isNull()) { | - | ||||||||||||||||||||||||
| 2112 | int iconExtent = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); | - | ||||||||||||||||||||||||
| 2113 | sz.setHeight(qMax(sz.height(), | - | ||||||||||||||||||||||||
| 2114 | mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() | - | ||||||||||||||||||||||||
| 2115 | + 2 * QWindowsStylePrivate::windowsItemFrame)); | - | ||||||||||||||||||||||||
| 2116 | } | - | ||||||||||||||||||||||||
| 2117 | int maxpmw = mi->maxIconWidth; | - | ||||||||||||||||||||||||
| 2118 | int tabSpacing = 20; | - | ||||||||||||||||||||||||
| 2119 | if (mi->text.contains(QLatin1Char('\t'))) | - | ||||||||||||||||||||||||
| 2120 | w += tabSpacing; | - | ||||||||||||||||||||||||
| 2121 | else if (mi->menuItemType == QStyleOptionMenuItem::SubMenu) | - | ||||||||||||||||||||||||
| 2122 | w += 2 * QWindowsStylePrivate::windowsArrowHMargin; | - | ||||||||||||||||||||||||
| 2123 | else if (mi->menuItemType == QStyleOptionMenuItem::DefaultItem) { | - | ||||||||||||||||||||||||
| 2124 | - | |||||||||||||||||||||||||
| 2125 | - | |||||||||||||||||||||||||
| 2126 | QFontMetrics fm(mi->font); | - | ||||||||||||||||||||||||
| 2127 | QFont fontBold = mi->font; | - | ||||||||||||||||||||||||
| 2128 | fontBold.setBold(true); | - | ||||||||||||||||||||||||
| 2129 | QFontMetrics fmBold(fontBold); | - | ||||||||||||||||||||||||
| 2130 | w += fmBold.width(mi->text) - fm.width(mi->text); | - | ||||||||||||||||||||||||
| 2131 | } | - | ||||||||||||||||||||||||
| 2132 | - | |||||||||||||||||||||||||
| 2133 | int checkcol = qMax<int>(maxpmw, QWindowsStylePrivate::windowsCheckMarkWidth); | - | ||||||||||||||||||||||||
| 2134 | w += checkcol; | - | ||||||||||||||||||||||||
| 2135 | w += int(QWindowsStylePrivate::windowsRightBorder) + 10; | - | ||||||||||||||||||||||||
| 2136 | sz.setWidth(w); | - | ||||||||||||||||||||||||
| 2137 | } | - | ||||||||||||||||||||||||
| 2138 | break; | - | ||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||
| 2140 | - | |||||||||||||||||||||||||
| 2141 | case CT_MenuBarItem: | - | ||||||||||||||||||||||||
| 2142 | if (!sz.isEmpty()) | - | ||||||||||||||||||||||||
| 2143 | sz += QSize(QWindowsStylePrivate::windowsItemHMargin * 4, QWindowsStylePrivate::windowsItemVMargin * 2); | - | ||||||||||||||||||||||||
| 2144 | break; | - | ||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||
| 2146 | case CT_ToolButton: | - | ||||||||||||||||||||||||
| 2147 | if (qstyleoption_cast<const QStyleOptionToolButton *>(opt)) | - | ||||||||||||||||||||||||
| 2148 | return sz += QSize(7, 6); | - | ||||||||||||||||||||||||
| 2149 | - | |||||||||||||||||||||||||
| 2150 | - | |||||||||||||||||||||||||
| 2151 | default: | - | ||||||||||||||||||||||||
| 2152 | sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); | - | ||||||||||||||||||||||||
| 2153 | } | - | ||||||||||||||||||||||||
| 2154 | return sz; | - | ||||||||||||||||||||||||
| 2155 | } | - | ||||||||||||||||||||||||
| 2156 | - | |||||||||||||||||||||||||
| 2157 | - | |||||||||||||||||||||||||
| 2158 | - | |||||||||||||||||||||||||
| 2159 | - | |||||||||||||||||||||||||
| 2160 | QIcon QWindowsStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, | - | ||||||||||||||||||||||||
| 2161 | const QWidget *widget) const | - | ||||||||||||||||||||||||
| 2162 | { | - | ||||||||||||||||||||||||
| 2163 | return QCommonStyle::standardIcon(standardIcon, option, widget); | - | ||||||||||||||||||||||||
| 2164 | } | - | ||||||||||||||||||||||||
| 2165 | - | |||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||
| 2167 | - | |||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||
| 2169 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |