[Qt-interest] Menu bar on QtCreator created GUI

OSProg osprog at gmail.com
Thu Jul 15 00:33:42 CEST 2010


This email contained a .zip file attachment. Raytheon does not allow email attachments that are considered likely to contain malicious code. For your protection this attachment has been removed.

If this email is from an unknown source, please simply delete this email.

If this email was expected, and it is from a known sender, you may follow the below suggested instructions to obtain these types of attachments.

+ Instruct the sender to enclose the file(s) in a ".zip" compressed file, and rename the ".zip" compressed file with a different extension, such as, ".rtnzip".  Password protecting the renamed ".zip" compressed file adds an additional layer of protection. When you receive the file, please rename it with the extension ".zip".

Additional instructions and options on how to receive these attachments can be found at:

http://security.it.ray.com/antivirus/extensions.html
http://security.it.ray.com/news/2007/zipfiles.html

Should you have any questions or difficulty with these instructions, please contact the Help Desk at 877.844.4712

---

I hope I can send file here.
It looks like the QWidget takes all QMouseEvent-s and doesn't pass them to 
QMenuBar...
Regards,
Nik

> On 14/07/10 20:33, Constantin Makshin wrote:
>> That's strange.
>>
>> I've made a "quick and dirty" test application (see the attachment) and 
>> everything works as expected.
>
> Wow, cool, thanks! :)
> I think it has to do with parenting. Weird... I have to see what I can do.
>
>> By the way, your connect() call looks a bit weird, too ? the signal has a 
>> parameter, but the slot does not.
>
> The signal is that way, because the parameterless one is not emitted (I
> checked the source code), but I don't need the parameter.
>
> Regards,
> Oszkar
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 14 Jul 2010 13:04:31 -0700
> From: "Malyushytsky, Alex" <alex at wai.com>
> Subject: Re: [Qt-interest] Menu bar on QtCreator created GUI
> To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> Message-ID: <F8145CF983B4DB42855E9BB7F5BE8FCC48CE873E at camail2>
> Content-Type: text/plain; charset="utf-8"
>
> There is nothing wrong, I guess you are missing something else.
> I think you can get such behavior if you specify wrong parent for example.
> Make small example which demonstrate your problem.
> Attach source code and post it.
>
> Regards,
>     Alex
>
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com 
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of OS Prog
> Sent: Wednesday, July 14, 2010 8:08 AM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] Menu bar on QtCreator created GUI
>
> On Wed, Jul 14, 2010 at 2:36 PM, OS Prog <osprog at gmail.com> wrote:
>>>> > ...
>>>> 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).
>>>
>> Nothing is displayed. Absolutely nothing. Even a pixel.
>> The changes are applied, I think, as I've added the QMenu and the
>> QActions on it at the same time and then I've build the code - The
>> menu text is there but didn't worked. So I assume that files are
>> generated correctly and I'm using the right build.
>>
>>> 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?
>>>
>> Yes, the release folder is empty and I'm working only on debug one...
>>
>>> 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
>>>
>> They are.
>>
>>> 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...
>> I've done it. Even I've cleaned all remaining files after 'clean' step
>> manually and I've rebuild it.
>>
>> BTW, I've noticed that for the first time in Qt4.5 (don't remember
>> QtCreator version) few months ago, but I worked around doing the menu
>> stuff in the code, rather on the designer. Now I'm using Qt4.7b1 and
>> QtCreator 1.3.83.
>>
>> I've tried building it on few machines (XP and Vista) - it's the same.
>>
>> Regards
>> Nik
>>
> I've payed a bit to find out more.
> It happened if I create a QWidget in the MainWindows constructor.
> You can reproduce it if you create a MainWindow GUI with the creator
> and put some menubar items on it.
> Then in the MainWindow constructor, just after the
> ui->setupUi(this);
> put:
> QWidget *wdg = new QWidget(this);
>
> So, the question is: What's wrong putting the QWidget on this place
> with parent MainWindow?
>
> Best regards,
> Nik



More information about the Qt-interest-old mailing list