QMenu popup does not work on Linux



  • I am using QMenu popup to show a popup list of entries on the click of a button (QToolButton). It works fine on windows but on Linux (Ubuntu 16.04), I get QPainter invalid errors whenever the button is clicked and no menu gets displayed. The Linux machine login is done from a Windows 10/7 machine using MobaXTerm through SSH and then running a local XMing on windows. Then, starting up the application using ./app.out starts and the GUI gets displayed (working absolutely fine, identical to Windows). However, on clicking the QToolButton, no menu gets displayed, on console I see messages about invalid QPainter. What is wrong? Is the problem with the setup itself?


  • Moderators

    @ajaxcrypto Is it working if you start the app directly on the Linux machine without SSH?



  • On running directly on Ubuntu 16.04 with Qt 5.9.0, I can see the popup but I cannot see any entries/text in them, though clicking on them works (only a white blank popup comes). In console I see lots of "Painter not active" and "Unbalanced save/restore" messages. I am not overriding paint method for either the button or the menu.


  • Moderators

    @ajaxcrypto Strange. Do any Qt app packaged by Ubuntu work? For example VLC.



  • VLC is working fine. But any QMenu instance whether it is context menu or QToolButton menu, comes blank without any text for it and throws a series of invalid QPainter errors.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.