Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 10

Qt-interest Archive, March 2002
[no subject]


Message 1 in thread

my problems is I create a class likely :

#ifndef SCALESBODYPOPUP_H
#define SCALESBODYPOPUP_H

#include <qwidget.h>
#include <qpixmap.h>
#include <qimage.h>
#include <qbitmap.h>

class ScalesBodyPopup : public QWidget
{
 Q_OBJECT

public:
 ScalesBodyPopup(QWidget* parent = 0, const char* name = 0, WFlags f = 0);
 ~ScalesBodyPopup();
protected:
 QImage* SBimg;
 QPixmap* SBpix;
public:
 virtual void popup(const QPoint &);
};
#endif

the .cpp is:
#include "scalesbodypopup.h"

ScalesBodyPopup::ScalesBodyPopup(QWidget* parent, const char* name,WFlags f)
:QWidget(parent,name,f)
{
    ....
}

ScalesBodyPopup::~ScalesBodyPopup(){
}

void ScalesBodyPopup::popup(const QPoint &e)
{
....
}

this class is make in the principale widget likely :
-in .h : ScalesBodyPopup* pop;
-in .cpp: pop =new ScalesBodyPopup(this,"pop",QWidget::WType_Popup);

(without Qwidget flag, th problem exist too)

compilation is ok, but when i execute the binary,  one erreur of system
appears : Exception forgotten Instruction. (0xc000001d) .. at the
emplacement 0x00...
and one else : the instruction at "0x39..." use memory at "0xff000000"
memory can't be read.
a expication?
----- Original Message -----
From: "Paul Robertson" <paul@jprassoc.demon.co.uk>
To: <atalargo@nerim.net>; <qt-interest@trolltech.com>
Sent: Wednesday, March 27, 2002 10:21 AM
Subject: Re: difference between...


> Gender aside, inheritance is a C++ thing, presumably you know about that.
>
> Parent-child relationships are a Qt thing. For example when you use
> setGeometry() to position a widget, the coordinates are relative to the
> parent. And when you destruct a QWidget, its children are automatically
> destroyed.
>
> What you describe is the usually the case in Qt apps, problems are more
> likely to arise if you go against this paradigm without thinking carefully
> about what you are doing.
> --
> Paul
>
> ----- Original Message -----
> From: <atalargo@nerim.net>
> To: <qt-interest@trolltech.com>
> Sent: Wednesday, March 27, 2002 8:24 AM
> Subject: difference between...
>
>
> > Hi, What is it the exact difference between A class that inherits of
> QWidget, and a class that inherits of QWidget AND is "daughter" of
QWidget?
> >
> > Because I have a problem with one class i make and perhaps it's a
possible
> reason of my problems.
> >
> > Thanks
> >
> > --
> > List archive and information: http://qt-interest.trolltech.com
>
> --
> List archive and information: http://qt-interest.trolltech.com
>


Message 2 in thread

Well I can't see anything in the code below which would cause a runtime
crash, but I'm not very good at spotting bugs in source code.
Also I've never seen a message like "Exception forgotten instruction",
perhaps it lost something in translation.
Run your app in a debugger and get a backtrace, or post a complete code
sample.
--
 [ signature omitted ]