|
a/src/qtgui/restable.cpp |
|
b/src/qtgui/restable.cpp |
|
... |
|
... |
65 |
public:
|
65 |
public:
|
66 |
virtual ~PlainToRichQtReslist() {}
|
66 |
virtual ~PlainToRichQtReslist() {}
|
67 |
virtual string startMatch(unsigned int)
|
67 |
virtual string startMatch(unsigned int)
|
68 |
{
|
68 |
{
|
69 |
return string("<span style='color: ")
|
69 |
return string("<span style='color: ")
|
70 |
+ string((const char *)prefs.qtermcolor.toAscii()) + string("'>");
|
70 |
+ qs2utf8s(prefs.qtermcolor) + string("'>");
|
71 |
}
|
71 |
}
|
72 |
virtual string endMatch() {return string("</span>");}
|
72 |
virtual string endMatch() {return string("</span>");}
|
73 |
};
|
73 |
};
|
74 |
static PlainToRichQtReslist g_hiliter;
|
74 |
static PlainToRichQtReslist g_hiliter;
|
75 |
|
75 |
|
|
... |
|
... |
284 |
}
|
284 |
}
|
285 |
|
285 |
|
286 |
void RecollModel::readDocSource()
|
286 |
void RecollModel::readDocSource()
|
287 |
{
|
287 |
{
|
288 |
LOGDEB(("RecollModel::readDocSource()\n"));
|
288 |
LOGDEB(("RecollModel::readDocSource()\n"));
|
289 |
reset();
|
289 |
beginResetModel();
|
|
|
290 |
endResetModel();
|
290 |
}
|
291 |
}
|
291 |
|
292 |
|
292 |
void RecollModel::setDocSource(RefCntr<DocSequence> nsource)
|
293 |
void RecollModel::setDocSource(RefCntr<DocSequence> nsource)
|
293 |
{
|
294 |
{
|
294 |
LOGDEB(("RecollModel::setDocSource\n"));
|
295 |
LOGDEB(("RecollModel::setDocSource\n"));
|
|
... |
|
... |
457 |
#if 0
|
458 |
#if 0
|
458 |
QPen pen = painter->pen();
|
459 |
QPen pen = painter->pen();
|
459 |
pen.setBrush(opt.palette.brush(QPalette::HighlightedText));
|
460 |
pen.setBrush(opt.palette.brush(QPalette::HighlightedText));
|
460 |
painter->setPen(pen);
|
461 |
painter->setPen(pen);
|
461 |
#else
|
462 |
#else
|
462 |
text = QString::fromAscii("<div style='color: white'> ") +
|
463 |
text = QString::fromUtf8("<div style='color: white'> ") +
|
463 |
text + QString::fromAscii("</div>");
|
464 |
text + QString::fromUtf8("</div>");
|
464 |
#endif
|
465 |
#endif
|
465 |
}
|
466 |
}
|
466 |
painter->setClipRect(option.rect);
|
467 |
painter->setClipRect(option.rect);
|
467 |
QPoint where = option.rect.topLeft();
|
468 |
QPoint where = option.rect.topLeft();
|
468 |
where.ry() += TEXTINCELLVTRANS;
|
469 |
where.ry() += TEXTINCELLVTRANS;
|
|
... |
|
... |
506 |
connect(header, SIGNAL(sectionResized(int,int,int)),
|
507 |
connect(header, SIGNAL(sectionResized(int,int,int)),
|
507 |
this, SLOT(saveColState()));
|
508 |
this, SLOT(saveColState()));
|
508 |
connect(header, SIGNAL(customContextMenuRequested(const QPoint&)),
|
509 |
connect(header, SIGNAL(customContextMenuRequested(const QPoint&)),
|
509 |
this, SLOT(createHeaderPopupMenu(const QPoint&)));
|
510 |
this, SLOT(createHeaderPopupMenu(const QPoint&)));
|
510 |
}
|
511 |
}
|
|
|
512 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
|
|
513 |
header->setSectionsMovable(true);
|
|
|
514 |
#else
|
511 |
header->setMovable(true);
|
515 |
header->setMovable(true);
|
|
|
516 |
#endif
|
512 |
|
517 |
|
513 |
header = tableView->verticalHeader();
|
518 |
header = tableView->verticalHeader();
|
514 |
if (header) {
|
519 |
if (header) {
|
515 |
header->setDefaultSectionSize(QApplication::fontMetrics().height() +
|
520 |
header->setDefaultSectionSize(QApplication::fontMetrics().height() +
|
516 |
ROWHEIGHTPAD);
|
521 |
ROWHEIGHTPAD);
|
|
... |
|
... |
538 |
splitter->setSizes(sizes);
|
543 |
splitter->setSizes(sizes);
|
539 |
}
|
544 |
}
|
540 |
|
545 |
|
541 |
delete textBrowser;
|
546 |
delete textBrowser;
|
542 |
m_detail = new ResTableDetailArea(this);
|
547 |
m_detail = new ResTableDetailArea(this);
|
543 |
m_detail->setReadOnly(TRUE);
|
548 |
m_detail->setReadOnly(true);
|
544 |
m_detail->setUndoRedoEnabled(FALSE);
|
549 |
m_detail->setUndoRedoEnabled(false);
|
545 |
m_detail->setOpenLinks(FALSE);
|
550 |
m_detail->setOpenLinks(false);
|
546 |
// signals and slots connections
|
551 |
// signals and slots connections
|
547 |
connect(m_detail, SIGNAL(anchorClicked(const QUrl &)),
|
552 |
connect(m_detail, SIGNAL(anchorClicked(const QUrl &)),
|
548 |
this, SLOT(linkWasClicked(const QUrl &)));
|
553 |
this, SLOT(linkWasClicked(const QUrl &)));
|
549 |
splitter->addWidget(m_detail);
|
554 |
splitter->addWidget(m_detail);
|
550 |
splitter->setOrientation(Qt::Vertical);
|
555 |
splitter->setOrientation(Qt::Vertical);
|
|
... |
|
... |
753 |
{
|
758 |
{
|
754 |
if (m_detaildocnum < 0) {
|
759 |
if (m_detaildocnum < 0) {
|
755 |
return;
|
760 |
return;
|
756 |
}
|
761 |
}
|
757 |
QString s = url.toString();
|
762 |
QString s = url.toString();
|
758 |
const char *ascurl = s.toAscii();
|
763 |
const char *ascurl = s.toUtf8();
|
759 |
LOGDEB(("ResTable::linkWasClicked: [%s]\n", ascurl));
|
764 |
LOGDEB(("ResTable::linkWasClicked: [%s]\n", ascurl));
|
760 |
|
765 |
|
761 |
int i = atoi(ascurl+1) -1;
|
766 |
int i = atoi(ascurl+1) -1;
|
762 |
int what = ascurl[0];
|
767 |
int what = ascurl[0];
|
763 |
switch (what) {
|
768 |
switch (what) {
|