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

sometimes we do chat. Sometimes ChatGPT gets confused.

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

C++ & Qt

If you're looking for idle chat, this is probably not the place.

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

C++ & Qt

I guess that depends. 😉

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

C++ & Qt

Welcome to the group, @Hurrybabe! :-)

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

just a showcase: the daw / media sequencer I've been building for some years, ossia score (https://ossia.io) with its Qt RHI shader pipeline finally running through QRhi in a webbrowser:

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

C++ & Qt

@Gencemiri [5515683351] banned.

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

C++ & Qt

Report sent⁣⁣⁣⁣

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

C++ & Qt

For members serious about growth, Alex Gonzalez is the mentor to follow. His crypto trading tips enabled me to realize $6,000 in profits this month.

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

C++ & Qt

I think the main thing is to not let it recalculate everything at 60 Hz (or worse)

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

C++ & Qt

i would like to hear some suggestions bout the "not letting the table view do something by itself on resize for all rows/columns"

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

C++ & Qt

but yea the scroll bar does not feel alright

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

C++ & Qt

so i managed to make this


log_view::log_view(log_model* lm)
: QTableView(nullptr) {
setModel(lm);
setAlternatingRowColors(true);
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
setWordWrap(true);

verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
verticalHeader()->setDefaultSectionSize(24);

auto header = horizontalHeader();
// i gave up on dynamic columns, just eyeballed the default size and let the
// user change it god damn
header->setSectionResizeMode(0, QHeaderView::Interactive);
header->resizeSection(0, 140);
header->setSectionResizeMode(1, QHeaderView::Interactive);
header->resizeSection(1, 80);
header->setSectionResizeMode(2, QHeaderView::Interactive);
header->resizeSection(2, 73);
header->setSectionResizeMode(3, QHeaderView::Stretch);

connect(
header, &QHeaderView::sectionResized,
this, &log_view::on_section_resized
);

connect(
verticalScrollBar(), &QScrollBar::valueChanged,
this, &log_view::schedule_visible_row_resize
);

connect(
model(), &QAbstractItemModel::dataChanged, this,
[this](const QModelIndex& topLeft, const QModelIndex& bottomRight) {
if (topLeft.column() == 3) {
for (int r = topLeft.row(); r <= bottomRight.row(); ++r)
if (visualRect(model()->index(r, 0)).intersects(viewport()->rect()))
resizeRowToContents(r);
}
}
);

QMetaObject::invokeMethod(this, &log_view::schedule_visible_row_resize, Qt::QueuedConnection);
}

void log_view::on_section_resized(int logicalIndex, int oldSize, int newSize) {
if (logicalIndex == 3)
schedule_visible_row_resize();
}

void log_view::schedule_visible_row_resize() {
QMetaObject::invokeMethod(
this, &log_view::update_visible_row_heights,
Qt::QueuedConnection
);
}

void log_view::update_visible_row_heights() {
if (!model() || model()->rowCount() == 0)
return;

setUpdatesEnabled(false);

const int first = rowAt(0);
if (first < 0) {
setUpdatesEnabled(true);
return;
}

int last = rowAt(viewport()->height() - 1);
if (last < 0)
last = model()->rowCount() - 1;

for (int row = first; row <= last; ++row)
resizeRowToContents(row);

setUpdatesEnabled(true);
}

void log_view::resizeEvent(QResizeEvent* ev) {
setUpdatesEnabled(false); // importand to not let the table view do nothin by itlself
QTableView::resizeEvent(ev);
setUpdatesEnabled(true);
schedule_visible_row_resize();
}


the schedule_visible_row_resize was suggusted by grok, the part that makes invocation in queued fashion, as he says:
Qt’s standard “do it once, later” pattern

When the current event loop finishes processing all the resize/scroll/paint events that are already queued, then run this once

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

C++ & Qt

but the scrollbar wont cbe in correct scale

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

C++ & Qt

it has to look at all elements above at least (and perhaps the rest of them to get the scrollbar size right)

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

C++ & Qt

With dynamic row height it has to do that i suppose, but perhaps it could happen less often

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

C++ & Qt

I see last message about January, I am confused it is not possible that developers are not chatting then chat is 'dead' , and there is other place somewhere I do not know ))

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

C++ & Qt

I usually get good answers here relatively quickly.

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

C++ & Qt

Hi everyone, where are the most qt people dwell?

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

C++ & Qt

I want to ask something straight

What are the chances to get a job being proficient in QT as compared to being proficient in backend development in Java in the current job market especially in countries like India?

I am on the aisle deciding which edge to choose

Genuine help would be appreciated
Thank you reading

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

C++ & Qt

Welcome to the group, @Wincreato! :-)

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

@kay_triller03 [1426681789] banned.

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

C++ & Qt

@admin

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

C++ & Qt

Welcome to the group, @Gencemiri! :-)

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

maybe i am missing something

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

C++ & Qt

and this works with 10k messages well

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

C++ & Qt

and damn right it is faster

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

C++ & Qt

perhaps it doesn't have to be perfect either? Skipping some lines when resizing isn't that much of a problem perhaps?

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

C++ & Qt

also wondering what will happen if i will just be getting element in the vierwport and calling the resizeRowToContents

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

C++ & Qt

or only on visible elements

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

C++ & Qt

resizeToContents on first 3 columns also make gui thread go up to 100% but without visible lag. this could be made fixed size thats all

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