Qt 4.8
Public Functions | Public Variables | List of all members
QAbstractButtonPrivate Class Reference

#include <qabstractbutton_p.h>

Inheritance diagram for QAbstractButtonPrivate:
QWidgetPrivate QObjectPrivate QObjectData QCheckBoxPrivate QPushButtonPrivate QRadioButtonPrivate QToolButtonPrivate QCommandLinkButtonPrivate

Public Functions

void click ()
 
void emitClicked ()
 
void emitPressed ()
 
void emitReleased ()
 
void fixFocusPolicy ()
 
void init ()
 
void moveFocus (int key)
 
void notifyChecked ()
 
 QAbstractButtonPrivate (QSizePolicy::ControlType type=QSizePolicy::DefaultType)
 
QList< QAbstractButton * > queryButtonList () const
 
QAbstractButtonqueryCheckedButton () const
 
void refresh ()
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QBasicTimer animateTimer
 
uint autoExclusive:1
 
uint autoRepeat:1
 
int autoRepeatDelay
 
int autoRepeatInterval
 
uint blockRefresh:1
 
uint checkable:1
 
uint checked:1
 
QSizePolicy::ControlType controlType
 
uint down:1
 
QButtonGroupgroup
 
QIcon icon
 
QSize iconSize
 
uint pressed: 1
 
QBasicTimer repeatTimer
 
QKeySequence shortcut
 
int shortcutId
 
QSize sizeHint
 
QString text
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 61 of file qabstractbutton_p.h.

Constructors and Destructors

◆ QAbstractButtonPrivate()

QAbstractButtonPrivate::QAbstractButtonPrivate ( QSizePolicy::ControlType  type = QSizePolicy::DefaultType)

Definition at line 167 of file qabstractbutton.cpp.

168  :
169 #ifndef QT_NO_SHORTCUT
170  shortcutId(0),
171 #endif
172  checkable(false), checked(false), autoRepeat(false), autoExclusive(false),
173  down(false), blockRefresh(false), pressed(false),
174 #ifndef QT_NO_BUTTONGROUP
175  group(0),
176 #endif
180 {}
int type
Definition: qmetatype.cpp:239
QSizePolicy::ControlType controlType
#define AUTO_REPEAT_DELAY
#define AUTO_REPEAT_INTERVAL

Functions

◆ click()

void QAbstractButtonPrivate::click ( )

Definition at line 514 of file qabstractbutton.cpp.

515 {
517 
518  down = false;
519  blockRefresh = true;
520  bool changeState = true;
521  if (checked && queryCheckedButton() == q) {
522  // the checked button of an exclusive or autoexclusive group cannot be unchecked
523 #ifndef QT_NO_BUTTONGROUP
524  if (group ? group->d_func()->exclusive : autoExclusive)
525 #else
526  if (autoExclusive)
527 #endif
528  changeState = false;
529  }
530 
531  QPointer<QAbstractButton> guard(q);
532  if (changeState) {
533  q->nextCheckState();
534  if (!guard)
535  return;
536  }
537  blockRefresh = false;
538  refresh();
539  q->repaint(); //flush paint event before invoking potentially expensive operation
541  if (guard)
542  emitReleased();
543  if (guard)
544  emitClicked();
545 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
#define Q_Q(Class)
Definition: qglobal.h:2483
bool exclusive
whether the button group is exclusive
Definition: qbuttongroup.h:63
QAbstractButton * queryCheckedButton() const
static void flush()
Flushes the platform specific event queues.

◆ emitClicked()

void QAbstractButtonPrivate::emitClicked ( )

Definition at line 547 of file qabstractbutton.cpp.

548 {
550  QPointer<QAbstractButton> guard(q);
551  emit q->clicked(checked);
552 #ifndef QT_NO_BUTTONGROUP
553  if (guard && group) {
555  if (guard && group)
557  }
558 #endif
559 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
void buttonClicked(QAbstractButton *)
This signal is emitted when the given button is clicked.
#define Q_Q(Class)
Definition: qglobal.h:2483
int id(QAbstractButton *button) const
#define emit
Definition: qobjectdefs.h:76

◆ emitPressed()

void QAbstractButtonPrivate::emitPressed ( )

Definition at line 561 of file qabstractbutton.cpp.

562 {
564  QPointer<QAbstractButton> guard(q);
565  emit q->pressed();
566 #ifndef QT_NO_BUTTONGROUP
567  if (guard && group) {
569  if (guard && group)
571  }
572 #endif
573 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
#define Q_Q(Class)
Definition: qglobal.h:2483
int id(QAbstractButton *button) const
void buttonPressed(QAbstractButton *)
#define emit
Definition: qobjectdefs.h:76

◆ emitReleased()

void QAbstractButtonPrivate::emitReleased ( )

Definition at line 575 of file qabstractbutton.cpp.

576 {
578  QPointer<QAbstractButton> guard(q);
579  emit q->released();
580 #ifndef QT_NO_BUTTONGROUP
581  if (guard && group) {
583  if (guard && group)
585  }
586 #endif
587 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
#define Q_Q(Class)
Definition: qglobal.h:2483
int id(QAbstractButton *button) const
#define emit
Definition: qobjectdefs.h:76
void buttonReleased(QAbstractButton *)

◆ fixFocusPolicy()

void QAbstractButtonPrivate::fixFocusPolicy ( )

Definition at line 470 of file qabstractbutton.cpp.

471 {
473 #ifndef QT_NO_BUTTONGROUP
474  if (!group && !autoExclusive)
475 #else
476  if (!autoExclusive)
477 #endif
478  return;
479 
481  for (int i = 0; i < buttonList.count(); ++i) {
482  QAbstractButton *b = buttonList.at(i);
483  if (!b->isCheckable())
484  continue;
485  b->setFocusPolicy((Qt::FocusPolicy) ((b == q || !q->isCheckable())
486  ? (b->focusPolicy() | Qt::TabFocus)
487  : (b->focusPolicy() & ~Qt::TabFocus)));
488  }
489 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Qt::FocusPolicy focusPolicy() const
#define Q_Q(Class)
Definition: qglobal.h:2483
QList< QAbstractButton * > queryButtonList() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isCheckable() const
FocusPolicy
Definition: qnamespace.h:181
Definition: qnamespace.h:54
void setFocusPolicy(Qt::FocusPolicy policy)
Definition: qwidget.cpp:7631
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ init()

void QAbstractButtonPrivate::init ( )

Definition at line 491 of file qabstractbutton.cpp.

492 {
494 
495  q->setFocusPolicy(Qt::FocusPolicy(q->style()->styleHint(QStyle::SH_Button_FocusPolicy)));
497  q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
498  q->setForegroundRole(QPalette::ButtonText);
499  q->setBackgroundRole(QPalette::Button);
500 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
QSizePolicy::ControlType controlType
#define Q_Q(Class)
Definition: qglobal.h:2483
FocusPolicy
Definition: qnamespace.h:181

◆ moveFocus()

void QAbstractButtonPrivate::moveFocus ( int  key)

Definition at line 379 of file qabstractbutton.cpp.

380 {
382 #ifndef QT_NO_BUTTONGROUP
383  bool exclusive = group ? group->d_func()->exclusive : autoExclusive;
384 #else
385  bool exclusive = autoExclusive;
386 #endif
389  if (!fb || !buttonList.contains(fb))
390  return;
391 
392  QAbstractButton *candidate = 0;
393  int bestScore = -1;
394  QRect target = f->rect().translated(f->mapToGlobal(QPoint(0,0)));
395  QPoint goal = target.center();
397 
398  for (int i = 0; i < buttonList.count(); ++i) {
399  QAbstractButton *button = buttonList.at(i);
400  if (button != f && button->window() == f->window() && button->isEnabled() && !button->isHidden() &&
401  (autoExclusive || (button->focusPolicy() & focus_flag) == focus_flag)) {
402  QRect buttonRect = button->rect().translated(button->mapToGlobal(QPoint(0,0)));
403  QPoint p = buttonRect.center();
404 
405  //Priority to widgets that overlap on the same coordinate.
406  //In that case, the distance in the direction will be used as significant score,
407  //take also in account orthogonal distance in case two widget are in the same distance.
408  int score;
409  if ((buttonRect.x() < target.right() && target.x() < buttonRect.right())
410  && (key == Qt::Key_Up || key == Qt::Key_Down)) {
411  //one item's is at the vertical of the other
412  score = (qAbs(p.y() - goal.y()) << 16) + qAbs(p.x() - goal.x());
413  } else if ((buttonRect.y() < target.bottom() && target.y() < buttonRect.bottom())
414  && (key == Qt::Key_Left || key == Qt::Key_Right) ) {
415  //one item's is at the horizontal of the other
416  score = (qAbs(p.x() - goal.x()) << 16) + qAbs(p.y() - goal.y());
417  } else {
418  score = (1 << 30) + (p.y() - goal.y()) * (p.y() - goal.y()) + (p.x() - goal.x()) * (p.x() - goal.x());
419  }
420 
421  if (score > bestScore && candidate)
422  continue;
423 
424  switch(key) {
425  case Qt::Key_Up:
426  if (p.y() < goal.y()) {
427  candidate = button;
428  bestScore = score;
429  }
430  break;
431  case Qt::Key_Down:
432  if (p.y() > goal.y()) {
433  candidate = button;
434  bestScore = score;
435  }
436  break;
437  case Qt::Key_Left:
438  if (p.x() < goal.x()) {
439  candidate = button;
440  bestScore = score;
441  }
442  break;
443  case Qt::Key_Right:
444  if (p.x() > goal.x()) {
445  candidate = button;
446  bestScore = score;
447  }
448  break;
449  }
450  }
451  }
452 
453  if (exclusive
454 #ifdef QT_KEYPAD_NAVIGATION
455  && !QApplication::keypadNavigationEnabled()
456 #endif
457  && candidate
458  && fb->d_func()->checked
459  && candidate->d_func()->checkable)
460  candidate->click();
461 
462  if (candidate) {
463  if (key == Qt::Key_Up || key == Qt::Key_Left)
464  candidate->setFocus(Qt::BacktabFocusReason);
465  else
466  candidate->setFocus(Qt::TabFocusReason);
467  }
468 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
T qobject_cast(QObject *object)
Definition: qobject.h:375
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
Qt::FocusPolicy focusPolicy() const
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
bool checked
whether the button is checked
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QList< QAbstractButton * > queryButtonList() const
bool exclusive
whether the button group is exclusive
Definition: qbuttongroup.h:63
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
unsigned int uint
Definition: qglobal.h:996
QRect rect() const
bool isEnabled() const
Definition: qwidget.h:948
bool checkable
whether the button is checkable
QPoint center() const
Returns the center point of the rectangle.
Definition: qrect.h:300
void setFocus()
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its paren...
Definition: qwidget.h:432
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
Q_GUI_EXPORT bool qt_tab_all_widgets
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
void click()
Performs a click.
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ notifyChecked()

void QAbstractButtonPrivate::notifyChecked ( )

Definition at line 362 of file qabstractbutton.cpp.

363 {
364 #ifndef QT_NO_BUTTONGROUP
366  if (group) {
367  QAbstractButton *previous = group->d_func()->checkedButton;
368  group->d_func()->checkedButton = q;
369  if (group->d_func()->exclusive && previous && previous != q)
370  previous->nextCheckState();
371  } else
372 #endif
373  if (autoExclusive) {
375  b->setChecked(false);
376  }
377 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
QAbstractButton * checkedButton() const
Returns the button group&#39;s checked button, or 0 if no buttons are checked.
#define Q_Q(Class)
Definition: qglobal.h:2483
virtual void nextCheckState()
This virtual handler is called when a button is clicked.
bool exclusive
whether the button group is exclusive
Definition: qbuttongroup.h:63
QAbstractButton * queryCheckedButton() const

◆ queryButtonList()

QList< QAbstractButton * > QAbstractButtonPrivate::queryButtonList ( ) const

Definition at line 320 of file qabstractbutton.cpp.

321 {
322 #ifndef QT_NO_BUTTONGROUP
323  if (group)
324  return group->d_func()->buttonList;
325 #endif
326 
328  if (autoExclusive) {
329  for (int i = candidates.count() - 1; i >= 0; --i) {
330  QAbstractButton *candidate = candidates.at(i);
331  if (!candidate->autoExclusive()
332 #ifndef QT_NO_BUTTONGROUP
333  || candidate->group()
334 #endif
335  )
336  candidates.removeAt(i);
337  }
338  }
339  return candidates;
340 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QButtonGroup * group() const
Returns the group that this button belongs to.
bool autoExclusive
whether auto-exclusivity is enabled
QObject * parent
Definition: qobject.h:92
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
Definition: qobject.h:162
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ queryCheckedButton()

QAbstractButton * QAbstractButtonPrivate::queryCheckedButton ( ) const

Definition at line 342 of file qabstractbutton.cpp.

343 {
344 #ifndef QT_NO_BUTTONGROUP
345  if (group)
346  return group->d_func()->checkedButton;
347 #endif
348 
349  Q_Q(const QAbstractButton);
351  if (!autoExclusive || buttonList.count() == 1) // no group
352  return 0;
353 
354  for (int i = 0; i < buttonList.count(); ++i) {
355  QAbstractButton *b = buttonList.at(i);
356  if (b->d_func()->checked && b != q)
357  return b;
358  }
359  return checked ? const_cast<QAbstractButton *>(q) : 0;
360 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
QAbstractButton * checkedButton() const
Returns the button group&#39;s checked button, or 0 if no buttons are checked.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_Q(Class)
Definition: qglobal.h:2483
bool checked
whether the button is checked
QList< QAbstractButton * > queryButtonList() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ refresh()

void QAbstractButtonPrivate::refresh ( )

Definition at line 502 of file qabstractbutton.cpp.

503 {
505 
506  if (blockRefresh)
507  return;
508  q->update();
509 #ifndef QT_NO_ACCESSIBILITY
511 #endif
512 }
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object&#39;s accessibility information.
#define Q_Q(Class)
Definition: qglobal.h:2483

Properties

◆ animateTimer

QBasicTimer QAbstractButtonPrivate::animateTimer

Definition at line 86 of file qabstractbutton_p.h.

◆ autoExclusive

uint QAbstractButtonPrivate::autoExclusive

Definition at line 77 of file qabstractbutton_p.h.

◆ autoRepeat

uint QAbstractButtonPrivate::autoRepeat

Definition at line 76 of file qabstractbutton_p.h.

◆ autoRepeatDelay

int QAbstractButtonPrivate::autoRepeatDelay

Definition at line 88 of file qabstractbutton_p.h.

◆ autoRepeatInterval

int QAbstractButtonPrivate::autoRepeatInterval

Definition at line 88 of file qabstractbutton_p.h.

◆ blockRefresh

uint QAbstractButtonPrivate::blockRefresh

Definition at line 79 of file qabstractbutton_p.h.

◆ checkable

uint QAbstractButtonPrivate::checkable

Definition at line 74 of file qabstractbutton_p.h.

◆ checked

uint QAbstractButtonPrivate::checked

Definition at line 75 of file qabstractbutton_p.h.

◆ controlType

QSizePolicy::ControlType QAbstractButtonPrivate::controlType

Definition at line 90 of file qabstractbutton_p.h.

◆ down

uint QAbstractButtonPrivate::down

Definition at line 78 of file qabstractbutton_p.h.

◆ group

QButtonGroup* QAbstractButtonPrivate::group

Definition at line 83 of file qabstractbutton_p.h.

◆ icon

QIcon QAbstractButtonPrivate::icon

Definition at line 68 of file qabstractbutton_p.h.

Referenced by QCommandLinkButton::minimumSizeHint().

◆ iconSize

QSize QAbstractButtonPrivate::iconSize

◆ pressed

uint QAbstractButtonPrivate::pressed

Definition at line 80 of file qabstractbutton_p.h.

◆ repeatTimer

QBasicTimer QAbstractButtonPrivate::repeatTimer

Definition at line 85 of file qabstractbutton_p.h.

◆ shortcut

QKeySequence QAbstractButtonPrivate::shortcut

Definition at line 71 of file qabstractbutton_p.h.

◆ shortcutId

int QAbstractButtonPrivate::shortcutId

Definition at line 72 of file qabstractbutton_p.h.

◆ sizeHint

QSize QAbstractButtonPrivate::sizeHint
mutable

Definition at line 91 of file qabstractbutton_p.h.

Referenced by QCommandLinkButton::minimumSizeHint().

◆ text

QString QAbstractButtonPrivate::text

Definition at line 67 of file qabstractbutton_p.h.


The documentation for this class was generated from the following files: