|
a/src/qtgui/restable.cpp |
|
b/src/qtgui/restable.cpp |
|
... |
|
... |
484 |
tableView->setModel(m_model);
|
484 |
tableView->setModel(m_model);
|
485 |
tableView->setMouseTracking(true);
|
485 |
tableView->setMouseTracking(true);
|
486 |
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
486 |
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
487 |
tableView->setItemDelegate(new ResTableDelegate(this));
|
487 |
tableView->setItemDelegate(new ResTableDelegate(this));
|
488 |
tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
488 |
tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
489 |
new QShortcut(QKeySequence("Ctrl+o"), this, SLOT(menuEdit()));
|
|
|
490 |
new QShortcut(QKeySequence("Ctrl+Shift+o"), this, SLOT(menuEditAndQuit()));
|
|
|
491 |
new QShortcut(QKeySequence("Ctrl+p"), this, SLOT(menuPreview()));
|
489 |
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
492 |
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
490 |
this, SLOT(createPopupMenu(const QPoint&)));
|
493 |
this, SLOT(createPopupMenu(const QPoint&)));
|
491 |
|
494 |
|
492 |
QHeaderView *header = tableView->horizontalHeader();
|
495 |
QHeaderView *header = tableView->horizontalHeader();
|
493 |
if (header) {
|
496 |
if (header) {
|
|
... |
|
... |
647 |
{
|
650 |
{
|
648 |
LOGDEB2(("ResTable::on_tableView_entered(%d, %d)\n",
|
651 |
LOGDEB2(("ResTable::on_tableView_entered(%d, %d)\n",
|
649 |
index.row(), index.column()));
|
652 |
index.row(), index.column()));
|
650 |
if (!tableView->selectionModel()->hasSelection())
|
653 |
if (!tableView->selectionModel()->hasSelection())
|
651 |
onTableView_currentChanged(index);
|
654 |
onTableView_currentChanged(index);
|
|
|
655 |
}
|
|
|
656 |
|
|
|
657 |
void ResTable::takeFocus()
|
|
|
658 |
{
|
|
|
659 |
// LOGDEB(("resTable: take focus\n"));
|
|
|
660 |
tableView->setFocus(Qt::ShortcutFocusReason);
|
652 |
}
|
661 |
}
|
653 |
|
662 |
|
654 |
void ResTable::setDocSource(RefCntr<DocSequence> nsource)
|
663 |
void ResTable::setDocSource(RefCntr<DocSequence> nsource)
|
655 |
{
|
664 |
{
|
656 |
LOGDEB(("ResTable::setDocSource\n"));
|
665 |
LOGDEB(("ResTable::setDocSource\n"));
|
|
... |
|
... |
906 |
void ResTable::menuEdit()
|
915 |
void ResTable::menuEdit()
|
907 |
{
|
916 |
{
|
908 |
if (m_detaildocnum >= 0)
|
917 |
if (m_detaildocnum >= 0)
|
909 |
emit editRequested(m_detaildoc);
|
918 |
emit editRequested(m_detaildoc);
|
910 |
}
|
919 |
}
|
|
|
920 |
void ResTable::menuEditAndQuit()
|
|
|
921 |
{
|
|
|
922 |
if (m_detaildocnum >= 0) {
|
|
|
923 |
emit editRequested(m_detaildoc);
|
|
|
924 |
m_rclmain->fileExit();
|
|
|
925 |
}
|
|
|
926 |
}
|
911 |
void ResTable::menuOpenWith(QAction *act)
|
927 |
void ResTable::menuOpenWith(QAction *act)
|
912 |
{
|
928 |
{
|
913 |
if (act == 0)
|
929 |
if (act == 0)
|
914 |
return;
|
930 |
return;
|
915 |
string cmd = qs2utf8s(act->data().toString());
|
931 |
string cmd = qs2utf8s(act->data().toString());
|