I need to make custome QWidget class and make some kind of helper class, how to do it properly
class MyWidget
: public QWidget,
public MyHelper
class MyWidget : public QWidget, public MyHelper
To copy to clipboard, switch view to plain text mode
The point is that I need to inherit public QObject in MyHelper to have the parent object available. When I will do it compiler complains
error: 'QObject' is an ambiguous base of 'ListView'
error: 'QObject' is an ambiguous base of 'ListView'
To copy to clipboard, switch view to plain text mode
When I take this out
error: type 'QObject' is not a direct base of 'MyHelper'
error: type 'QObject' is not a direct base of 'MyHelper'
To copy to clipboard, switch view to plain text mode
and
warning
: Class MyObject inherits from two
QObject subclasses MyHelper and
QWidget.
This is not supported
!
warning: Class MyObject inherits from two QObject subclasses MyHelper and QWidget. This is not supported!
To copy to clipboard, switch view to plain text mode
error
: Class contains
Q_OBJECT macro but does not inherit from
QObject
error: Class contains Q_OBJECT macro but does not inherit from QObject
To copy to clipboard, switch view to plain text mode
Is it possible ?
Bookmarks