Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_gui_dialogs_qmessagebox.cpp File Reference

(69d4ecd6ef9057cb3703178277042ff7a7411459)

#include <QApplication>
#include <QMessageBox>
+ Include dependency graph for src_gui_dialogs_qmessagebox.cpp:

Go to the source code of this file.

Functions

msgBox exec ()
 
 if (msgBox.clickedButton()==connectButton)
 
 if (messageBox.clickedButton()==disconnectButton)
 
int main (int argc, char *argv[])
 [3]
 
msgBox setText ("The document has been modified.")
 
msgBox setInformativeText ("Do you want to save your changes?")
 
msgBox setStandardButtons (QMessageBox::Save|QMessageBox::Discard|QMessageBox::Cancel)
 
msgBox setDefaultButton (QMessageBox::Save)
 
 switch (ret)
 [6]
 

Variables

int ret
 [0]
 
QMessageBox msgBox
 [0]
 
QPushButtonconnectButton = msgBox.addButton(tr("Connect"), QMessageBox::ActionRole)
 
QPushButtonabortButton = msgBox.addButton(QMessageBox::Abort)
 
QMessageBox messageBox (this)
 [2]
 
QAbstractButtondisconnectButton
 

Function Documentation

◆ exec()

msgBox exec ( )

◆ if() [1/2]

if ( messageBox. clickedButton() = disconnectButton)

Definition at line 35 of file src_gui_dialogs_qmessagebox.cpp.

◆ if() [2/2]

else if ( msgBox. clickedButton() = connectButton)

Definition at line 21 of file src_gui_dialogs_qmessagebox.cpp.

◆ main()

int main ( int argc,
char * argv[] )

[3]

[2]

[4]

[printing a custom type]

[printing a custom type] [storing a custom value]

[storing a custom value]

[retrieving a custom value]

[retrieving a custom value]

[0]

[0] [1]

[1]

[0]

[0]

[1]

[1] [2]

[2]

[0]

[0]

[2]

[2]

[22]

[22]

[3]

[3]

[4]

[4]

[10]

[10]

[qcinfo_stream]

[qcinfo_stream]

[11]

[11]

[12]

[12]

[13]

[13]

[qcinfo_printf]

[qcinfo_printf]

[14]

[14]

[15]

[15]

[16]

[16]

[17]

[17]

[0]

[0]

[1]

[1]

[2]

[2]

[Window class using revision]

[Window class using revision]

[0]

[0]

[0]

[0]

[1]

[1]

[2]

[2]

[0]

[0]

[write output] [start stream]

[start stream]

[write element]

[write element]

[finish stream]

[finish stream] [write output]

[1]

[1]

[0]

[0]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1] //! [2]

[2]

[0]

[0]

[1]

[1]

[Adding a resource]

[Adding a resource]

[Inserting an image with a cursor]

[Inserting an image with a cursor]

[Inserting an image using HTML]

[Inserting an image using HTML]

[0]

[0] //! [1]

[1]

Definition at line 45 of file src_gui_dialogs_qmessagebox.cpp.

References app, QApplication::exec(), and QT_REQUIRE_VERSION.

+ Here is the call graph for this function:

◆ setDefaultButton()

msgBox setDefaultButton ( QMessageBox::Save )

◆ setInformativeText()

msgBox setInformativeText ( "Do you want to save your changes?" )

◆ setStandardButtons()

◆ setText()

msgBox setText ( "The document has been modified." )

◆ switch()

switch ( ret )

[6]

[7]

Definition at line 71 of file src_gui_dialogs_qmessagebox.cpp.

References QMessageBox::Cancel, QMessageBox::Discard, and QMessageBox::Save.

Variable Documentation

◆ abortButton

QPushButton* abortButton = msgBox.addButton(QMessageBox::Abort)

Definition at line 17 of file src_gui_dialogs_qmessagebox.cpp.

◆ connectButton

QPushButton* connectButton = msgBox.addButton(tr("Connect"), QMessageBox::ActionRole)

Definition at line 16 of file src_gui_dialogs_qmessagebox.cpp.

Referenced by QWizardPrivate::ensureButton().

◆ disconnectButton

QAbstractButton* disconnectButton
Initial value:
=
void addButton(QAbstractButton *button, ButtonRole role)
#define tr(X)
QMessageBox messageBox(this)
[2]

Definition at line 31 of file src_gui_dialogs_qmessagebox.cpp.

◆ messageBox

◆ msgBox

QMessageBox msgBox

[0]

[4]

[2]

[5]

[6]

Definition at line 15 of file src_gui_dialogs_qmessagebox.cpp.

Referenced by QMessageBox::about(), QMessageBox::aboutQt(), and showNewMessageBox().

◆ ret

int ret
Initial value:
= QMessageBox::warning(this, tr("My Application"),
tr("The document has been modified.\n"
"Do you want to save your changes?"),
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)

[0]

Definition at line 5 of file src_gui_dialogs_qmessagebox.cpp.