Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt equivalent to MS UserControls
cosmos2469 last edited by
I have an app written in C# that we are wanting to port to Qt. The idea of the app is straightforward - it contains several menu items and depending on which menu item you select, different operations appear in the central widget area (different buttons, datagrids, etc.). The functions for each screen was implemented with a UserControl and it was only a matter of displaying the correct UserControl. I thought it would be easy to implement the same thing in Qt using Widget, but I ran into a few oddities:
Creating a Widget gives a caption bar which is not desired for this app (the caption on the application window is fine) - is there a way to turn off the caption in a widget? This way I can dispay the Widget in my main application's central widget area and it appears that various "screens" appear but without a caption.
KDialog is the closest thing I found to solve issue #1, but it has few quirks. I want to overlay each "screen" in the same place on the Qapplication. But Qt wants to build a parent/child relationship with each KDialog that I overlay on the screen.
As a complete newbie to Qt, I would appreciate any input/thoughts/guideliens/examples.
Thanks for your time
goetz last edited by
A widget only has a caption bar when it is displayed as toplevel widget. As soon as you put it into some other widget, it is frameless.
Seems like "QStackedWidget":http://doc.qt.nokia.com/4.7/qstackedwidget.html could do what you want.
As you are completely new to Qt, I'd propose to go through some tutorials:
- "How to learn Qt":http://doc.qt.nokia.com/4.7/how-to-learn-qt.html
- "Getting Started Programming with Qt":http://doc.qt.nokia.com/4.7/gettingstartedqt.html (translations in the "wiki":http://developer.qt.nokia.com/wiki/Category:Learning::GettingStarted)
- "Tutorials overview":http://doc.qt.nokia.com/4.7/tutorials.html