Remove dead QT_EXPERIMENTAL_CLIENT_DECORATIONS code
Change-Id: I841f483b368d3f2740828f8933b91898f6a4d453 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
589bfddc7c
commit
420db269fe
@ -1,8 +1,6 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||||
|
|
||||||
//#define QT_EXPERIMENTAL_CLIENT_DECORATIONS
|
|
||||||
|
|
||||||
#include "qmainwindow.h"
|
#include "qmainwindow.h"
|
||||||
#include "qmainwindowlayout_p.h"
|
#include "qmainwindowlayout_p.h"
|
||||||
|
|
||||||
@ -69,57 +67,11 @@ QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *mainWindow)
|
|||||||
return QMainWindowPrivate::mainWindowLayout(mainWindow);
|
return QMainWindowPrivate::mainWindowLayout(mainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_EXPERIMENTAL_CLIENT_DECORATIONS
|
|
||||||
Q_WIDGETS_EXPORT void qt_setMainWindowTitleWidget(QMainWindow *mainWindow, Qt::DockWidgetArea area, QWidget *widget)
|
|
||||||
{
|
|
||||||
QGridLayout *topLayout = qobject_cast<QGridLayout *>(mainWindow->layout());
|
|
||||||
Q_ASSERT(topLayout);
|
|
||||||
|
|
||||||
int row = 0;
|
|
||||||
int column = 0;
|
|
||||||
|
|
||||||
switch (area) {
|
|
||||||
case Qt::LeftDockWidgetArea:
|
|
||||||
row = 1;
|
|
||||||
column = 0;
|
|
||||||
break;
|
|
||||||
case Qt::TopDockWidgetArea:
|
|
||||||
row = 0;
|
|
||||||
column = 1;
|
|
||||||
break;
|
|
||||||
case Qt::BottomDockWidgetArea:
|
|
||||||
row = 2;
|
|
||||||
column = 1;
|
|
||||||
break;
|
|
||||||
case Qt::RightDockWidgetArea:
|
|
||||||
row = 1;
|
|
||||||
column = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Q_ASSERT_X(false, "qt_setMainWindowTitleWidget", "Unknown area");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (QLayoutItem *oldItem = topLayout->itemAtPosition(row, column))
|
|
||||||
delete oldItem->widget();
|
|
||||||
topLayout->addWidget(widget, row, column);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void QMainWindowPrivate::init()
|
void QMainWindowPrivate::init()
|
||||||
{
|
{
|
||||||
Q_Q(QMainWindow);
|
Q_Q(QMainWindow);
|
||||||
|
|
||||||
#ifdef QT_EXPERIMENTAL_CLIENT_DECORATIONS
|
|
||||||
QGridLayout *topLayout = new QGridLayout(q);
|
|
||||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
|
||||||
|
|
||||||
layout = new QMainWindowLayout(q, topLayout);
|
|
||||||
|
|
||||||
topLayout->addItem(layout, 1, 1);
|
|
||||||
#else
|
|
||||||
layout = new QMainWindowLayout(q, nullptr);
|
layout = new QMainWindowLayout(q, nullptr);
|
||||||
#endif
|
|
||||||
|
|
||||||
const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, nullptr, q);
|
const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, nullptr, q);
|
||||||
iconSize = QSize(metric, metric);
|
iconSize = QSize(metric, metric);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user