Results 1 to 3 of 3

Thread: how to remove the small dot when selecting ListWidget

  1. #1
    Join Date
    Apr 2016
    Posts
    5
    Thanks
    1

    Default how to remove the small dot when selecting ListWidget

    hello all,

    I am working with icons with listWidget, and here is my code.
    Would you let me know how I can remove the small dot which the yellow arrow is pointing at?
    (Please take a look at the image attached)
    When I selected an item, the dot appeared right below the item I selected.
    Thanks a lot.



    Qt Code:
    1. ui->listWidget->setFlow(QListWidget::LeftToRight);
    2. ui->listWidget->setViewMode(QListWidget::IconMode);
    3. ui->listWidget->setIconSize(QSize(126,126));
    4. ui->listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    5. ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    6.  
    7. this->setStyleSheet("QMainWindow {background: black;}");
    8.  
    9. ui->listWidget->setStyleSheet(
    10. "QListWidget {"
    11. "border-style: solid;"
    12. "border-width:1px;"
    13. "border-color:black;"
    14. "background-color: black;"
    15. "}"
    16. "QListWidget::item {"
    17. "border: 0px solid black;"
    18. "}");
    19.  
    20. for(int cnt = 0; cnt < 5; ++cnt)
    21. {
    22. QIcon icon(":/images/HMD.png");
    23. item->setIcon(icon);
    24. item->setFlags(item->flags() ^ Qt::ItemIsSelectable);
    25. ui->listWidget->insertItem(cnt, item);
    26. }
    27.  
    28. // http://stackoverflow.com/questions/6337589/qlistwidget-adjust-size-to-content
    29. ui->listWidget->setFixedSize(ui->listWidget->sizeHintForColumn(0) * ui->listWidget->count() + 3 * ui->listWidget->frameWidth(),
    30. ui->listWidget->sizeHintForRow(0) + 2 * ui->listWidget->frameWidth());
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to remove the small dot when selecting ListWidget

    It is not coming from anything obvious in your code. Does it appear if you place no items in the list widget? Does the dot move when you click on items? Does it appear in other applications or in a fixed position on the screen?
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  3. The following user says thank you to ChrisW67 for this useful post:

    sehnkim (27th April 2016)

  4. #3
    Join Date
    Apr 2016
    Posts
    5
    Thanks
    1

    Default Re: how to remove the small dot when selecting ListWidget

    > Does it appear if you place no items in the list widget? => No.
    > Does the dot move when you click on items? ==> If I click on other items, it moves to the item I just clicked. But even though I click on the same item again and again, it doesn't move.
    > Does it appear in other applications or in a fixed position on the screen? ==> I tried with listWidget with another application, and had the same issue.

    Here is the source code I am testing with.
    https://www.dropbox.com/sh/g3yedv1ii...iRVzpiB7a?dl=0

    Thanks.

Similar Threads

  1. Printing a ListWidget
    By viciv919 in forum Newbie
    Replies: 3
    Last Post: 9th March 2010, 09:47
  2. QValidator and ListWidget
    By csvivek in forum Qt Programming
    Replies: 4
    Last Post: 9th July 2008, 19:19
  3. listWidget resize
    By buckadl in forum Qt Tools
    Replies: 3
    Last Post: 12th June 2007, 20:56

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.