PythonQt.QtGui.QApplication · declarations 004
Back to PythonQt.QtGui.QApplication
setOrganizationName
setOrganizationName(orgName: Any) -> Any
X.setOrganizationName(orgName)
setOverrideCursor
setOverrideCursor(arg__1: Any) -> Any
X.setOverrideCursor(arg__1)
setPalette
setPalette(arg__1: Any, className: Any) -> None
X.setPalette(arg__1, className)
Supplemental documentation: Qt 5 reference:
[static] void QApplication::setPalette(const QPalette \&palette, const char *className \= nullptr)
Changes the application palette to palette.
If className is passed, the change applies only to widgets that inherit className (as reported by QObject::inherits()). If className is left 0, the change affects all widgets, thus overriding any previously set class specific palettes.
The palette may be changed according to the current GUI style in QStyle::polish().
Warning: Do not use this function in conjunction with Qt Style Sheets. When using style sheets, the palette of a widget can be customized using the "color", "background-color", "selection-color", "selection-background-color" and "alternate-background-color".
Note: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for the Windows Vista and macOS styles.
See also QWidget::setPalette(), palette(), and QStyle::polish().
Upstream PySide2 reference signatures (binding differences may apply):
setPalette(arg__1: PySide2.QtGui.QPalette, className: typing.Optional[str]=...) -> None
setPalette(pal: PySide2.QtGui.QPalette) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setPalette
setQuitLockEnabled
setQuitLockEnabled(enabled: Any) -> Any
X.setQuitLockEnabled(enabled)
setQuitOnLastWindowClosed
setQuitOnLastWindowClosed(quit: Any) -> Any
X.setQuitOnLastWindowClosed(quit)
setSetuidAllowed
setSetuidAllowed(allow: Any) -> Any
X.setSetuidAllowed(allow)
setStartDragDistance
setStartDragDistance(l: int) -> None
X.setStartDragDistance(l)
Upstream PySide2 reference signatures (binding differences may apply):
setStartDragDistance(l: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setStartDragDistance
setStartDragTime
setStartDragTime(ms: int) -> None
X.setStartDragTime(ms)
Upstream PySide2 reference signatures (binding differences may apply):
setStartDragTime(ms: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setStartDragTime
setStyle
setStyle(arg__1: Any) -> Any
X.setStyle(arg__1)
Supplemental documentation: Qt 5 reference:
[static] void QApplication::setStyle(QStyle *style)
Sets the application's GUI style to style. Ownership of the style object is transferred to QApplication, so QApplication will delete the style object on application exit or when a new style is set and the old style is still the parent of the application object.
Example usage:
QApplication::setStyle(QStyleFactory::create("Fusion"));
When switching application styles, the color palette is set back to the initial colors or the system defaults. This is necessary since certain styles have to adapt the color palette to be fully style-guide compliant.
Setting the style before a palette has been set, i.e., before creating QApplication, will cause the application to use QStyle::standardPalette() for the palette.
Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.
See also style(), QStyle, setPalette(), and desktopSettingsAware().
[static] QStyle *QApplication::setStyle(const QString \&style)
This is an overloaded function.
Requests a QStyle object for style from the QStyleFactory.
The string must be one of the QStyleFactory::keys(), typically one of "windows", "windowsvista", "fusion", or "macintosh". Style names are case insensitive.
Returns nullptr if an unknown style is passed, otherwise the
QStyle object returned is set as the
application's GUI style.
Warning: To ensure that the application's style is set correctly, it is best to call this function before the QApplication constructor, if possible.
Upstream PySide2 reference signatures (binding differences may apply):
setStyle(arg__1: PySide2.QtWidgets.QStyle) -> None
setStyle(arg__1: str) -> PySide2.QtWidgets.QStyle
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setStyle
setStyleSheet
setStyleSheet(sheet: str) -> None
X.setStyleSheet(sheet)
Upstream PySide2 reference signatures (binding differences may apply):
setStyleSheet(self, sheet: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setStyleSheet
setWheelScrollLines
setWheelScrollLines(arg__1: int) -> None
X.setWheelScrollLines(arg__1)
Upstream PySide2 reference signatures (binding differences may apply):
setWheelScrollLines(arg__1: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setWheelScrollLines
setWindowIcon
setWindowIcon(icon: Any) -> None
X.setWindowIcon(icon)
Upstream PySide2 reference signatures (binding differences may apply):
setWindowIcon(icon: PySide2.QtGui.QIcon) -> None
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#setWindowIcon
startDragDistance
instance-attribute
startDragDistance: int
Qt 5 reference:
startDragDistance : int
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:
if ((startPos - currentPos).manhattanLength() >=
QApplication::startDragDistance())
startTheDrag();
Qt uses this value internally, e.g. in QFileDialog.
The default value (if the platform doesn't provide a different default) is 10 pixels.
Access functions:
| int | startDragDistance() |
|---|---|
| void | setStartDragDistance(int l) |
See also startDragTime(), QPoint::manhattanLength(), and Drag and Drop.
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#startDragDistance
startDragTime
instance-attribute
startDragTime: int
Qt 5 reference:
startDragTime : int
This property holds 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.
Qt also uses this delay internally, e.g. in QTextEdit and QLineEdit, for starting a drag.
The default value is 500 ms.
Access functions:
| int | startDragTime() |
|---|---|
| void | setStartDragTime(int ms) |
See also startDragDistance() and Drag and Drop.
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#startDragTime
startingUp
startingUp() -> bool
X.startingUp() -> bool
style
style() -> Any
X.style() -> PythonQt.QtGui.QStyle
Supplemental documentation: Qt 5 reference:
[static] QStyle *QApplication::style()
Returns the application's style object.
See also setStyle() and QStyle.
Upstream PySide2 reference signatures (binding differences may apply):
style() -> PySide2.QtWidgets.QStyle
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#style
styleHints
styleHints() -> Any
X.styleHints() -> PythonQt.QtGui.QStyleHints
styleSheet
instance-attribute
styleSheet: str
Qt 5 reference:
styleSheet : QString
This property holds the application style sheet
By default, this property returns an empty string unless the user specifies the
-stylesheet option on the command line when running the application.
This property was introduced in Qt 4.2.
Access functions:
| QString | styleSheet() const |
|---|---|
| void | setStyleSheet(const QString \&sheet) |
See also QWidget::setStyle() and Qt Style Sheets.
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#styleSheet
sync
sync() -> Any
X.sync()
testAttribute
testAttribute(attribute: Any) -> bool
X.testAttribute(attribute) -> bool
topLevelAt
topLevelAt(x: Any, y: Any) -> Any
X.topLevelAt(x, y) -> PythonQt.QtGui.QWidget
Supplemental documentation: Qt 5 reference:
[static] QWidget *QApplication::topLevelAt(const QPoint \&point)
Returns the top-level widget at the given point; returns nullptr if there is no such
widget.
[static] QWidget *QApplication::topLevelAt(int x, int y)
This is an overloaded function.
Returns the top-level widget at the point (x, y); returns 0 if there is no such widget.
Upstream PySide2 reference signatures (binding differences may apply):
topLevelAt(p: PySide2.QtCore.QPoint) -> PySide2.QtWidgets.QWidget
topLevelAt(x: int, y: int) -> PySide2.QtWidgets.QWidget
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#topLevelAt
topLevelWidgets
topLevelWidgets() -> tuple
X.topLevelWidgets() -> tuple
Supplemental documentation: Qt 5 reference:
[static] QWidgetList QApplication::topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
Note: Some of the top-level widgets may be hidden, for example a tooltip if no tooltip is currently shown.
Example:
void showAllHiddenTopLevelWidgets()
{
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();
for (QWidget *widget : topLevelWidgets) {
if (widget->isHidden())
widget->show();
}
}
See also allWidgets(), QWidget::isWindow(), and QWidget::isHidden().
Upstream PySide2 reference signatures (binding differences may apply):
topLevelWidgets() -> typing.List[PySide2.QtWidgets.QWidget]
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#topLevelWidgets
topLevelWindows
topLevelWindows() -> tuple
X.topLevelWindows() -> tuple
translate
translate(context: Any, key: Any, disambiguation: Any, n: Any) -> str
X.translate(context, key, disambiguation, n) -> str
wheelScrollLines
instance-attribute
wheelScrollLines: int
Qt 5 reference:
wheelScrollLines : int
This property holds the number of lines to scroll a widget, when the mouse wheel is rotated.
If the value exceeds the widget's number of visible lines, the widget should interpret the scroll operation as a single page up or page down. If the widget is an item view class, then the result of scrolling one line depends on the setting of the widget's scroll mode. Scroll one line can mean scroll one item or scroll one pixel.
By default, this property has a value of 3.
Access functions:
| int | wheelScrollLines() |
|---|---|
| void | setWheelScrollLines(int) |
See also QStyleHints::wheelScrollLines().
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#wheelScrollLines
widgetAt
widgetAt(x: Any, y: Any) -> Any
X.widgetAt(x, y) -> PythonQt.QtGui.QWidget
Supplemental documentation: Qt 5 reference:
[static] QWidget *QApplication::widgetAt(const QPoint \&point)
Returns the widget at global screen position point, or nullptr if there is no Qt
widget there.
This function can be slow.
See also QCursor::pos(), QWidget::grabMouse(), and QWidget::grabKeyboard().
[static] QWidget *QApplication::widgetAt(int x, int y)
This is an overloaded function.
Returns the widget at global screen position (x, y), or nullptr if there is no Qt
widget there.
Upstream PySide2 reference signatures (binding differences may apply):
widgetAt(p: PySide2.QtCore.QPoint) -> PySide2.QtWidgets.QWidget
widgetAt(x: int, y: int) -> PySide2.QtWidgets.QWidget
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#widgetAt
windowIcon
instance-attribute
windowIcon: QIcon
Qt 5 reference:
windowIcon : QIcon
This property holds the default window icon
Access functions:
| QIcon | windowIcon() |
|---|---|
| void | setWindowIcon(const QIcon \&icon) |
See also QWidget::setWindowIcon() and Setting the Application Icon.
Source: https://doc.qt.io/archives/qt-5.15/qapplication.html#windowIcon