forked from blue/squawk
an attempt to display text in a better way with QTextDocument + QTextBrowser
This commit is contained in:
parent
51ac1ac709
commit
d86e2c28a0
7 changed files with 88 additions and 338 deletions
|
@ -343,6 +343,7 @@ void FeedView::paintEvent(QPaintEvent* event)
|
|||
|
||||
QDateTime lastDate;
|
||||
bool first = true;
|
||||
QRect viewportRect = vp->rect();
|
||||
for (const QModelIndex& index : toRener) {
|
||||
QDateTime currentDate = index.data(Models::MessageFeed::Date).toDateTime();
|
||||
option.rect = visualRect(index);
|
||||
|
@ -356,7 +357,10 @@ void FeedView::paintEvent(QPaintEvent* event)
|
|||
}
|
||||
first = false;
|
||||
}
|
||||
bool mouseOver = option.rect.contains(cursor) && vp->rect().contains(cursor);
|
||||
QRect stripe = option.rect;
|
||||
stripe.setLeft(0);
|
||||
stripe.setWidth(viewportRect.width());
|
||||
bool mouseOver = stripe.contains(cursor) && viewportRect.contains(cursor);
|
||||
option.state.setFlag(QStyle::State_MouseOver, mouseOver);
|
||||
itemDelegate(index)->paint(&painter, option, index);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue