[Qt-interest] Menu bar on QtCreator created GUI

OS Prog osprog at gmail.com
Wed Jul 14 13:10:58 CEST 2010


> OSProg wrote on Tuesday, July 13, 2010 9:55 PM:
>
>>>> I've created a GUI with the Qt Creator and I've put some items under
>>>> the Menu Bar. On the QtCreator Designer window it looks OK,
>>>
>>> What do you mean by "it looks OK"? Does something happen (besides
>>> that
>>> the menu disappears, as I ASSUME)?
>>>
>> I mean that I can add actions and menus and all is as expected.
>
> So what do you expect? Sorry, but your answer sounds like the answer "Yes!" to the question "Do you want tea or coffee?"
>
>>>> but when
>>>> I run the application the items are not click-able. They are not
>>>> disabled (grayed out), but when I click on them nothing happened.
>
> So that sounds for the the items are there, but nothing happens when you click on them...
>
>>> ..
>> Well, normally when I have a menu I expect to see all the items when
>> I click on it. I cannot click on an item because they doesn't appear
>> when I click on the menu.
>
> ... and now you are saying the items are not there at all?!
>
> Let's define some vocabulary here
>
> "menu": the panel which contains "items" and is available in the menu bar.
>
> "item": typically a QAction based menu entry which triggers some action when clicked. Or another submenu
>
>
> So is it now that you can't click on the items, because they are NOT THERE AT ALL, or that when you click on them that NOTHING HAPPENS?
>
> Sorry, but I am having problems understanding your statements here, I am just trying to narrow down the problem here...
>
Ok, some example:
I have QMainWindow which has QMenuBar.
In the QMenuBar I have two 'QMenu's ('File' and 'Tools'). Under each
of the 'QMenu's I have 'QAction's.

On the creator I can add new QMenu on the QMenuBar by clicking "Type
Here" next to the last QMenu I've created. Then I can add new QAction
under the QMenu. That works fine.

The problem is when I run this application. I can see "File" and
"Tools" texts on the QMenuBar, but when I click on them nothing
happens - like I'm not clicking on them. The menu doesn't appear (this
drop-down menu that should appear when you click on them with all the
actions on it..).

>
> So for now I *assume* that you don't SEE the items when running the application: did you SAFE the *.ui file before exiting the Designer? Did you recompile the mocced files? Are the _moc.cpp etc. files actually re-generated at all? Maybe try a 'make clean; make all' (recompile everything). For me it sounds like the auto-generated files are not properly updated.
>
I'll try it. Could that be...

Best regards,
Nikolay




More information about the Qt-interest-old mailing list