Provide way to show a variable chooser widget.

For the Qt Creator variables, currently used in the external tools.
The variable chooser looks if the current focus widget has a variable
support property set and is a line edit, text edit or plain text edit.
For line edits it adds a little icon button that shows the chooser.
This commit is contained in:
con
2011-03-03 20:50:25 +01:00
parent 79c899636b
commit efc817d8e0
4 changed files with 85 additions and 18 deletions

View File

@@ -36,6 +36,8 @@
#include "core_global.h"
#include <utils/fancylineedit.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
#include <QtGui/QLineEdit>
@@ -59,16 +61,19 @@ public:
private slots:
void updateDescription(const QString &variable);
void updateCurrentEditor(QWidget *widget);
void updateCurrentEditor(QWidget *old, QWidget *widget);
void handleItemActivated(QListWidgetItem *item);
void insertVariable(const QString &variable);
private:
void createIconButton();
Ui::VariableChooser *ui;
QString m_defaultDescription;
QPointer<QLineEdit> m_lineEdit;
QPointer<QTextEdit> m_textEdit;
QPointer<QPlainTextEdit> m_plainTextEdit;
QPointer<Utils::IconButton> m_iconButton;
};