forked from qt-creator/qt-creator
Add a generic variable chooser widget.
The chooser allows choosing variables from a list, and inserting them into previously focused line edit, text edit, or plain text edit. Variables are now registered with a description in the variable manager. Also make the QT_INSTALL_BINS --> CurrentProject:QT_INSTALL_BINS for consistency.
This commit is contained in:
@@ -63,6 +63,7 @@ class VariableManagerPrivate : public QObject
|
||||
public:
|
||||
QHash<QString, QString> m_map;
|
||||
VMMapExpander m_macroExpander;
|
||||
QMap<QString, QString> m_descriptions;
|
||||
static VariableManager *m_instance;
|
||||
};
|
||||
|
||||
@@ -113,6 +114,21 @@ VariableManager* VariableManager::instance()
|
||||
return VariableManagerPrivate::m_instance;
|
||||
}
|
||||
|
||||
void VariableManager::registerVariable(const QString &variable, const QString &description)
|
||||
{
|
||||
d->m_descriptions.insert(variable, description);
|
||||
}
|
||||
|
||||
QList<QString> VariableManager::variables() const
|
||||
{
|
||||
return d->m_descriptions.keys();
|
||||
}
|
||||
|
||||
QString VariableManager::variableDescription(const QString &variable) const
|
||||
{
|
||||
return d->m_descriptions.value(variable);
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
#include "variablemanager.moc"
|
||||
|
||||
Reference in New Issue
Block a user