diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 4193a87e05f..62a77373500 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -50,9 +50,9 @@ #include #include +#include #include #include -#include #include #include @@ -118,8 +118,8 @@ private: std::function verifyCallback = [](const QString &) { return true; }; QLabel *inputContextlabel = new QLabel(this); QLineEdit *inputEdit = new QLineEdit(this); - QLabel *warningIcon = new QLabel(this); - QLabel *warningLabel = new QLabel(this); + Utils::InfoLabel *warningLabel = new Utils::InfoLabel(tr("Incorrect password."), + Utils::InfoLabel::Warning, this); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); }; @@ -633,20 +633,12 @@ PasswordInputDialog::PasswordInputDialog(PasswordInputDialog::Context context, { inputEdit->setEchoMode(QLineEdit::Password); - warningIcon->setPixmap(Utils::Icons::WARNING.pixmap()); - warningIcon->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum)); - warningIcon->hide(); - warningLabel->hide(); - auto warningLayout = new QHBoxLayout; - warningLayout->addWidget(warningIcon); - warningLayout->addWidget(warningLabel); - auto mainLayout = new QVBoxLayout(this); mainLayout->addWidget(inputContextlabel); mainLayout->addWidget(inputEdit); - mainLayout->addLayout(warningLayout); + mainLayout->addWidget(warningLabel); mainLayout->addWidget(buttonBox); connect(inputEdit, &QLineEdit::textChanged,[this](const QString &text) { @@ -657,9 +649,7 @@ PasswordInputDialog::PasswordInputDialog(PasswordInputDialog::Context context, if (verifyCallback(inputEdit->text())) { accept(); // Dialog accepted. } else { - warningIcon->show(); warningLabel->show(); - warningLabel->setText(tr("Incorrect password.")); inputEdit->clear(); adjustSize(); } diff --git a/src/plugins/android/androidbuildapkwidget.cpp b/src/plugins/android/androidbuildapkwidget.cpp index 0edf6aef3f8..a9dd54f8b60 100644 --- a/src/plugins/android/androidbuildapkwidget.cpp +++ b/src/plugins/android/androidbuildapkwidget.cpp @@ -42,9 +42,9 @@ #include +#include #include #include -#include #include #include @@ -156,13 +156,8 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup() m_signPackageCheckBox = new QCheckBox(tr("Sign package"), group); m_signPackageCheckBox->setChecked(m_step->signPackage()); - m_signingDebugWarningIcon = new QLabel(group); - m_signingDebugWarningIcon->setSizePolicy(sizePolicy); - m_signingDebugWarningIcon->setPixmap(Icons::WARNING.pixmap()); - m_signingDebugWarningIcon->hide(); - - m_signingDebugWarningLabel = new QLabel(tr("Signing a debug package"), group); - m_signingDebugWarningLabel->setSizePolicy(sizePolicy); + m_signingDebugWarningLabel = new Utils::InfoLabel(tr("Signing a debug package"), + Utils::InfoLabel::Warning, group); m_signingDebugWarningLabel->hide(); auto certificateAliasLabel = new QLabel(tr("Certificate alias:"), group); @@ -182,7 +177,6 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup() horizontalLayout_2->addWidget(keystoreCreateButton); auto horizontalLayout_3 = new QHBoxLayout; - horizontalLayout_3->addWidget(m_signingDebugWarningIcon); horizontalLayout_3->addWidget(m_signingDebugWarningLabel); horizontalLayout_3->addWidget(certificateAliasLabel); horizontalLayout_3->addWidget(m_certificatesAliasComboBox); @@ -356,7 +350,6 @@ void AndroidBuildApkWidget::updateSigningWarning() { bool nonRelease = m_step->buildConfiguration()->buildType() != BuildConfiguration::Release; bool visible = m_step->signPackage() && nonRelease; - m_signingDebugWarningIcon->setVisible(visible); m_signingDebugWarningLabel->setVisible(visible); } diff --git a/src/plugins/android/androidbuildapkwidget.h b/src/plugins/android/androidbuildapkwidget.h index 4c35b5dcd7c..c3751484a19 100644 --- a/src/plugins/android/androidbuildapkwidget.h +++ b/src/plugins/android/androidbuildapkwidget.h @@ -38,6 +38,10 @@ class QComboBox; class QLabel; QT_END_NAMESPACE +namespace Utils { +class InfoLabel; +} + namespace Android { namespace Internal { @@ -62,8 +66,7 @@ private: private: AndroidBuildApkStep *m_step = nullptr; QCheckBox *m_signPackageCheckBox = nullptr; - QLabel *m_signingDebugWarningIcon = nullptr; - QLabel *m_signingDebugWarningLabel = nullptr; + Utils::InfoLabel *m_signingDebugWarningLabel = nullptr; QComboBox *m_certificatesAliasComboBox = nullptr; QCheckBox *m_addDebuggerCheckBox = nullptr; };