[Qt-interest] Derived custom widgets

Neville Dastur qt at dastur.me.uk
Wed Sep 1 12:42:14 CEST 2010


On 30/08/10 23:08, Scott Aron Bloom wrote:
>
> You have to use QStyle::SC_COmboBoxArrow to get the size of the 
> subcontrol with QStyle::subControlRect
>
Thank you for the suggestion. Unfortunately, this just gives the size of 
the arrow icon. About 15 pixels. I have tried using the same function 
but with params such as style()->subControlRect(QStyle::CC_ToolButton, 
&opt, QStyle::SC_ToolButtonMenu, 0), but none give a reasonable size.

A small gif illustrates the desired result. So on Ubuntu the popup 
button measures 26 x 22 pixels, but obviously this is going to vary by 
style and so was looking for a generic way of getting the size.

I also thought I would illustrate the spinbox problem.



>
> There probably IS a better way.. but I don't know it J
>
>
>
> 1) I am using a fudge factor of 24 to account for the combobox drop down
>   
> arrow button. I can't find a pixel metric for it. Is there a better way
> of getting the width
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100901/efd18d71/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NullDateEditComboPopupSize.gif
Type: image/gif
Size: 2605 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100901/efd18d71/attachment.gif 


More information about the Qt-interest-old mailing list