Registered Member
|
hello,
i have again a big problem. i created a small qt/kde app with QMainWindow etc.. but than i saw, that KXmlGuiWindow also includes the whole about-menu, shortcuts etc... so i thought about change it to KXmlGuiWindow, but it didn't work. than i tried a minimal example, took the example from the tutorial (http://techbase.kde.org/Development/Tutorials/Using_KActions) and tried to delete repalce the textarea as standard widget with my ui-file. but it doesn't work, and i don't know what to do. has here somebody an minimalexample for me? i thought it is as easy as in qt... class MainWindow : public KXmlGuiWindow, private Ui::MainWindow or isn't it possible, and i can only use widgets and set them as main-widget? or how do you do such things? not all kde programms are editors or can i also describe my ui in the xml-file? and what happend with the mainmenu from the ui-file? PS: sorry for my newbie questions... perhaps an kde-beginners-board would be cool...
papierschiff, proud to be a member of KDE forums since 2008-Nov.
|
KDE Developer
|
I think the direct inheritance should work, but since your designer file is intended to work on a QMainWindow it might do things that interfere with the KXmlGui stuff.
While I am quite sure one could change the designer UI such that this doesn't happen anymore it is probably easier to recreate the designer UI in a plain widget container and use this as the window's central widget. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
hm, this makes sence.. but the problem is, when i use kxmlgui for the gui it would be difficult to port the programm as an qt-programm... stupid cross-plattform....
papierschiff, proud to be a member of KDE forums since 2008-Nov.
|
KDE Developer
|
Depending on your targeted timeframe, even a KDE application can be cross-platform, i.e. the KDE application framework is already working on other platforms (e.g. Windows, Mac OSX) and installation handling is being worked on.
If for whatever reason you require a Qt-Only version, the "central widget" approach gives you the most flexibility, since the GUI stays the same and you only put it into a different main window depending on build options. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]