[Gambas-user] Why is MyMainWindow inheriting from QWidget (gb.qt4, CWindow width)?

Leandro Santiago leandrosansilva at ...626...
Wed Jun 2 16:33:07 CEST 2010


Hello, I'm looking at gb.qt4 code (I'm not a very good C++ programmer
:-) ) and I saw that the gambas3 main window (MyMainWindow) has
QWidget as parent class, but QMainWindow serves exactly to this.

It's because gambas applications don't have full integration with
other qt applications. For example, I use KDE with bespin theme. There
is a plasmoid called xbar and it implements a global menu, like in OS
X. All native qt4 applications can use this resource, but gambas apps
can't.

There is a method in QMainWindow called setMenuBar that set a menubar
as native menubar. So I just changed MyMainWindow parent to
QMenuWindow and added setMenuBar(menuBar) at MyMainWindow::configure()
method. Simple applications (with menubar) I created work fine with
globalmenu integration, but now gambas IDE is separated in a lot of
windows, each one with a component (text editor, toolbar, widgets
hierarch, etc), but uses globalmenu, at least :-)

I think if gambas wants to be ported to other plataforms (like Mac and
Windows), has a native and integred look is really important.

What do the main developers think about this?

ps: where can I find a small "guideline" to write gambas components
like gb.qt, gb.gtk, etc?

Sorry for my bad English.




More information about the User mailing list