Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. No cursor or text visible in QLineEdit, on top QGraphicsView
Forum Update on Monday, May 27th 2025

No cursor or text visible in QLineEdit, on top QGraphicsView

Scheduled Pinned Locked Moved General and Desktop
qlineeditqmainwindowqgraphicsviewqgraphicsscene
3 Posts 1 Posters 1.8k Views
  • 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.
  • F Offline
    F Offline
    FinitelyFailed
    wrote on last edited by FinitelyFailed
    #1

    Hi

    I have a QMainWindow which contains a graphicsview and scene. Where images, text, videos and similar are rendered. I have added a QLineEdit as a child to the MainWindows (i.e. a sibling to the scene etc.). I can see the LineEdit and the placeholder-text I have set and I can make it focused, but no cursor or input text is visible. I can get the text that I have input via keyboard (even touch keyboard) so I know that it works, I just can't see it. I'm running Windows 8.1 and Qt 5.4.1.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      FinitelyFailed
      wrote on last edited by
      #2

      I have now explored the issue a bit further, as long as the GraphicsView is the same size as the screen (1920x1080) or larger the QMainWindow (which is set to be fullscreen) doesn't receive any paintevents, which is probably why the LineEdit isn't repainted after it is first shown. Why is that? Is there any solution for my problem?

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FinitelyFailed
        wrote on last edited by
        #3

        For the moment I have made the GraphicsView 1 pixel shorter than the screen layout (i.e. 1920x1079) which makes everything work perfectly. I'm using an QGLWidget as the viewport for the GraphicsView. When I try to use the new QOpenGLWidget instead the (normal) widgets that are added on top of the graphics view are rendered correctly, however anything drawn using OpenGL flickers as soon as any part of the widget normal needs to be redrawn. E.g. when adding a QLineEdit and the cursor blinks or when text is inputted into the widget the parts drawn with OpenGL (in the graphicsview) flickers. Which makes it (QOpenGLWidget as a viewport) impossible to use in our case.

        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