Cannot interact with subclass of QTabWidget
Solved
General and Desktop
-
Hello,
I have subclassed QTabWidget. Added two tabs.addTab(new QLineEdit, "Test1"); addTab(new QWidget,"Test2"); connect(this,&QTabWidget::tabBarClicked, this, [=](int i){qDebug()<<QString::number(i);} );
Problem is that I cannot switch to the other tab and I can't insert any text in the QLineEdit object. The behaviour is like a picture. You can see the tabs and the QLineEdit instance, but you are not able to interact with any instance.
-
@ppp1 said in Cannot interact wiht subclass of QTabWidget:
I have subclassed QTabWidget.
Why do you subclassed it?
Please show us more code, there is no picture.
-
Hi,
I could solve the problem.ui->setupUi(this);
This command should the first command in the constructor. I have placed it after the declaration and definition of the tab widget. That was the reason why it didn'tr run properly.
@ppp1 Then please mark this topic as solved, thx.