Registered Member
|
Adding a QDockWidget to a KXmlGuiWindow by editing it's main widget in QT Designer
Tue Feb 10, 2009 4:12 am
Hi everyone!
I'm trying to get into Qt/KDE application programming, and have hit a snag implementing QDockWidgets in my application. This is all from the basic template provided by KDevelop 4, so while I understand what's going on, I just don't know the best way to change it. I've got these classes:
The AEmpire created in my main.cpp, which initializes an AEmpireView as the window's "central widget". So the UI I'm editing in Qt Designer (aempireview_base.ui) is just a QWidget, and so while I can drag QDockWidgets into it, they won't auto-dock, and aren't draggable when they are floated -- they just sit there immovably until I close or re-unfloat (haha) them back to their static spot in the QWidget. Apparently in order to actually have fully functional QDockWidgets I need to embed them into a QMainWindow (which KXmlGuiWindow inherits from), where they will be docked next to the windows main widget, not inside of it. So, how do I add functional QDockWidgets into my main application? Is designing them separately, and add them to the UI by hand in AEmpire.cpp the best option? Or maybe removing the entire AEmpireView class, and making my ui file directly represent a KXmlGuiWindow object to be loaded by the AEmpireClass? Or am I totally overlooking something obvious? Thanks for reading! |
Administrator
|
RE: Adding a QDockWidget to a KXmlGuiWindow by editing it's main widget in QT Designer
Tue Feb 10, 2009 7:00 am
I am not too familar with KXmlGuiWidget myself, but I would design the QDockWidgets individually ( easier to refactor later ) then manually bring them in.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
RE: Adding a QDockWidget to a KXmlGuiWindow by editing it's main widget in QT Designer
Fri Feb 13, 2009 9:40 am
Alright. That shouldn't be too hard, thanks for the help!
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell