Results 1 to 4 of 4

Thread: QListView::setSelectionRectVisible(bool)

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default QListView::setSelectionRectVisible(bool)

    Hi,

    could someone explain why the following:

    Qt Code:
    1. this->sectorsList = new QListWidget;
    2. this->sectorsList->setSortingEnabled(true);
    3. this->sectorsList->setSelectionMode(QAbstractItemView::ExtendedSelection);
    4. this->sectorsList->setSelectionRectVisible(false);
    To copy to clipboard, switch view to plain text mode 

    doesn't work (i.e. the rectangle is still visible) ?

    The documentation says the following:

    Note: The selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected; i.e., it will not draw a selection rectangle if the selection mode is QAbstractItemView::SingleSelection.
    The selection mode is QAbstractItemView::ExtendedSelection which is why the rectangle is visible. Does it mean that QListView::setSelectionRectVisible(bool) has no effect ?

  2. #2
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QListView::setSelectionRectVisible(bool)

    Is the selection rectangle the rectangle around the QListWidget displayed when one clicks on the widget ?

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QListView::setSelectionRectVisible(bool)

    Are you sure it is the selection rectangle? Isn't it the focus indication?

  4. #4
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QListView::setSelectionRectVisible(bool)

    I'm affraid I don't know. Could you explain me what is the selection rectangle and why do we use it for ?

Similar Threads

  1. Combobox + bool + DataWidgetMapper not good
    By RolandHughes in forum Qt Programming
    Replies: 7
    Last Post: 15th November 2008, 08:21
  2. QGroupBox and signal clicked(bool)
    By codebehind in forum Newbie
    Replies: 9
    Last Post: 30th August 2008, 21:09
  3. QMenu and setTearOffEnabled(bool)
    By dvmorris in forum Qt Programming
    Replies: 3
    Last Post: 9th April 2007, 02:18
  4. setAutoDelete(bool) in Qlist
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 19th January 2007, 02:50
  5. Detect utf8 text/html bool....
    By patrik08 in forum Newbie
    Replies: 2
    Last Post: 2nd June 2006, 11:39

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.