Live data from Hacker News

Understanding the Layout Process in Qt Widgets

felipefarinon.com

11–20 of 47 posts

Re: Understanding the Layout Process in Qt Widgets

#11

Earlier quoted context omitted.

> I've had more problems with Widgets, especially when doing a lot of animations (even just scrolling big text views) on a 4K display on MacOS, but maybe I'm thinking graphics and not input lag. There's two things to consider when comparing rendering performance: throughput and latency. Throughput, or how much FPS the engine can sustain, is much better in QML since it's leveraging the GPU, but latency it's very platf…

Sidenote: Have you seen the new TextEdit improvements in Qt 6.7? I'm curious if that bridges the gap that you had when you started working on your app. My app is also text editing heavy so I'm hoping it's a big improvement.

I saw them, they are a very small step in what I believe is the right direction, since you can use a custom textDocument. Anyway what I think would be useful is to jailbreak the QML API. Make the QML C++ API publicly available. Let us derive from the controls, manipulate and customize them with C++, as the Qt team devs themselves do.

Re: Understanding the Layout Process in Qt Widgets

#12

I'm curious why you chose Qt Widgets for a relatively new application? Is desktop support that much better than QML? There's a bunch of tradeoffs for everyone who has to make that choice and it's always interesting to know why people choose the one that they do.

Desktop and tablet/phone applications need very different UIs. Anyone who tries to force the same UI on both is wrong and needs to be forced back to human-machine-interaction school (odds are they never went in the first place)

Re: Understanding the Layout Process in Qt Widgets

#13

I'm curious why you chose Qt Widgets for a relatively new application? Is desktop support that much better than QML? There's a bunch of tradeoffs for everyone who has to make that choice and it's always interesting to know why people choose the one that they do.

I can't speak for the author, but many systems programmers look at declarative/markup-based UI as a kind of black magic that you can't trust and that will get in your way sooner or later by not leaving a sane way for you to address some project requirement. We/they are often way more comfortable working with the kind of programmatic widget and graphics library that we/they might write, and whose behavior we can debug…

Amen. I've coding in Qt since v1.x and have never felt the need to switch to QML.

Re: Understanding the Layout Process in Qt Widgets

#15

Managing widget size and layout in complex UIs is definitely one of the more challenging aspects of programming with Qt. But you usually get what you want with a bit of trial and error.

This is my stock response when anyone complains about CSS; consider the alternatives.

Re: Understanding the Layout Process in Qt Widgets

#16

Managing widget size and layout in complex UIs is definitely one of the more challenging aspects of programming with Qt. But you usually get what you want with a bit of trial and error.

This is my stock response when anyone complains about CSS; consider the alternatives.

I found Qt way easier around 2010, maybe the new flexbox stuff is good though?

Re: Understanding the Layout Process in Qt Widgets

#17

Managing widget size and layout in complex UIs is definitely one of the more challenging aspects of programming with Qt. But you usually get what you want with a bit of trial and error.

This is my stock response when anyone complains about CSS; consider the alternatives.

With CSS you typically need a lot of trial and error, and then there’s different browser implementations and versions on top of that.

Re: Understanding the Layout Process in Qt Widgets

#18

Managing widget size and layout in complex UIs is definitely one of the more challenging aspects of programming with Qt. But you usually get what you want with a bit of trial and error.

I am running up against it now. While QT works on the major OSes, it somehow manages to not quite fit with the design of the OS - which drives me crazy. If I wanted it to sort of behave like a Windows app, I'd write Windows apps. Sadly, it's the best option for Python.

Re: Understanding the Layout Process in Qt Widgets

#19

Managing widget size and layout in complex UIs is definitely one of the more challenging aspects of programming with Qt. But you usually get what you want with a bit of trial and error.

This is my stock response when anyone complains about CSS; consider the alternatives.

I prefer Qt layout to CSS any day.

Re: Understanding the Layout Process in Qt Widgets

#20

I'm curious why you chose Qt Widgets for a relatively new application? Is desktop support that much better than QML? There's a bunch of tradeoffs for everyone who has to make that choice and it's always interesting to know why people choose the one that they do.

Well, I don't want to bash on QML, since I really appreciate the efforts that the team puts in it. But I do think its current state is not the best when compared to Qt Widgets, and lament that there's a split between the two toolkits inside the framework. The problems I had with QML are: 1) The controls that Qt Quick 2 provides are oriented toward touch interfaces, and some are not even feature-complete. For example,…

[dead]
Post reply on HN