[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: re-implement paintEvent() for drawButton
From:       "dave selby" <dave6502 () googlemail ! com>
Date:       2007-07-09 19:30:25
Message-ID: f52017b60707091230i3951eb41s56ebdd48307abee0 () mail ! gmail ! com
[Download RAW message or body]

On 09/07/07, Johannes Bergmeier <Johannes.Bergmeier@gmx.net> wrote:
> On Sunday 08 July 2007, dave selby wrote:
> > On 08/07/07, Robert Knight <robertknight@gmail.com> wrote:
> > > > The nice easy way with QT3 drawButton() and
> > > > drawButtonLabel() seems to be a thing of the past :(
> > >
> > > Let me try again.  Find the YourQ3ButtonClass::drawButton()
> > > implementation, and copy and paste the code into
> > > YourQ4ButtonClass::paintEvent().
> > >
> > > Regards,
> > > Robert.
> > >
> >
> > OK, have to go now, will try tomorrow night :)
> >
> I recognized that QItemDelegate's can draw CheckBoxes somewhere a week ago.
> Thought, that this might be helpfull to your problem and took a look into the
> code.
>
> Maybe this will do it:
> Get the current QStyle* style either by widget->style() or
> QApplication::style()
> Create the QStyleOptionButton* opt with the required settings
> Draw the button with: style->drawControl(QStyle::PE_PushButton, opt, painter);
>

Interesting ... OK I will dig into my C++ & QT4 book and do some
research ... this looks like a very neat solution

Many thanks

Dave





> Hope this helps you
>
> Josel
>
> --
> Johannes Bergmeier
> Johannes.Bergmeier@gmx.net
> Jabber: joselb@jabber.org
>
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
>
>
>


-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic