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// Qt-Security score:significant reason:default
4
7
8#include <layoutinfo_p.h>
9
10#include <QtDesigner/abstractmetadatabase.h>
11#include <QtDesigner/abstractformwindow.h>
12#include <QtDesigner/abstractformeditor.h>
13
15
16namespace qdesigner_internal {
17
18// ---- QDesignerLayoutDecorationFactory ----
19QDesignerLayoutDecorationFactory::QDesignerLayoutDecorationFactory(QExtensionManager *parent)
20 : QExtensionFactory(parent)
21{
22}
23
24QObject *QDesignerLayoutDecorationFactory::createExtension(QObject *object, const QString &iid, QObject *parent) const
25{
26 if (!object->isWidgetType() || iid != Q_TYPEID(QDesignerLayoutDecorationExtension))
27 return nullptr;
28
29 QWidget *widget = qobject_cast<QWidget*>(object);
30
31 if (const QLayoutWidget *layoutWidget = qobject_cast<const QLayoutWidget*>(widget))
32 return QLayoutSupport::createLayoutSupport(layoutWidget->formWindow(), widget, parent);
33
34 if (QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(widget))
35 if (LayoutInfo::managedLayout(fw->core(), widget))
36 return QLayoutSupport::createLayoutSupport(fw, widget, parent);
37
38 return nullptr;
39}
40}
41
42QT_END_NAMESPACE
friend class QWidget
Definition qpainter.h:432
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.