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