Results 1 to 11 of 11

Thread: How to add a menu bar to fullscreen Qmainwindow?

  1. #1
    Join Date
    Feb 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default How to add a menu bar to fullscreen Qmainwindow?

    Hi,
    How to add a menu bar to fullscreen Qmainwindow?
    thanks
    Ram

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    Create a menu bar widget and add it to main window's layout.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    what exactly is the problem? does your menu disappear on full screen?

  4. #4
    Join Date
    Feb 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    yes it appears without problem in the normal window but with the full it didn't
    thanks

  5. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    how did you add your menubar? using QMainWindow::menuBar()?

  6. #6
    Join Date
    Feb 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    thanks nish,
    i'm using this
    Qt Code:
    1. QMenuBar *menuBar1 = new QMenuBar(0);
    2.  
    3. fileMenu = menuBar()->addMenu(tr("&File"));
    4.  
    5. QAction* exit = new QAction(tr("&Exit"),this);
    6. exit->setShortcuts(QKeySequence::Close);
    7. exit->setStatusTip(tr("exit now"));
    8. // menuBar()->addAction(exit);
    9. fileMenu->addAction(exit);
    10. connect(exit, SIGNAL(triggered()), this, SLOT(close()));
    11. menuBar1->addMenu(fileMenu);
    To copy to clipboard, switch view to plain text mode 
    it is working fine in case of normal screen but on the fullscreen it is shown in the top of screen
    all what i need is to make menu bar (options-back) on the normal position of the bottom of screen

    thanks
    Ram

  7. #7
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    menuBar() creates AND puts it in the default layout of mainwindow at the top. Do not manipulate it. Unfortunately it always sits on the top of the window.

  8. #8
    Join Date
    Feb 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    thanks nish,
    i solved it right now by writing this snippet code and it shows me the device softkeys with fullscreen mode
    Qt Code:
    1. fileMenu = menuBar()->addMenu(tr("&File"));
    2. QAction* exit = new QAction(tr("&Exit"), this);
    3. fileMenu->addAction(exit);
    4.  
    5. Qt::WindowFlags flags;
    6.  
    7. flags |= Qt::WindowSoftkeysVisibleHint;
    8. flags &= ~Qt::WindowSoftkeysRespondHint;
    9. setWindowFlags(flags); // Hides visible window
    10. showFullScreen();
    To copy to clipboard, switch view to plain text mode 
    but the problem now is how to replace the "options-exit" menu with "options-back" or "back" soft key only

    Ram

  9. #9
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    now read your first post again... how in this great world we will know that you were talking about a mobile application? Qt is not just for mobile.

  10. #10
    Join Date
    Feb 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    i'm so sorry about confusion

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add a menu bar to fullscreen Qmainwindow?

    Quote Originally Posted by ram4soft View Post
    i'm so sorry about confusion
    Stating in your profile that you use Qt for every possible platform (which is doubtful) doesn't help too.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. [Symbian] show device's menu within a fullscreen application
    By curreli in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 12th September 2010, 07:54
  2. Hiding mac system menu in fullscreen mode
    By jupi32000 in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 19:32
  3. switch a QWidget inside a QMainWindow to fullscreen
    By koenux in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2009, 21:25
  4. PopUp a Menu when showing FullScreen
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2007, 10:04
  5. disable QMainWindow toolbar menu?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 18:24

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.