1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the Qt Designer of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #include "abstractformwindow.h"
|
---|
43 |
|
---|
44 | #include <widgetfactory_p.h>
|
---|
45 |
|
---|
46 | #include <QtGui/QTabBar>
|
---|
47 | #include <QtGui/QSizeGrip>
|
---|
48 | #include <QtGui/QAbstractButton>
|
---|
49 | #include <QtGui/QToolBox>
|
---|
50 | #include <QtGui/QMenuBar>
|
---|
51 | #include <QtGui/QMainWindow>
|
---|
52 | #include <QtGui/QDockWidget>
|
---|
53 | #include <QtGui/QToolBar>
|
---|
54 |
|
---|
55 | #include <QtCore/qdebug.h>
|
---|
56 |
|
---|
57 | QT_BEGIN_NAMESPACE
|
---|
58 |
|
---|
59 | /*!
|
---|
60 | \class QDesignerFormWindowInterface
|
---|
61 |
|
---|
62 | \brief The QDesignerFormWindowInterface class allows you to query
|
---|
63 | and manipulate form windows appearing in Qt Designer's workspace.
|
---|
64 |
|
---|
65 | \inmodule QtDesigner
|
---|
66 |
|
---|
67 | QDesignerFormWindowInterface provides information about
|
---|
68 | the associated form window as well as allowing its properties to be
|
---|
69 | altered. The interface is not intended to be instantiated
|
---|
70 | directly, but to provide access to \QD's current form windows
|
---|
71 | controlled by \QD's \l {QDesignerFormWindowManagerInterface}{form
|
---|
72 | window manager}.
|
---|
73 |
|
---|
74 | If you are looking for the form window containing a specific
|
---|
75 | widget, you can use the static
|
---|
76 | QDesignerFormWindowInterface::findFormWindow() function:
|
---|
77 |
|
---|
78 | \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp 0
|
---|
79 |
|
---|
80 | But in addition, you can access any of the current form windows
|
---|
81 | through \QD's form window manager: Use the
|
---|
82 | QDesignerFormEditorInterface::formWindowManager() function to
|
---|
83 | retrieve an interface to the manager. Once you have this
|
---|
84 | interface, you have access to all of \QD's current form windows
|
---|
85 | through the QDesignerFormWindowManagerInterface::formWindow()
|
---|
86 | function. For example:
|
---|
87 |
|
---|
88 | \snippet doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp 1
|
---|
89 |
|
---|
90 | The pointer to \QD's current QDesignerFormEditorInterface object
|
---|
91 | (\c formEditor in the example above) is provided by the
|
---|
92 | QDesignerCustomWidgetInterface::initialize() function's
|
---|
93 | parameter. When implementing a custom widget plugin, you must
|
---|
94 | subclass the QDesignerCustomWidgetInterface class to expose your
|
---|
95 | plugin to \QD.
|
---|
96 |
|
---|
97 | Once you have the form window, you can query its properties. For
|
---|
98 | example, a plain custom widget plugin is managed by \QD only at
|
---|
99 | its top level, i.e. none of its child widgets can be resized in
|
---|
100 | \QD's workspace. But QDesignerFormWindowInterface provides you
|
---|
101 | with functions that enables you to control whether a widget should
|
---|
102 | be managed by \QD, or not:
|
---|
103 |
|
---|
|
---|