forked from qt-creator/qt-creator
CppEditor: Use FancyLineEdit in CppCodeModelInspectorDialog
Change-Id: Ib4688ec1406dafb39059fe3b4ea3277ea8e6fffa Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include <cplusplus/Overview.h>
|
#include <cplusplus/Overview.h>
|
||||||
#include <cplusplus/Token.h>
|
#include <cplusplus/Token.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/fancylineedit.h>
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -146,7 +147,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QTreeView *view;
|
QTreeView *view;
|
||||||
QLineEdit *lineEdit;
|
Utils::FancyLineEdit *lineEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
FilterableView::FilterableView(QWidget *parent)
|
FilterableView::FilterableView(QWidget *parent)
|
||||||
@@ -157,20 +158,17 @@ FilterableView::FilterableView(QWidget *parent)
|
|||||||
view->setTextElideMode(Qt::ElideMiddle);
|
view->setTextElideMode(Qt::ElideMiddle);
|
||||||
view->setSortingEnabled(true);
|
view->setSortingEnabled(true);
|
||||||
|
|
||||||
lineEdit = new QLineEdit(this);
|
lineEdit = new Utils::FancyLineEdit(this);
|
||||||
|
lineEdit->setFiltering(true);
|
||||||
lineEdit->setPlaceholderText(QLatin1String("File Path"));
|
lineEdit->setPlaceholderText(QLatin1String("File Path"));
|
||||||
QObject::connect(lineEdit, &QLineEdit::textChanged, this, &FilterableView::filterChanged);
|
QObject::connect(lineEdit, &QLineEdit::textChanged, this, &FilterableView::filterChanged);
|
||||||
|
|
||||||
QLabel *label = new QLabel(QLatin1String("&Filter:"), this);
|
QLabel *label = new QLabel(QLatin1String("&Filter:"), this);
|
||||||
label->setBuddy(lineEdit);
|
label->setBuddy(lineEdit);
|
||||||
|
|
||||||
QPushButton *clearButton = new QPushButton(QLatin1String("&Clear"), this);
|
|
||||||
QObject::connect(clearButton, &QAbstractButton::clicked, this, &FilterableView::clearFilter);
|
|
||||||
|
|
||||||
auto filterBarLayout = new QHBoxLayout();
|
auto filterBarLayout = new QHBoxLayout();
|
||||||
filterBarLayout->addWidget(label);
|
filterBarLayout->addWidget(label);
|
||||||
filterBarLayout->addWidget(lineEdit);
|
filterBarLayout->addWidget(lineEdit);
|
||||||
filterBarLayout->addWidget(clearButton);
|
|
||||||
|
|
||||||
auto mainLayout = new QVBoxLayout();
|
auto mainLayout = new QVBoxLayout();
|
||||||
mainLayout->addWidget(view);
|
mainLayout->addWidget(view);
|
||||||
|
Reference in New Issue
Block a user