[Kde-bindings] Qt, Qyoto buttons work intermediately

linuxoidoz at yahoo.com.au linuxoidoz at yahoo.com.au
Mon Feb 15 08:09:31 UTC 2010


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?

------------------  Original Message  ------------------
Subject: Re: [Kde-bindings] Qt, Qyoto buttons work intermediately
Date: Mon, 15 Feb 2010
From: linuxoid.au at gmail.com
To: kde-bindings at kde.org

> Apparently, it wasn't just the Title, as soon as I added this: "menuBar.Enabled = true;" the menu bar appeared. I guess there's a methods to set a menu bar, here's what I have:
> 
> menuBar = new QMenuBar(this);
> menuFile = new QMenu(menuBar);
> menuFile = MenuBar().AddMenu("&File");
> menuFile.AddAction(actionOpen);
> menuBar.Enabled = true;
> this.SetMenuBar(menuBar);
> 
> if I change "menuFile = MenuBar().AddMenu("&File");" for "menuFile.Title = "&File"" it also works.
> 
> But still no luck with controls in the 2nd class. Even the menus work fine in the MainWindow, but they don't work in the StartWindow or BasicVideoWindow.
> 
> ------------------  Original Message  ------------------
> Subject: Re: [Kde-bindings] Qt, Qyoto buttons work intermediately
> Date: Mon, 15 Feb 2010
> From: Arno Rehn <arno at arnorehn.de>
> To: KDE bindings for other programming languages <kde-bindings at kde.org>
> 
> > On Monday 15 February 2010 00:57:50 Linuxoid Oz wrote:
> > > Arno,
> > > 
> > > Please get the whole project and code from here:
> > > http://qt-giraff.svn.sourceforge.net/viewvc/qt-giraff/trunk/source/
> > > 
> > > If I could only get through this wall, I should be OK with the rest. Do you
> > > know why the menu bar only shows from a Qt converted UI file but not when
> > > I create it myself in the code? I'd really appreciate your help. Thank
> > > you.
> > The menubar is actually added. You just don't set any titles for the menus, so 
> > the bar is just around 1px high. Add a line like
> > menuFile.Title = "File...";
> > and there you are.
> > If you design the UI in-code, it is probably more convenient to use the 
> > AddMenu() methods of QMenuBar. It already has overloads that accept a string 
> > for the menu title.
> > 
> > 
> 



More information about the Kde-bindings mailing list