As the warning you posted says, you can't inherit multiple times a QObject.
but how do you do it when you have some complicated stuff to display and you want to display and print the same stuff? Which I will, when I get around to adding the GUI to another program I'm working on.
You could make DotPaintDevice not derive form QObject.
There is really no need to as its only doing some specialized painting.
Pseudo code:
class DotPaintDevice
{
public:
DotPaintDevice();
~DotPaintDevice();
void mySpecialPainitingMethod();
};
class DotCanvas
: public DotPaintDevice,
public QWidget{
void paintEvent(...)
{
.....
mySpecialPainitingMethod();
....
}
};
class DotPaintDevice
{
public:
DotPaintDevice();
~DotPaintDevice();
void mySpecialPainitingMethod();
};
class DotCanvas : public DotPaintDevice, public QWidget
{
void paintEvent(...)
{
.....
mySpecialPainitingMethod();
....
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks