1220
Link: @CplusplusQt Embedded: @EMBCpp • Allowed Topics: C++ and everything related to Qt • Use only English • No Private Message without asking user's permission • No NSFW • No Spam • No unauthorized Bots • No Offtopic • No Self Promotions
Also the below calls are very expensive and should be aboided if used.
resizeColumnsToContents() / resizeRowsToContents()
I have done similar things with tables in qml. Apparently qml uses single point precision for row offsets, so if the number of rows are big enough the layout gets weird (even if the performance is good)
Читать полностью…
You can also do that in the parent widget by using only x rows in the listview.
Читать полностью…
Uniform row heights is also good, but I suppose you want it to look as in the image above
Читать полностью…
Are you using, by any chance, any call to view->setIndexWidget()? This implies a huge performance penalty. Also, if you can move to QML, it reuses delegates and has no calls to paint(), which is quite likely to be executed in CPU instead of GPU.
Читать полностью…
no I did not. i guess the table resize entire table at once. if i will manage to run profiler i will get back to you
Читать полностью…
l have change resizeToContents and Stretch to FIxed and yes it is fast alright
Читать полностью…
i have this log_view inherited from table view that uses custom table model to show logs. i want the logs to have 4 columns: timestamp, level, service, message. first 3 columns should be sized to fit, fotrh should stretch to the widget end and use word wrap. i have accomplished there requirements with
log_view::log_view(log_model* lm) {
setModel(lm);
setAlternatingRowColors(true);
setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows);
verticalHeader()->setSectionResizeMode(QHeaderView::ResizeMode::ResizeToContents);
auto header = horizontalHeader();
header->setSectionResizeMode(0, QHeaderView::ResizeMode::ResizeToContents);
header->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
header->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
header->setSectionResizeMode(3, QHeaderView::ResizeMode::Stretch);
setWordWrap(true);
connect(header, &QHeaderView::sectionResized, this,
[this](int logicalIndex, int /*oldSize*/, int /*newSize*/) {
if (logicalIndex == 3)
resizeRowsToContents();
}
);
};
Welcome to the group, @hishamzidanx! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
https://treelinev1.devpost.com/ anyone wants to team up for this,dm....
Читать полностью…
It's been quite a long since I used widgets. I can suggest the below solution.
Try disable updates while resizing.
Qt repaints continuously during a resize event. You can suppress this.
Override resizeEvent.
void MyWidget::resizeEvent(QResizeEvent *event)
{
tableWidget->setUpdatesEnabled(false);
QWidget::resizeEvent(event);
tableWidget->setUpdatesEnabled(true);
}
In one of my projects, I have a thumbnail view that with about 100k pictures. Performance was really bad - in the end, I just implemented the paintEvent() myself. It's really nice now.
Читать полностью…
I'd probably subclass the list widget and only render the visible portion of the list.
Читать полностью…
I think there may be ways to make the size estimation faster
Читать полностью…
Did you try running callgrind (or any other profiler) to reveal where the bootleneck is in?
Читать полностью…
the before and after. as you can see i get desired behaivour, the first long message row gets resized to fit the message well
Читать полностью…
Welcome to the group, @rickliu2000! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
Welcome to the group, -! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
Welcome to the group, @imrandogan46! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
Welcome to the group, @Le_Burrito! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)