diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index c0cf9a7f41e..a486df9887e 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -315,6 +315,17 @@ void PathChooser::setPath(const QString &path) m_d->m_lineEdit->setText(QDir::toNativeSeparators(path)); } +bool PathChooser::isReadOnly() const +{ + return m_d->m_lineEdit->isReadOnly(); +} + +void PathChooser::setReadOnly(bool b) +{ + m_d->m_lineEdit->setReadOnly(b); + m_d->m_button->setEnabled(!b); +} + void PathChooser::slotBrowse() { emit beforeBrowsing(); diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 51c08249be8..872e2bd9f4a 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -63,6 +63,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget Q_PROPERTY(Kind expectedKind READ expectedKind WRITE setExpectedKind DESIGNABLE true) Q_PROPERTY(QString baseDirectory READ baseDirectory WRITE setBaseDirectory DESIGNABLE true) Q_PROPERTY(QStringList commandVersionArguments READ commandVersionArguments WRITE setCommandVersionArguments) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true) public: static const char * const browseButtonLabel; @@ -126,6 +127,9 @@ public: // Install a tooltip on lineedits used for binaries showing the version. static void installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments); + bool isReadOnly() const; + void setReadOnly(bool b); + private: // Returns overridden title or the one from