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:
con
2011-02-10 20:58:17 +01:00
parent 738d1ccec9
commit b40500a7bf
13 changed files with 329 additions and 22 deletions

View File

@@ -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"