Commit aa66684b authored by dt's avatar dt
Browse files

PathChooser: Introduce read-only mode.

In that mode the lineedit is readonly and the browse button is
disabled. To be used in the new targetsetuppage
parent 7edd89ba
......@@ -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();
......
......@@ -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 <title>
QString makeDialogTitle(const QString &title);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment