M
Martin Jensen
Hi
I have a problem with Qt. My class definition is this:
class Button : public QObject, public Tk_Object {
Q_OBJECT
public:
Button() {}
Button(Tk_Object &p);
~Button();
void pack();
void setKeyword(string key, StringVar value);
void setKeyword(string key, string value);
void setKeyword(string key, double value);
void setKeyword(string key, void value());
QWidget* getWidget();
private:
QPushButton* qPushButton;
Tk_Object* parent;
/* Keywords */
string text;
StringVar* textvariable;
int width;
string relief;
};
There are a lot more classes, but this is the problem... When I try to
compile, I get this error:
/usr/lib/qt-3.1/include/qobject.h: In member function `Tkinter::Button&
Tkinter::Button:perator=(const Tkinter::Button&)':
/usr/lib/qt-3.1/include/qobject.h:212: error: `QObject&
QObject:perator=(const QObject&)' is private
output/example6.tk_sml.py.main.cpp:38: error: within this context
This is probabaly because I use this in the main-program to instantiate the
Button-class:
int main() {
...
Tkinter::Button compute = Tkinter::Button(top);
...
}
The compiler compains that the = operator in the QObject class is private.
This seems to mean that I can't instatiate a class which inherits the
QObject class in this way. Can this be right? Can somebody help me get
around this? Or is there something obvious I have done wrong? Can I overload
the = operator of the QObject class or someting?
Thanks
Martin Jensen
I have a problem with Qt. My class definition is this:
class Button : public QObject, public Tk_Object {
Q_OBJECT
public:
Button() {}
Button(Tk_Object &p);
~Button();
void pack();
void setKeyword(string key, StringVar value);
void setKeyword(string key, string value);
void setKeyword(string key, double value);
void setKeyword(string key, void value());
QWidget* getWidget();
private:
QPushButton* qPushButton;
Tk_Object* parent;
/* Keywords */
string text;
StringVar* textvariable;
int width;
string relief;
};
There are a lot more classes, but this is the problem... When I try to
compile, I get this error:
/usr/lib/qt-3.1/include/qobject.h: In member function `Tkinter::Button&
Tkinter::Button:perator=(const Tkinter::Button&)':
/usr/lib/qt-3.1/include/qobject.h:212: error: `QObject&
QObject:perator=(const QObject&)' is private
output/example6.tk_sml.py.main.cpp:38: error: within this context
This is probabaly because I use this in the main-program to instantiate the
Button-class:
int main() {
...
Tkinter::Button compute = Tkinter::Button(top);
...
}
The compiler compains that the = operator in the QObject class is private.
This seems to mean that I can't instatiate a class which inherits the
QObject class in this way. Can this be right? Can somebody help me get
around this? Or is there something obvious I have done wrong? Can I overload
the = operator of the QObject class or someting?
Thanks
Martin Jensen