pub struct ApplicationAttribute(/* private fields */);
Expand description

This enum describes attributes that change the behavior of application-wide features. These are enabled and disabled using QCoreApplication::setAttribute(), and can be tested for with QCoreApplication::testAttribute().

C++ enum: Qt::ApplicationAttribute.

C++ documentation:

This enum describes attributes that change the behavior of application-wide features. These are enabled and disabled using QCoreApplication::setAttribute(), and can be tested for with QCoreApplication::testAttribute().

The following values are deprecated or obsolete:

Implementations§

source§

impl ApplicationAttribute

source

pub fn to_int(&self) -> c_int

source§

impl ApplicationAttribute

source

pub const AAImmediateWidgetCreation: ApplicationAttribute = _

This attribute is no longer fully supported in Qt 5. It ensures that widgets are created as soon as they are constructed. By default, resources for widgets are allocated on demand to improve efficiency and minimize resource usage. Setting or clearing this attribute affects widgets constructed after the change. Setting it tells Qt to create toplevel windows immediately. Therefore, if it is important to minimize resource consumption, do not set this attribute. (C++ enum variant: AA_ImmediateWidgetCreation = 0)

source

pub const AAMSWindowsUseDirect3DByDefault: ApplicationAttribute = _

This value is obsolete and has no effect. (C++ enum variant: AA_MSWindowsUseDirect3DByDefault = 1)

source

pub const AADontShowIconsInMenus: ApplicationAttribute = _

Actions with the Icon property won’t be shown in any menus unless specifically set by the QAction::iconVisibleInMenu property. Menus that are currently open or menus already created in the native macOS menubar may not pick up a change in this attribute. Changes in the QAction::iconVisibleInMenu property will always be picked up. (C++ enum variant: AA_DontShowIconsInMenus = 2)

source

pub const AANativeWindows: ApplicationAttribute = _

Ensures that widgets have native windows. (C++ enum variant: AA_NativeWindows = 3)

source

pub const AADontCreateNativeWidgetSiblings: ApplicationAttribute = _

Ensures that siblings of native widgets stay non-native unless specifically set by the Qt::WA_NativeWindow attribute. (C++ enum variant: AA_DontCreateNativeWidgetSiblings = 4)

source

pub const AAPluginApplication: ApplicationAttribute = _

Indicates that Qt is used to author a plugin. Depending on the operating system, it suppresses specific initializations that do not necessarily make sense in the plugin case. For example on macOS, this includes avoiding loading our nib for the main menu and not taking possession of the native menu bar. Setting this attribute to true will also set the AA_DontUseNativeMenuBar attribute to true. It also disables native event filters. This attribute has been added in Qt 5.7. It must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_PluginApplication = 5)

source

pub const AAMacPluginApplication: ApplicationAttribute = _

This attribute has been deprecated. Use AA_PluginApplication instead. (C++ enum variant: AA_MacPluginApplication = 5)

source

pub const AADontUseNativeMenuBar: ApplicationAttribute = _

All menubars created while this attribute is set to true won’t be used as a native menubar (e.g, the menubar at the top of the main screen on macOS). (C++ enum variant: AA_DontUseNativeMenuBar = 6)

source

pub const AAMacDontSwapCtrlAndMeta: ApplicationAttribute = _

On macOS by default, Qt swaps the Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt sends Meta, and whenever Meta is pressed Control is sent). When this attribute is true, Qt will not do the flip. QKeySequence::StandardKey will also flip accordingly (i.e., QKeySequence::Copy will be Command+C on the keyboard regardless of the value set, though what is output for QKeySequence::toString() will be different). (C++ enum variant: AA_MacDontSwapCtrlAndMeta = 7)

source

pub const AAUse96Dpi: ApplicationAttribute = _

Assume the screen has a resolution of 96 DPI rather than using the OS-provided resolution. This will cause font rendering to be consistent in pixels-per-point across devices rather than defining 1 point as 1/72 inch. (C++ enum variant: AA_Use96Dpi = 8)

source

pub const AAX11InitThreads: ApplicationAttribute = _

This value is obsolete and has no effect. (C++ enum variant: AA_X11InitThreads = 10)

source

pub const AASynthesizeTouchForUnhandledMouseEvents: ApplicationAttribute = _

All mouse events that are not accepted by the application will be translated to touch events instead. (C++ enum variant: AA_SynthesizeTouchForUnhandledMouseEvents = 11)

source

pub const AASynthesizeMouseForUnhandledTouchEvents: ApplicationAttribute = _

All touch events that are not accepted by the application will be translated to left button mouse events instead. This attribute is enabled by default. (C++ enum variant: AA_SynthesizeMouseForUnhandledTouchEvents = 12)

source

pub const AAUseHighDpiPixmaps: ApplicationAttribute = _

Make QIcon::pixmap() generate high-dpi pixmaps that can be larger than the requested size. Such pixmaps will have devicePixelRatio() set to a value higher than 1. After setting this attribute, application code that uses pixmap sizes in layout geometry calculations should typically divide by devicePixelRatio() to get device-independent layout geometry. (C++ enum variant: AA_UseHighDpiPixmaps = 13)

source

pub const AAForceRasterWidgets: ApplicationAttribute = _

Make top-level widgets use pure raster surfaces, and do not support non-native GL-based child widgets. (C++ enum variant: AA_ForceRasterWidgets = 14)

source

pub const AAUseDesktopOpenGL: ApplicationAttribute = _

Forces the usage of desktop OpenGL (for example, opengl32.dll or libGL.so) on platforms that use dynamic loading of the OpenGL implementation. This value has been added in Qt 5.3. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_UseDesktopOpenGL = 15)

source

pub const AAUseOpenGLES: ApplicationAttribute = _

Forces the usage of OpenGL ES 2.0 or higher on platforms that use dynamic loading of the OpenGL implementation. This value has been added in Qt 5.3. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_UseOpenGLES = 16)

source

pub const AAUseSoftwareOpenGL: ApplicationAttribute = _

Forces the usage of a software based OpenGL implementation on platforms that use dynamic loading of the OpenGL implementation. This will typically be a patched build of Mesa llvmpipe, providing OpenGL 2.1. The value may have no effect if no such OpenGL implementation is available. The default name of this library is opengl32sw.dll and can be overridden by setting the environment variable QT_OPENGL_DLL. See the platform-specific pages, for instance Qt for Windows, for more information. This value has been added in Qt 5.4. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_UseSoftwareOpenGL = 17)

source

pub const AAShareOpenGLContexts: ApplicationAttribute = _

Enables resource sharing between the OpenGL contexts used by classes like QOpenGLWidget and QQuickWidget. This allows sharing OpenGL resources, like textures, between QOpenGLWidget instances that belong to different top-level windows. This value has been added in Qt 5.4. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_ShareOpenGLContexts = 18)

source

pub const AASetPalette: ApplicationAttribute = _

Indicates whether a palette was explicitly set on the Q(Gui)Application. This value has been added in Qt 5.5. (C++ enum variant: AA_SetPalette = 19)

source

pub const AAEnableHighDpiScaling: ApplicationAttribute = _

Enables high-DPI scaling in Qt on supported platforms (see also High DPI Displays). Supported platforms are X11, Windows and Android. Enabling makes Qt scale the main (device independent) coordinate system according to display scale factors provided by the operating system. This corresponds to setting the QT_AUTO_SCREEN​_SCALE_FACTOR environment variable to 1. This value has been added in Qt 5.6. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_EnableHighDpiScaling = 20)

source

pub const AADisableHighDpiScaling: ApplicationAttribute = _

Disables high-DPI scaling in Qt, exposing window system coordinates. Note that the window system may do its own scaling, so this does not guarantee that QPaintDevice::devicePixelRatio() will be equal to 1. In addition, scale factors set by QT_SCALE_FACTOR will not be affected. This corresponds to setting the QT_AUTO_SCREEN​_SCALE_FACTOR environment variable to 0. This value has been added in Qt 5.6. This attribute must be set before Q(Gui)Application is constructed. (C++ enum variant: AA_DisableHighDpiScaling = 21)

source

pub const AAUseStyleSheetPropagationInWidgetStyles: ApplicationAttribute = _

By default, Qt Style Sheets disable regular QWidget palette and font propagation. When this flag is enabled, font and palette changes propagate as though the user had manually called the corresponding QWidget methods. See The Style Sheet Syntax - Inheritance for more details. This value has been added in Qt 5.7. (C++ enum variant: AA_UseStyleSheetPropagationInWidgetStyles = 22)

source

pub const AADontUseNativeDialogs: ApplicationAttribute = _

All dialogs created while this attribute is set to true won’t use the native dialogs provided by the platform. This value has been added in Qt 5.7. (C++ enum variant: AA_DontUseNativeDialogs = 23)

source

pub const AASynthesizeMouseForUnhandledTabletEvents: ApplicationAttribute = _

All tablet events that are not accepted by the application will be translated to mouse events instead. This attribute is enabled by default. This value has been added in Qt 5.7. (C++ enum variant: AA_SynthesizeMouseForUnhandledTabletEvents = 24)

source

pub const AACompressHighFrequencyEvents: ApplicationAttribute = _

Enables compression of certain frequent events. On the X11 windowing system, the default value is true, which means that QEvent::MouseMove, QEvent::TouchUpdate, and changes in window size and position will be combined whenever they occur more frequently than the application handles them, so that they don’t accumulate and overwhelm the application later. On other platforms, the default is false. (In the future, the compression feature may be implemented across platforms.) You can test the attribute to see whether compression is enabled. If your application needs to handle all events with no compression, you can unset this attribute. This value has been added in Qt 5.7. (C++ enum variant: AA_CompressHighFrequencyEvents = 25)

source

pub const AADontCheckOpenGLContextThreadAffinity: ApplicationAttribute = _

When making a context current using QOpenGLContext, do not check that the QObject thread affinity of the QOpenGLContext object is the same thread calling makeCurrent(). This value has been added in Qt 5.8. (C++ enum variant: AA_DontCheckOpenGLContextThreadAffinity = 26)

source

pub const AADisableShaderDiskCache: ApplicationAttribute = _

Disables caching of shader program binaries on disk. By default Qt Quick, QPainter’s OpenGL backend, and any application using QOpenGLShaderProgram with one of its addCacheableShaderFromSource overloads will employ a disk-based program binary cache in either the shared or per-process cache storage location, on systems that support glProgramBinary(). In the unlikely event of this being problematic, set this attribute to disable all disk-based caching of shaders. (C++ enum variant: AA_DisableShaderDiskCache = 27)

source

pub const AAAttributeCount: ApplicationAttribute = _

C++ enum variant: AA_AttributeCount = 28

source

pub const AADontShowShortcutsInContextMenus: ApplicationAttribute = _

Actions with the Shortcut property won’t be shown in any shortcut menus unless specifically set by the QAction::shortcutVisibleInContextMenu property. This value was added in Qt 5.10. (C++ enum variant: AA_DontShowShortcutsInContextMenus = 28)

source

pub const AACompressTabletEvents: ApplicationAttribute = _

Enables compression of input events from tablet devices. Notice that AA_CompressHighFrequencyEvents must be true for events compression to be enabled, and that this flag extends the former to tablet events. Its default value is false. This value was added in Qt 5.10. (C++ enum variant: AA_CompressTabletEvents = 29)

source

pub const AADisableWindowContextHelpButton: ApplicationAttribute = _

Disables the WindowContextHelpButtonHint by default on Qt::Sheet and Qt::Dialog widgets. This hides the ? button on Windows, which only makes sense if you use QWhatsThis functionality. This value was added in Qt 5.10. In Qt 6, WindowContextHelpButtonHint will not be set by default. (C++ enum variant: AA_DisableWindowContextHelpButton = 30)

source

pub const AAAttributeCount2: ApplicationAttribute = _

C++ enum variant: AA_AttributeCount = 31

source

pub const AADisableSessionManager: ApplicationAttribute = _

Disables the QSessionManager. By default Qt will connect to a running session manager for a GUI application on supported platforms, use of a session manager may be redundant for system services. This attribute must be set before QGuiApplication is constructed. This value was added in 5.13 (C++ enum variant: AA_DisableSessionManager = 31)

source

pub const AAAttributeCount3: ApplicationAttribute = _

C++ enum variant: AA_AttributeCount = 32

Trait Implementations§

source§

impl Clone for ApplicationAttribute

source§

fn clone(&self) -> ApplicationAttribute

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ApplicationAttribute

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ApplicationAttribute> for c_int

source§

fn from(value: ApplicationAttribute) -> Self

Converts to this type from the input type.
source§

impl From<i32> for ApplicationAttribute

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ApplicationAttribute

source§

fn eq(&self, other: &ApplicationAttribute) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ApplicationAttribute

source§

impl Eq for ApplicationAttribute

source§

impl StructuralEq for ApplicationAttribute

source§

impl StructuralPartialEq for ApplicationAttribute

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.