Qt-interest Archive, March 2007
Custom widget style flag.
Message 1 in thread
Hey guys,
Here is my issue, I have my own custom widget:
class ZeListWidget : public QFrame
but for some reason my follwing custom frame style doesn't affect it :
void ZeStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
*option,
QPainter *painter, const QWidget *widget) const
{
case PE_Frame:
{
...
}
break;
}
Any idea ? How does that PE_Frame flag can be setted to a custom widget ?
Thanks.
Mr Arnaud.
--
[ signature omitted ]
Message 2 in thread
Anyone ?
----- Original Message -----
From: "bunjeee" <bunjeee@xxxxxxx>
To: <qt-interest@xxxxxxxxxxxxx>
Sent: Monday, March 05, 2007 11:55 PM
Subject: Custom widget style flag.
> Hey guys,
>
> Here is my issue, I have my own custom widget:
> class ZeListWidget : public QFrame
>
> but for some reason my follwing custom frame style doesn't affect it :
> void ZeStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
> *option,
>
> QPainter *painter, const QWidget *widget) const
>
> {
>
> case PE_Frame:
>
> {
>
> ...
>
> }
>
> break;
>
> }
>
> Any idea ? How does that PE_Frame flag can be setted to a custom widget ?
>
> Thanks.
>
> Mr Arnaud.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 3 in thread
Hi,
Its hard to tell without a more complete example. Here are a few
debugging hints.
1. Have you set the style on the widget or the application?
2. Does your custom frame have a custom paint event? If it has a custom
paint event, do you do a style()->drawPrimitive(QStyle::PE_Frame,...) ?
3. If you do not have a custom paint event, do you set frame style as
QFrame::StyledPanel?
Girish
bunjeee wrote:
> Hey guys,
>
> Here is my issue, I have my own custom widget:
> class ZeListWidget : public QFrame
>
> but for some reason my follwing custom frame style doesn't affect it :
> void ZeStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
> *option,
>
> QPainter *painter, const QWidget *widget) const
>
> {
>
> case PE_Frame:
>
> {
>
> ...
>
> }
>
> break;
>
> }
>
> Any idea ? How does that PE_Frame flag can be setted to a custom widget ?
>
> Thanks.
>
> Mr Arnaud.
--
[ signature omitted ]
Message 4 in thread
Thanks Girish,
In fact my question is pretty simple :
By default the widget's painting area is a rectangle.
Is it possible to set that area to a Round rectangle ?
Thanks.
Mr Arnaud.
----- Original Message -----
From: "Girish Ramakrishnan" <girish@xxxxxxxxxxxxx>
Newsgroups: trolltech.qt-interest
To: "bunjeee" <bunjeee@xxxxxxx>
Sent: Tuesday, March 06, 2007 2:27 PM
Subject: Re: Custom widget style flag.
> Hi,
> Its hard to tell without a more complete example. Here are a few debugging
> hints.
>
> 1. Have you set the style on the widget or the application?
> 2. Does your custom frame have a custom paint event? If it has a custom
> paint event, do you do a style()->drawPrimitive(QStyle::PE_Frame,...) ?
> 3. If you do not have a custom paint event, do you set frame style as
> QFrame::StyledPanel?
>
> Girish
>
> bunjeee wrote:
>> Hey guys,
>>
>> Here is my issue, I have my own custom widget:
>> class ZeListWidget : public QFrame
>>
>> but for some reason my follwing custom frame style doesn't affect it :
>> void ZeStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
>> *option,
>>
>> QPainter *painter, const QWidget *widget) const
>>
>> {
>>
>> case PE_Frame:
>>
>> {
>>
>> ...
>>
>> }
>>
>> break;
>>
>> }
>>
>> Any idea ? How does that PE_Frame flag can be setted to a custom widget ?
>>
>> Thanks.
>>
>> Mr Arnaud.
>
>
--
[ signature omitted ]