Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:layout_code [2013/07/02 10:55]
127.0.0.1 external edit
dev:layout_code [2022/05/06 16:07] (current)
Line 52: Line 52:
 </code> </code>
  
-All of this vBox begat frame begat QPushButton code can be removed for simplicity.  It is rarely necessary or beneficial to supply all these optional parent parameters.  This has many practical advantages, and has been greatly helpful to me in resolving broken layouts during this restructuring work.  If an existing layout ain't broke, there is little point in fixing it, but please do not write code like this in new layouts.  The example above will work perfectly fine when reduced to:+All of this vBox begat frame begat QPushButton code can be removed for simplicity.  (QLayout::addItem() which is eventually called by addWidget() will take ownership of the widget.  So there is no danger of memory leaks.)  It is rarely necessary or beneficial to supply all these optional parent parameters.  This has many practical advantages, and has been greatly helpful to me in resolving broken layouts during this restructuring work.  If an existing layout ain't broke, there is little point in fixing it, but please do not write code like this in new layouts.  The example above will work perfectly fine when reduced to:
  
 <code c++> <code c++>
 
 
dev/layout_code.1372762529.txt.gz ยท Last modified: 2022/05/06 16:07 (external edit)
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki