|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
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.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
resized
This signal is emitted when the size of screen changes. |
QSignalEmitter.Signal1 |
workAreaResized
This signal is emitted when the work area available on screen changes. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
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)
Returns the available geometry of the screen which contains p. |
QRect |
availableGeometry(QWidget widget)
Returns the available geometry of the screen which contains widget. |
static QDesktopWidget |
fromNativePointer(QNativePointer nativePointer)
|
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. |
QWidget |
screen(int screen)
Returns a widget that represents the screen with index 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)
Returns the geometry of the screen which contains p. |
QRect |
screenGeometry(QWidget widget)
Returns the geometry of the screen which contains widget. |
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)
Returns the index of the screen that contains the point, or the screen which is the shortest distance from the point. |
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 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
public final QSignalEmitter.Signal1 workAreaResized
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)
screenGeometry()
.
public final QRect availableGeometry(QWidget 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). 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). 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)
public final QRect screenGeometry(QWidget widget)
public final QRect screenGeometry()
screenNumber()
.
public final QRect screenGeometry(int screen)
screenNumber()
.
public final int screenNumber(QPoint arg__1)
primaryScreen()
.
public final int screenNumber()
primaryScreen()
.
public final int screenNumber(QWidget widget)
primaryScreen()
.
public static QDesktopWidget fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |