diff --git a/src/Cutter.pro b/src/Cutter.pro index 9f35771d..738ab9e6 100644 --- a/src/Cutter.pro +++ b/src/Cutter.pro @@ -173,6 +173,7 @@ SOURCES += \ dialogs/R2PluginsDialog.cpp \ widgets/CutterDockWidget.cpp \ widgets/CutterSeekableWidget.cpp \ + widgets/CutterTreeWidget.cpp \ widgets/GraphWidget.cpp \ utils/JsonTreeItem.cpp \ utils/JsonModel.cpp \ @@ -266,6 +267,7 @@ HEADERS += \ utils/NestedIPyKernel.h \ dialogs/R2PluginsDialog.h \ widgets/CutterDockWidget.h \ + widgets/CutterTreeWidget.h \ widgets/CutterSeekableWidget.h \ widgets/GraphWidget.h \ utils/JsonTreeItem.h \ diff --git a/src/widgets/CommentsWidget.cpp b/src/widgets/CommentsWidget.cpp index 48c15811..c68e2546 100644 --- a/src/widgets/CommentsWidget.cpp +++ b/src/widgets/CommentsWidget.cpp @@ -217,10 +217,14 @@ bool CommentsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &ri CommentsWidget::CommentsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), ui(new Ui::CommentsWidget), - main(main) + main(main), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + commentsModel = new CommentsModel(&comments, &nestedComments, this); commentsProxyModel = new CommentsProxyModel(commentsModel, this); ui->commentsTreeView->setModel(commentsProxyModel); @@ -240,6 +244,10 @@ CommentsWidget::CommentsWidget(MainWindow *main, QAction *action) : commentsProxyModel, SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->commentsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(commentsProxyModel->rowCount()); + }); + setScrollMode(); ui->actionHorizontal->setChecked(true); @@ -327,6 +335,8 @@ void CommentsWidget::refreshTree() commentsModel->endResetModel(); qhelpers::adjustColumns(ui->commentsTreeView, 3, 0); + + tree->showItemsNumber(commentsProxyModel->rowCount()); } void CommentsWidget::setScrollMode() diff --git a/src/widgets/CommentsWidget.h b/src/widgets/CommentsWidget.h index 2a4e320e..89d3fade 100644 --- a/src/widgets/CommentsWidget.h +++ b/src/widgets/CommentsWidget.h @@ -7,6 +7,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" class MainWindow; class QTreeWidgetItem; @@ -88,6 +89,7 @@ private: CommentsModel *commentsModel; CommentsProxyModel *commentsProxyModel; + CutterTreeWidget *tree; QList comments; QMap> nestedComments; diff --git a/src/widgets/CutterTreeWidget.cpp b/src/widgets/CutterTreeWidget.cpp new file mode 100644 index 00000000..b4621e79 --- /dev/null +++ b/src/widgets/CutterTreeWidget.cpp @@ -0,0 +1,26 @@ +#include "CutterTreeWidget.h" +#include "MainWindow.h" + +CutterTreeWidget::CutterTreeWidget(QObject *parent) : + QObject(parent), + bar(nullptr) +{} + +void CutterTreeWidget::addStatusBar(QVBoxLayout *pos) +{ + if(!bar) { + bar = new QStatusBar; + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + bar->setSizePolicy(sizePolicy); + pos->addWidget(bar); + } +} + +void CutterTreeWidget::showItemsNumber(int count) +{ + if(bar){ + bar->showMessage(tr("%1 Items").arg(count)); + } +} + +CutterTreeWidget::~CutterTreeWidget() {} diff --git a/src/widgets/CutterTreeWidget.h b/src/widgets/CutterTreeWidget.h new file mode 100644 index 00000000..1cdc10cc --- /dev/null +++ b/src/widgets/CutterTreeWidget.h @@ -0,0 +1,24 @@ +#ifndef CUTTERTREEWIDGET_H +#define CUTTERTREEWIDGET_H + +#include +#include + +class MainWindow; + +class CutterTreeWidget : public QObject +{ + + Q_OBJECT + +public: + explicit CutterTreeWidget(QObject *parent = nullptr); + ~CutterTreeWidget(); + void addStatusBar(QVBoxLayout *pos); + void showItemsNumber(int count); + +private: + QStatusBar *bar; + +}; +#endif // CUTTERTREEWIDGET_H diff --git a/src/widgets/ExportsWidget.cpp b/src/widgets/ExportsWidget.cpp index 4c8b154f..c96dfd2d 100644 --- a/src/widgets/ExportsWidget.cpp +++ b/src/widgets/ExportsWidget.cpp @@ -113,10 +113,14 @@ bool ExportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig ExportsWidget::ExportsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::ExportsWidget) + ui(new Ui::ExportsWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + exportsModel = new ExportsModel(&exports, this); exportsProxyModel = new ExportsProxyModel(exportsModel, this); ui->exportsTreeView->setModel(exportsProxyModel); @@ -136,6 +140,10 @@ ExportsWidget::ExportsWidget(MainWindow *main, QAction *action) : exportsProxyModel, SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->exportsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(exportsProxyModel->rowCount()); + }); + setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshExports())); @@ -150,6 +158,8 @@ void ExportsWidget::refreshExports() exportsModel->endResetModel(); qhelpers::adjustColumns(ui->exportsTreeView, 3, 0); + + tree->showItemsNumber(exportsProxyModel->rowCount()); } diff --git a/src/widgets/ExportsWidget.h b/src/widgets/ExportsWidget.h index 4cd9d0d4..ee3b2897 100644 --- a/src/widgets/ExportsWidget.h +++ b/src/widgets/ExportsWidget.h @@ -5,6 +5,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" #include #include @@ -70,6 +71,7 @@ private: ExportsModel *exportsModel; ExportsProxyModel *exportsProxyModel; QList exports; + CutterTreeWidget *tree; void setScrollMode(); }; diff --git a/src/widgets/FlagsWidget.cpp b/src/widgets/FlagsWidget.cpp index ba856d73..d62daa89 100644 --- a/src/widgets/FlagsWidget.cpp +++ b/src/widgets/FlagsWidget.cpp @@ -114,10 +114,14 @@ bool FlagsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIn FlagsWidget::FlagsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), ui(new Ui::FlagsWidget), - main(main) + main(main), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + flags_model = new FlagsModel(&flags, this); flags_proxy_model = new FlagsSortFilterProxyModel(flags_model, this); connect(ui->filterLineEdit, SIGNAL(textChanged(const QString &)), flags_proxy_model, @@ -140,7 +144,11 @@ FlagsWidget::FlagsWidget(MainWindow *main, QAction *action) : } }); clearShortcut->setContext(Qt::WidgetWithChildrenShortcut); - + + connect(ui->filterLineEdit, &QLineEdit::textChanged, this, [this] { + tree->showItemsNumber(flags_proxy_model->rowCount()); + }); + setScrollMode(); ui->flagsTreeView->setContextMenuPolicy(Qt::CustomContextMenu); @@ -238,7 +246,8 @@ void FlagsWidget::refreshFlags() qhelpers::adjustColumns(ui->flagsTreeView, 2, 0); - + tree->showItemsNumber(flags_proxy_model->rowCount()); + // TODO: this is not a very good place for the following: QStringList flagNames; for (auto i : flags) diff --git a/src/widgets/FlagsWidget.h b/src/widgets/FlagsWidget.h index 964560e0..5118a2bb 100644 --- a/src/widgets/FlagsWidget.h +++ b/src/widgets/FlagsWidget.h @@ -8,6 +8,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" class MainWindow; class QTreeWidgetItem; @@ -78,11 +79,12 @@ private slots: private: std::unique_ptr ui; - MainWindow *main; + MainWindow *main; FlagsModel *flags_model; FlagsSortFilterProxyModel *flags_proxy_model; QList flags; + CutterTreeWidget *tree; void refreshFlags(); void setScrollMode(); diff --git a/src/widgets/FunctionsWidget.cpp b/src/widgets/FunctionsWidget.cpp index 1fff1451..5acd52e1 100644 --- a/src/widgets/FunctionsWidget.cpp +++ b/src/widgets/FunctionsWidget.cpp @@ -411,10 +411,14 @@ bool FunctionSortFilterProxyModel::lessThan(const QModelIndex &left, const QMode FunctionsWidget::FunctionsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::FunctionsWidget) + ui(new Ui::FunctionsWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + // Radare core found in: this->main = main; @@ -445,6 +449,10 @@ FunctionsWidget::FunctionsWidget(MainWindow *main, QAction *action) : SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->functionsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(functionProxyModel->rowCount()); + }); + setScrollMode(); // Set Functions context menu @@ -492,6 +500,8 @@ void FunctionsWidget::refreshTree() // resize offset and size columns qhelpers::adjustColumns(ui->functionsTreeView, 3, 0); + + tree->showItemsNumber(functionProxyModel->rowCount()); }); Core()->getAsyncTaskManager()->start(task); } diff --git a/src/widgets/FunctionsWidget.h b/src/widgets/FunctionsWidget.h index b743578b..a7e0f952 100644 --- a/src/widgets/FunctionsWidget.h +++ b/src/widgets/FunctionsWidget.h @@ -8,6 +8,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" class MainWindow; class QTreeWidgetItem; @@ -122,7 +123,7 @@ protected: private: std::unique_ptr ui; - MainWindow *main; + MainWindow *main; QSharedPointer task; @@ -133,6 +134,8 @@ private: FunctionModel *functionModel; FunctionSortFilterProxyModel *functionProxyModel; + CutterTreeWidget *tree; + void setScrollMode(); }; diff --git a/src/widgets/ImportsWidget.cpp b/src/widgets/ImportsWidget.cpp index 5ba4a90b..630743ac 100644 --- a/src/widgets/ImportsWidget.cpp +++ b/src/widgets/ImportsWidget.cpp @@ -127,10 +127,14 @@ ImportsWidget::ImportsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), ui(new Ui::ImportsWidget), importsModel(new ImportsModel(&imports, this)), - importsProxyModel(new ImportsProxyModel(importsModel, this)) + importsProxyModel(new ImportsProxyModel(importsModel, this)), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + ui->importsTreeView->setModel(importsProxyModel); ui->importsTreeView->sortByColumn(ImportsModel::NameColumn, Qt::AscendingOrder); @@ -148,6 +152,10 @@ ImportsWidget::ImportsWidget(MainWindow *main, QAction *action) : importsProxyModel, SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->importsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(importsProxyModel->rowCount()); + }); + setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshImports())); @@ -161,6 +169,8 @@ void ImportsWidget::refreshImports() imports = Core()->getAllImports(); importsModel->endResetModel(); qhelpers::adjustColumns(ui->importsTreeView, 4, 0); + + tree->showItemsNumber(importsProxyModel->rowCount()); } void ImportsWidget::setScrollMode() diff --git a/src/widgets/ImportsWidget.h b/src/widgets/ImportsWidget.h index 50df62c6..5b3b3c56 100644 --- a/src/widgets/ImportsWidget.h +++ b/src/widgets/ImportsWidget.h @@ -11,6 +11,7 @@ #include "CutterDockWidget.h" #include "Cutter.h" +#include "CutterTreeWidget.h" class MainWindow; class QTreeWidget; @@ -84,9 +85,11 @@ private slots: private: std::unique_ptr ui; + ImportsModel *importsModel; ImportsProxyModel *importsProxyModel; QList imports; + CutterTreeWidget *tree; void highlightUnsafe(); void setScrollMode(); diff --git a/src/widgets/RegisterRefsWidget.cpp b/src/widgets/RegisterRefsWidget.cpp index 277d069e..3f4980ec 100644 --- a/src/widgets/RegisterRefsWidget.cpp +++ b/src/widgets/RegisterRefsWidget.cpp @@ -103,10 +103,14 @@ bool RegisterRefProxyModel::lessThan(const QModelIndex &left, const QModelIndex RegisterRefsWidget::RegisterRefsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::RegisterRefsWidget) + ui(new Ui::RegisterRefsWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + registerRefModel = new RegisterRefModel(®isterRefs, this); registerRefProxyModel = new RegisterRefProxyModel(registerRefModel, this); ui->registerRefTreeView->setModel(registerRefProxyModel); @@ -135,6 +139,10 @@ RegisterRefsWidget::RegisterRefsWidget(MainWindow *main, QAction *action) : ui->registerRefTreeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->registerRefTreeView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showRegRefContextMenu(const QPoint &))); + + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(registerRefProxyModel->rowCount()); + }); } RegisterRefsWidget::~RegisterRefsWidget() {} @@ -148,6 +156,8 @@ void RegisterRefsWidget::refreshRegisterRef() ui->registerRefTreeView->resizeColumnToContents(0); ui->registerRefTreeView->resizeColumnToContents(1); ui->registerRefTreeView->resizeColumnToContents(2); + + tree->showItemsNumber(registerRefProxyModel->rowCount()); } void RegisterRefsWidget::setScrollMode() diff --git a/src/widgets/RegisterRefsWidget.h b/src/widgets/RegisterRefsWidget.h index a2881753..b3f4adfb 100644 --- a/src/widgets/RegisterRefsWidget.h +++ b/src/widgets/RegisterRefsWidget.h @@ -4,6 +4,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" #include #include @@ -80,5 +81,6 @@ private: QList registerRefs; QAction *actionCopyValue; QAction *actionCopyRef; + CutterTreeWidget *tree; void setScrollMode(); }; diff --git a/src/widgets/RelocsWidget.cpp b/src/widgets/RelocsWidget.cpp index 58baa073..a05744f0 100644 --- a/src/widgets/RelocsWidget.cpp +++ b/src/widgets/RelocsWidget.cpp @@ -104,10 +104,14 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), ui(new Ui::RelocsWidget), relocsModel(new RelocsModel(&relocs, this)), - relocsProxyModel(new RelocsProxyModel(relocsModel, this)) + relocsProxyModel(new RelocsProxyModel(relocsModel, this)), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + ui->relocsTreeView->setModel(relocsProxyModel); ui->relocsTreeView->sortByColumn(RelocsModel::NameColumn, Qt::AscendingOrder); @@ -125,6 +129,10 @@ RelocsWidget::RelocsWidget(MainWindow *main, QAction *action) : relocsProxyModel, SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->relocsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(relocsProxyModel->rowCount()); + }); + setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshRelocs())); @@ -146,6 +154,8 @@ void RelocsWidget::refreshRelocs() relocs = Core()->getAllRelocs(); relocsModel->endResetModel(); qhelpers::adjustColumns(ui->relocsTreeView, 3, 0); + + tree->showItemsNumber(relocsProxyModel->rowCount()); } void RelocsWidget::setScrollMode() diff --git a/src/widgets/RelocsWidget.h b/src/widgets/RelocsWidget.h index c1a71ff8..5a5fee2c 100644 --- a/src/widgets/RelocsWidget.h +++ b/src/widgets/RelocsWidget.h @@ -7,6 +7,7 @@ #include "CutterDockWidget.h" #include "Cutter.h" +#include "CutterTreeWidget.h" class MainWindow; class RelocsWidget; @@ -63,9 +64,11 @@ private slots: private: std::unique_ptr ui; + RelocsModel *relocsModel; RelocsProxyModel *relocsProxyModel; QList relocs; + CutterTreeWidget *tree; void setScrollMode(); }; diff --git a/src/widgets/StringsWidget.cpp b/src/widgets/StringsWidget.cpp index e8e5d4e5..4bcfa388 100644 --- a/src/widgets/StringsWidget.cpp +++ b/src/widgets/StringsWidget.cpp @@ -122,10 +122,14 @@ bool StringsSortFilterProxyModel::lessThan(const QModelIndex &left, const QModel StringsWidget::StringsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::StringsWidget) + ui(new Ui::StringsWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + qhelpers::setVerticalScrollMode(ui->stringsTreeView); // Ctrl-F to show/hide the filter entry @@ -147,6 +151,10 @@ StringsWidget::StringsWidget(MainWindow *main, QAction *action) : SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->stringsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(proxy_model->rowCount()); + }); + connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshStrings())); } @@ -183,5 +191,7 @@ void StringsWidget::stringSearchFinished(const QList &strings if (ui->stringsTreeView->columnWidth(1) > 300) ui->stringsTreeView->setColumnWidth(1, 300); + tree->showItemsNumber(proxy_model->rowCount()); + task = nullptr; } diff --git a/src/widgets/StringsWidget.h b/src/widgets/StringsWidget.h index 37960af6..7ae49b25 100644 --- a/src/widgets/StringsWidget.h +++ b/src/widgets/StringsWidget.h @@ -6,6 +6,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" #include "utils/StringsTask.h" +#include "CutterTreeWidget.h" #include #include @@ -77,6 +78,7 @@ private: StringsModel *model; StringsSortFilterProxyModel *proxy_model; QList strings; + CutterTreeWidget *tree; }; #endif // STRINGSWIDGET_H diff --git a/src/widgets/SymbolsWidget.cpp b/src/widgets/SymbolsWidget.cpp index 4b749923..87210044 100644 --- a/src/widgets/SymbolsWidget.cpp +++ b/src/widgets/SymbolsWidget.cpp @@ -102,10 +102,14 @@ bool SymbolsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig SymbolsWidget::SymbolsWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::SymbolsWidget) + ui(new Ui::SymbolsWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + symbolsModel = new SymbolsModel(&symbols, this); symbolsProxyModel = new SymbolsProxyModel(symbolsModel, this); ui->symbolsTreeView->setModel(symbolsProxyModel); @@ -125,6 +129,10 @@ SymbolsWidget::SymbolsWidget(MainWindow *main, QAction *action) : symbolsProxyModel, SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->symbolsTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(symbolsProxyModel->rowCount()); + }); + setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshSymbols())); @@ -149,6 +157,8 @@ void SymbolsWidget::refreshSymbols() symbolsModel->endResetModel(); qhelpers::adjustColumns(ui->symbolsTreeView, SymbolsModel::ColumnCount, 0); + + tree->showItemsNumber(symbolsProxyModel->rowCount()); } void SymbolsWidget::setScrollMode() diff --git a/src/widgets/SymbolsWidget.h b/src/widgets/SymbolsWidget.h index 5859c064..9460994a 100644 --- a/src/widgets/SymbolsWidget.h +++ b/src/widgets/SymbolsWidget.h @@ -7,6 +7,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" class MainWindow; class QTreeWidgetItem; @@ -66,9 +67,11 @@ private slots: private: std::unique_ptr ui; + QList symbols; SymbolsModel *symbolsModel; SymbolsProxyModel *symbolsProxyModel; + CutterTreeWidget *tree; void setScrollMode(); }; diff --git a/src/widgets/VTablesWidget.cpp b/src/widgets/VTablesWidget.cpp index 0a70a26d..474c7c21 100644 --- a/src/widgets/VTablesWidget.cpp +++ b/src/widgets/VTablesWidget.cpp @@ -128,10 +128,14 @@ bool VTableSortFilterProxyModel::filterAcceptsRow(int source_row, VTablesWidget::VTablesWidget(MainWindow *main, QAction *action) : CutterDockWidget(main, action), - ui(new Ui::VTablesWidget) + ui(new Ui::VTablesWidget), + tree(new CutterTreeWidget(this)) { ui->setupUi(this); + // Add Status Bar footer + tree->addStatusBar(ui->verticalLayout); + model = new VTableModel(&vtables, this); proxy = new VTableSortFilterProxyModel(model); @@ -151,6 +155,10 @@ VTablesWidget::VTablesWidget(MainWindow *main, QAction *action) : SLOT(setFilterWildcard(const QString &))); connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->vTableTreeView, SLOT(setFocus())); + connect(ui->quickFilterView, &QuickFilterView::filterTextChanged, this, [this] { + tree->showItemsNumber(proxy->rowCount()); + }); + connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshVTables())); } @@ -167,6 +175,8 @@ void VTablesWidget::refreshVTables() qhelpers::adjustColumns(ui->vTableTreeView, 3, 0); ui->vTableTreeView->setColumnWidth(0, 200); + + tree->showItemsNumber(proxy->rowCount()); } void VTablesWidget::on_vTableTreeView_doubleClicked(const QModelIndex &index) diff --git a/src/widgets/VTablesWidget.h b/src/widgets/VTablesWidget.h index 2168a446..2e15505c 100644 --- a/src/widgets/VTablesWidget.h +++ b/src/widgets/VTablesWidget.h @@ -8,6 +8,7 @@ #include "Cutter.h" #include "CutterDockWidget.h" +#include "CutterTreeWidget.h" namespace Ui { class VTablesWidget; @@ -68,6 +69,7 @@ private: VTableModel *model; QSortFilterProxyModel *proxy; QList vtables; + CutterTreeWidget *tree; }; #endif // VTABLESWIDGET_H