summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-10-01 12:56:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 08:06:24 +0200
commitf20266f9f43ab3956de271f696c769db02992e87 (patch)
tree30559ada80346c71a2f731a89c829dbdf1bdec14 /src/widgets/kernel
parent24c403a2bd71578a1978baed1c60f08c12cd62c5 (diff)
fix QWidget::setWindowFilePath on Mac OS
Task-number: QTBUG-27299 Change-Id: I4dddbb9690aac327ad33477d8cea9afa84d10eb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp4
-rw-r--r--src/widgets/kernel/qwidget_p.h2
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp10
3 files changed, 13 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 84bb5a6685..ffcaa15527 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5725,7 +5725,7 @@ void QWidget::setWindowFilePath(const QString &filePath)
void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath)
{
if (extra->topextra && extra->topextra->caption.isEmpty()) {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
setWindowTitle_helper(QFileInfo(filePath).fileName());
#else
Q_Q(QWidget);
@@ -5733,7 +5733,7 @@ void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath)
setWindowTitle_helper(q->windowTitle());
#endif
}
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
setWindowFilePath_sys(filePath);
#endif
}
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 84785dadf2..eb67f756e8 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -477,6 +477,7 @@ public:
void setWindowIconText_sys(const QString &cap);
void setWindowIconText_helper(const QString &cap);
void setWindowTitle_sys(const QString &cap);
+ void setWindowFilePath_sys(const QString &filePath);
#ifndef QT_NO_CURSOR
void setCursor_sys(const QCursor &cursor);
@@ -766,7 +767,6 @@ public:
void update_sys(const QRegion &rgn);
void setGeometry_sys_helper(int, int, int, int, bool);
void updateMaximizeButton_sys();
- void setWindowFilePath_sys(const QString &filePath);
void createWindow_sys();
void recreateMacWindow();
void setSubWindowStacking(bool set);
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 7c84c7fc29..c6680eacec 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -346,6 +346,16 @@ void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
}
+void QWidgetPrivate::setWindowFilePath_sys(const QString &filePath)
+{
+ Q_Q(QWidget);
+ if (!q->isWindow())
+ return;
+
+ if (QWindow *window = q->windowHandle())
+ window->setWindowFilePath(filePath);
+}
+
void QWidgetPrivate::setWindowIcon_sys()
{
Q_Q(QWidget);