13 #include <QDialogButtonBox>
14 #include <QGridLayout>
15 #include <QPushButton>
22 :
QDialog(parent), mSelectedId(0), mReceiver(receiver),
23 mSelectableGates(selectable), mPickerModeActivated(false), mWindowTitle(title)
28 mButtonPick =
new QPushButton(
"Pick gate from graph",
this);
42 mTabWidget->
addTab(mTableView,
"Gate list");
50 mTabWidget->
addTab(mLastUsed,
"Recent selection");
73 mToggleSearchbar =
new QAction(
this);
88 if (receiver ==
nullptr)
95 void GateDialog::enableButtons()
134 void GateDialog::handleTreeDoubleClick(
const QModelIndex& index)
136 u32 moduleId = treeGateId(index);
144 if (mSelectedId && doubleClick)
accept();
147 void GateDialog::handlePickFromGraph()
150 mPickerModeActivated =
true;
160 void GateDialog::handleToggleSearchbar()
static SettingsItemKeybind * sSettingSearch
void handleTableSelection(u32 id, bool doubleClick)
void keybindToggleSearchbar(const QKeySequence &seq)
GateDialog(const QSet< u32 > &selectable=QSet< u32 >(), const QString &title=QString("Select gate"), GateSelectReceiver *receiver=nullptr, QWidget *parent=nullptr)
static GateSelectHistory * instance()
static bool isAccepted(u32 gateId, const QSet< u32 > &selectable)
The GateSelectPicker class instance gets spawned to pick module from graph.
The GateSelectProxy class allows sorting and filtering of module tables.
void startSearch(QString text, int options)
The GateSelectView class is the table widget for module selection.
void gateSelected(u32 gatId, bool doubleClick)
Gate * get_gate_by_id(const u32 gate_id) const
virtual QList< QString > getColumnNames()
A QFrame with a QLineEdit that can be used to input a substring to search for.
void setColumnNames(QList< QString > list)
void triggerNewSearch(const QString &text, int searchOptions)
void keySequenceChanged(QKeySequence value)
virtual int rowCount(const QModelIndex &parent) const const=0
QAbstractItemModel * model() const const
void setShortcut(const QKeySequence &shortcut)
void triggered(bool checked)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString fromStdString(const std::string &str)