Results 1 to 9 of 9

Thread: Custom LineEdit - need help!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Custom LineEdit - need help!

    Check the implementation of drawCursor(), maybe it does some painter transformations prior to drawing the cursor. Maybe this will fix the difference between your line and drawCursor(). If the line itself is at a wrong position then I'd assume your earlier calculations don't take some aspect into consideration. Check the source code for QLineEdit again and see if you didn't miss something.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Re: Custom LineEdit - need help!

    pfff... finally, I fixed it. I had to reimplement the QLineEdit::mousePressEvent() and QLineEdit::mouseMoveEvent() methods to calculate the cursor position and call setCursorPosition().

  3. #3
    Join Date
    Nov 2009
    Location
    Sacramento, CA
    Posts
    24
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Custom LineEdit - need help!

    Could you post your code for the mouse events?

  4. #4
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom LineEdit - need help!

    Send image for us.

Similar Threads

  1. setFocus() on Lineedit
    By qtuser20 in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2010, 18:54
  2. Custom Model? Custom View? Custom Delegate?
    By Doug Broadwell in forum Newbie
    Replies: 4
    Last Post: 11th February 2010, 20:23
  3. Help on using QTableWidget with LineEdit.
    By narendra in forum Qt Programming
    Replies: 3
    Last Post: 31st December 2009, 15:30
  4. lineedit in qpainter
    By Devoraz in forum Newbie
    Replies: 9
    Last Post: 5th August 2009, 01:52
  5. Get Color from LineEdit
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 15th May 2007, 15:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.