Registered Member
|
Hi,
I'm *very* new to programming so please forgive me if I say anything here that doesn't make any sense or is just plain stupid. I'm trying to write a KDE application with a QML interface, and within that interface I would like to embed a KPart. I have tried a million things, and the closest I have gotten to making it work is by putting the KPart in a QDeclarativeItem, and then making it available as a QML type through qmlRegisterType. In the QDeclarativeItem, I wrap the KPart with a QGraphicsProxyWidget. With this, I do see the KPart in my QML interface, but it appears only in a small rectangle (much smaller than the rectangle within which I placed it) and it is a complete mess in terms of menus, etc. Am I trying to do something that just cannot be done? Or is there a way to do this that I'm missing? Any help would be much appreciated! Best, Oriol |
Administrator
|
I fear this will be difficult.
For the sizing issues, you need to setup layouts, to ensure the QGraphicsWidget fills the available space in the QDeclarativeItem.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks for your help, Ben. Layouts improved things a little since now I can see the whole width of the KPart, but I am still only seeing its very top. I wonder if the problem is that KParts are not QWidgets, and so when I wrap the KPart with a QGrapicsProxyWidget there's bound to be problems. I don't know how else to do this though. I have been playing around with this for days and I am getting nowhere. My coding skills are obviously not good enough to solve this, so I guess I'll build the GUI with QWidgets and I'll come back to this when I understand how all this works better (and maybe QtQuick 2.x will make this easier). Thanks anyway!
|
Administrator
|
Make sure to use KXMLGuiWindow if you want to allow KParts to be used, as it allows for menus and toolbars to be merged in.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I am looking for a working example in QML/QtQuick that embed a KPart
ideally, the konsolepart thanks |
Registered Member
|
answered all my questions...
example in QML embedding konsolepart https://github.com/Swordfish90/cool-retro-term The QML terminal widget https://github.com/Swordfish90/qmltermwidget And finally, (drum rolling) a yakuake fork, that tries to be very much like Konsole, but with REAL SPLIT PANES !!! Final name has to be decided, and a new repo on github will be created once we are settled on a good name please try it, and names suggestions are welcome https://bitbucket.org/somekool/kde-start/ |
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot]