Browse Source

WIP: supported double-click on namespace.

keva-gui
Just Wonder 5 years ago
parent
commit
f7e392a078
  1. 6
      src/qt/kevabookmarksdialog.cpp
  2. 1
      src/qt/kevabookmarksdialog.h
  3. 6
      src/qt/kevamynamespacesdialog.cpp
  4. 1
      src/qt/kevamynamespacesdialog.h

6
src/qt/kevabookmarksdialog.cpp

@ -58,6 +58,12 @@ void KevaBookmarksDialog::namespaceView_selectionChanged()
} }
} }
void KevaBookmarksDialog::on_namespaceView_doubleClicked(const QModelIndex &index)
{
selectedIndex = index;
this->apply();
}
void KevaBookmarksDialog::apply() void KevaBookmarksDialog::apply()
{ {
QModelIndex idIdx = selectedIndex.sibling(selectedIndex.row(), KevaBookmarksModel::Id); QModelIndex idIdx = selectedIndex.sibling(selectedIndex.row(), KevaBookmarksModel::Id);

1
src/qt/kevabookmarksdialog.h

@ -41,6 +41,7 @@ public Q_SLOTS:
private Q_SLOTS: private Q_SLOTS:
void namespaceView_selectionChanged(); void namespaceView_selectionChanged();
void on_namespaceView_doubleClicked(const QModelIndex &index);
private: private:
Ui::KevaBookmarksDialog *ui; Ui::KevaBookmarksDialog *ui;

6
src/qt/kevamynamespacesdialog.cpp

@ -60,6 +60,12 @@ void KevaMyNamespacesDialog::namespaceView_selectionChanged()
} }
} }
void KevaMyNamespacesDialog::on_namespaceView_doubleClicked(const QModelIndex &index)
{
selectedIndex = ui->namespaceView->selectionModel()->currentIndex();
this->apply();
}
void KevaMyNamespacesDialog::apply() void KevaMyNamespacesDialog::apply()
{ {
QModelIndex idIdx = selectedIndex.sibling(selectedIndex.row(), KevaNamespaceModel::Id); QModelIndex idIdx = selectedIndex.sibling(selectedIndex.row(), KevaNamespaceModel::Id);

1
src/qt/kevamynamespacesdialog.h

@ -41,6 +41,7 @@ public Q_SLOTS:
private Q_SLOTS: private Q_SLOTS:
void namespaceView_selectionChanged(); void namespaceView_selectionChanged();
void on_namespaceView_doubleClicked(const QModelIndex &index);
private: private:
Ui::KevaMyNamespacesDialog *ui; Ui::KevaMyNamespacesDialog *ui;

Loading…
Cancel
Save