Results 1 to 1 of 1

Thread: QMenuBar and QGraphicsScene

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QMenuBar and QGraphicsScene

    Hi all,

    I'm developing an OpenGL application using QT for the overlay. Or at least that's the goal. I've been using the "modelviewer" example as reference ( git://gitorious.org/qt-labs/modelviewer.git ), but now I'm stuck trying to add a simple menu bar. I don't know if I'm doing something wrong or if there is a bug, but I can't get it to work.

    In the example, I would for example add the following code to the OpenGLScene constructor:

    Qt Code:
    1. QMenuBar* pMenuBar = new QMenuBar();
    2. QMenu* pMenu = pMenuBar->addMenu("File");
    3. pMenu->addAction("asd");
    4. pMenuBar->addAction("Test");
    5. pMenuBar->addAction("x");
    6. pMenuBar->addAction("y");
    7. pMenuBar->addAction("z");
    8.  
    9. //pMenuBar->setMinimumHeight(25);
    10.  
    11. addWidget(pMenuBar);
    To copy to clipboard, switch view to plain text mode 

    Like this, the menu bar doesn't even appear. Now if I comment out the setMinimumHeight() function, a gray rectangle appears (the menu bar), but without any menus.

    The attached screenshot shows the menu bar below (?!) the "Instructions" dialog. There is also a lot of noise around the scene that I can't explain...

    Any help would be welcome !
    Attached Images Attached Images

Similar Threads

  1. QMenuBar Updates
    By johnmauer in forum Qt Programming
    Replies: 5
    Last Post: 20th January 2010, 13:35
  2. QMenuBar and QMenu
    By thedoctor in forum Qt Programming
    Replies: 0
    Last Post: 21st December 2009, 21:01
  3. how will a cumstomized qmenubar look like under mac os x?
    By billconan in forum Qt Programming
    Replies: 0
    Last Post: 10th November 2009, 10:39
  4. Styling QMenubar???
    By anupamgee in forum Qt Programming
    Replies: 5
    Last Post: 29th April 2009, 10:01
  5. Hide Qmenubar
    By user_mail07 in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2008, 22:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.