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
abstractdialoggui.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
8
9/*!
10 \class QDesignerDialogGuiInterface
11 \since 4.4
12 \internal
13
14 \brief The QDesignerDialogGuiInterface allows integrations of \QD to replace the
15 message boxes displayed by \QD by custom dialogs.
16
17 \inmodule QtDesigner
18
19 QDesignerDialogGuiInterface provides virtual functions that can be overwritten
20 to display message boxes and file dialogs.
21 \sa QMessageBox, QFileDialog
22*/
23
24/*!
25 \enum QDesignerDialogGuiInterface::Message
26
27 This enum specifies the context from within the message box is called.
28
29 \value FormLoadFailureMessage Loading of a form failed
30 \value UiVersionMismatchMessage Attempt to load a file created with an old version of Designer
31 \value ResourceLoadFailureMessage Resources specified in a file could not be found
32 \value TopLevelSpacerMessage Spacer items detected on a container without layout
33 \value PropertyEditorMessage Messages of the propert yeditor
34 \value SignalSlotEditorMessage Messages of the signal / slot editor
35 \value FormEditorMessage Messages of the form editor
36 \value PreviewFailureMessage A preview could not be created
37 \value PromotionErrorMessage Messages related to promotion of a widget
38 \value ResourceEditorMessage Messages of the resource editor
39 \value ScriptDialogMessage Messages of the script dialog
40 \value SignalSlotDialogMessage Messages of the signal slot dialog
41 \value OtherMessage Unspecified context
42*/
43
44/*!
45 Constructs a QDesignerDialogGuiInterface object.
46*/
47
48QDesignerDialogGuiInterface::QDesignerDialogGuiInterface() = default;
49
50/*!
51 Destroys the QDesignerDialogGuiInterface object.
52*/
53QDesignerDialogGuiInterface::~QDesignerDialogGuiInterface() = default;
54
55/*!
56 \fn QMessageBox::StandardButton QDesignerDialogGuiInterface::message(QWidget *parent, Message context, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
57
58 Opens a message box as child of \a parent within the context \a context, using \a icon, \a title, \a text, \a buttons and \a defaultButton
59 and returns the button chosen by the user.
60*/
61
62/*!
63 \fn QString QDesignerDialogGuiInterface::getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, QFileDialog::Options options)
64
65 Opens a file dialog as child of \a parent using the parameters \a caption, \a dir and \a options that prompts the
66 user for an existing directory. Returns a directory selected by the user.
67*/
68
69/*!
70 \fn QString QDesignerDialogGuiInterface::getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
71
72 Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
73 that prompts the user for an existing file. Returns a file selected by the user.
74*/
75
76/*!
77 \fn QStringList QDesignerDialogGuiInterface::getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
78
79 Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
80 that prompts the user for a set of existing files. Returns one or more existing files selected by the user.
81*/
82
83/*!
84 Opens a file dialog with image browsing capabilities as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
85 that prompts the user for an existing file. Returns a file selected by the user.
86
87 The default implementation simply calls getOpenFileName(). On platforms that do not support an image preview in the QFileDialog,
88 the function can be reimplemented to provide an image browser.
89
90 \since 4.5
91*/
92
93QString QDesignerDialogGuiInterface::getOpenImageFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options)
94{
95 return getOpenFileName(parent, caption, dir, filter, selectedFilter, options);
96}
97
98/*!
99 Opens a file dialog with image browsing capabilities as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
100 that prompts the user for a set of existing files. Returns one or more existing files selected by the user.
101
102 The default implementation simply calls getOpenFileNames(). On platforms that do not support an image preview in the QFileDialog,
103 the function can be reimplemented to provide an image browser.
104
105 \since 4.5
106*/
107
108QStringList QDesignerDialogGuiInterface::getOpenImageFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options)
109{
110 return getOpenFileNames(parent, caption, dir, filter, selectedFilter, options);
111}
112
113/*!
114 \fn QString QDesignerDialogGuiInterface::getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
115
116 Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
117 that prompts the user for a file. Returns a file selected by the user. The file does not have to exist.
118*/
119
120QT_END_NAMESPACE
Combined button and popup list for selecting options.