Home > Mobile >  New a new controls a pointer to the problem
New a new controls a pointer to the problem

Time:02-23

Two new toolbutton controls
 
GroupBox=new QGroupBox (horizontalLayoutWidget);
GroupBox - & gt; GroupBox setObjectName (QStringLiteral (" "));
VerticalLayout=new QVBoxLayout (groupBox);
VerticalLayout - & gt; SetObjectName (QStringLiteral (" verticalLayout "));
ToolButton=new QToolButton (groupBox);
ToolButton - & gt; ToolButton setObjectName (QStringLiteral (" "));

VerticalLayout - & gt; AddWidget (toolButton);
 
GroupBox=new QGroupBox (horizontalLayoutWidget);
GroupBox - & gt; GroupBox setObjectName (QStringLiteral (" "));
VerticalLayout=new QVBoxLayout (groupBox);
VerticalLayout - & gt; SetObjectName (QStringLiteral (" verticalLayout "));
ToolButton=new QToolButton ();
ToolButton - & gt; ToolButton setObjectName (QStringLiteral (" "));

VerticalLayout - & gt; AddWidget (toolButton);

New QToolButton () write here don't write pointer will have what differentiation?

CodePudding user response:

Toolbutton not declared, you won't such an error?

CodePudding user response:

reference 1/f, joke zare response:
toolbutton not declared, you won't such an error?
statement written in the book. H file inside

CodePudding user response:

Should be no difference in the release release groupBox resources

CodePudding user response:

No problem, because later to join in the layout manager
Can pass toolButton. Parent () to see, you can refer to other layout manager of the official document, there are
When using the layout and structure in the child window when the widget does not need to * * * * parent widget, the layout will be automatically redistributed widget (using QWidget: : setParent ()), so that they are installing the layout of the widget child widgets,
  •  Tags:  
  • Qt
  • Related