summaryrefslogtreecommitdiffstats
path: root/tests/manual/qlayout
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qlayout')
-rw-r--r--tests/manual/qlayout/gridwidget.cpp8
-rw-r--r--tests/manual/qlayout/hbwidget.cpp8
-rw-r--r--tests/manual/qlayout/vbwidget.cpp8
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index 31f0094182..6d7de3c763 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -53,6 +53,7 @@ GridWidget::GridWidget(QWidget *parent) :
QWidget(parent)
{
QGridLayout *hb = new QGridLayout(this);
+ hb->setObjectName("GridWidget");
QComboBox *combo = new QComboBox();
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -71,4 +72,11 @@ GridWidget::GridWidget(QWidget *parent) :
hb->addWidget(new QPushButton("123"), 1, 4);
hb->addWidget(new QSpinBox(), 0, 5);
hb->addWidget(new QSpinBox(), 1, 5);
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index e8bb07f4a4..743b420b0d 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -53,6 +53,7 @@ HbWidget::HbWidget(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *hb = new QHBoxLayout(this);
+ hb->setObjectName("HbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ HbWidget::HbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index 063176625d..ffd918b955 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -53,6 +53,7 @@ VbWidget::VbWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *hb = new QVBoxLayout(this);
+ hb->setObjectName("VbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ VbWidget::VbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}