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

List:       kde-devel
Subject:    Re: why doesn't this code paint on screen like it should?
From:       Alan Bryan <icemanind () yahoo ! com>
Date:       2004-09-26 16:26:49
Message-ID: 20040926162649.9310.qmail () web21322 ! mail ! yahoo ! com
[Download RAW message or body]

You need to override the virtual paint function,
otherwise there will be no way for it to know to draw
that stuff.

--- Mathias Homann <Mathias.Homann@eregion.de> wrote:

> Hi,
> 
> 
> i can't see why this code doesnt draw in my
> window...
> of course it is compiled with DEBUG defined, i see
> the cout << happen 
> in konsole.
> 
> 
> any hints?
> 
> 
> bye,
> 	MH
> 
> 
> void kannasaver::draw_kana()
> {
>     /// @todo implement me
>     QWidget *mywidget = qApp->mainWidget();
>     QPainter paint;
>     paint.begin(this);
>     
>     int mywidth = mywidget->rect().width();
>     int myheight = mywidget->rect().height();
> 
>     setBackgroundColor( QColor(black)  );
>     erase();
>     paint.setClipping(false);
>     
>     paint.setPen( Qt::white );
> #ifdef DEBUG
>     paint.drawText( 10,10, (const QString)"test",
> -1, QPainter::Auto);
>     cout << "Breite: " << mywidth << "; Höhe: " <<
> myheight << endl;
> #endif
> }
> 
> -- 
> Die unaufgeforderte Zusendung einer Werbemail an
> Privatleute verstößt 
> gegen §1 UWG und 823 I BGB (Beschluß des LG Berlin
> vom 2.8.1998 Az: 
> 16 O 201/98). Jede kommerzielle Nutzung der
> übermittelten 
> persönlichen Daten sowie deren Weitergabe an Dritte
> ist ausdrücklich 
> untersagt!
> 
> gpg key fingerprint: 5F64 4C92 9B77 DE37 D184  C5F9
> B013 44E7 27BD 
> 763C
>  
> >> Visit
> http://mail.kde.org/mailman/listinfo/kde-devel#unsub
> to unsubscribe <<
> 

 
>> 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