×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    51

    Question QListWidget: selected item with strange thin border

    Hello!
    I have created QListWidget and now trying to style it. However when I select any item it is painted with thin black border. I have changed border width and other stuff, but the problem is still here. Here is it:

    Code:
    QListWidget {color: "COLOR3"; background-color: "COLOR4"; border-radius: 6px; border-style: outset;border-width: 3px; border-color: grey}
    QListWidget::item { color: black; margin-right: 8px; margin-left: 8px; padding: 10px; border-bottom: 2px solid grey; }
    QListWidget::item::selected { background-color: "COLOR5"; }


    Please help me to get rid of it. Thank you!

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: QListWidget: selected item with strange thin border


  3. #3
    Registered User
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    51

    Re: QListWidget: selected item with strange thin border

    Thanks Rahul, but I saw this links. I played with "show-decoration-selected" property, but it changes only a size of this frame. Now I have found out that this frame is the focus rectange, and it can be switched off by

    listWidget->setAttribute(Qt::WA_MacShowFocusRect,false);

    Its really strange, but it doesn't work. I use Qt 4.7.4

  4. #4
    Registered User
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    51

    Re: QListWidget: selected item with strange thin border

    The soulution is listWidget->setFocusPolicy(Qt::NoFocus);

Similar Threads

  1. How to set border thickness of QListWidget
    By rahul.kulshreshtha in forum Qt
    Replies: 6
    Last Post: 2010-12-31, 13:12
  2. How to add Border to each item in ListBox
    By ash_leo in forum Symbian
    Replies: 2
    Last Post: 2008-12-15, 08:17
  3. Replies: 1
    Last Post: 2008-05-15, 07:59
  4. Different Selected Item in Menu Item
    By naresh99 in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-11-06, 13:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×