|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QDesktopWidget
public class QDesktopWidget
The QDesktopWidget class provides access to screen information on multi-head systems. Systems with more than one graphics card and monitor can manage the physical screen space available either as multiple desktops, or as a large virtual desktop, which usually has the size of the bounding rectangle of all the screens (see isVirtualDesktop()
). For an application, one of the available screens is the primary screen, i.e. the screen where the main widget resides (see primaryScreen()
). All windows opened in the context of the application should be constrained to the boundaries of the primary screen; for example, it would be inconvenient if a dialog box popped up on a different screen, or split over two screens.
The QDesktopWidget provides information about the geometry of the available screens with screenGeometry()
. The number of screens available is returned by numScreens()
. The screen number that a particular point or widget is located in is returned by screenNumber()
.
Widgets provided by Qt use this class, for example, to place tooltips, menus and dialog boxes according to the parent or application widget.
Applications can use this class to save window positions, or to place child widgets on one screen.
QWidget
properties, width() and height(), which specify the size of the desktop. However, for desktops with multiple screens, the size of the desktop is the union of all the screen sizes, so width() and height() should not be used for computing the size of a widget to be placed on one of the screens. The correct width and height values are obtained using availableGeometry()
or screenGeometry()
for a particular screen. QApplication
, and QX11Info::appRootWindow().
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
resized
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
workAreaResized
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QDesktopWidget()
Creates the desktop widget. |
Method Summary | |
---|---|
QRect |
availableGeometry()
Returns the available geometry of the screen with index screen. |
QRect |
availableGeometry(int screen)
Returns the available geometry of the screen with index screen. |
QRect |
availableGeometry(QPoint point)
This is an overloaded member function, provided for convenience. |
QRect |
availableGeometry(QWidget widget)
This is an overloaded member function, provided for convenience. |
boolean |
isVirtualDesktop()
Returns true if the system manages the available screens in a virtual desktop; otherwise returns false. |
int |
numScreens()
Returns the number of available screens. |
int |
primaryScreen()
Returns the index of the primary screen. |
QWidget |
screen()
Returns a widget that represents the screen with index screen (a value of -1 means the default screen). |
QWidget |
screen(int screen)
Returns a widget that represents the screen with index screen (a value of -1 means the default screen). |
QRect |
screenGeometry()
Returns the geometry of the screen with index screen. |
QRect |
screenGeometry(int screen)
Returns the geometry of the screen with index screen. |
QRect |
screenGeometry(QPoint point)
This is an overloaded member function, provided for convenience. |
QRect |
screenGeometry(QWidget widget)
This is an overloaded member function, provided for convenience. |
int |
screenNumber()
Returns the index of the screen that contains the largest part of widget, or -1 if the widget not on a screen. |
int |
screenNumber(QPoint arg__1)
This is an overloaded member function, provided for convenience. |
int |
screenNumber(QWidget widget)
Returns the index of the screen that contains the largest part of widget, or -1 if the widget not on a screen. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 resized
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: screen)>:
This signal is emitted when the size of screen changes.
public final QSignalEmitter.Signal1 workAreaResized
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: screen)>:
This signal is emitted when the work area available on screen changes.
Constructor Detail |
---|
public QDesktopWidget()
If the system supports a virtual desktop, this widget will have the size of the virtual desktop; otherwise this widget will have the size of the primary screen.
Instead of using QDesktopWidget directly, use QApplication::desktop()
.
Method Detail |
---|
public final QRect availableGeometry(QPoint point)
Returns the available geometry of the screen which contains p.
screenGeometry()
.
public final QRect availableGeometry(QWidget widget)
Returns the available geometry of the screen which contains widget.
screenGeometry()
.
public final QRect availableGeometry()
screenGeometry()
based on what the platform decides is available (for example excludes the dock and menu bar on Mac OS X, or the task bar on Windows). The default screen is used if screen is -1. screenNumber()
, and screenGeometry()
.
public final QRect availableGeometry(int screen)
screenGeometry()
based on what the platform decides is available (for example excludes the dock and menu bar on Mac OS X, or the task bar on Windows). The default screen is used if screen is -1. screenNumber()
, and screenGeometry()
.
public final boolean isVirtualDesktop()
For virtual desktops, screen()
will always return the same widget. The size of the virtual desktop is the size of this desktop widget.
public final int numScreens()
primaryScreen()
.
public final int primaryScreen()
numScreens()
.
public final QWidget screen()
If the system uses a virtual desktop, the returned widget will have the geometry of the entire virtual desktop; i.e., bounding every screen.
primaryScreen()
, numScreens()
, and isVirtualDesktop()
.
public final QWidget screen(int screen)
If the system uses a virtual desktop, the returned widget will have the geometry of the entire virtual desktop; i.e., bounding every screen.
primaryScreen()
, numScreens()
, and isVirtualDesktop()
.
public final QRect screenGeometry(QPoint point)
Returns the geometry of the screen which contains p.
public final QRect screenGeometry(QWidget widget)
Returns the geometry of the screen which contains widget.
public final QRect screenGeometry()
screenNumber()
.
public final QRect screenGeometry(int screen)
screenNumber()
.
public final int screenNumber(QPoint arg__1)
Returns the index of the screen that contains the point, or the screen which is the shortest distance from the point.
primaryScreen()
.
public final int screenNumber()
primaryScreen()
.
public final int screenNumber(QWidget widget)
primaryScreen()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |