From kde-devel Sun Sep 26 16:26:49 2004 From: Alan Bryan Date: Sun, 26 Sep 2004 16:26:49 +0000 To: kde-devel Subject: Re: why doesn't this code paint on screen like it should? Message-Id: <20040926162649.9310.qmail () web21322 ! mail ! yahoo ! com> X-MARC-Message: https://marc.info/?l=kde-devel&m=109621602214342 You need to override the virtual paint function, otherwise there will be no way for it to know to draw that stuff. --- Mathias Homann 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 <<