[SOLVED]Add custom widget to layout?
-
I have created a custom widget that is based on QTextEdit
@class MyWidget : public QTextEdit
{@and now I want to add a method for showing this widget, but trying
@QWidget *myWidget = new QWidget;
QGridLayout *myLayout = new QGridLayout;
MyWidget customWidget(myWidget);
myLayout->addItem(customWidget); // or addWidget, same result
myWidget->setLayout(myLayout);
myWidget->show();@results in the error
@error: no matching member function for call to 'addItem'
myLayout->addItem(customWidget);
~~~~@^How can I show my custom QWidget?
-