[Qt-interest] Menu bar on QtCreator created GUI

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Wed Jul 14 13:48:08 CEST 2010


OS Prog wrote on Wednesday, July 14, 2010 1:11 PM:

> > ...
> 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..).    

Okay, now I understand the problem. But are you really sure that nothing at all is displayed? Not even a tiny empty rectangle (the actual menu with no items in it)? And I mean really small, like a few pixels in height... this would indicate that the changes you did in Qt Creator - adding the menu items - are not reflected in either the *.ui file (you did not save) or the generated files (they are not re-generated or compiled/linked).

Also, are you sure you are not mixing up your debug/release binaries? Maybe you are building in release mode, but are starting the (outdated) debug binary?

Anyway, I still assume that after you did your changes in Qt Creator that the resulting files are not properly auto-generated. Are you using qmake? I strongly assume so (since you mentioned Qt Creator). Make sure that in your *.pro file the UI files are proplery declared:

FORMS += YourMainWindow.ui

qmake then takes care of the necessary steps (uic'ing, moc'ing). Do a 'make clean' (or in Qt Creator: right-click on the project(s) and "Clean") and see if that makes a difference...

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list