summaryrefslogtreecommitdiffstats
path: root/tests/manual/dialogs/colordialogpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/dialogs/colordialogpanel.cpp')
-rw-r--r--tests/manual/dialogs/colordialogpanel.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/manual/dialogs/colordialogpanel.cpp b/tests/manual/dialogs/colordialogpanel.cpp
index 24416fdfa1..eb4bbd0a93 100644
--- a/tests/manual/dialogs/colordialogpanel.cpp
+++ b/tests/manual/dialogs/colordialogpanel.cpp
@@ -169,6 +169,8 @@ void ColorDialogPanel::execModal()
QColorDialog dialog(this);
applySettings(&dialog);
connect(&dialog, SIGNAL(accepted()), this, SLOT(accepted()));
+ connect(&dialog, SIGNAL(rejected()), this, SLOT(rejected()));
+ connect(&dialog, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(currentColorChanged(const QColor&)));
dialog.setWindowTitle(tr("Modal Color Dialog Qt %1").arg(QLatin1String(QT_VERSION_STR)));
dialog.exec();
}
@@ -180,6 +182,8 @@ void ColorDialogPanel::showModal()
m_modalDialog = new QColorDialog(this);
m_modalDialog->setModal(true);
connect(m_modalDialog.data(), SIGNAL(accepted()), this, SLOT(accepted()));
+ connect(m_modalDialog.data(), SIGNAL(rejected()), this, SLOT(rejected()));
+ connect(m_modalDialog.data(), SIGNAL(currentColorChanged(const QColor&)), this, SLOT(currentColorChanged(const QColor&)));
m_modalDialog->setWindowTitle(tr("Modal Color Dialog #%1 Qt %2")
.arg(++n)
.arg(QLatin1String(QT_VERSION_STR)));
@@ -195,6 +199,8 @@ void ColorDialogPanel::showNonModal()
static int n = 0;
m_nonModalDialog = new QColorDialog(this);
connect(m_nonModalDialog.data(), SIGNAL(accepted()), this, SLOT(accepted()));
+ connect(m_nonModalDialog.data(), SIGNAL(rejected()), this, SLOT(rejected()));
+ connect(m_nonModalDialog.data(), SIGNAL(currentColorChanged(const QColor&)), this, SLOT(currentColorChanged(const QColor&)));
m_nonModalDialog->setWindowTitle(tr("Non-Modal Color Dialog #%1 Qt %2")
.arg(++n)
.arg(QLatin1String(QT_VERSION_STR)));
@@ -223,12 +229,24 @@ void ColorDialogPanel::accepted()
const QColorDialog *d = qobject_cast<const QColorDialog *>(sender());
Q_ASSERT(d);
m_result.clear();
+ qDebug() << "Current color: " << d->currentColor()
+ << "Selected color: " << d->selectedColor();
QDebug(&m_result).nospace()
<< "Current color: " << d->currentColor()
<< "\nSelected color: " << d->selectedColor();
QTimer::singleShot(0, this, SLOT(showAcceptedResult())); // Avoid problems with the closing (modal) dialog as parent.
}
+void ColorDialogPanel::rejected()
+{
+ qDebug() << "rejected";
+}
+
+void ColorDialogPanel::currentColorChanged(const QColor &color)
+{
+ qDebug() << color;
+}
+
void ColorDialogPanel::showAcceptedResult()
{
QMessageBox::information(this, tr("Color Dialog Accepted"), m_result, QMessageBox::Ok);