3

Im trying to set spacing between the items in QCombobox. for the spacing i used the

1.listview of the combobox and used setSpacing(2) for setting the spaces between the item.

in customCombobox class

QListView * listView = new QListView(this);
listView->setSpacing(3);
    this->setView(listView);
listView->setStyleSheet("background: white;                             \
                                font-size: 12px,0.2em;                          \
                                font-family: Segoe Regular;                     \
                                QListView::item {                               \
                                color: black;                                   \
                                margin-top:15px;                                     \
                                background: white;}                             \
                                QListView::item:selected {                      \
                                    outline: 0px;                                   \
                                    padding-left:8px;\
                                    color: white;                                   \
                                    background-color: #0093D6                       \
                                }                                                   \
                ");

but it is enabling the scrollbar which i want to avoid. i want to show the popUp with items i can able to show without hiding.for showing three items it wont use scrollbar.

  1. If i do the padding-left in listview item, the selection color block (say red color box) also shifts 8px to left , how to avoid it. enter image description here tis is whout spacing and with spacing enter image description here
Wagmare
  • 1,354
  • 1
  • 24
  • 58
  • "i want to show the popUp with items i can able to show without hiding.for showing three items it wont use scrollbar. " -> You mean you would not like to see the scrollbar e.g. for three items because they are visible, and the scrollbar is unnecessary? – László Papp Jan 07 '14 at 06:26
  • yes . i added the two scenario screenshots in my post .. the last text will be hidden if i use spacing ..if it is there anyother way i can set spacing ..? – Wagmare Jan 07 '14 at 06:31
  • Wagmare, still not sure I understand the inquiry properly, so you would like to increase the height of the popup and let the scroll bar go away? – László Papp Jan 07 '14 at 06:34
  • first i thank you for reply . exactly .. i want to adjust the size of the popup with the items even with the spacing .. – Wagmare Jan 07 '14 at 06:38

0 Answers0