forked from qt-creator/qt-creator
Drop autoconnections
Use typed connections instead. Change-Id: I04205c877541722cc059398a146a216727daa103 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -54,6 +54,14 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
|
||||
this, &AndroidCreateKeystoreCertificate::checkCertificateAlias);
|
||||
connect(ui->countryLineEdit, &QLineEdit::textChanged,
|
||||
this, &AndroidCreateKeystoreCertificate::checkCountryCode);
|
||||
connect(ui->keystoreShowPassCheckBox, &QCheckBox::stateChanged,
|
||||
this, &AndroidCreateKeystoreCertificate::keystoreShowPassStateChanged);
|
||||
connect(ui->certificateShowPassCheckBox, &QCheckBox::stateChanged,
|
||||
this, &AndroidCreateKeystoreCertificate::certificateShowPassStateChanged);
|
||||
connect(ui->samePasswordCheckBox, &QCheckBox::stateChanged,
|
||||
this, &AndroidCreateKeystoreCertificate::samePasswordStateChanged);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted,
|
||||
this, &AndroidCreateKeystoreCertificate::buttonBoxAccepted);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected,
|
||||
this, &QDialog::reject);
|
||||
connect(ui->keystorePassLineEdit,
|
||||
@@ -144,19 +152,19 @@ bool AndroidCreateKeystoreCertificate::checkCountryCode()
|
||||
return true;
|
||||
}
|
||||
|
||||
void AndroidCreateKeystoreCertificate::on_keystoreShowPassCheckBox_stateChanged(int state)
|
||||
void AndroidCreateKeystoreCertificate::keystoreShowPassStateChanged(int state)
|
||||
{
|
||||
ui->keystorePassLineEdit->setEchoMode(state == Qt::Checked ? QLineEdit::Normal : QLineEdit::Password);
|
||||
ui->keystoreRetypePassLineEdit->setEchoMode(ui->keystorePassLineEdit->echoMode());
|
||||
}
|
||||
|
||||
void AndroidCreateKeystoreCertificate::on_certificateShowPassCheckBox_stateChanged(int state)
|
||||
void AndroidCreateKeystoreCertificate::certificateShowPassStateChanged(int state)
|
||||
{
|
||||
ui->certificatePassLineEdit->setEchoMode(state == Qt::Checked ? QLineEdit::Normal : QLineEdit::Password);
|
||||
ui->certificateRetypePassLineEdit->setEchoMode(ui->certificatePassLineEdit->echoMode());
|
||||
}
|
||||
|
||||
void AndroidCreateKeystoreCertificate::on_buttonBox_accepted()
|
||||
void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
|
||||
{
|
||||
if (!validateUserInput())
|
||||
return;
|
||||
@@ -200,7 +208,7 @@ void AndroidCreateKeystoreCertificate::on_buttonBox_accepted()
|
||||
accept();
|
||||
}
|
||||
|
||||
void AndroidCreateKeystoreCertificate::on_samePasswordCheckBox_stateChanged(int state)
|
||||
void AndroidCreateKeystoreCertificate::samePasswordStateChanged(int state)
|
||||
{
|
||||
if (state == Qt::Checked) {
|
||||
ui->certificatePassLineEdit->setDisabled(true);
|
||||
|
||||
@@ -61,10 +61,10 @@ private:
|
||||
bool checkCountryCode();
|
||||
|
||||
private slots:
|
||||
void on_keystoreShowPassCheckBox_stateChanged(int state);
|
||||
void on_certificateShowPassCheckBox_stateChanged(int state);
|
||||
void on_buttonBox_accepted();
|
||||
void on_samePasswordCheckBox_stateChanged(int state);
|
||||
void keystoreShowPassStateChanged(int state);
|
||||
void certificateShowPassStateChanged(int state);
|
||||
void buttonBoxAccepted();
|
||||
void samePasswordStateChanged(int state);
|
||||
|
||||
private:
|
||||
bool validateUserInput();
|
||||
|
||||
@@ -39,14 +39,22 @@ ClassDefinition::ClassDefinition(QWidget *parent) :
|
||||
m_ui.iconPathChooser->setHistoryCompleter(QLatin1String("Qmake.Icon.History"));
|
||||
m_ui.iconPathChooser->setPromptDialogTitle(tr("Select Icon"));
|
||||
m_ui.iconPathChooser->setPromptDialogFilter(tr("Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg)"));
|
||||
|
||||
connect(m_ui.libraryRadio, &QRadioButton::toggled, this, &ClassDefinition::enableButtons);
|
||||
connect(m_ui.skeletonCheck, &QCheckBox::toggled, this, &ClassDefinition::enableButtons);
|
||||
connect(m_ui.widgetLibraryEdit, &QLineEdit::textChanged,
|
||||
this, &ClassDefinition::widgetLibraryChanged);
|
||||
connect(m_ui.widgetHeaderEdit, &QLineEdit::textChanged,
|
||||
this, &ClassDefinition::widgetHeaderChanged);
|
||||
connect(m_ui.pluginClassEdit, &QLineEdit::textChanged,
|
||||
this, &ClassDefinition::pluginClassChanged);
|
||||
connect(m_ui.pluginHeaderEdit, &QLineEdit::textChanged,
|
||||
this, &ClassDefinition::pluginHeaderChanged);
|
||||
connect(m_ui.domXmlEdit, &QTextEdit::textChanged,
|
||||
this, [this] { m_domXmlChanged = true; });
|
||||
}
|
||||
|
||||
void ClassDefinition::enableButtons()
|
||||
{
|
||||
on_libraryRadio_toggled();
|
||||
}
|
||||
|
||||
void ClassDefinition::on_libraryRadio_toggled()
|
||||
{
|
||||
const bool enLib = m_ui.libraryRadio->isChecked();
|
||||
m_ui.widgetLibraryLabel->setEnabled(enLib);
|
||||
@@ -66,11 +74,6 @@ void ClassDefinition::on_libraryRadio_toggled()
|
||||
(m_ui.libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
||||
}
|
||||
|
||||
void ClassDefinition::on_skeletonCheck_toggled()
|
||||
{
|
||||
on_libraryRadio_toggled();
|
||||
}
|
||||
|
||||
static inline QString xmlFromClassName(const QString &name)
|
||||
{
|
||||
QString rc = QLatin1String("<widget class=\"");
|
||||
@@ -96,31 +99,25 @@ void ClassDefinition::setClassName(const QString &name)
|
||||
}
|
||||
}
|
||||
|
||||
void ClassDefinition::on_widgetLibraryEdit_textChanged()
|
||||
void ClassDefinition::widgetLibraryChanged(const QString &text)
|
||||
{
|
||||
m_ui.widgetProjectEdit->setText(
|
||||
m_ui.widgetLibraryEdit->text() +
|
||||
m_ui.widgetProjectEdit->setText(text +
|
||||
(m_ui.libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
||||
}
|
||||
|
||||
void ClassDefinition::on_widgetHeaderEdit_textChanged()
|
||||
void ClassDefinition::widgetHeaderChanged(const QString &text)
|
||||
{
|
||||
m_ui.widgetSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(m_ui.widgetHeaderEdit->text()));
|
||||
m_ui.widgetSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||
}
|
||||
|
||||
void ClassDefinition::on_pluginClassEdit_textChanged()
|
||||
void ClassDefinition::pluginClassChanged(const QString &text)
|
||||
{
|
||||
m_ui.pluginHeaderEdit->setText(m_fileNamingParameters.headerFileName(m_ui.pluginClassEdit->text()));
|
||||
m_ui.pluginHeaderEdit->setText(m_fileNamingParameters.headerFileName(text));
|
||||
}
|
||||
|
||||
void ClassDefinition::on_pluginHeaderEdit_textChanged()
|
||||
void ClassDefinition::pluginHeaderChanged(const QString &text)
|
||||
{
|
||||
m_ui.pluginSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(m_ui.pluginHeaderEdit->text()));
|
||||
}
|
||||
|
||||
void ClassDefinition::on_domXmlEdit_textChanged()
|
||||
{
|
||||
m_domXmlChanged = true;
|
||||
m_ui.pluginSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||
}
|
||||
|
||||
PluginOptions::WidgetOptions ClassDefinition::widgetOptions(const QString &className) const
|
||||
|
||||
@@ -50,13 +50,10 @@ public:
|
||||
void enableButtons();
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_libraryRadio_toggled();
|
||||
void on_skeletonCheck_toggled();
|
||||
void on_widgetLibraryEdit_textChanged();
|
||||
void on_widgetHeaderEdit_textChanged();
|
||||
void on_pluginClassEdit_textChanged();
|
||||
void on_pluginHeaderEdit_textChanged();
|
||||
void on_domXmlEdit_textChanged();
|
||||
void widgetLibraryChanged(const QString &text);
|
||||
void widgetHeaderChanged(const QString &text);
|
||||
void pluginClassChanged(const QString &text);
|
||||
void pluginHeaderChanged(const QString &text);
|
||||
|
||||
private:
|
||||
Ui::ClassDefinition m_ui;
|
||||
|
||||
@@ -60,6 +60,12 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
|
||||
|
||||
connect(m_ui->classList, &ClassList::currentRowChanged,
|
||||
this, &CustomWidgetWidgetsWizardPage::slotCurrentRowChanged);
|
||||
connect(m_ui->classList, &ClassList::classAdded,
|
||||
this, &CustomWidgetWidgetsWizardPage::slotClassAdded);
|
||||
connect(m_ui->classList, &ClassList::classDeleted,
|
||||
this, &CustomWidgetWidgetsWizardPage::slotClassDeleted);
|
||||
connect(m_ui->classList, &ClassList::classRenamed,
|
||||
this, &CustomWidgetWidgetsWizardPage::slotClassRenamed);
|
||||
|
||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Custom Widgets"));
|
||||
}
|
||||
@@ -87,7 +93,7 @@ void CustomWidgetWidgetsWizardPage::slotCurrentRowChanged(int row)
|
||||
m_tabStackLayout->setCurrentIndex(row);
|
||||
}
|
||||
|
||||
void CustomWidgetWidgetsWizardPage::on_classList_classAdded(const QString &name)
|
||||
void CustomWidgetWidgetsWizardPage::slotClassAdded(const QString &name)
|
||||
{
|
||||
auto *cdef = new ClassDefinition;
|
||||
cdef->setFileNamingParameters(m_fileNamingParameters);
|
||||
@@ -96,12 +102,12 @@ void CustomWidgetWidgetsWizardPage::on_classList_classAdded(const QString &name)
|
||||
m_tabStackLayout->setCurrentIndex(index);
|
||||
m_uiClassDefs.append(cdef);
|
||||
cdef->enableButtons();
|
||||
on_classList_classRenamed(index, name);
|
||||
slotClassRenamed(index, name);
|
||||
// First class or collection class, re-check.
|
||||
slotCheckCompleteness();
|
||||
}
|
||||
|
||||
void CustomWidgetWidgetsWizardPage::on_classList_classDeleted(int index)
|
||||
void CustomWidgetWidgetsWizardPage::slotClassDeleted(int index)
|
||||
{
|
||||
delete m_tabStackLayout->widget(index);
|
||||
m_uiClassDefs.removeAt(index);
|
||||
@@ -109,7 +115,7 @@ void CustomWidgetWidgetsWizardPage::on_classList_classDeleted(int index)
|
||||
slotCheckCompleteness();
|
||||
}
|
||||
|
||||
void CustomWidgetWidgetsWizardPage::on_classList_classRenamed(int index, const QString &name)
|
||||
void CustomWidgetWidgetsWizardPage::slotClassRenamed(int index, const QString &name)
|
||||
{
|
||||
m_uiClassDefs[index]->setClassName(name);
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ public:
|
||||
void initializePage() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_classList_classAdded(const QString &name);
|
||||
void on_classList_classDeleted(int index);
|
||||
void on_classList_classRenamed(int index, const QString &newName);
|
||||
void slotClassAdded(const QString &name);
|
||||
void slotClassDeleted(int index);
|
||||
void slotClassRenamed(int index, const QString &newName);
|
||||
void slotCheckCompleteness();
|
||||
void slotCurrentRowChanged(int);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user