Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QDESKTOPWIDGET_H
00043 #define QDESKTOPWIDGET_H
00044
00045 #include <QtGui/qwidget.h>
00046
00047 QT_BEGIN_HEADER
00048
00049 QT_BEGIN_NAMESPACE
00050
00051 QT_MODULE(Gui)
00052
00053 class QApplication;
00054 class QDesktopWidgetPrivate;
00055
00056 class Q_GUI_EXPORT QDesktopWidget : public QWidget
00057 {
00058 Q_OBJECT
00059 Q_PROPERTY(bool virtualDesktop READ isVirtualDesktop)
00060 Q_PROPERTY(int screenCount READ screenCount NOTIFY screenCountChanged)
00061 Q_PROPERTY(int primaryScreen READ primaryScreen)
00062 public:
00063 QDesktopWidget();
00064 ~QDesktopWidget();
00065
00066 bool isVirtualDesktop() const;
00067
00068 int numScreens() const;
00069 int screenCount() const;
00070 int primaryScreen() const;
00071
00072 int screenNumber(const QWidget *widget = 0) const;
00073 int screenNumber(const QPoint &) const;
00074
00075 QWidget *screen(int screen = -1);
00076
00077 const QRect screenGeometry(int screen = -1) const;
00078 const QRect screenGeometry(const QWidget *widget) const;
00079 const QRect screenGeometry(const QPoint &point) const
00080 { return screenGeometry(screenNumber(point)); }
00081
00082 const QRect availableGeometry(int screen = -1) const;
00083 const QRect availableGeometry(const QWidget *widget) const;
00084 const QRect availableGeometry(const QPoint &point) const
00085 { return availableGeometry(screenNumber(point)); }
00086
00087 Q_SIGNALS:
00088 void resized(int);
00089 void workAreaResized(int);
00090 void screenCountChanged(int);
00091
00092 protected:
00093 void resizeEvent(QResizeEvent *e);
00094
00095 private:
00096 Q_DISABLE_COPY(QDesktopWidget)
00097 Q_DECLARE_PRIVATE(QDesktopWidget)
00098
00099 friend class QApplication;
00100 friend class QApplicationPrivate;
00101 };
00102
00103 inline int QDesktopWidget::screenCount() const
00104 { return numScreens(); }
00105
00106 QT_END_NAMESPACE
00107
00108 QT_END_HEADER
00109
00110 #endif // QDESKTOPWIDGET_H