Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
Qt::WindowState setWindowState(Qt::WindowState state);
void setWindowTitle(const QString &title);
+ void setWindowFilePath(const QString &filePath);
void raise();
void lower();
void propagateSizeHints();
#include "qcocoaglcontext.h"
#include "qcocoahelpers.h"
#include "qnsview.h"
+#include <QtCore/qfileinfo.h>
#include <QtCore/private/qcore_mac_p.h>
#include <qwindow.h>
#include <qpa/qwindowsysteminterface.h>
CFRelease(windowTitle);
}
+void QCocoaWindow::setWindowFilePath(const QString &filePath)
+{
+ QCocoaAutoReleasePool pool;
+ if (!m_nsWindow)
+ return;
+
+ QFileInfo fi(filePath);
+ [m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""];
+}
+
void QCocoaWindow::raise()
{
//qDebug() << "raise" << this;
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);
setWindowTitle_helper(q->windowTitle());
#endif
}
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
setWindowFilePath_sys(filePath);
#endif
}
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);
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);
}
+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);