diff options
author | Robert Griebl <robert.griebl@qt.io> | 2023-08-12 01:58:20 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2023-08-16 20:24:43 +0200 |
commit | 4e70e84f0ef8150d10c3e942998e6b73d04b2c34 (patch) | |
tree | 80940ba820f86005d2e302290303471a5363cb49 /src/window-lib | |
parent | 33d37a3517f89c16807e93e4ca686d7a1e81dd53 (diff) |
cmake: add support for Unity builds
Pick-to: 6.5 6.6
Change-Id: I5304ef97f051844a26e7e277a34e4bc790543647
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/window-lib')
-rw-r--r-- | src/window-lib/windowmanager.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp index de98d26a..e08b4dd0 100644 --- a/src/window-lib/windowmanager.cpp +++ b/src/window-lib/windowmanager.cpp @@ -203,14 +203,12 @@ QT_BEGIN_NAMESPACE_AM -namespace { -enum Roles +enum WMRoles { Id = Qt::UserRole + 1000, WindowRole, ContentState }; -} WindowManager *WindowManager::s_instance = nullptr; @@ -352,9 +350,9 @@ WindowManager::WindowManager(QQmlEngine *qmlEngine, const QString &waylandSocket Q_UNUSED(waylandSocketName) #endif - d->roleNames.insert(Id, "applicationId"); - d->roleNames.insert(WindowRole, "window"); - d->roleNames.insert(ContentState, "contentState"); + d->roleNames.insert(WMRoles::Id, "applicationId"); + d->roleNames.insert(WMRoles::WindowRole, "window"); + d->roleNames.insert(WMRoles::ContentState, "contentState"); d->qmlEngine = qmlEngine; @@ -426,15 +424,15 @@ QVariant WindowManager::data(const QModelIndex &index, int role) const Window *win = d->windowsInModel.at(index.row()); switch (role) { - case Id: + case WMRoles::Id: if (win->application()) { return win->application()->nonAliased()->id(); } else { return QString(); } - case WindowRole: + case WMRoles::WindowRole: return QVariant::fromValue(win); - case ContentState: + case WMRoles::ContentState: return win->contentState(); } return QVariant(); @@ -761,7 +759,7 @@ void WindowManager::setupWindow(Window *window) QModelIndex modelIndex = QAbstractListModel::index(index); qCDebug(LogGraphics).nospace() << "emitting dataChanged, index: " << modelIndex.row() << ", contentState: " << window->contentState(); - emit dataChanged(modelIndex, modelIndex, QVector<int>() << ContentState); + emit dataChanged(modelIndex, modelIndex, QVector<int>() << WMRoles::ContentState); } if (contentState == Window::NoSurface) { |