QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
JumpToElementDialog Class Reference

The JumpToElementDialog class A lightweight, transient "quick open" popup: type part of an element's label or other information to live-filter the elements on a diagram, then Enter to select the chosen element on the diagram and scroll it into view. Up/Down move through the filtered list, Escape cancels without changing the current selection. More...

#include <jumptoelementdialog.h>

Inherits QDialog.

Collaboration diagram for JumpToElementDialog:
Collaboration graph

Classes

struct  Candidate

Public Member Functions

 JumpToElementDialog (Diagram *diagram, QWidget *parent=nullptr)
 JumpToElementDialog::JumpToElementDialog.
 ~JumpToElementDialog () override

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 JumpToElementDialog::eventFilter Redirect Up/Down/Enter/Escape typed in the filter field to the result list, so the user never has to leave the text field to navigate or confirm a choice.

Private Slots

void updateFilteredList (const QString &filter_text)
 JumpToElementDialog::updateFilteredList Refill m_result_list with every candidate whose search text contains filter_text (case-insensitive), and select the first match.
void activateCurrentItem ()
 JumpToElementDialog::activateCurrentItem Select the element corresponding to the currently highlighted result on the diagram, scroll it into view, and close this dialog.

Private Member Functions

void buildCandidates ()
 JumpToElementDialog::buildCandidates Collect every element on m_diagram into m_candidates, along with the searchable text used to filter it (its type name, its label, and its other element informations).

Private Attributes

QPointer< Diagramm_diagram
QList< Candidatem_candidates
QLineEdit * m_filter_edit
QListWidget * m_result_list

Detailed Description

The JumpToElementDialog class A lightweight, transient "quick open" popup: type part of an element's label or other information to live-filter the elements on a diagram, then Enter to select the chosen element on the diagram and scroll it into view. Up/Down move through the filtered list, Escape cancels without changing the current selection.

Constructor & Destructor Documentation

◆ JumpToElementDialog()

JumpToElementDialog::JumpToElementDialog ( Diagram * diagram,
QWidget * parent = nullptr )
explicit

JumpToElementDialog::JumpToElementDialog.

Parameters
diagram: the diagram whose elements can be jumped to
parent
Here is the call graph for this function:

◆ ~JumpToElementDialog()

JumpToElementDialog::~JumpToElementDialog ( )
override

Member Function Documentation

◆ activateCurrentItem

void JumpToElementDialog::activateCurrentItem ( )
privateslot

JumpToElementDialog::activateCurrentItem Select the element corresponding to the currently highlighted result on the diagram, scroll it into view, and close this dialog.

Here is the caller graph for this function:

◆ buildCandidates()

void JumpToElementDialog::buildCandidates ( )
private

JumpToElementDialog::buildCandidates Collect every element on m_diagram into m_candidates, along with the searchable text used to filter it (its type name, its label, and its other element informations).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventFilter()

bool JumpToElementDialog::eventFilter ( QObject * watched,
QEvent * event )
overrideprotected

JumpToElementDialog::eventFilter Redirect Up/Down/Enter/Escape typed in the filter field to the result list, so the user never has to leave the text field to navigate or confirm a choice.

Here is the call graph for this function:

◆ updateFilteredList

void JumpToElementDialog::updateFilteredList ( const QString & filter_text)
privateslot

JumpToElementDialog::updateFilteredList Refill m_result_list with every candidate whose search text contains filter_text (case-insensitive), and select the first match.

Parameters
filter_text
Here is the caller graph for this function:

Member Data Documentation

◆ m_candidates

QList<Candidate> JumpToElementDialog::m_candidates
private

◆ m_diagram

QPointer<Diagram> JumpToElementDialog::m_diagram
private

◆ m_filter_edit

QLineEdit* JumpToElementDialog::m_filter_edit
private

◆ m_result_list

QListWidget* JumpToElementDialog::m_result_list
private

The documentation for this class was generated from the following files: