summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/dialogs/dialogs.cpp
diff options
context:
space:
mode:
authorOleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io>2025-08-06 14:53:56 +0200
committerOleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io>2025-08-06 20:26:58 +0200
commit1cf7d9f34f1bc3ddc5fa97ff57a95dd8083f9ae8 (patch)
tree17fd4c4f1ee5437abb40b12acac566d90b62cd87 /src/widgets/doc/snippets/dialogs/dialogs.cpp
parent1ad8e33ef2500cba7e83cb7248f0f554def610ab (diff)
Fix indentation issues in the widgets snippets folder
Most of the snippets in widgets have indentation problems. So I refactored them to have a consistent indentation. Change-Id: I94422c222aa7a72cb2352f8cfb41ffe207c74904 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/dialogs/dialogs.cpp')
-rw-r--r--src/widgets/doc/snippets/dialogs/dialogs.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/doc/snippets/dialogs/dialogs.cpp b/src/widgets/doc/snippets/dialogs/dialogs.cpp
index e0ab0802773..f807955fa66 100644
--- a/src/widgets/doc/snippets/dialogs/dialogs.cpp
+++ b/src/widgets/doc/snippets/dialogs/dialogs.cpp
@@ -163,7 +163,7 @@ inline bool boo()
{
// hardware failure
-//! [2]
+ //! [2]
QMessageBox mb("Application Name",
"Hardware failure.\n\nDisk error detected\nDo you want to stop?",
QMessageBox::Question,
@@ -172,7 +172,7 @@ inline bool boo()
QMessageBox::NoButton);
if (mb.exec() == QMessageBox::No) {
// try again
-//! [2]
+ //! [2]
}
}
}
@@ -180,7 +180,7 @@ inline bool boo()
inline void moo()
{
int numFiles;
-//! [3]
+ //! [3]
QProgressDialog progress("Copying files...", "Abort Copy", 0, numFiles, this);
progress.setWindowModality(Qt::WindowModal);
@@ -192,7 +192,7 @@ inline void moo()
//... copy one file
}
progress.setValue(numFiles);
-//! [3]
+ //! [3]
}
class Operation : public QObject
@@ -247,7 +247,7 @@ void Operation::extension()
QWidget *extension;
QVBoxLayout *mainLayout;
-//! [extension]
+ //! [extension]
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
findButton = new QPushButton(tr("&Find"));
@@ -259,13 +259,13 @@ void Operation::extension()
extension->hide();
connect(moreButton, &QAbstractButton::toggled, extension, &QWidget::setVisible);
-//! [extension]
+ //! [extension]
-//! [buttonbox]
+ //! [buttonbox]
QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole);
-//! [buttonbox]
+ //! [buttonbox]
}
int main()