[Kde-bindings] Qt, Qyoto buttons work intermediately

Arno Rehn arno at arnorehn.de
Mon Feb 15 12:57:39 UTC 2010

On Monday 15 February 2010 09:09:31 linuxoidoz at yahoo.com.au wrote:
> Well, even more apparently it's not even those but the order of these two:
> menuBar.Enabled = true;
> this.SetMenuBar(menuBar);
> If I put them right after
> menuBar = new QMenuBar(this);
> the menu bar appears. If I put them after all the menus and actions, the
> menu doesn't appear? How come?
It has nothing to do with the order of anything. The menubar is there. I have 
it here. If you don't set a title, it's just 1px high. But I can click the 
first menu and it appears just fine. If I add menuFile.Title = "File..."; 
somewhere, the menu gets a title and consequently the menu bar grows. 
QMenuBar.Enabled is inherited from QWidget and doesn't have anything to do 
with visibility. It changes whether the widget is active or inactive, i.e. 
whether you can click it or not. And the property is set to true by default.

WRT to your second problem: I don't have a clue yet. Your class layout is 
quite strange, but I try to track the problem it down. It probably has to do 
something with objects being collected by the GC at the wrong time. If you add 
a reference to any of the button's MetaObject(), it magically starts working. 
That's probably a bug; I'll investigate.

Arno Rehn
arno at arnorehn.de

More information about the Kde-bindings mailing list