I have two examples where I'm basically creating wrapper objects rather than what would ideally be a simple conversion.
If foo is a QWidget* instantiated earlier, can I avoid creating a wrapper QLayout for it:
const auto layout = new QVBoxLayout();
layout->addWidget( foo );
const auto frame = new QLabel( QLatin1String( "Why Do I Need a Layout?" ) );
frame->setLayout( layout );
If foo is a QLayout* instantiated earlier, can I avoid creating a wrapper QWidget for it:
const auto widget = new QWidget();
widget->setLayout( foo );
const auto tabs = new QTabWidget();
tabs->addTab( widget, QLatin1String( "Why Do I Need a Widget?" ) );
layoutis a wrapper, I don't need theQLayout, it doesn't do anything, but I can't callframe->setWidget( foo );causeQLabeldoesn't have that function. I'm asking if there's a way I can skip thelayoutwrapper. Same thing for thewidgetwrapper. - Jonathan Mee