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
abstractformwindowmanager.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
6
7#include <QtCore/qmap.h>
8
10
11/*!
12 \class QDesignerFormWindowManagerInterface
13
14 \brief The QDesignerFormWindowManagerInterface class allows you to
15 manipulate the collection of form windows in \QD, and
16 control \QD's form editing actions.
17
18 \inmodule QtDesigner
19
20 QDesignerFormWindowManagerInterface is not intended to be
21 instantiated directly. \QD uses the form window manager to
22 control the various form windows in its workspace. You can
23 retrieve an interface to \QD's form window manager using
24 the QDesignerFormEditorInterface::formWindowManager()
25 function. For example:
26
27 \snippet lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp 0
28
29 When implementing a custom widget plugin, a pointer to \QD's
30 current QDesignerFormEditorInterface object (\c formEditor in the
31 example above) is provided by the
32 QDesignerCustomWidgetInterface::initialize() function's parameter.
33 You must subclass the QDesignerCustomWidgetInterface to expose
34 your plugin to \QD.
35
36 The form window manager interface provides the createFormWindow()
37 function that enables you to create a new form window which you
38 can add to the collection of form windows that the manager
39 maintains, using the addFormWindow() slot. It also provides the
40 formWindowCount() function returning the number of form windows
41 currently under the manager's control, the formWindow() function
42 returning the form window associated with a given index, and the
43 activeFormWindow() function returning the currently selected form
44 window. The removeFormWindow() slot allows you to reduce the
45 number of form windows the manager must maintain, and the
46 setActiveFormWindow() slot allows you to change the form window
47 focus in \QD's workspace.
48
49 In addition, QDesignerFormWindowManagerInterface contains a
50 collection of functions that enables you to intervene and control
51 \QD's form editing actions. All these functions return the
52 original action, making it possible to propagate the function
53 further after intervention.
54
55 Finally, the interface provides three signals which are emitted
56 when a form window is added, when the currently selected form
57 window changes, or when a form window is removed, respectively. All
58 the signals carry the form window in question as their parameter.
59
60 \sa QDesignerFormEditorInterface, QDesignerFormWindowInterface
61*/
62
63/*!
64 \enum QDesignerFormWindowManagerInterface::Action
65
66 Specifies an action of \QD.
67
68 \sa action()
69
70 \since 5.0
71 \value CutAction Clipboard Cut
72 \value CopyAction Clipboard Copy
73 \value PasteAction Clipboard Paste
74 \value DeleteAction Clipboard Delete
75 \value SelectAllAction Select All
76 \value LowerAction Lower current widget
77 \value RaiseAction Raise current widget
78 \value UndoAction Undo
79 \value RedoAction Redo
80 \value HorizontalLayoutAction Lay out using QHBoxLayout
81 \value VerticalLayoutAction Lay out using QVBoxLayout
82 \value SplitHorizontalAction Lay out in horizontal QSplitter
83 \value SplitVerticalAction Lay out in vertical QSplitter
84 \value GridLayoutAction Lay out using QGridLayout
85 \value FormLayoutAction Lay out using QFormLayout
86 \value BreakLayoutAction Break existing layout
87 \value AdjustSizeAction Adjust size
88 \value SimplifyLayoutAction Simplify QGridLayout or QFormLayout
89 \value DefaultPreviewAction Create a preview in default style
90 \value FormWindowSettingsDialogAction Show dialog with form settings
91*/
92
93/*!
94 \enum QDesignerFormWindowManagerInterface::ActionGroup
95
96 Specifies an action group of \QD.
97
98 \sa actionGroup()
99 \since 5.0
100 \value StyledPreviewActionGroup Action group containing styled preview actions
101*/
102
103/*!
104 Constructs an interface with the given \a parent for the form window
105 manager.
106*/
107QDesignerFormWindowManagerInterface::QDesignerFormWindowManagerInterface(QObject *parent)
108 : QObject(parent)
109{
110}
111
112/*!
113 Destroys the interface for the form window manager.
114*/
115QDesignerFormWindowManagerInterface::~QDesignerFormWindowManagerInterface() = default;
116
117/*!
118 Allows you to intervene and control \QD's "cut" action. The function
119 returns the original action.
120
121 \sa QAction
122 \deprecated
123
124 Use action() instead.
125*/
126#if QT_CONFIG(clipboard)
127QAction *QDesignerFormWindowManagerInterface::actionCut() const
128{
129 return action(CutAction);
130}
131#endif
132
133/*!
134 Allows you to intervene and control \QD's "copy" action. The
135 function returns the original action.
136
137 \sa QAction
138 \deprecated
139
140 Use action() instead.
141*/
142#if QT_CONFIG(clipboard)
143QAction *QDesignerFormWindowManagerInterface::actionCopy() const
144{
145 return action(CopyAction);
146}
147#endif
148
149/*!
150 Allows you to intervene and control \QD's "paste" action. The
151 function returns the original action.
152
153 \sa QAction
154 \deprecated
155
156 Use action() instead.
157*/
158#if QT_CONFIG(clipboard)
159QAction *QDesignerFormWindowManagerInterface::actionPaste() const
160{
161 return action(PasteAction);
162}
163#endif
164
165/*!
166 Allows you to intervene and control \QD's "delete" action. The function
167 returns the original action.
168
169 \sa QAction
170 \deprecated
171
172 Use action() instead.
173*/
174QAction *QDesignerFormWindowManagerInterface::actionDelete() const
175{
176 return action(DeleteAction);
177}
178
179/*!
180 Allows you to intervene and control \QD's "select all" action. The
181 function returns the original action.
182
183 \sa QAction
184 \deprecated
185
186 Use action() instead.
187*/
188QAction *QDesignerFormWindowManagerInterface::actionSelectAll() const
189{
190 return action(SelectAllAction);
191}
192
193/*!
194 Allows you to intervene and control the action of lowering a form
195 window in \QD's workspace. The function returns the original
196 action.
197
198 \sa QAction
199 \deprecated
200
201 Use action() instead.
202*/
203
204QAction *QDesignerFormWindowManagerInterface::actionLower() const
205{
206 return action(LowerAction);
207}
208
209/*!
210 Allows you to intervene and control the action of raising of a
211 form window in \QD's workspace. The function returns the original
212 action.
213
214 \sa QAction
215 \deprecated
216
217 Use action() instead.
218*/
219QAction *QDesignerFormWindowManagerInterface::actionRaise() const
220{
221 return action(RaiseAction);
222}
223
224/*!
225 Allows you to intervene and control a request for horizontal
226 layout for a form window in \QD's workspace. The function returns
227 the original action.
228
229 \sa QAction
230 \deprecated
231
232 Use action() instead.
233*/
234QAction *QDesignerFormWindowManagerInterface::actionHorizontalLayout() const
235{
236 return action(HorizontalLayoutAction);
237}
238
239/*!
240 Allows you to intervene and control a request for vertical layout
241 for a form window in \QD's workspace. The function returns the
242 original action.
243
244 \sa QAction
245 \deprecated
246
247 Use action() instead.
248*/
249QAction *QDesignerFormWindowManagerInterface::actionVerticalLayout() const
250{
251 return action(VerticalLayoutAction);
252}
253
254/*!
255 Allows you to intervene and control \QD's "split horizontal"
256 action. The function returns the original action.
257
258 \sa QAction
259 \deprecated
260
261 Use action() instead.
262*/
263QAction *QDesignerFormWindowManagerInterface::actionSplitHorizontal() const
264{
265 return action(SplitHorizontalAction);
266}
267
268/*!
269 Allows you to intervene and control \QD's "split vertical"
270 action. The function returns the original action.
271
272 \sa QAction
273 \deprecated
274
275 Use action() instead.
276*/
277QAction *QDesignerFormWindowManagerInterface::actionSplitVertical() const
278{
279 return action(SplitVerticalAction);
280}
281
282/*!
283 Allows you to intervene and control a request for grid layout for
284 a form window in \QD's workspace. The function returns the
285 original action.
286
287 \sa QAction
288 \deprecated
289
290 Use action() instead.
291*/
292QAction *QDesignerFormWindowManagerInterface::actionGridLayout() const
293{
294 return action(GridLayoutAction);
295}
296
297/*!
298 Allows you to intervene and control \QD's "form layout" action. The
299 function returns the original action.
300
301 \sa QAction
302 \since 4.4
303 \deprecated
304
305 Use action() instead.
306*/
307
308QAction *QDesignerFormWindowManagerInterface::actionFormLayout() const
309{
310 return action(FormLayoutAction);
311}
312
313/*!
314 Allows you to intervene and control \QD's "break layout" action. The
315 function returns the original action.
316
317 \sa QAction
318 \deprecated
319
320 Use action() instead.
321*/
322QAction *QDesignerFormWindowManagerInterface::actionBreakLayout() const
323{
324 return action(BreakLayoutAction);
325}
326
327/*!
328 Allows you to intervene and control \QD's "adjust size" action. The
329 function returns the original action.
330
331 \sa QAction
332 \deprecated
333
334 Use action() instead.
335*/
336QAction *QDesignerFormWindowManagerInterface::actionAdjustSize() const
337{
338 return action(AdjustSizeAction);
339}
340
341/*!
342 Allows you to intervene and control \QD's "simplify layout" action. The
343 function returns the original action.
344
345 \sa QAction
346 \since 4.4
347 \deprecated
348
349 Use action() instead.
350*/
351
352QAction *QDesignerFormWindowManagerInterface::actionSimplifyLayout() const
353{
354 return action(SimplifyLayoutAction);
355}
356
357/*!
358 \fn virtual QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::activeFormWindow() const
359 Returns the currently active form window in \QD's workspace.
360
361 \sa setActiveFormWindow(), removeFormWindow()
362*/
363
364/*!
365 \fn virtual QDesignerFormEditorInterface *QDesignerFormWindowManagerInterface::core() const
366 Returns a pointer to \QD's current QDesignerFormEditorInterface
367 object.
368*/
369
370/*!
371 \fn virtual void QDesignerFormWindowManagerInterface::addFormWindow(QDesignerFormWindowInterface *formWindow)
372 Adds the given \a formWindow to the collection of windows that
373 \QD's form window manager maintains.
374
375 \sa formWindowAdded()
376*/
377
378/*!
379 \fn virtual void QDesignerFormWindowManagerInterface::removeFormWindow(QDesignerFormWindowInterface *formWindow)
380 Removes the given \a formWindow from the collection of windows that
381 \QD's form window manager maintains.
382
383 \sa formWindow(), formWindowRemoved()
384*/
385
386/*!
387 \fn virtual void QDesignerFormWindowManagerInterface::setActiveFormWindow(QDesignerFormWindowInterface *formWindow)
388 Sets the given \a formWindow to be the currently active form window in
389 \QD's workspace.
390
391 \sa activeFormWindow(), activeFormWindowChanged()
392*/
393
394/*!
395 \fn int QDesignerFormWindowManagerInterface::formWindowCount() const
396 Returns the number of form windows maintained by \QD's form window
397 manager.
398*/
399
400/*!
401 \fn QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::formWindow(int index) const
402 Returns the form window at the given \a index.
403
404 \sa setActiveFormWindow(), removeFormWindow()
405*/
406
407/*!
408 \fn QDesignerFormWindowInterface *QDesignerFormWindowManagerInterface::createFormWindow(QWidget *parent, Qt::WindowFlags flags)
409
410 Creates a form window with the given \a parent and the given window
411 \a flags.
412
413 \sa addFormWindow()
414*/
415
416/*!
417 \fn QPixmap QDesignerFormWindowManagerInterface::createPreviewPixmap() const
418
419 Creates a pixmap representing the preview of the currently active form.
420*/
421
422/*!
423 Allows you to intervene and control \QD's "undo" action. The
424 function returns the original action.
425
426 \sa QAction
427 \deprecated
428
429 Use action() instead.
430*/
431QAction *QDesignerFormWindowManagerInterface::actionUndo() const
432{
433 return action(UndoAction);
434}
435
436/*!
437 Allows you to intervene and control \QD's "redo" action. The
438 function returns the original action.
439
440 \sa QAction
441 \deprecated
442
443 Use action() instead.
444*/
445QAction *QDesignerFormWindowManagerInterface::actionRedo() const
446{
447 return action(RedoAction);
448}
449
450/*!
451 \fn void QDesignerFormWindowManagerInterface::formWindowAdded(QDesignerFormWindowInterface *formWindow)
452
453 This signal is emitted when a new form window is added to the
454 collection of windows that \QD's form window manager maintains. A
455 pointer to the new \a formWindow is passed as an argument.
456
457 \sa addFormWindow(), setActiveFormWindow()
458*/
459
460/*!
461 \fn void QDesignerFormWindowManagerInterface::formWindowSettingsChanged(QDesignerFormWindowInterface *formWindow)
462
463 This signal is emitted when the settings of the form window change. It can be used to update
464 window titles, etc. accordingly. A pointer to the \a formWindow is passed as an argument.
465
466 \sa FormWindowSettingsDialogAction
467*/
468
469/*!
470 \fn void QDesignerFormWindowManagerInterface::formWindowRemoved(QDesignerFormWindowInterface *formWindow)
471
472 This signal is emitted when a form window is removed from the
473 collection of windows that \QD's form window manager maintains. A
474 pointer to the removed \a formWindow is passed as an argument.
475
476 \sa removeFormWindow()
477*/
478
479/*!
480 \fn void QDesignerFormWindowManagerInterface::activeFormWindowChanged(QDesignerFormWindowInterface *formWindow)
481
482 This signal is emitted when the contents of the currently active
483 form window in \QD's workspace changed. A pointer to the currently
484 active \a formWindow is passed as an argument.
485
486 \sa activeFormWindow()
487*/
488
489/*!
490 \fn void QDesignerFormWindowManagerInterface::dragItems(const QList<QDesignerDnDItemInterface*> &item_list)
491
492 \internal
493*/
494
495/*!
496 \fn virtual QAction QDesignerFormWindowManagerInterface::action(Action action) const
497
498 Returns the action specified by the enumeration value \a action.
499
500 Obsoletes the action accessors of Qt 4.X.
501
502 \since 5.0
503*/
504
505/*!
506 \fn virtual QActionGroup *QDesignerFormWindowManagerInterface::actionGroup(ActionGroup actionGroup) const
507
508 Returns the action group specified by the enumeration value \a actionGroup.
509
510 \since 5.0
511*/
512
513/*!
514 \fn virtual void QDesignerFormWindowManagerInterface::showPreview()
515
516 Show a preview of the current form using the default parameters.
517
518 \since 5.0
519 \sa closeAllPreviews()
520*/
521
522/*!
523 \fn virtual void QDesignerFormWindowManagerInterface::closeAllPreviews()
524
525 Close all currently open previews.
526
527 \since 5.0
528 \sa showPreview()
529*/
530
531/*!
532 \fn virtual void QDesignerFormWindowManagerInterface::showPluginDialog()
533
534 Opens a dialog showing the plugins loaded by \QD's and its plugin load failures.
535
536 \since 5.0
537*/
538
539QT_END_NAMESPACE
Combined button and popup list for selecting options.