Qt Designer in C++

85 views
Skip to first unread message

Joe Weidenbach

unread,
May 19, 2015, 11:56:59 AM5/19/15
to python_in...@googlegroups.com
Hello all,

I'm working on pushing my Qt skills to the next level, and am moving from PySide into C++ for that (mostly to work on some realtime OpenGL so I can move to that from DirectX).

In Pyside, for the last two years or so, I've avoided Qt Designer like the plague, due to a host of problems I had when migrating to PySide from PyQt, and the subsequent advice I received on this forum.  I've gotten used to specifying my entire UI in code, and I'm rather fond of that approach, but as I've been working with C++, it seems that the designer and its resulting UI is at least an order of magnitude more stable than it was in PyQt/PySide.  Does this match up with anyone else's experience?

For the folks who use Qt with C++ on a daily basis, do you tend to still hardcode your UI's?

Just a general question :)

Thanks all!

Joe

Marcus Ottosson

unread,
May 19, 2015, 12:08:18 PM5/19/15
to python_in...@googlegroups.com
You don't necessarily need to program with Qt using C++ to make use of OpenGL or DirectX.

You can keep your knowledge and experience in developing with PySide, along with the benefits of Python versus C++ when it comes to rapid development, and supplement it with something like a [Python OpenGL library](http://pyopengl.sourceforge.net/) or by writing just the OpenGL part with C++, and exposing it to your PySide UI.

Furthermore, if you're considering leaving Python altogether in search of making use of the GPU, you could also consider QML as it runs entirely on the GPU and has native supports for OpenGL shaders and all of that jazz. 

Also, widgets aren't being developed anymore. If there's a next level to Qt, it's QML.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5gZBu9uNkP8mYWfYWfzgW0urcY_jPL4vCuFQOhx%3Dm8Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Joe Weidenbach

unread,
May 19, 2015, 12:26:29 PM5/19/15
to python_in...@googlegroups.com
Hey Marcus,

I've got no intention of leaving Python behind, I just want to go deeper into Qt, and I want to get further into OpenGL (as I said, I've been using DirectX, but that's much less (read: not at all) portable.  I've also been learning CUDA just for fun, at some point I might go to OpenCL as well.

Background here: I've been coding in C# for the last 7 years on Windows, and even though that's (only for the next month--wahoo!) still my day job, I feel like I need to get back to full Linux compatibility.  I'm fluent in XAML and WPF, which from my understanding is the same concept as QML, So I think QML's definitely in the cards at some point.  Mostly though, I'm trying to get the OpenGL side down, preferably in a manner that's platform independent (so coding a base window in Win32 is right out--which is the limit of my experience with low-level GUI systems in C++).  Qt seems the best option to do that, and I want C++ for speed.  This is mostly just personal experiments, but I'm trying to re-up my C++, since I've been in C# and Python for so long.

So basically, I'm trying to stick to the base libraries for the moment, but I'm also trying to dive into the deeper Qt Framework (for sql, xml, etc--not just GUI).  I'm highly looking forward to diving into QML (I love XAML/WPF), but want to get the base translation from Python done at the moment.  Hence the question on the Designer :)

Thanks again for the feedback!

Joe

damon shelton

unread,
May 19, 2015, 12:37:56 PM5/19/15
to python_in...@googlegroups.com
I personally have had zero issue with stability in using ui files for my work in pyqt or pyside, just some random stability issues with PySide itself. I use UI files as the basis for all of my interfaces (and there are many of them). Also Qt has an OpenGl module for implementing opengl into your interfaces. QML will be good to learn for using newer versions of Qt. PyQt has a version for Qt5 but no more PySide unless people start developing their own version of it. Thinking about starting a wrapper myself, but will be a long time to get it working and tested.


Marcus Ottosson

unread,
May 19, 2015, 4:55:17 PM5/19/15
to python_in...@googlegroups.com
Ah, gotcha. The background really helped, thanks for clarifying that. I can't offer any advice on Qt Designer, as I haven't seen the use for it myself beyond the initial learning phase.


For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Justin Israel

unread,
May 19, 2015, 7:02:49 PM5/19/15
to python_in...@googlegroups.com
In C++/Qt I exclusively use QtCreator, which I find to be an excellent IDE for Qt development. It obviously has a lot more specific support for Qt projects. Still, even with QtCreator, I don't use UI files at all. I continue to hand code all UI functionality. For me it is just a preference. But if you are doing your project in QtCreator, most of the UI/resource conversion stuff is handled for you automatically. 


Joe Weidenbach

unread,
May 19, 2015, 8:36:13 PM5/19/15
to python_in...@googlegroups.com
Fair enough.  I agree on the UI files from my PySide experience. I'd run some tutorials just to wrap my head around working with Qt in C++ (and QtCreator--I'm a Visual Studio user, so need to practice with a different tool--not quite ready for cmake yet, but I've been using that for Maya plugins, so not too worried by it).  The tutorials used the Designer, and I was blown away by how simple and automatic it was.  I still find the Designer to be over-complicated for most things, but I could see with C++ and writing some designer plugins that it could work really nicely.  Whether it's worth it to write the plugins is obviously debatable.

But yeah, I still think I'll stick with hand-coding.  It definitely makes it easier when you get into the Model-View stuff. Or really, anything more advanced UI-wise :).

Reply all
Reply to author
Forward
0 new messages