[Interest] QGroupBox Subclass
imikejackson at gmail.com
Tue May 21 20:42:14 CEST 2013
On May 21, 2013, at 11:29 AM, Tony Rietwyk wrote:
>> Sent: Tuesday, 21 May 2013 11:32 PM
>> I am currently using a QGroupBox (with some custom style sheets) as a
>> superclass for a custom widget in our program. QGroupBox has the
>> "isCheckable" property which we use then style with a custom image for an
>> icon and over ride the "toggled" to get some custom actions when the user
>> clicks the "button". We would like to be able to add a few more buttons to
>> the QGroupBox to perform some other actions. I took at the source code for
>> QGroupBox to try and figure out where the layout was being performed and
>> I would have to say I understand generally what is going on but I can not
>> figure out where the actual "QCheckBox" is being added to the layout for
>> My Question is: Could some nice developer just give me a nudge in the
>> direction as to where the actual layout of the QGroupBox is being
>> and where the QCheckBox is instantiated? I think I can figure it out from
>> Thanks so much.
>> Mike Jackson (dream3d.bluequartz.net)
> Hi Mike,
> There is no QCheckBox child. The checkbox is drawn and handled in
> conjunction with the style as a QStyle::SubControl. See QGroupBox.event for
> the details (around line 330 in 4.8.4). I think you need to override
> QProxyStyle to force extra space between the existing checkbox and label.
> Please let the list know how you go, as I may need to do something similar
Thanks for the hint. I got much farther and deeper into QStyle, QStyleOption and QCommonStyle and how the painting is proceeding from there. I think this probably is not the route I can take as there is a lot there that I would have to reimplement in code that I would have to generate. I'll take another stab at starting with a QWidget and going from there.
THanks for the nudge.
More information about the Interest