Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Menu Problems
Qt 6.11 is out! See what's new in the release blog

Menu Problems

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gogoi
    wrote on last edited by
    #1

    hello friends

    Actually i am not able to contruct a menu in my App..the code i have written is like that...

    @#include "menumainwindow.h"

    menumainwindow::menumainwindow(QWidget *parent)
    : QMainWindow(parent)
    {

    showAct = new QAction(("&Show"), this);
    connect(showAct, SIGNAL(triggered()),label1, SLOT(show()));
    hideAct = new QAction(("&Hide"), this);
    connect(hideAct, SIGNAL(triggered()),label1, SLOT(hide()));
    exitAct = new QAction(("&Exit"), this);
    connect(exitAct, SIGNAL(triggered()),qApp, SLOT(quit()));
    bar = menuBar()->addMenu("&File");
    bar->addAction(showAct);
    bar->addAction(hideAct);
    bar->addSeparator();
    bar->addAction(exitAct);
    setCentralWidget(bar);

    }@
    here it will display show,hide,exit menu but i want it to show when i click the "file"..so anything wrong in the code..please suggest

    regards
    Rahul

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      remove setCentralWidget(bar), or set other central widget in your main window

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gogoi
        wrote on last edited by
        #3

        hello cincirin

        but if i remove setcentralWidget(bar) than nothing diaplay in the simulator..

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cincirin
          wrote on last edited by
          #4

          hi !
          First thing, sorry, I didn't realize that this is mobile forum.
          Now, if you set other central widget in your main window, other than menu bar, didn't work ?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gogoi
            wrote on last edited by
            #5

            i cant get it can you please me how that can be done..can you give me an example of hoe it can be done

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cincirin
              wrote on last edited by
              #6

              @setCentralWidget(new QWidget)@

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved