diff options
Diffstat (limited to 'src/gui/kernel/qwindow.h')
-rw-r--r-- | src/gui/kernel/qwindow.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 4832adfb63..1413d3db25 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -93,10 +93,15 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface Q_OBJECT Q_DECLARE_PRIVATE(QWindow) - Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) - Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath) - Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon) - Q_PROPERTY(Qt::WindowModality windowModality READ windowModality WRITE setWindowModality NOTIFY windowModalityChanged) + // All properties which are declared here are inherited by QQuickWindow and therefore available in QML. + // So please think carefully about what it does to the QML namespace if you add any new ones, + // particularly the possible meanings these names might have in any specializations of Window. + // For example "state" (meaning windowState) is not a good property to declare, because it has + // a different meaning in QQuickItem, and users will tend to assume it is the same for Window. + + Q_PROPERTY(QString title READ title WRITE setTitle) + Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged) + Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags) Q_PROPERTY(int x READ x WRITE setX NOTIFY xChanged) Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged) Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) @@ -110,9 +115,6 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged) -#ifndef QT_NO_CURSOR - Q_PROPERTY(QCursor cursor READ cursor WRITE setCursor RESET unsetCursor) -#endif public: @@ -135,29 +137,29 @@ public: bool isTopLevel() const; bool isModal() const; - Qt::WindowModality windowModality() const; - void setWindowModality(Qt::WindowModality windowModality); + Qt::WindowModality modality() const; + void setModality(Qt::WindowModality modality); void setFormat(const QSurfaceFormat &format); QSurfaceFormat format() const; QSurfaceFormat requestedFormat() const; - void setWindowFlags(Qt::WindowFlags flags); - Qt::WindowFlags windowFlags() const; - Qt::WindowType windowType() const; + void setFlags(Qt::WindowFlags flags); + Qt::WindowFlags flags() const; + Qt::WindowType type() const; - QString windowTitle() const; + QString title() const; void setOpacity(qreal level); - void requestActivateWindow(); + void requestActivate(); bool isActive() const; void reportContentOrientationChange(Qt::ScreenOrientation orientation); Qt::ScreenOrientation contentOrientation() const; - bool requestWindowOrientation(Qt::ScreenOrientation orientation); - Qt::ScreenOrientation windowOrientation() const; + bool requestOrientation(Qt::ScreenOrientation orientation); + Qt::ScreenOrientation orientation() const; Qt::WindowState windowState() const; void setWindowState(Qt::WindowState state); @@ -213,11 +215,11 @@ public: void resize(const QSize &newSize); inline void resize(int w, int h) { resize(QSize(w, h)); } - void setWindowFilePath(const QString &filePath); - QString windowFilePath() const; + void setFilePath(const QString &filePath); + QString filePath() const; - void setWindowIcon(const QIcon &icon); - QIcon windowIcon() const; + void setIcon(const QIcon &icon); + QIcon icon() const; void destroy(); @@ -256,7 +258,7 @@ public Q_SLOTS: void raise(); void lower(); - void setWindowTitle(const QString &); + void setTitle(const QString &); void setX(int arg) { @@ -289,7 +291,8 @@ public Q_SLOTS: Q_SIGNALS: void screenChanged(QScreen *screen); - void windowModalityChanged(Qt::WindowModality windowModality); + void modalityChanged(Qt::WindowModality modality); + void windowStateChanged(Qt::WindowState windowState); void xChanged(int arg); void yChanged(int arg); |