Qt Text Selection works in Debugging, but not when running

Sysprogs forums Forums VisualGDB Qt Text Selection works in Debugging, but not when running

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23175
    tchad
    Participant

    I have a Qt 5 app that runs on a Raspberry Pi, on Raspbien Stretch.

    The app has several QLineEdit widgets. In debugging with the window redirected to my Windows 10 / VisualGDB laptop, they work as expected. The cursor is visible in the QLineEdit, and text can be selected as normal. When alt-tabbing between QLineEdits, each newly selected QLineEdit selects the contained text.

    When running on the Raspberry Pi via startx (not debugging through VisualGDB), those same QLineEdit widgets behave strangely. The cursor is invisible, and tabbing between QLineEdits is invisible — it’s impossible to tell where the cursor is. If you start typing, text does appear – the cursor is in there and works, it’s just invisible.

    If you very carefully click and drag, you can get it to highlight text in blue as usual, but Qt calls to highlightAll don’t show up, and selection while “tabbing” between fields doesn’t show up.

    I’m not sure where to start debugging this. Any suggestions on what to test next?

    Things I have considered but don’t know how to do:

    • Check the command used by VisualGDB to run my app and try replicating it (I don’t know what command VisualGDB uses to initiate the app)
    • Manually redirect my app to XMing over SSH without VisualGDB and see if the problem exists there (I get an error: QXcbConnection: Could not connect to display localhost:10.0
      Aborted)
    • This topic was modified 5 years, 4 months ago by tchad.
    #23190
    support
    Keymaster

    Hi,

    This might be triggered by some Qt-level configuration settings. Are you using the stock Qt library installed via apt-get, or have you built it from scratch?

    Either way, please try browsing through the Qt examples and locating an example with similar functionality. Then:

    • Try building it on the device (without VisualGDB at all).
    • Try importing it into VisualGDB and building/debugging it.
    • Try creating a new VisualGDB project with the default flags and then copying the sources from that sample to it.

    If you encounter different behavior between some of the setups mentioned above, try analyzing the differences between them.

    You can find the exact command used by VisualGDB to run/debug the app via View->Other Windows->VisualGDB Diagnostics Console. You can also use VisualGDB Project Properties -> Debug Settings to configure VisualGDB to display the GUI on the Raspberry Pi desktop instead of forwarding it via XMing.

    You could also try running the app via SmarTTY – it uses the same X11 redirection logic as VisualGDB, but won’t run the app under debugger.

    #23213
    tchad
    Participant

    Thank you for the suggestions and help, it got me going in the right direction.

    The issue was embarrassingly easy, and was not related to Qt or VisualGDB…

    The script that was starting my VisualGDB app was running startx with the “-nocursor” option, because it’s on a touch-screen device, and I wanted to hide the mouse cursor. As it turns out, that entirely eliminates the cursor, including in text boxes.

    I changed the script to instead use “unclutter -idle 0” instead, and everything is fixed. *sigh*

    I am glad to know about SmarTTY and the VisualGDB Diagnostic Console, those have both been useful already. Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.