Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QStyleHints class contains platform specific hints and settings. \inmodule QtGui. More...
#include <qstylehints.h>
Public Member Functions | |
void | setMouseDoubleClickInterval (int mouseDoubleClickInterval) |
Sets the mouseDoubleClickInterval. | |
int | mouseDoubleClickInterval () const |
int | mouseDoubleClickDistance () const |
int | touchDoubleTapDistance () const |
void | setMousePressAndHoldInterval (int mousePressAndHoldInterval) |
Sets the mousePressAndHoldInterval. | |
int | mousePressAndHoldInterval () const |
void | setStartDragDistance (int startDragDistance) |
Sets the startDragDistance. | |
int | startDragDistance () const |
void | setStartDragTime (int startDragTime) |
Sets the startDragDragTime. | |
int | startDragTime () const |
int | startDragVelocity () const |
void | setKeyboardInputInterval (int keyboardInputInterval) |
Sets the keyboardInputInterval. | |
int | keyboardInputInterval () const |
qreal | keyboardAutoRepeatRateF () const |
void | setCursorFlashTime (int cursorFlashTime) |
Sets the cursorFlashTime. | |
int | cursorFlashTime () const |
bool | showIsFullScreen () const |
bool | showIsMaximized () const |
bool | showShortcutsInContextMenus () const |
void | setShowShortcutsInContextMenus (bool showShortcutsInContextMenus) |
Qt::ContextMenuTrigger | contextMenuTrigger () const |
void | setContextMenuTrigger (Qt::ContextMenuTrigger contextMenuTrigger) |
int | passwordMaskDelay () const |
QChar | passwordMaskCharacter () const |
qreal | fontSmoothingGamma () const |
bool | useRtlExtensions () const |
bool | setFocusOnTouchRelease () const |
Qt::TabFocusBehavior | tabFocusBehavior () const |
void | setTabFocusBehavior (Qt::TabFocusBehavior tabFocusBehavior) |
Sets the tabFocusBehavior. | |
bool | singleClickActivation () const |
bool | useHoverEffects () const |
void | setUseHoverEffects (bool useHoverEffects) |
int | wheelScrollLines () const |
void | setWheelScrollLines (int scrollLines) |
Sets the wheelScrollLines. | |
void | setMouseQuickSelectionThreshold (int threshold) |
Sets the mouse quick selection threshold. | |
int | mouseQuickSelectionThreshold () const |
Qt::ColorScheme | colorScheme () const |
void | setColorScheme (Qt::ColorScheme scheme) |
void | unsetColorScheme () |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T > | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) 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. | |
template<typename T > | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Properties | |
int | cursorFlashTime |
the text cursor's flash (blink) time in milliseconds. | |
qreal | fontSmoothingGamma |
the gamma value used in font smoothing. | |
qreal | keyboardAutoRepeatRateF |
the rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down. | |
int | keyboardInputInterval |
the time limit, in milliseconds, that distinguishes a key press from two consecutive key presses. | |
int | mouseDoubleClickInterval |
the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks. | |
int | mousePressAndHoldInterval |
the time limit in milliseconds that activates a press and hold. | |
QChar | passwordMaskCharacter |
the character used to mask the characters typed into text input fields in password mode. | |
int | passwordMaskDelay |
the time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password mode. | |
bool | setFocusOnTouchRelease |
the event that should set input focus on focus objects. | |
bool | showIsFullScreen |
whether the platform defaults to fullscreen windows. | |
bool | showIsMaximized |
whether the platform defaults to maximized windows. | |
bool | showShortcutsInContextMenus |
true if the platform normally shows shortcut key sequences in context menus, otherwise false . | |
Qt::ContextMenuTrigger | contextMenuTrigger |
mouse event used to trigger a context menu event. | |
int | startDragDistance |
the distance, in pixels, that the mouse must be moved with a button held down before a drag and drop operation will begin. | |
int | startDragTime |
the time, in milliseconds, that a mouse button must be held down before a drag and drop operation will begin. | |
int | startDragVelocity |
the limit for the velocity, in pixels per second, that the mouse may be moved, with a button held down, for a drag and drop operation to begin. | |
bool | useRtlExtensions |
the writing direction. | |
Qt::TabFocusBehavior | tabFocusBehavior |
The focus behavior on press of the tab key. | |
bool | singleClickActivation |
whether items are activated by single or double click. | |
bool | useHoverEffects |
whether UI elements use hover effects. | |
int | wheelScrollLines |
Number of lines to scroll by default for each wheel click. | |
int | mouseQuickSelectionThreshold |
Quick selection mouse threshold in QLineEdit. | |
int | mouseDoubleClickDistance |
the maximum distance, in pixels, that the mouse can be moved between two consecutive mouse clicks and still have it detected as a double-click | |
int | touchDoubleTapDistance |
the maximum distance, in pixels, that a finger can be moved between two consecutive taps and still have it detected as a double-tap | |
Qt::ColorScheme | colorScheme |
the color scheme used by the application. | |
Properties inherited from QObject | |
QString | objectName |
the name of this object | |
Friends | |
class | QGuiApplication |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
\threadsafe | |
Static Public Member Functions inherited from QObject | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
The QStyleHints class contains platform specific hints and settings. \inmodule QtGui.
An object of this class, obtained from QGuiApplication, provides access to certain global user interface parameters of the current platform.
Access to most settings is read only. The platform itself usually provides the user with ways to tune these parameters. Authors of custom user interface components should read relevant settings to allow the components to exhibit the same behavior and feel as other components.
Definition at line 16 of file qstylehints.h.
Qt::ColorScheme QStyleHints::colorScheme | ( | ) | const |
Definition at line 151 of file qstylehints.cpp.
|
signal |
Qt::ContextMenuTrigger QStyleHints::contextMenuTrigger | ( | ) | const |
Definition at line 459 of file qstylehints.cpp.
|
signal |
int QStyleHints::cursorFlashTime | ( | ) | const |
Definition at line 374 of file qstylehints.cpp.
|
signal |
qreal QStyleHints::fontSmoothingGamma | ( | ) | const |
Definition at line 503 of file qstylehints.cpp.
qreal QStyleHints::keyboardAutoRepeatRateF | ( | ) | const |
Definition at line 346 of file qstylehints.cpp.
int QStyleHints::keyboardInputInterval | ( | ) | const |
Definition at line 319 of file qstylehints.cpp.
|
signal |
int QStyleHints::mouseDoubleClickDistance | ( | ) | const |
Definition at line 102 of file qstylehints.cpp.
int QStyleHints::mouseDoubleClickInterval | ( | ) | const |
Definition at line 88 of file qstylehints.cpp.
|
signal |
int QStyleHints::mousePressAndHoldInterval | ( | ) | const |
Definition at line 203 of file qstylehints.cpp.
|
signal |
int QStyleHints::mouseQuickSelectionThreshold | ( | ) | const |
Definition at line 667 of file qstylehints.cpp.
|
signal |
QChar QStyleHints::passwordMaskCharacter | ( | ) | const |
Definition at line 494 of file qstylehints.cpp.
int QStyleHints::passwordMaskDelay | ( | ) | const |
Definition at line 484 of file qstylehints.cpp.
void QStyleHints::setColorScheme | ( | Qt::ColorScheme | scheme | ) |
Sets the color scheme used by the application to an explicit scheme, or revert to the system's current color scheme if scheme is Qt::ColorScheme::Unknown.
Definition at line 163 of file qstylehints.cpp.
void QStyleHints::setContextMenuTrigger | ( | Qt::ContextMenuTrigger | contextMenuTrigger | ) |
Definition at line 470 of file qstylehints.cpp.
void QStyleHints::setCursorFlashTime | ( | int | cursorFlashTime | ) |
Sets the cursorFlashTime.
Definition at line 357 of file qstylehints.cpp.
bool QStyleHints::setFocusOnTouchRelease | ( | ) | const |
Definition at line 529 of file qstylehints.cpp.
void QStyleHints::setKeyboardInputInterval | ( | int | keyboardInputInterval | ) |
Sets the keyboardInputInterval.
Definition at line 305 of file qstylehints.cpp.
void QStyleHints::setMouseDoubleClickInterval | ( | int | mouseDoubleClickInterval | ) |
Sets the mouseDoubleClickInterval.
Definition at line 74 of file qstylehints.cpp.
void QStyleHints::setMousePressAndHoldInterval | ( | int | mousePressAndHoldInterval | ) |
Sets the mousePressAndHoldInterval.
Definition at line 187 of file qstylehints.cpp.
void QStyleHints::setMouseQuickSelectionThreshold | ( | int | threshold | ) |
Sets the mouse quick selection threshold.
Definition at line 647 of file qstylehints.cpp.
void QStyleHints::setShowShortcutsInContextMenus | ( | bool | showShortcutsInContextMenus | ) |
Definition at line 436 of file qstylehints.cpp.
void QStyleHints::setStartDragDistance | ( | int | startDragDistance | ) |
Sets the startDragDistance.
Definition at line 217 of file qstylehints.cpp.
void QStyleHints::setStartDragTime | ( | int | startDragTime | ) |
Sets the startDragDragTime.
Definition at line 258 of file qstylehints.cpp.
void QStyleHints::setTabFocusBehavior | ( | Qt::TabFocusBehavior | tabFocusBehavior | ) |
Sets the tabFocusBehavior.
Definition at line 557 of file qstylehints.cpp.
void QStyleHints::setUseHoverEffects | ( | bool | useHoverEffects | ) |
Definition at line 598 of file qstylehints.cpp.
void QStyleHints::setWheelScrollLines | ( | int | scrollLines | ) |
Sets the wheelScrollLines.
Definition at line 632 of file qstylehints.cpp.
bool QStyleHints::showIsFullScreen | ( | ) | const |
Definition at line 394 of file qstylehints.cpp.
bool QStyleHints::showIsMaximized | ( | ) | const |
Definition at line 412 of file qstylehints.cpp.
bool QStyleHints::showShortcutsInContextMenus | ( | ) | const |
Definition at line 428 of file qstylehints.cpp.
|
signal |
bool QStyleHints::singleClickActivation | ( | ) | const |
Definition at line 575 of file qstylehints.cpp.
int QStyleHints::startDragDistance | ( | ) | const |
Definition at line 244 of file qstylehints.cpp.
|
signal |
int QStyleHints::startDragTime | ( | ) | const |
Definition at line 278 of file qstylehints.cpp.
|
signal |
int QStyleHints::startDragVelocity | ( | ) | const |
Definition at line 294 of file qstylehints.cpp.
Qt::TabFocusBehavior QStyleHints::tabFocusBehavior | ( | ) | const |
Definition at line 543 of file qstylehints.cpp.
|
signal |
int QStyleHints::touchDoubleTapDistance | ( | ) | const |
Definition at line 116 of file qstylehints.cpp.
|
inline |
Restores the color scheme to the system's current color scheme.
Definition at line 103 of file qstylehints.h.
bool QStyleHints::useHoverEffects | ( | ) | const |
Definition at line 590 of file qstylehints.cpp.
|
signal |
bool QStyleHints::useRtlExtensions | ( | ) | const |
Definition at line 515 of file qstylehints.cpp.
int QStyleHints::wheelScrollLines | ( | ) | const |
Definition at line 618 of file qstylehints.cpp.
|
signal |
|
friend |
Definition at line 121 of file qstylehints.h.
|
readwrite |
the color scheme used by the application.
By default, this follows the system's default color scheme (also known as appearance), and changes when the system color scheme changes (e.g. during dusk or dawn). Setting the color scheme to an explicit value will override the system setting and ignore any changes to the system's color scheme. However, doing so is a hint to the system, and overriding the color scheme is not supported on all platforms.
Resetting this property, or setting it to \l{Qt::ColorScheme::Unknown}, will remove the override and make the application follow the system default again. The property value will change to the color scheme the system currently has.
When this property changes, Qt will read the system palette and update the default palette, but won't overwrite palette entries that have been explicitly set by the application. When the colorSchemeChange() signal gets emitted, the old palette is still in effect.
Application-specific colors should be selected to work well with the effective palette, taking the current color scheme into account. To update application- specific colors when the effective palette changes, handle \l{QEvent::}{PaletteChange} or \l{QEvent::}{ApplicationPaletteChange} events.
Definition at line 57 of file qstylehints.h.
|
read |
mouse event used to trigger a context menu event.
The default on UNIX systems is to show context menu on mouse button press event, while on Windows it is the mouse button release event. This property can be used to override the default platform behavior.
Definition at line 39 of file qstylehints.h.
|
read |
the text cursor's flash (blink) time in milliseconds.
The flash time is the time used to display, invert and restore the caret display. Usually the text cursor is displayed for half the cursor flash time, then hidden for the same amount of time.
Definition at line 20 of file qstylehints.h.
|
read |
the gamma value used in font smoothing.
Definition at line 21 of file qstylehints.h.
|
read |
the rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down.
Definition at line 25 of file qstylehints.h.
|
read |
the time limit, in milliseconds, that distinguishes a key press from two consecutive key presses.
Definition at line 26 of file qstylehints.h.
|
read |
the maximum distance, in pixels, that the mouse can be moved between two consecutive mouse clicks and still have it detected as a double-click
Definition at line 54 of file qstylehints.h.
|
read |
the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks.
Definition at line 28 of file qstylehints.h.
|
read |
the time limit in milliseconds that activates a press and hold.
Definition at line 30 of file qstylehints.h.
|
readwrite |
Quick selection mouse threshold in QLineEdit.
This property defines how much the mouse cursor should be moved along the y axis to trigger a quick selection during a normal QLineEdit text selection.
If the property value is less than or equal to 0, the quick selection feature is disabled.
Definition at line 51 of file qstylehints.h.
|
read |
the character used to mask the characters typed into text input fields in password mode.
Definition at line 32 of file qstylehints.h.
|
read |
the time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password mode.
Definition at line 33 of file qstylehints.h.
|
read |
the event that should set input focus on focus objects.
This property is true
if focus objects (line edits etc) should receive input focus after a touch/mouse release. This is normal behavior on touch platforms. On desktop platforms, the standard is to set focus already on touch/mouse press.
Definition at line 34 of file qstylehints.h.
|
read |
whether the platform defaults to fullscreen windows.
This property is true
if the platform defaults to windows being fullscreen, otherwise false
.
Definition at line 35 of file qstylehints.h.
|
read |
whether the platform defaults to maximized windows.
This property is true
if the platform defaults to windows being maximized, otherwise false
.
Definition at line 36 of file qstylehints.h.
|
readwrite |
true
if the platform normally shows shortcut key sequences in context menus, otherwise false
.
Since Qt 5.13, the setShowShortcutsInContextMenus() function can be used to override the platform default.
Definition at line 37 of file qstylehints.h.
|
read |
whether items are activated by single or double click.
This property is true
if items should be activated by single click, false
if they should be activated by double click instead.
Definition at line 47 of file qstylehints.h.
|
read |
the distance, in pixels, that the mouse must be moved with a button held down before a drag and drop operation will begin.
If you support drag and drop in your application, and want to start a drag and drop operation after the user has moved the cursor a certain distance with a button held down, you should use this property's value as the minimum distance required.
For example, if the mouse position of the click is stored in startPos
and the current position (e.g. in the mouse move event) is currentPos
, you can find out if a drag should be started with code like this:
Definition at line 41 of file qstylehints.h.
|
read |
the time, in milliseconds, that a mouse button must be held down before a drag and drop operation will begin.
If you support drag and drop in your application, and want to start a drag and drop operation after the user has held down a mouse button for a certain amount of time, you should use this property's value as the delay.
Definition at line 42 of file qstylehints.h.
|
read |
the limit for the velocity, in pixels per second, that the mouse may be moved, with a button held down, for a drag and drop operation to begin.
A value of 0 means there is no such limit.
Definition at line 43 of file qstylehints.h.
|
read |
The focus behavior on press of the tab key.
Definition at line 45 of file qstylehints.h.
|
read |
the maximum distance, in pixels, that a finger can be moved between two consecutive taps and still have it detected as a double-tap
Definition at line 56 of file qstylehints.h.
|
readwrite |
whether UI elements use hover effects.
This property is true
if UI elements should use hover effects. This is the standard behavior on desktop platforms with a mouse pointer, whereas on touch platforms the overhead of hover event delivery can be avoided.
Definition at line 48 of file qstylehints.h.
|
read |
the writing direction.
This property is true
if right-to-left writing direction is enabled, otherwise false
.
Definition at line 44 of file qstylehints.h.
|
read |
Number of lines to scroll by default for each wheel click.
Definition at line 50 of file qstylehints.h.