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.
Understanding the Layout Process in Qt Widgets
21–30 of 47 posts
Re: Understanding the Layout Process in Qt Widgets
#22Managing 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.
Re: Understanding the Layout Process in Qt Widgets
#23Re: Understanding the Layout Process in Qt Widgets
#24I’d love to see an article on Qt text layout processing.
What would you like to know more about it?
Re: Understanding the Layout Process in Qt Widgets
#25I'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.
Re: Understanding the Layout Process in Qt Widgets
#26I'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…
This exact scenario has played out for many trying to adopt SwiftUI. For even moderately complex projects it’s common to get 90% of the way there fairly easily, only for that last 10% to be a struggle/slog as a result of its inflexibility. AppKit/UIKit may not be trendy or sexy and might take longer to get new projects spun up with, but it’s much more rare to hit that brick wall with them; you’ll probably be able to accomplish what you need with little or no pain.
I’ve seen shades of this in Jetpack Compose too, which makes me think that these sorts of problems are just inherent to the type of UI framework.
Re: Understanding the Layout Process in Qt Widgets
#27Earlier quoted context omitted.
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…
> 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. This exact scenario has played out for many trying to adopt SwiftUI. For even moderately complex projects it’s common to get 90% of the way there fairly easily,…
Re: Understanding the Layout Process in Qt Widgets
#28Have you used Qt Creator? Once I started using this, my app development started flying because I didn't have to edit, run program, edit again. Just drag and drop widgets around, its very nice.
Re: Understanding the Layout Process in Qt Widgets
#29Earlier quoted context omitted.
> 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. This exact scenario has played out for many trying to adopt SwiftUI. For even moderately complex projects it’s common to get 90% of the way there fairly easily,…
I'm curious to hear more about those problems. Do you have any articles covering them in more depth?
In short though, frameworks like SwiftUI tend to be designed around a very narrow set of use cases and if yours deviates from those in any way you're in for a bad time, and depending on how great the deviation is will likely land you with falling back to older imperative frameworks for their more customizable/hackable widgets in places (if that's an option) or dropping the declarative framework altogether.
Re: Understanding the Layout Process in Qt Widgets
#30QGridLayout is my go-to for applications. I like how it allows a responsive design when resizing. Most of my desktop apps are for simplifying tasks that my coworkers and me are doing, so no one's expecting the most professional look and Qt has gotten the job done. Have you used Qt Creator? Once I started using this, my app development started flying because I didn't have to edit, run program, edit again. Just drag an…
Personally, I was keen on Qt right up to the 5.x change over. =3