forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user