class QPlatformScreen;
class QPlatformWindowPrivate;
class QWindow;
+class QIcon;
class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface
{
virtual void setParent(const QPlatformWindow *window);
virtual void setWindowTitle(const QString &title);
+ virtual void setWindowIcon(const QIcon &icon);
virtual void raise();
virtual void lower();
void QPlatformWindow::setWindowTitle(const QString &title) { Q_UNUSED(title); }
/*!
+ Reimplement to set the window icon to \a icon
+*/
+void QPlatformWindow::setWindowIcon(const QIcon &icon) { Q_UNUSED(icon); }
+
+/*!
Reimplement to be able to let Qt raise windows to the top of the desktop
*/
void QPlatformWindow::raise() { qWarning("This plugin does not support raise()"); }
{
Q_D(QWindow);
d->windowTitle = title;
- if (d->platformWindow) {
+ if (d->platformWindow)
d->platformWindow->setWindowTitle(title);
- }
}
QString QWindow::windowTitle() const
}
/*!
+ Sets the window icon to the given \a icon.
+
+ The window icon might be used by the windowing system for example to decorate the window,
+ or in the task switcher.
+*/
+void QWindow::setWindowIcon(const QIcon &icon)
+{
+ Q_D(QWindow);
+ d->windowIcon = icon;
+ if (d->platformWindow)
+ d->platformWindow->setWindowIcon(icon);
+}
+
+QIcon QWindow::windowIcon() const
+{
+ Q_D(const QWindow);
+ return d->windowIcon;
+}
+
+/*!
Raise the window in the windowing system.
Requests that the window be raised to appear above other windows.
void QWindow::raise()
{
Q_D(QWindow);
- if (d->platformWindow) {
+ if (d->platformWindow)
d->platformWindow->raise();
- }
}
/*!
void QWindow::lower()
{
Q_D(QWindow);
- if (d->platformWindow) {
+ if (d->platformWindow)
d->platformWindow->lower();
- }
}
/*!
}
/*!
- Sets the window icon to the given \a icon image.
-
- The window icon might be used by the windowing system for example to decorate the window,
- or in the task switcher.
-*/
-void QWindow::setWindowIcon(const QImage &icon) const
-{
- Q_UNUSED(icon);
- qDebug() << "unimplemented:" << __FILE__ << __LINE__;
-}
-
-/*!
Releases the native platform resources associated with this window.
\sa create()
#include <QtGui/qsurfaceformat.h>
#include <QtGui/qwindowdefs.h>
+#include <QtGui/qicon.h>
+
#ifndef QT_NO_CURSOR
#include <QtGui/qcursor.h>
#endif
Q_DECLARE_PRIVATE(QWindow)
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle)
+ Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
Q_PROPERTY(Qt::WindowModality windowModality READ windowModality WRITE setWindowModality NOTIFY windowModalityChanged)
Q_PROPERTY(int x READ x WRITE setX NOTIFY xChanged)
Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged)
void resize(const QSize &newSize);
inline void resize(int w, int h) { resize(QSize(w, h)); }
- void setWindowIcon(const QImage &icon) const;
+ void setWindowIcon(const QIcon &icon);
+ QIcon windowIcon() const;
void destroy();
#include <qpa/qplatformwindow.h>
#include <QtCore/private/qobject_p.h>
+#include <QtGui/QIcon>
QT_BEGIN_HEADER
bool exposed;
QSurfaceFormat requestedFormat;
QString windowTitle;
+ QIcon windowIcon;
QRect geometry;
Qt::WindowState windowState;
bool resizeEventPending;