[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: still cant get my paintevent!!!
From: Espen Sand <espensa () online ! no>
Date: 2000-04-29 15:43:16
[Download RAW message or body]
On Sat, 29 Apr 2000, Jesper Pedersen wrote:
> Hi.
> I've tried to cut down the example, where I don't get the paintevent. The
> whole example is shown below.
SNIP
Hi, I have attached a minimalistic (pure) Qt program that has I have verified
on my machine. It prints "EspenWidget::paintEvent" when I expect it. Extend
the widget step by step and see where it stops working when you use it in your
program. (compile it as a standalong Qt program first as well)
--
Espen Sand
["widget.pro" (text/plain)]
HEADERS = widget.h
SOURCES = widget.cc
TARGET = widget
["widget.h" (text/x-c++)]
#ifndef _WIDGET_H_
#define _WIDGET_H_
#include <qwidget.h>
class EspenWidget : public QWidget
{
Q_OBJECT
public:
EspenWidget( QWidget *parent=0, const char *name=0, WFlags flag=0 );
protected:
virtual void paintEvent( QPaintEvent *e );
};
#endif
["widget.cc" (text/x-c)]
#include "widget.h"
#include <qapplication.h>
#include <iostream>
EspenWidget::EspenWidget( QWidget *parent, const char *name, WFlags flag )
:QWidget( parent, name, flag )
{
cout << "EspenWidget::EspenWidget" << endl;
}
void EspenWidget::paintEvent( QPaintEvent * )
{
cout << "EspenWidget::paintEvent" << endl;
}
int main( int argc, char **argv )
{
QApplication app( argc, argv );
EspenWidget *topLevel = new EspenWidget();
topLevel->show();
int returnCode = app.exec();
return returnCode;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic