Disable find-as-you-type keyboard searches in buffer viewer

* This will cause the model to evaluate every data item to search it, which is
  the exact thing we're trying to avoid with lazy item views.
This commit is contained in:
baldurk
2023-03-08 14:06:02 +00:00
parent fd12fdb84b
commit 760bfdcb40
3 changed files with 16 additions and 0 deletions
@@ -221,6 +221,12 @@ void RDTableView::keyPressEvent(QKeyEvent *e)
return QTableView::keyPressEvent(e);
}
void RDTableView::keyboardSearch(const QString &search)
{
if(m_allowKeyboardSearches)
return QTableView::keyboardSearch(search);
}
void RDTableView::paintEvent(QPaintEvent *e)
{
const int gridWidth = showGrid() ? 1 : 0;
@@ -45,6 +45,10 @@ public:
void setColumnWidths(const QList<int> &widths);
void resizeColumnsToContents();
void setAllowKeyboardSearches(bool allow) { m_allowKeyboardSearches = allow; }
bool allowKeyboardSearches() const { return m_allowKeyboardSearches; }
void keyboardSearch(const QString &search) override;
void setCustomHeaderSizing(bool sizing) { m_horizontalHeader->setCustomSizing(sizing); }
void setItemDelegate(QAbstractItemDelegate *delegate);
QAbstractItemDelegate *itemDelegate() const;
@@ -74,6 +78,8 @@ private:
int m_pinnedColumns = 0;
int m_columnGroupRole = 0;
bool m_allowKeyboardSearches = true;
RDHeaderView *m_horizontalHeader;
QModelIndex m_currentHoverIndex;
+4
View File
@@ -2221,6 +2221,10 @@ BufferViewer::BufferViewer(ICaptureContext &ctx, bool meshview, QWidget *parent)
ui->vsoutData->setCustomHeaderSizing(true);
ui->gsoutData->setCustomHeaderSizing(true);
ui->vsinData->setAllowKeyboardSearches(false);
ui->vsoutData->setAllowKeyboardSearches(false);
ui->gsoutData->setAllowKeyboardSearches(false);
QObject::connect(ui->fixedVars, &RDTreeWidget::customContextMenuRequested, this,
&BufferViewer::fixedVars_contextMenu);