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. How to make QMenubar visible on Android 4xx?
Qt 6.11 is out! See what's new in the release blog

How to make QMenubar visible on Android 4xx?

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.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.
  • A Offline
    A Offline
    adutzu89
    wrote on last edited by
    #1

    I have a application for Android which I tried to deploy it on multiple Android devices(both physical and AVDs), when it starts it shows the titlebar+menubutton(which is the QMenuBar I added)
    When the application starts it asks the user to enter username and password, after login I replace that menubar with another but the titlebar+menubar disappears without any way to acces it, it only happens on devices which do not have a "menu" option on the device.
    Is there a way to set it visible?

    I am using Qt 5.3.1

    1 Reply Last reply
    0
    • A Offline
      A Offline
      adutzu89
      wrote on last edited by
      #2

      This might be a bug since I managed to do a workaround, as it only occurs if menubars are changed via @setMenuBar(QMenuBar *menubar)@

      without deleting the current menubar and if there are any methods that modify the widgets inside central's widget layout(deleting,adding) before adding a new menubar.

      In case someone bumps into this, here is my workaround:

      @/* this is the first menubar which I set by default, before login and after the the user disconnects /
      void mainwindow::setMenuBar1(){
      /
      do nothing here /
      if(this->menuWidget()!=NULL){
      delete this->menuWidget();
      mb=new MenuBar1(this);
      setMenuBar(mb);
      }
      else{
      mb=new MenuBar1(this);
      setMenuBar(mb);
      }
      /
      in case it's needed do something here */
      }

      /* this is the menubar which I set after login /
      void mainwindow::setMenuBar2(){
      /
      do nothing here /
      if(this->menuWidget()!=NULL){
      delete this->menuWidget();
      mb=new MenuBar2(this);
      setMenuBar(mb);
      }
      /
      in case it's needed do something here */
      }@

      This workaround works 80%-90% of the time unfortunately. If someone care to help I'm open for tips.

      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