Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
default_layoutdecoration.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
6
7#include <layoutinfo_p.h>
8
9#include <QtDesigner/abstractmetadatabase.h>
10#include <QtDesigner/abstractformwindow.h>
11#include <QtDesigner/abstractformeditor.h>
12
14
15namespace qdesigner_internal {
16
17// ---- QDesignerLayoutDecorationFactory ----
18QDesignerLayoutDecorationFactory::QDesignerLayoutDecorationFactory(QExtensionManager *parent)
19 : QExtensionFactory(parent)
20{
21}
22
23QObject *QDesignerLayoutDecorationFactory::createExtension(QObject *object, const QString &iid, QObject *parent) const
24{
25 if (!object->isWidgetType() || iid != Q_TYPEID(QDesignerLayoutDecorationExtension))
26 return nullptr;
27
28 QWidget *widget = qobject_cast<QWidget*>(object);
29
30 if (const QLayoutWidget *layoutWidget = qobject_cast<const QLayoutWidget*>(widget))
31 return QLayoutSupport::createLayoutSupport(layoutWidget->formWindow(), widget, parent);
32
33 if (QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(widget))
34 if (LayoutInfo::managedLayout(fw->core(), widget))
35 return QLayoutSupport::createLayoutSupport(fw, widget, parent);
36
37 return nullptr;
38}
39}
40
41QT_END_NAMESPACE
friend class QWidget
Definition qpainter.h:421
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.