PDA

View Full Version : How we increase the width of Scroll bar of QCombo Box



rajeshclt3
16th August 2011, 07:32
Hi,

When we resize the QComboBox to bigger size,drop down arrow of combo box becomes big sync with combo boz size but vertical Scroll bar's width is small (default size).How can we increase the width of combo box sync with Combo box's size .This behavior is on panels.Please give any suggestions.

Thanks
-Rajesh

nish
16th August 2011, 07:59
try to get the listview of combobox and then find the scrollbar as children, finally resize it.

rajeshclt3
16th August 2011, 08:28
Thank you so much for your valuable suggestion.Could you please give suggestion to find out the width of dropdown menu of Qcombobox so that I can sync the width of vertical scroll bar with dropdown width.

Thank you
-Rajesh

nish
16th August 2011, 08:47
that drop down menu is the listview


QComboBox:: view()->width()

rajeshclt3
16th August 2011, 09:22
Hi,

C:\Users\EXOR\Desktop\comboBox.jpgIn panel when we resize the combobox ,the the rect which contain dropdown arrow also increasing,I would like to get the width of that rect.

Thanks
-Rajesh

Added after 5 minutes:

Hi,
Please find the attachment to find the issue .Please give any suggestion

nish
16th August 2011, 09:44
QComboBox combo;
QStyleOptionComboBox option;
option.initFrom ( &combo );
QRect buttonRect = qApp()->style()->subControlRect ( QStyle::CC_ComboBox, &option, QStyle::SC_ComboBoxArrow) ;

rajeshclt3
16th August 2011, 10:53
Thank you so much!!!!!!!!!