|
|
||||||||||
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.
In the illustration above, Application One's primary screen is screen 0, and App Two's primary screen is screen 1.
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.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<java.lang.Integer> |
resized
This signal is emitted when the size of arg__1 changes. |
QSignalEmitter.Signal1<java.lang.Integer> |
workAreaResized
This signal is emitted when the work area available on arg__1 changes. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QDesktopWidget()
Creates the desktop widget. |
Method Summary | |
---|---|
QRect |
availableGeometry()
Equivalent to availableGeometry(-1). |
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 point. |
QRect |
availableGeometry(QWidget widget)
Returns the available geometry of the screen which contains widget. |
static QDesktopWidget |
fromNativePointer(QNativePointer nativePointer)
This function returns the QDesktopWidget instance pointed to by 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. |
protected void |
resizeEvent(QResizeEvent e)
This function is reimplemented for internal reasons. |
QWidget |
screen()
Equivalent to screen(-1). |
QWidget |
screen(int screen)
Returns a widget that represents the screen with index screen. |
QRect |
screenGeometry()
Equivalent to screenGeometry(-1). |
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 point. |
QRect |
screenGeometry(QWidget widget)
Returns the geometry of the screen which contains widget. |
int |
screenNumber()
Equivalent to screenNumber(0). |
int |
screenNumber(QPoint arg__1)
Returns the index of the screen that contains the arg__1, or the screen which is the shortest distance from the arg__1. |
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 |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<java.lang.Integer> resized
This signal is emitted when the size of arg__1 changes.
public final QSignalEmitter.Signal1<java.lang.Integer> workAreaResized
This signal is emitted when the work area available on arg__1 changes.
Constructor Detail |
---|
public QDesktopWidget()
Creates the desktop widget.
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 point.
public final QRect availableGeometry()
Equivalent to availableGeometry(-1).
public final QRect availableGeometry(int screen)
Returns the available geometry of the screen with index screen. What is available will be subrect of 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).
public final QRect availableGeometry(QWidget widget)
Returns the available geometry of the screen which contains widget.
public final boolean isVirtualDesktop()
Returns true if the system manages the available screens in a virtual desktop; otherwise returns false.
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()
Returns the number of available screens.
public final int primaryScreen()
Returns the index of the primary screen.
public final QWidget screen()
Equivalent to screen(-1).
public final QWidget screen(int screen)
Returns a widget that represents the screen with index 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.
public final QRect screenGeometry(QPoint point)
Returns the geometry of the screen which contains point.
public final QRect screenGeometry()
Equivalent to screenGeometry(-1).
public final QRect screenGeometry(int screen)
Returns the geometry of the screen with index screen.
public final QRect screenGeometry(QWidget widget)
Returns the geometry of the screen which contains widget.
public final int screenNumber(QPoint arg__1)
Returns the index of the screen that contains the arg__1, or the screen which is the shortest distance from the arg__1.
public final int screenNumber()
Equivalent to screenNumber(0).
public final 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.
protected void resizeEvent(QResizeEvent e)
This function is reimplemented for internal reasons.
resizeEvent
in class QWidget
Example
public static QDesktopWidget fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |