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. Problem with QLineEdit BlinkCursor
QtWS25 Last Chance

Problem with QLineEdit BlinkCursor

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.3k 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.
  • BuccaneerB Offline
    BuccaneerB Offline
    Buccaneer
    wrote on last edited by
    #1

    I'm trying to redefine QLineEdit as private class - and it's ok
    But I want to paint lineEdit with my style, and when I use paintEvent it's work well except Blink cursor... there is no cursor, and there is no text in lineedit box
    It's look like text and cursor are hiden behind paint event
    Please some one tell me, how I can use paintevent and show normal text and cursor
    For example in QSpinBox if I use paintevent the cursor is on his place... so why in lineedit such a problem
    What I do wrong?
    Thanks

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Check if "this":http://developer.nokia.com/community/wiki/Archived:Creating_a_custom_custom_line_editor_from_QLineEdit helps you.

      157

      1 Reply Last reply
      0
      • BuccaneerB Offline
        BuccaneerB Offline
        Buccaneer
        wrote on last edited by
        #3

        [quote author="p3c0" date="1411024877"]
        Check if "this":http://developer.nokia.com/community/wiki/Archived:Creating_a_custom_custom_line_editor_from_QLineEdit helps you.[/quote]

        Thanks for your help !
        But you see, from that manual, the paintevent starts only when text line is empty. So when lineedit has a focus - paintevent (from app code) doesn't start.
        In my case I try to paint the whole lineedit area, so my paintevent code is working during the whole app loop... and there is still no cursor and no text (((

        I'm starting to think that the only solution is to write code to repaint the Blink cursor by myself

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          If it's a style question, why not implement your own based on e.g. QStyle ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • BuccaneerB Offline
            BuccaneerB Offline
            Buccaneer
            wrote on last edited by
            #5

            [quote author="SGaist" date="1411030922"]If it's a style question, why not implement your own based on e.g. QStyle ?[/quote]
            damn you're right... and I so wanted to be a Qt jedi, painting widgets by myself

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Well technically that's what you will do, it's the style that paints some of the widget :)

              Don't be too hasty young Padawan ;)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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