cplusplusqt | Unsorted

Telegram-канал cplusplusqt - C++ & Qt

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

Subscribe to a channel

C++ & Qt

Also the below calls are very expensive and should be aboided if used.

resizeColumnsToContents() / resizeRowsToContents()

Читать полностью…

C++ & Qt

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)

Читать полностью…

C++ & Qt

You can also do that in the parent widget by using only x rows in the listview.

Читать полностью…

C++ & Qt

Uniform row heights is also good, but I suppose you want it to look as in the image above

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

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

Читать полностью…

C++ & Qt

l have change resizeToContents and Stretch to FIxed and yes it is fast alright

Читать полностью…

C++ & Qt

so, what can I do regarding the performance????

Читать полностью…

C++ & Qt

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();
}
);

};


but when log gets huge (perse 200+ lines, not that huge alright), it lags a lot and uses gui thread for 100% on resize. what is going on? how could i optimize it?

my main purpose is to get rid of the manually dragging the horizontal header to fit the level and timestamp width (their width does not change in general)

Читать полностью…

C++ & Qt

Report sent⁣⁣⁣⁣

Читать полностью…

C++ & Qt

The qmlls improvements sounds nice

Читать полностью…

C++ & Qt

@Rasmussen_Maja [8318401428] banned.

Читать полностью…

C++ & Qt

@admin

Читать полностью…

C++ & Qt

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. :)

Читать полностью…

C++ & Qt

https://treelinev1.devpost.com/ anyone wants to team up for this,dm....

Читать полностью…

C++ & Qt

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);
}

Читать полностью…

C++ & Qt

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.

Читать полностью…

C++ & Qt

I'd probably subclass the list widget and only render the visible portion of the list.

Читать полностью…

C++ & Qt

200 rows should work even without models I think

Читать полностью…

C++ & Qt

I think there may be ways to make the size estimation faster

Читать полностью…

C++ & Qt

Did you try running callgrind (or any other profiler) to reveal where the bootleneck is in?

Читать полностью…

C++ & Qt

Is it faster if all columns have fixed with?

Читать полностью…

C++ & Qt

the before and after. as you can see i get desired behaivour, the first long message row gets resized to fit the message well

Читать полностью…

C++ & Qt

@GerdSimonsen [8367815543] banned.

Читать полностью…

C++ & Qt

@admin

Читать полностью…

C++ & Qt

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. :)

Читать полностью…

C++ & Qt

Report sent⁣⁣⁣⁣

Читать полностью…

C++ & Qt

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. :)

Читать полностью…

C++ & Qt

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. :)

Читать полностью…

C++ & Qt

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. :)

Читать полностью…
Subscribe to a channel