Results 1 to 2 of 2

Thread: QLineEdit, draw only text

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QLineEdit, draw only text

    Qt 4.4.3, Windows XP
    I used 'search', but didn't find an answer...
    Well I need to tune drawing of QLineEdit (I'm subclassing it) so it paints only text (possibly selected) and flicking cursor. No background and no frame. I can disable background with
    Qt Code:
    1. QPalette p = palette();
    2. p.setBrush(backgroundRole(), QBrush(Qt::transparent));
    3. setPalette(p);
    To copy to clipboard, switch view to plain text mode 
    but the thin blue line is still painted. In Qt's source there is:
    Qt Code:
    1. initStyleOption(&panel);
    2. style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
    To copy to clipboard, switch view to plain text mode 
    So is it possible not to draw the frame without total reimplementation of paintEvent (it's rather huge )?
    thanks in advance.

    Added: sorry, I didn't notice the setFrame
    Last edited by Radagast; 28th March 2009 at 11:17.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. QLineEdit and background text
    By SnarlCat in forum Qt Programming
    Replies: 2
    Last Post: 6th March 2009, 22:17
  3. Text before editting on QLineEdit
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 8th September 2008, 15:51
  4. QLineEdit text() crash - Qt3
    By user_mail07 in forum Qt Programming
    Replies: 7
    Last Post: 10th June 2008, 09:42
  5. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.