restable Ctrl+i shortcuts to jump from results to row i
This commit is contained in:
parent
c19229a59f
commit
84815d4aa6
@ -594,6 +594,17 @@ void ResTable::init()
|
|||||||
connect(&SCBase::scBase(), SIGNAL(shortcutsChanged()),
|
connect(&SCBase::scBase(), SIGNAL(shortcutsChanged()),
|
||||||
this, SLOT(onNewShortcuts()));
|
this, SLOT(onNewShortcuts()));
|
||||||
|
|
||||||
|
new QShortcut(QKeySequence("Ctrl+0"), this, SLOT(setCurrentRow0()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+1"), this, SLOT(setCurrentRow1()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+2"), this, SLOT(setCurrentRow2()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+3"), this, SLOT(setCurrentRow3()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+4"), this, SLOT(setCurrentRow4()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+5"), this, SLOT(setCurrentRow5()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+6"), this, SLOT(setCurrentRow6()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+7"), this, SLOT(setCurrentRow7()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+8"), this, SLOT(setCurrentRow8()));
|
||||||
|
new QShortcut(QKeySequence("Ctrl+9"), this, SLOT(setCurrentRow9()));
|
||||||
|
|
||||||
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||||
this, SLOT(createPopupMenu(const QPoint&)));
|
this, SLOT(createPopupMenu(const QPoint&)));
|
||||||
|
|
||||||
@ -727,6 +738,25 @@ void ResTable::onUiPrefsChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SETCURRENTROW(INDEX) \
|
||||||
|
void ResTable::setCurrentRow##INDEX() \
|
||||||
|
{ \
|
||||||
|
tableView->setFocus(Qt::ShortcutFocusReason); \
|
||||||
|
tableView->selectionModel()->setCurrentIndex( \
|
||||||
|
m_model->index(INDEX, 0), \
|
||||||
|
QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows); \
|
||||||
|
}
|
||||||
|
SETCURRENTROW(0)
|
||||||
|
SETCURRENTROW(1)
|
||||||
|
SETCURRENTROW(2)
|
||||||
|
SETCURRENTROW(3)
|
||||||
|
SETCURRENTROW(4)
|
||||||
|
SETCURRENTROW(5)
|
||||||
|
SETCURRENTROW(6)
|
||||||
|
SETCURRENTROW(7)
|
||||||
|
SETCURRENTROW(8)
|
||||||
|
SETCURRENTROW(9)
|
||||||
|
|
||||||
int ResTable::getDetailDocNumOrTopRow()
|
int ResTable::getDetailDocNumOrTopRow()
|
||||||
{
|
{
|
||||||
if (m_detaildocnum >= 0)
|
if (m_detaildocnum >= 0)
|
||||||
|
|||||||
@ -32,11 +32,12 @@
|
|||||||
|
|
||||||
class ResTable;
|
class ResTable;
|
||||||
|
|
||||||
typedef std::string (FieldGetter)(const std::string& fldname, const Rcl::Doc& doc);
|
typedef std::string (FieldGetter)(
|
||||||
|
const std::string& fldname, const Rcl::Doc& doc);
|
||||||
|
|
||||||
class RecollModel : public QAbstractTableModel {
|
class RecollModel : public QAbstractTableModel {
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RecollModel(const QStringList fields, ResTable *tb, QObject *parent = 0);
|
RecollModel(const QStringList fields, ResTable *tb, QObject *parent = 0);
|
||||||
@ -115,14 +116,11 @@ class QShortcut;
|
|||||||
|
|
||||||
class ResTable : public QWidget, public Ui::ResTable
|
class ResTable : public QWidget, public Ui::ResTable
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ResTable(QWidget* parent = 0)
|
ResTable(QWidget* parent = 0)
|
||||||
: QWidget(parent),
|
: QWidget(parent) {
|
||||||
m_model(0), m_pager(0), m_detail(0), m_detaildocnum(-1),
|
|
||||||
m_rclmain(0), m_ismainres(true)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@ -169,6 +167,16 @@ public slots:
|
|||||||
virtual void takeFocus();
|
virtual void takeFocus();
|
||||||
virtual void onUiPrefsChanged();
|
virtual void onUiPrefsChanged();
|
||||||
virtual void onNewShortcuts();
|
virtual void onNewShortcuts();
|
||||||
|
virtual void setCurrentRow0();
|
||||||
|
virtual void setCurrentRow1();
|
||||||
|
virtual void setCurrentRow2();
|
||||||
|
virtual void setCurrentRow3();
|
||||||
|
virtual void setCurrentRow4();
|
||||||
|
virtual void setCurrentRow5();
|
||||||
|
virtual void setCurrentRow6();
|
||||||
|
virtual void setCurrentRow7();
|
||||||
|
virtual void setCurrentRow8();
|
||||||
|
virtual void setCurrentRow9();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void docPreviewClicked(int, Rcl::Doc, int);
|
void docPreviewClicked(int, Rcl::Doc, int);
|
||||||
@ -184,18 +192,21 @@ signals:
|
|||||||
|
|
||||||
friend class ResTablePager;
|
friend class ResTablePager;
|
||||||
friend class ResTableDetailArea;
|
friend class ResTableDetailArea;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject* obj, QEvent* event);
|
bool eventFilter(QObject* obj, QEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
RecollModel *m_model{nullptr};
|
RecollModel *m_model{nullptr};
|
||||||
ResTablePager *m_pager{nullptr};
|
ResTablePager *m_pager{nullptr};
|
||||||
ResTableDetailArea *m_detail{nullptr};
|
ResTableDetailArea *m_detail{nullptr};
|
||||||
int m_detaildocnum;
|
int m_detaildocnum{-1};
|
||||||
Rcl::Doc m_detaildoc;
|
Rcl::Doc m_detaildoc;
|
||||||
int m_popcolumn;
|
int m_popcolumn{0};
|
||||||
RclMain *m_rclmain{nullptr};
|
RclMain *m_rclmain{nullptr};
|
||||||
bool m_ismainres;
|
bool m_ismainres{true};
|
||||||
QShortcut *m_opensc{nullptr};
|
QShortcut *m_opensc{nullptr};
|
||||||
QShortcut *m_openquitsc{nullptr};
|
QShortcut *m_openquitsc{nullptr};
|
||||||
QShortcut *m_previewsc{nullptr};
|
QShortcut *m_previewsc{nullptr};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user