1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Designer of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#include "abstractnewformwidget.h"
30#include <newformwidget_p.h>
31
32QT_BEGIN_NAMESPACE
33
34/*!
35 \class QDesignerNewFormWidgetInterface
36 \since 4.5
37 \internal
38
39 \brief QDesignerNewFormWidgetInterface provides an interface for chooser
40 widgets that can be used within "New Form" dialogs and wizards.
41 It presents the user with a list of choices taken from built-in
42 templates, pre-defined template paths and suitable custom widgets.
43 It provides a static creation function that returns \QD's
44 implementation.
45
46 \inmodule QtDesigner
47*/
48
49/*!
50 Constructs a QDesignerNewFormWidgetInterface object.
51*/
52
53QDesignerNewFormWidgetInterface::QDesignerNewFormWidgetInterface(QWidget *parent) :
54 QWidget(parent)
55{
56}
57
58/*!
59 Destroys the QDesignerNewFormWidgetInterface object.
60*/
61
62QDesignerNewFormWidgetInterface::~QDesignerNewFormWidgetInterface() = default;
63
64/*!
65 Creates an instance of the QDesignerNewFormWidgetInterface as a child
66 of \a parent using \a core.
67*/
68
69QDesignerNewFormWidgetInterface *QDesignerNewFormWidgetInterface::createNewFormWidget(QDesignerFormEditorInterface *core, QWidget *parent)
70{
71 return new qdesigner_internal::NewFormWidget(core, parent);
72}
73
74/*!
75 \fn bool QDesignerNewFormWidgetInterface::hasCurrentTemplate() const
76
77 Returns whether a form template is currently selected.
78*/
79
80/*!
81 \fn QString QDesignerNewFormWidgetInterface::currentTemplate(QString *errorMessage = 0)
82
83 Returns the contents of the currently selected template. If the method fails,
84 an empty string is returned and \a errorMessage receives an error message.
85*/
86
87// Signals
88
89/*!
90 \fn void QDesignerNewFormWidgetInterface::templateActivated()
91
92 This signal is emitted whenever the user activates a template by double-clicking.
93*/
94
95/*!
96 \fn void QDesignerNewFormWidgetInterface::currentTemplateChanged(bool templateSelected)
97
98 This signal is emitted whenever the user changes the current template.
99 \a templateSelected indicates whether a template is currently selected.
100*/
101
102QT_END_NAMESPACE
103

source code of qttools/src/designer/src/lib/sdk/abstractnewformwidget.cpp