Yes, I am doing that only. Previously I was doing this:
MyWidget
::MyWidget(QWidget *parent
): parent
(parent
){
prepareUI();
}
MyWidget::prepareUI()
{
baseWidget->setStylesheet("...");
label->setText("...");
}
//in main:
MyWidget *widget = new MyWidget(this);
MyWidget::MyWidget(QWidget *parent): parent(parent)
{
prepareUI();
}
MyWidget::prepareUI()
{
QFrame *baseWidget = new QFrame(parent);
baseWidget->setStylesheet("...");
QLabel *label = new QLabel(baseWidget);
label->setText("...");
}
//in main:
MyWidget *widget = new MyWidget(this);
To copy to clipboard, switch view to plain text mode
Now I am doing this:
MyWidget
::MyWidget(QWidget *parent
): parent
(parent
){
prepareUI();
}
MyWidget::prepareUI()
{
this->setStylesheet("...");
label->setText("...");
this->show();
}
//in main:
MyWidget *widget = new MyWidget(this);
widget->show();
MyWidget::MyWidget(QWidget *parent): parent(parent)
{
prepareUI();
}
MyWidget::prepareUI()
{
this->setStylesheet("...");
QLabel *label = new QLabel(this);
label->setText("...");
this->show();
}
//in main:
MyWidget *widget = new MyWidget(this);
widget->show();
To copy to clipboard, switch view to plain text mode
Still it doesn't show anything at all.
Added after 7 minutes:
No no, it's working now. I did not do a clean build, so it was taking the old code..
Bookmarks