--- a/src/qtgui/restable.cpp
+++ b/src/qtgui/restable.cpp
@@ -519,6 +519,8 @@
connect(tableView->selectionModel(),
SIGNAL(currentChanged(const QModelIndex&, const QModelIndex &)),
this, SLOT(onTableView_currentChanged(const QModelIndex&)));
+ connect(tableView, SIGNAL(doubleClicked(const QModelIndex&)),
+ this, SLOT(onDoubleClick(const QModelIndex&)));
m_pager = new ResTablePager(this);
@@ -777,6 +779,22 @@
}
}
+void ResTable::onDoubleClick(const QModelIndex& index)
+{
+ if (!m_model || m_model->getDocSource().isNull())
+ return;
+ Rcl::Doc doc;
+ if (m_model->getDocSource()->getDoc(index.row(), doc)) {
+ m_detail->clear();
+ m_detaildocnum = index.row();
+ m_detaildoc = doc;
+ if (m_detaildocnum >= 0)
+ emit editRequested(m_detaildoc);
+ } else {
+ m_detaildocnum = -1;
+ }
+}
+
void ResTable::createPopupMenu(const QPoint& pos)
{
LOGDEB(("ResTable::createPopupMenu: m_detaildocnum %d\n", m_detaildocnum));