forked from qt-creator/qt-creator
VariableChooser: Rework
Allow multiple expanders to be registered for lineedits, e.g. a local and the global ones, and actually show them. Use a tree view in the chooser for somewhat more structured display. Change-Id: I769f92144e5249f45e54381de52aa6973eb20118 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -35,10 +35,16 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace Utils { class MacroExpander; }
|
||||
|
||||
namespace Core {
|
||||
|
||||
namespace Internal { class VariableChooserPrivate; }
|
||||
|
||||
typedef std::function<Utils::MacroExpander *()> MacroExpanderProvider;
|
||||
|
||||
class CORE_EXPORT VariableChooser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -47,8 +53,8 @@ public:
|
||||
explicit VariableChooser(QWidget *parent = 0);
|
||||
~VariableChooser();
|
||||
|
||||
static const char kVariableSupportProperty[];
|
||||
static void addVariableSupport(QWidget *textcontrol);
|
||||
void addMacroExpanderProvider(const MacroExpanderProvider &provider);
|
||||
void addSupportedWidget(QWidget *textcontrol, const QByteArray &ownName = QByteArray());
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *ke);
|
||||
|
||||
Reference in New Issue
Block a user