Results 1 to 7 of 7

Thread: QListView item with border 0 still visible

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: QListView item with border 0 still visible

    You probably meant
    QListView::setFrameStyle( QFrame::NoFrame );

    I tried that and it doesn't work. I also tried setSelectionRectVisible( false ) but behaviour is still the same.

    Any other ideas? I'm starting to suspect that this border/frame cannot be hidden at all!

  2. #2
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListView item with border 0 still visible

    I got rid of listwidget-borders by calling setContentsMargins on the layout holding the widget.

    Qt Code:
    1. layout->setContentsMargins(0,0,0,0);
    To copy to clipboard, switch view to plain text mode 

    Hope it helps
    /anton

  3. #3
    Join Date
    Jul 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: QListView item with border 0 still visible

    No success, I tried:
    Qt Code:
    1. ui->listView->setContentsMargins( 0,0,0,0 );
    To copy to clipboard, switch view to plain text mode 

    Should I have used setContentsMargins on some other item?
    White rectangle still appears around each item when it is selected. Any other suggestions?

  4. #4
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: QListView item with border 0 still visible

    Hi,

    I have same problem. It looks like border is around only text of item. Icon is rendered outside of border. I've tried to play with QListView::text in Qt Style Sheet, but it looks like any changes in QListView::text have no any effects. Can someone help me with it?

    Thank you.

  5. #5
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QListView item with border 0 still visible

    Several things to try:

    border:none;

    I've had occasions where I'm using stylesheets, but I had to localize some of the settings in the .cpp files. For example:

    ui->setupUi(this);

    this->setStyleSheet("\
    QLabel {\
    color: white;\
    background-color: black;\
    font: bold normal 8pt;\
    border-style: solid;\
    border-width: 1px;\
    border-radius: 8px;\
    border-color: black;\
    padding: 3px;\
    }\
    ");

    leftLayout = new QGridLayout();

    And sometimes I've had to localize style sheet settings to particular objects:

    QLabel * TmpLabel= new QLabel();
    TmpLabel->setStyleSheet(put your settings here);

    Hope this helps.

Similar Threads

  1. QListview set selected item
    By Freeman551 in forum Qt Programming
    Replies: 1
    Last Post: 25th December 2009, 00:17
  2. Add new item to a QListView
    By graciano in forum Newbie
    Replies: 2
    Last Post: 18th August 2009, 18:49
  3. QListView item alignment
    By innerhippy in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2008, 09:32
  4. how to move item up and down in QListView
    By zhanglr in forum Qt Programming
    Replies: 3
    Last Post: 1st August 2008, 14:39
  5. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00

Tags for this Thread

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.