Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qscrollbar.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qapplication.h"
5#include "qcursor.h"
6#include "qevent.h"
7#include "qpainter.h"
8#include "qscrollbar.h"
9#include "qstyle.h"
10#include "qstyleoption.h"
11#include "qstylepainter.h"
12#if QT_CONFIG(menu)
13#include "qmenu.h"
14#endif
15#include <QtCore/qelapsedtimer.h>
16
17#if QT_CONFIG(accessibility)
18#include "qaccessible.h"
19#endif
20#include <limits.h>
21#include "qscrollbar_p.h"
22
24
159{
160 Q_Q(QScrollBar);
161 QRect lastHoverRect = hoverRect;
162 QStyle::SubControl lastHoverControl = hoverControl;
163 bool doesHover = q->testAttribute(Qt::WA_Hover);
164 if (lastHoverControl != newHoverControl(pos) && doesHover) {
165 q->update(lastHoverRect);
166 q->update(hoverRect);
167 return true;
168 }
169 return !doesHover;
170}
171
173{
174 Q_Q(QScrollBar);
175 QStyleOptionSlider opt;
176 q->initStyleOption(&opt);
177 opt.subControls = QStyle::SC_All;
178 hoverControl = q->style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, pos, q);
180 hoverRect = QRect();
181 else
182 hoverRect = q->style()->subControlRect(QStyle::CC_ScrollBar, &opt, hoverControl, q);
183 return hoverControl;
184}
185
187{
188 Q_Q(QScrollBar);
189 if (transient != value) {
191 if (q->isVisible()) {
192 QStyleOptionSlider opt;
193 q->initStyleOption(&opt);
194 if (q->style()->styleHint(QStyle::SH_ScrollBar_Transient, &opt, q))
195 q->update();
196 } else if (!transient) {
197 q->show();
198 }
199 }
200}
201
203{
204 Q_Q(QScrollBar);
205 QStyleOptionSlider opt;
206 q->initStyleOption(&opt);
207 if (!flashed && q->style()->styleHint(QStyle::SH_ScrollBar_Transient, &opt, q)) {
208 flashed = true;
209 if (!q->isVisible())
210 q->show();
211 else
212 q->update();
213 }
214 if (!flashTimer)
215 flashTimer = q->startTimer(0);
216}
217
218void QScrollBarPrivate::activateControl(uint control, int threshold)
219{
221 switch (control) {
224 break;
227 break;
230 break;
233 break;
236 break;
239 break;
240 default:
241 break;
242 }
243
244 if (action) {
245 q_func()->setRepeatAction(action, threshold);
246 q_func()->triggerAction(action);
247 }
248}
249
251{
252 Q_Q(QScrollBar);
254 q->setRepeatAction(QAbstractSlider::SliderNoAction);
256
258 q->setSliderDown(false);
259
260 QStyleOptionSlider opt;
261 q->initStyleOption(&opt);
262 q->repaint(q->style()->subControlRect(QStyle::CC_ScrollBar, &opt, tmp, q));
263}
264
272void QScrollBar::initStyleOption(QStyleOptionSlider *option) const
273{
274 if (!option)
275 return;
276
277 Q_D(const QScrollBar);
278 option->initFrom(this);
279 option->subControls = QStyle::SC_None;
280 option->activeSubControls = QStyle::SC_None;
281 option->orientation = d->orientation;
282 option->minimum = d->minimum;
283 option->maximum = d->maximum;
284 option->sliderPosition = d->position;
285 option->sliderValue = d->value;
286 option->singleStep = d->singleStep;
287 option->pageStep = d->pageStep;
288 option->upsideDown = d->invertedAppearance;
289 if (d->orientation == Qt::Horizontal)
291 if ((d->flashed || !d->transient) && style()->styleHint(QStyle::SH_ScrollBar_Transient, option, this))
292 option->state |= QStyle::State_On;
293}
294
295
296#define HORIZONTAL (d_func()->orientation == Qt::Horizontal)
297#define VERTICAL !HORIZONTAL
298
311 : QScrollBar(Qt::Vertical, parent)
312{
313}
314
328{
329 d_func()->orientation = orientation;
330 d_func()->init();
331}
332
333
334
339{
340}
341
343{
344 Q_Q(QScrollBar);
345 invertedControls = true;
349 opt.initFrom(q);
350 transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, &opt, q);
351 flashed = false;
352 flashTimer = 0;
353 q->setFocusPolicy(Qt::NoFocus);
356 sp.transpose();
357 q->setSizePolicy(sp);
358 q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
359 q->setAttribute(Qt::WA_OpaquePaintEvent);
360}
361
362#ifndef QT_NO_CONTEXTMENU
365{
366 if (!style()->styleHint(QStyle::SH_ScrollBar_ContextMenu, nullptr, this)) {
368 return ;
369 }
370
371#if QT_CONFIG(menu)
372 bool horiz = HORIZONTAL;
373 QPointer<QMenu> menu = new QMenu(this);
374 QAction *actScrollHere = menu->addAction(tr("Scroll here"));
376 QAction *actScrollTop = menu->addAction(horiz ? tr("Left edge") : tr("Top"));
377 QAction *actScrollBottom = menu->addAction(horiz ? tr("Right edge") : tr("Bottom"));
379 QAction *actPageUp = menu->addAction(horiz ? tr("Page left") : tr("Page up"));
380 QAction *actPageDn = menu->addAction(horiz ? tr("Page right") : tr("Page down"));
382 QAction *actScrollUp = menu->addAction(horiz ? tr("Scroll left") : tr("Scroll up"));
383 QAction *actScrollDn = menu->addAction(horiz ? tr("Scroll right") : tr("Scroll down"));
384 QAction *actionSelected = menu->exec(event->globalPos());
385 delete menu;
386 if (actionSelected == nullptr)
387 /* do nothing */ ;
388 else if (actionSelected == actScrollHere)
389 setValue(d_func()->pixelPosToRangeValue(horiz ? event->pos().x() : event->pos().y()));
390 else if (actionSelected == actScrollTop)
392 else if (actionSelected == actScrollBottom)
394 else if (actionSelected == actPageUp)
396 else if (actionSelected == actPageDn)
398 else if (actionSelected == actScrollUp)
400 else if (actionSelected == actScrollDn)
402#endif // QT_CONFIG(menu)
403}
404#endif // QT_NO_CONTEXTMENU
405
406
409{
411 QStyleOptionSlider opt;
413
414 int scrollBarExtent = style()->pixelMetric(QStyle::PM_ScrollBarExtent, &opt, this);
415 int scrollBarSliderMin = style()->pixelMetric(QStyle::PM_ScrollBarSliderMin, &opt, this);
416 QSize size;
417 if (opt.orientation == Qt::Horizontal)
418 size = QSize(scrollBarExtent * 2 + scrollBarSliderMin, scrollBarExtent);
419 else
420 size = QSize(scrollBarExtent, scrollBarExtent * 2 + scrollBarSliderMin);
421
423 }
424
427{
429}
430
435{
436 Q_D(QScrollBar);
437 switch(event->type()) {
441 if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
442 d_func()->updateHoverControl(he->position().toPoint());
443 break;
444 case QEvent::StyleChange: {
445 QStyleOptionSlider opt;
447 d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient, &opt, this));
448 break;
449 }
450 case QEvent::Timer:
451 if (static_cast<QTimerEvent *>(event)->timerId() == d->flashTimer) {
452 QStyleOptionSlider opt;
454 if (d->flashed && style()->styleHint(QStyle::SH_ScrollBar_Transient, &opt, this)) {
455 d->flashed = false;
456 update();
457 }
458 killTimer(d->flashTimer);
459 d->flashTimer = 0;
460 }
461 break;
462 default:
463 break;
464 }
466}
467
471#if QT_CONFIG(wheelevent)
472void QScrollBar::wheelEvent(QWheelEvent *event)
473{
474 event->ignore();
475 bool horizontal = qAbs(event->angleDelta().x()) > qAbs(event->angleDelta().y());
476 // The vertical wheel can be used to scroll a horizontal scrollbar, but only if
477 // there is no simultaneous horizontal wheel movement. This is to avoid chaotic
478 // scrolling on touchpads.
479 if (!horizontal && event->angleDelta().x() != 0 && orientation() == Qt::Horizontal)
480 return;
481 // scrollbar is a special case - in vertical mode it reaches minimum
482 // value in the upper position, however QSlider's minimum value is on
483 // the bottom. So we need to invert the value, but since the scrollbar is
484 // inverted by default, we need to invert the delta value only for the
485 // horizontal orientation.
486 int delta = horizontal ? -event->angleDelta().x() : event->angleDelta().y();
487 Q_D(QScrollBar);
488 if (d->scrollByDelta(horizontal ? Qt::Horizontal : Qt::Vertical, event->modifiers(), delta))
489 event->accept();
490
491 if (event->phase() == Qt::ScrollBegin)
492 d->setTransient(false);
493 else if (event->phase() == Qt::ScrollEnd)
494 d->setTransient(true);
495}
496#endif
497
502{
503 Q_D(QScrollBar);
504 QStylePainter p(this);
505 QStyleOptionSlider opt;
507 opt.subControls = QStyle::SC_All;
508 if (d->pressedControl) {
509 opt.activeSubControls = (QStyle::SubControl)d->pressedControl;
510 if (!d->pointerOutsidePressedControl)
512 } else {
513 opt.activeSubControls = (QStyle::SubControl)d->hoverControl;
514 }
515 p.drawComplexControl(QStyle::CC_ScrollBar, opt);
516}
517
522{
523 Q_D(QScrollBar);
524
525 if (d->repeatActionTimer.isActive())
526 d->stopRepeatAction();
527
529 nullptr, this);
530 QStyleOptionSlider opt;
532 opt.keyboardModifiers = e->modifiers();
533
534 if (d->maximum == d->minimum // no range
535 || (e->buttons() & (~e->button())) // another button was clicked before
536 || !(e->button() == Qt::LeftButton || (midButtonAbsPos && e->button() == Qt::MiddleButton)))
537 return;
538
539 d->pressedControl = style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, e->position().toPoint(), this);
540 d->pointerOutsidePressedControl = false;
541
544 QPoint click = e->position().toPoint();
545 QPoint pressValue = click - sr.center() + sr.topLeft();
546 d->pressValue = d->orientation == Qt::Horizontal ? d->pixelPosToRangeValue(pressValue.x()) :
547 d->pixelPosToRangeValue(pressValue.y());
548 if (d->pressedControl == QStyle::SC_ScrollBarSlider) {
549 d->clickOffset = HORIZONTAL ? (click.x()-sr.x()) : (click.y()-sr.y());
550 d->snapBackPosition = d->position;
551 }
552
553 if ((d->pressedControl == QStyle::SC_ScrollBarAddPage
554 || d->pressedControl == QStyle::SC_ScrollBarSubPage)
555 && ((midButtonAbsPos && e->button() == Qt::MiddleButton)
557 && e->button() == Qt::LeftButton))) {
558 int sliderLength = HORIZONTAL ? sr.width() : sr.height();
559 setSliderPosition(d->pixelPosToRangeValue((HORIZONTAL ? e->position().toPoint().x()
560 : e->position().toPoint().y()) - sliderLength / 2));
561 d->pressedControl = QStyle::SC_ScrollBarSlider;
562 d->clickOffset = sliderLength / 2;
563 }
564 const int initialDelay = 500; // default threshold
566 time.start();
567 d->activateControl(d->pressedControl, initialDelay);
568 repaint(style()->subControlRect(QStyle::CC_ScrollBar, &opt, d->pressedControl, this));
569 if (time.elapsed() >= initialDelay && d->repeatActionTimer.isActive()) {
570 // It took more than 500ms (the initial timer delay) to process
571 // the control activation and repaint(), we therefore need
572 // to restart the timer in case we have a pending mouse release event;
573 // otherwise we'll get a timer event right before the release event,
574 // causing the repeat action to be invoked twice on a single mouse click.
575 // 50ms is the default repeat time (see activateControl/setRepeatAction).
576 d->repeatActionTimer.start(50, this);
577 }
578 if (d->pressedControl == QStyle::SC_ScrollBarSlider)
579 setSliderDown(true);
580}
581
582
587{
588 Q_D(QScrollBar);
589 if (!d->pressedControl)
590 return;
591
592 if (e->buttons() & (~e->button())) // some other button is still pressed
593 return;
594
595 d->stopRepeatAction();
596}
597
598
603{
604 Q_D(QScrollBar);
605 if (!d->pressedControl)
606 return;
607
608 QStyleOptionSlider opt;
610 if (!(e->buttons() & Qt::LeftButton
611 || ((e->buttons() & Qt::MiddleButton)
613 return;
614
615 if (d->pressedControl == QStyle::SC_ScrollBarSlider) {
616 QPoint click = e->position().toPoint();
617 int newPosition = d->pixelPosToRangeValue((HORIZONTAL ? click.x() : click.y()) -d->clickOffset);
619 if (m >= 0) {
620 QRect r = rect();
621 r.adjust(-m, -m, m, m);
622 if (! r.contains(e->position().toPoint()))
623 newPosition = d->snapBackPosition;
624 }
625 setSliderPosition(newPosition);
626 } else if (!style()->styleHint(QStyle::SH_ScrollBar_ScrollWhenPointerLeavesControl, &opt, this)) {
627
628 if (style()->styleHint(QStyle::SH_ScrollBar_RollBetweenButtons, &opt, this)
630 QStyle::SubControl newSc = style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, e->position().toPoint(), this);
631 if (newSc == d->pressedControl && !d->pointerOutsidePressedControl)
632 return; // nothing to do
634 d->pointerOutsidePressedControl = false;
635 QRect scRect = style()->subControlRect(QStyle::CC_ScrollBar, &opt, newSc, this);
636 scRect |= style()->subControlRect(QStyle::CC_ScrollBar, &opt, d->pressedControl, this);
637 d->pressedControl = newSc;
638 d->activateControl(d->pressedControl, 0);
639 update(scRect);
640 return;
641 }
642 }
643
644 // stop scrolling when the mouse pointer leaves a control
645 // similar to push buttons
646 QRect pr = style()->subControlRect(QStyle::CC_ScrollBar, &opt, d->pressedControl, this);
647 if (pr.contains(e->position().toPoint()) == d->pointerOutsidePressedControl) {
648 if ((d->pointerOutsidePressedControl = !d->pointerOutsidePressedControl)) {
649 d->pointerOutsidePressedControl = true;
651 repaint(pr);
652 } else {
653 d->activateControl(d->pressedControl);
654 }
655 }
656 }
657}
658
659
661{
662 Q_Q(const QScrollBar);
663 QStyleOptionSlider opt;
664 q->initStyleOption(&opt);
665 QRect gr = q->style()->subControlRect(QStyle::CC_ScrollBar, &opt,
667 QRect sr = q->style()->subControlRect(QStyle::CC_ScrollBar, &opt,
669 int sliderMin, sliderMax, sliderLength;
670
672 sliderLength = sr.width();
673 sliderMin = gr.x();
674 sliderMax = gr.right() - sliderLength + 1;
675 if (q->layoutDirection() == Qt::RightToLeft)
676 opt.upsideDown = !opt.upsideDown;
677 } else {
678 sliderLength = sr.height();
679 sliderMin = gr.y();
680 sliderMax = gr.bottom() - sliderLength + 1;
681 }
682
684 sliderMax - sliderMin, opt.upsideDown);
685}
686
690{
691 Q_D(QScrollBar);
692 if (d->pressedControl) {
693 d->pressedControl = QStyle::SC_None;
695 }
696}
697
701Q_WIDGETS_EXPORT QStyleOptionSlider qt_qscrollbarStyleOption(QScrollBar *scrollbar)
702{
703 QStyleOptionSlider opt;
704 scrollbar->initStyleOption(&opt);
705 return opt;
706}
707
709
710#include "moc_qscrollbar.cpp"
Qt::Orientation orientation
The QAbstractSlider class provides an integer value within a range.
void setRepeatAction(SliderAction action, int thresholdTime=500, int repeatTime=50)
Sets action action to be triggered repetitively in intervals of repeatTime, after an initial delay of...
virtual void sliderChange(SliderChange change)
Reimplement this virtual function to track slider changes such as \l SliderRangeChange,...
SliderAction
\value SliderNoAction \value SliderSingleStepAdd \value SliderSingleStepSub \value SliderPageStepAdd ...
Qt::Orientation orientation
the orientation of the slider
bool event(QEvent *e) override
\reimp
void setSliderPosition(int)
SliderChange
\value SliderRangeChange \value SliderOrientationChange \value SliderStepsChange \value SliderValueCh...
void triggerAction(SliderAction action)
Triggers a slider action.
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:593
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:45
@ StyleChange
Definition qcoreevent.h:136
@ HoverLeave
Definition qcoreevent.h:176
@ HoverEnter
Definition qcoreevent.h:175
@ HoverMove
Definition qcoreevent.h:177
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:585
\inmodule QtGui
Definition qevent.h:245
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
QAction * exec()
Executes this menu synchronously.
Definition qmenu.cpp:2586
QAction * addSeparator()
This convenience function creates a new separator action, i.e.
Definition qmenu.cpp:1899
void addAction(QAction *action)
Appends the action action to this widget's list of actions.
Definition qwidget.cpp:3124
\inmodule QtGui
Definition qevent.h:195
void killTimer(int id)
Kills the timer with timer identifier, id.
Definition qobject.cpp:1872
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:485
\inmodule QtCore\reentrant
Definition qpoint.h:23
constexpr int x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:127
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:132
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr int height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:238
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
Definition qrect.h:181
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:220
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qrect.cpp:851
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
Definition qrect.h:184
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:235
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
Definition qrect.h:187
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
Definition qrect.h:232
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
Definition qrect.h:178
QStyle::SubControl newHoverControl(const QPoint &pos)
void activateControl(uint control, int threshold=500)
void setTransient(bool value)
QStyle::SubControl pressedControl
QStyle::SubControl hoverControl
bool pointerOutsidePressedControl
int pixelPosToRangeValue(int pos) const
bool updateHoverControl(const QPoint &pos)
The QScrollBar widget provides a vertical or horizontal scroll bar.
Definition qscrollbar.h:20
~QScrollBar()
Destroys the scroll bar.
QScrollBar(QWidget *parent=nullptr)
Constructs a vertical scroll bar.
void paintEvent(QPaintEvent *) override
\reimp
void contextMenuEvent(QContextMenuEvent *) override
\reimp
virtual void initStyleOption(QStyleOptionSlider *option) const
Initialize option with the values from this QScrollBar.
bool event(QEvent *event) override
\reimp
void mouseReleaseEvent(QMouseEvent *) override
\reimp
void hideEvent(QHideEvent *) override
\reimp
void mousePressEvent(QMouseEvent *) override
\reimp
void sliderChange(SliderChange change) override
\reimp
void mouseMoveEvent(QMouseEvent *) override
\reimp
QSize sizeHint() const override
\reimp
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
Definition qsizepolicy.h:18
\inmodule QtCore
Definition qsize.h:25
The QStyleOption class stores the parameters used by QStyle functions.
QStyle::State state
void initFrom(const QWidget *w)
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
@ State_Sunken
Definition qstyle.h:69
@ State_Horizontal
Definition qstyle.h:74
@ State_On
Definition qstyle.h:72
@ CT_ScrollBar
Definition qstyle.h:558
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_ScrollBar_RollBetweenButtons
Definition qstyle.h:646
@ SH_ScrollBar_Transient
Definition qstyle.h:679
@ SH_ScrollBar_MiddleClickAbsolutePosition
Definition qstyle.h:585
@ SH_ScrollBar_LeftClickAbsolutePosition
Definition qstyle.h:622
@ SH_ScrollBar_ContextMenu
Definition qstyle.h:645
@ SH_ScrollBar_ScrollWhenPointerLeavesControl
Definition qstyle.h:586
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=nullptr) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
@ PM_ScrollBarExtent
Definition qstyle.h:426
@ PM_MaximumDragDistance
Definition qstyle.h:424
@ PM_ScrollBarSliderMin
Definition qstyle.h:427
static int sliderValueFromPosition(int min, int max, int pos, int space, bool upsideDown=false)
Converts the given pixel position to a logical value.
Definition qstyle.cpp:2268
@ CC_ScrollBar
Definition qstyle.h:334
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
SubControl
This enum describes the available sub controls.
Definition qstyle.h:347
@ SC_ScrollBarSubLine
Definition qstyle.h:351
@ SC_ScrollBarAddPage
Definition qstyle.h:352
@ SC_ScrollBarLast
Definition qstyle.h:355
@ SC_ScrollBarAddLine
Definition qstyle.h:350
@ SC_ScrollBarGroove
Definition qstyle.h:357
@ SC_ScrollBarFirst
Definition qstyle.h:354
@ SC_All
Definition qstyle.h:400
@ SC_ScrollBarSlider
Definition qstyle.h:356
@ SC_ScrollBarSubPage
Definition qstyle.h:353
@ SC_None
Definition qstyle.h:348
\inmodule QtCore
Definition qcoreevent.h:359
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void repaint()
Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the ...
QSize size
the size of the widget excluding any window frame
Definition qwidget.h:113
QRect rect
the internal geometry of the widget excluding any window frame
Definition qwidget.h:116
void ensurePolished() const
Ensures that the widget and its children have been polished by QStyle (i.e., have a proper font and p...
void update()
Updates the widget unless updates are disabled or the widget is hidden.
QStyle * style() const
Definition qwidget.cpp:2607
virtual void contextMenuEvent(QContextMenuEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive widget context men...
Definition qwidget.cpp:9921
EGLImageKHR int int EGLuint64KHR * modifiers
double e
QStyleOptionButton opt
Combined button and popup list for selecting options.
@ LeftButton
Definition qnamespace.h:57
@ MiddleButton
Definition qnamespace.h:59
@ WA_Hover
Definition qnamespace.h:339
@ WA_WState_OwnSizePolicy
Definition qnamespace.h:333
@ WA_OpaquePaintEvent
Definition qnamespace.h:286
@ RightToLeft
@ NoFocus
Definition qnamespace.h:106
Orientation
Definition qnamespace.h:97
@ Horizontal
Definition qnamespace.h:98
@ Vertical
Definition qnamespace.h:99
@ ScrollBegin
@ ScrollEnd
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qAbs(const T &t)
Definition qnumeric.h:328
const GLfloat * m
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLboolean r
[2]
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
GLuint GLenum option
Q_WIDGETS_EXPORT QStyleOptionSlider qt_qscrollbarStyleOption(QScrollBar *scrollbar)
#define HORIZONTAL
#define sp
#define tr(X)
unsigned int uint
Definition qtypes.h:29
QMenu menu
[5]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent