Path Chooser: Introduce tooltip displaying the version.

Add a string-list type property specifying the version argument
for command type Path Choosers. Use it prototypically in
GccToolChainWidget.

Rubber-stamped-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2011-02-22 12:25:19 +01:00
parent 8784196ff5
commit 086c993ac9
3 changed files with 146 additions and 10 deletions

View File

@@ -62,6 +62,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
Q_PROPERTY(QString promptDialogTitle READ promptDialogTitle WRITE setPromptDialogTitle DESIGNABLE true)
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)
public:
static const char * const browseButtonLabel;
@@ -113,6 +114,17 @@ public:
QLineEdit *lineEdit() const;
// For PathChoosers of 'Command' type, this property specifies the arguments
// required to obtain the tool version (commonly, '--version'). Setting them
// causes the version to be displayed as a tooltip.
QStringList commandVersionArguments() const;
void setCommandVersionArguments(const QStringList &arguments);
// Utility to run a tool and return its stdout.
static QString toolVersion(const QString &binary, const QStringList &arguments);
// Install a tooltip on lineedits used for binaries showing the version.
static void installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments);
private:
// Returns overridden title or the one from <title>
QString makeDialogTitle(const QString &title);