Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Popup-Qmenu



  • When using the popup or exec function to display the submenus contained in my qmenu, I would like them to be visible and not disappear when I click the mouse. I know this can be done with the showTearOffMenu function but this function does not suit my visualization needs of my interface.

    I leave the code that I am using for the popup():

    void MainWindow::DespliegoSubmenu()
    {
    
        reset = false;
        timer.stop();
        timer.disconnect(&timer, SIGNAL(timeout()), this, SLOT(BarridoMenuPrincipal()));
        Highlight->~QRubberBand();
        Highlight = new QRubberBand(QRubberBand::Line,menu);
        lista = menu->actions();
        p_submenu =0;
        connect(&timer,SIGNAL(timeout()), this, SLOT(BarridoSubMenu()));
        connect(&timer, SIGNAL(timeout()), this, SLOT(update()));
        timer.start(velBarrido);
        QPoint point5;
        point5 = mapToGlobal(QPoint(anchura,ui->menubar->rect().height()));
        menu->popup(point5);
       
    
    
    }
    

    I would like to add two things:

    • I have another widget that has grabbed the mosue with function grabMouse ().

    • With windows it ignores the mouse click but with Android it is where I have the problem.


Log in to reply