Hack Forums
Windows Forms, Qt, or others? CPP/C++ - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: Windows Forms, Qt, or others? CPP/C++ (/showthread.php?tid=6254947)



Windows Forms, Qt, or others? CPP/C++ - Hackers - Oct 27, 2023

I have experience using Qt in other systems, but not specifically with C++. I've heard a lot of people make the case for Windows Forms. I feel like I should at least start there to learn and then can figure out which is best after - might as well get a headstart.

What's your favorite, least favorite ways to build out a GUI with C++? Looking mostly for technical reasons & best practices


RE: Windows Forms, Qt, or others? CPP/C++ - Disease - Oct 27, 2023

(Oct 27, 2023 01:58 PM)nodes Wrote:  I have experience using Qt in other systems, but not specifically with C++. I've heard a lot of people make the case for Windows Forms. I feel like I should at least start there to learn and then can figure out which is best after - might as well get a headstart.

What's your favorite, least favorite ways to build out a GUI with C++? Looking mostly for technical reasons & best practices

I would write a Windows GUI using Qt over native WINAPI all day, every day. I haven't touched C++ in the context of a Windows form application in many, many years. You'd have to really, really convince me why I'd want to use that over C# (especially these days with .NET Core) outside of certain specific use cases. But the last time I was, after learning the basics of WINAPI, I quickly picked up Qt and it worked out well.

I know there's some other contenders in the space, like GTK. But Qt definitely owns that market. It's mature, has a solid ecosystem and community, and is feature rich.


RE: Windows Forms, Qt, or others? CPP/C++ - Hackers - Oct 27, 2023

(Oct 27, 2023 02:15 PM)Disease Wrote:  I would write a Windows GUI using Qt over native WINAPI all day, every day. I haven't touched C++ in the context of a Windows form application in many, many years. You'd have to really, really convince me why I'd want to use that over C# (especially these days with .NET Core) outside of certain specific use cases. But the last time I was, after learning the basics of WINAPI, I quickly picked up Qt and it worked out well.

I know there's some other contenders in the space, like GTK. But Qt definitely owns that market. It's mature, has a solid ecosystem and community, and is feature rich.

That's good to hear, it has been a while since I've used it. I got things working but at the time I was more focused on learning Python so didn't get to spend enough time with it. Good to hear though, encouraging

A lot of people are saying C# is a good way to go, but I want to hold off on that until I have a couple of years of C++ under my belt first.


RE: Windows Forms, Qt, or others? CPP/C++ - Tentco - Oct 27, 2023

(Oct 27, 2023 01:58 PM)nodes Wrote:  I have experience using Qt in other systems, but not specifically with C++. I've heard a lot of people make the case for Windows Forms. I feel like I should at least start there to learn and then can figure out which is best after - might as well get a headstart.

What's your favorite, least favorite ways to build out a GUI with C++? Looking mostly for technical reasons & best practices

Nothing sexier than Immediate-mode UI's like ImGui.
https://github.com/ocornut/imgui
https://github.com/Patitotective/ImThemes


RE: Windows Forms, Qt, or others? CPP/C++ - Hackers - Oct 28, 2023

(Oct 27, 2023 07:30 PM)Tentco Wrote:  Nothing sexier than Immediate-mode UI's like ImGui.
https://github.com/ocornut/imgui
https://github.com/Patitotective/ImThemes

What would you say are some of the main benefits, but also downsides of using imgui instead of others?


RE: Windows Forms, Qt, or others? CPP/C++ - Tentco - Oct 28, 2023

(Oct 28, 2023 07:54 AM)nodes Wrote:  What would you say are some of the main benefits, but also downsides of using imgui instead of others?

You're indirectly asking difference between Immediate-mode UI and Retained UI.

Pros: Easy to implement the engine.
Easy to customize like graphics,animations etc... Direct access to low-level access.
Faster performance.

Cons: Draws frame-by-frame so expect some CPU overload.
Doesn't have much built in graphics,controls(you can add by yourself).

I must say explaining everything here is hard and I might forgot to explain some key-points.
Some articles I found give them a read.

https://collquinn.gitlab.io/portfolio/my-article.html
https://news.ycombinator.com/item?id=24988745
https://gist.github.com/bkaradzic/853fd21a15542e0ec96f7268150f1b62


RE: Windows Forms, Qt, or others? CPP/C++ - Hackers - Oct 28, 2023

(Oct 28, 2023 08:05 AM)Tentco Wrote:  You're indirectly asking difference between Immediate-mode UI and Retained UI.

Pros: Easy to implement the engine.
Easy to customize like graphics,animations etc... Direct access to low-level access.
Faster performance.

Cons: Draws frame-by-frame so expect some CPU overload.
Doesn't have much built in graphics,controls(you can add by yourself).

I must say explaining everything here is hard and I might forgot to explain some key-points.
Some articles I found give them a read.

https://collquinn.gitlab.io/portfolio/my-article.html
https://news.ycombinator.com/item?id=24988745
https://gist.github.com/bkaradzic/853fd21a15542e0ec96f7268150f1b62

Ah thanks for clarifying this, I saw Dear Imgui and thought that was the whole thing. I did not realize you meant it as a general concept / sort of protocol and not a specific implementation.

Thanks, I'll do some reading

Edit, went knee deep into Qt Creator and figured out how to use slots and signals to trigger logic from a cpp file function. Pulled input text to variables and now working on destroying the view or otherwise replacing it with "slide2". Converting a command line quiz to a visual quiz software that logs the results / gives info at end

The qt creator / visual editor with clear documentation for new actions, elements, etc is perfect. Qt seems extremely straightforward for creating GUI programs and the fact that I can bind to Python instead if I want to is a huge plus.

I'm going to stay on QT for a bit. I will try out Imgui at some point too.