21 QPushButton* pcmdMessage =
new QPushButton(
"&Message");
22 connect(pcmdMessage, SIGNAL(clicked()), SLOT(
slotMessage()));
24 QPushButton* pcmdInformation =
new QPushButton(
"&Information");
27 QPushButton* pcmdWarning =
new QPushButton(
"&Warning");
28 connect(pcmdWarning, SIGNAL(clicked()), SLOT(
slotWarning()));
30 QPushButton* pcmdCritical =
new QPushButton(
"&Critical");
31 connect(pcmdCritical, SIGNAL(clicked()), SLOT(
slotCritical()));
33 QPushButton* pcmdAbout =
new QPushButton(
"&About");
34 connect(pcmdAbout, SIGNAL(clicked()), SLOT(
slotAbout()));
36 QPushButton* pcmdAboutQt =
new QPushButton(
"A&boutQt");
37 connect(pcmdAboutQt, SIGNAL(clicked()), SLOT(
slotAboutQt()));
39 QPushButton* pcmdError =
new QPushButton(
"&Error");
40 connect(pcmdError, SIGNAL(clicked()), SLOT(
slotError()));
42 QVBoxLayout* pvbxLayout =
new QVBoxLayout;
43 pvbxLayout->addWidget(pcmdMessage);
44 pvbxLayout->addWidget(pcmdInformation);
45 pvbxLayout->addWidget(pcmdWarning);
46 pvbxLayout->addWidget(pcmdCritical);
47 pvbxLayout->addWidget(pcmdAbout);
48 pvbxLayout->addWidget(pcmdAboutQt);
49 pvbxLayout->addWidget(pcmdError);
51 setLayout(pvbxLayout);
59 new QMessageBox(
"MessageBox",
60 "<b>A</b> <i>Simple</i> <u>Message</u>",
61 QMessageBox::Question,
64 QMessageBox::Cancel | QMessageBox::Escape
69 if (n == QMessageBox::Yes) {
77 QMessageBox::information(0,
"Information",
"Operation Complete");
84 QMessageBox::warning(0,
86 "The text in the file has changed," 87 "\n Do you want to save the changes?",
103 QMessageBox::critical(0,
105 "This operation will make your " 106 "computer unusable, continue?",
107 QMessageBox::Yes | QMessageBox::Default,
109 QMessageBox::Cancel | QMessageBox::Escape
111 if (n == QMessageBox::Yes) {
119 QMessageBox::about(0,
"About",
"My Program Ver. 1.0");
125 QMessageBox::aboutQt(0);
131 (
new QErrorMessage(
this))->showMessage(
"Write Error");
StartDialog(QWidget *pwgt=0)