forked from qt-creator/qt-creator
Add validChanged(bool) to PathChooser.
This is useful when e.g. connecting directly to the setEnabled() slot of a Widget.
This commit is contained in:
@@ -138,10 +138,12 @@ void BaseValidatingLineEdit::slotChanged(const QString &t)
|
||||
m_bd->m_state = newState;
|
||||
m_bd->m_firstChange = false;
|
||||
setTextColor(this, newState == Invalid ? m_bd->m_errorTextColor : m_bd->m_okTextColor);
|
||||
if (validHasChanged)
|
||||
if (validHasChanged) {
|
||||
emit validChanged(newState == Valid);
|
||||
emit validChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BaseValidatingLineEdit::slotReturnPressed()
|
||||
{
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
|
||||
signals:
|
||||
void validChanged();
|
||||
void validChanged(bool validState);
|
||||
void validReturnPressed();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -108,6 +108,7 @@ PathChooser::PathChooser(QWidget *parent) :
|
||||
connect(m_d->m_lineEdit, SIGNAL(validReturnPressed()), this, SIGNAL(returnPressed()));
|
||||
connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed(QString)));
|
||||
connect(m_d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged()));
|
||||
connect(m_d->m_lineEdit, SIGNAL(validChanged(bool)), this, SIGNAL(validChanged(bool)));
|
||||
connect(m_d->m_lineEdit, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
|
||||
|
||||
m_d->m_lineEdit->setMinimumWidth(200);
|
||||
|
||||
@@ -99,6 +99,7 @@ private:
|
||||
|
||||
signals:
|
||||
void validChanged();
|
||||
void validChanged(bool validState);
|
||||
void changed(const QString &text);
|
||||
void editingFinished();
|
||||
void beforeBrowsing();
|
||||
|
||||
Reference in New Issue
Block a user