diff options
Diffstat (limited to 'doc/html/layout.html')
-rw-r--r-- | doc/html/layout.html | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/html/layout.html b/doc/html/layout.html index 7fd76c805..89f656558 100644 --- a/doc/html/layout.html +++ b/doc/html/layout.html @@ -62,9 +62,9 @@ layouts and which generates the C++ layout code for you. layout widgets: <a href="ntqhbox.html">TQHBox</a>, <a href="ntqvbox.html">TQVBox</a> and <a href="ntqgrid.html">TQGrid</a>. A layout widget automatically lays out its child widgets in the order they are constructed. To create more complex layouts, you can nest layout -widgets inside each other. (Note that <a href="ntqwidget.html">TQWidget</a> does not have a +widgets inside each other. (Note that <a href="tqwidget.html">TQWidget</a> does not have a layout by default, you must add one if you want to lay out widgets -inside a <a href="ntqwidget.html">TQWidget</a>.) +inside a <a href="tqwidget.html">TQWidget</a>.) <p> <ul> <li> A <a href="ntqhbox.html">TQHBox</a> lays out its child widgets in a horizontal row, left to right. <p> <center><img src="qhbox-m.png" alt="Horizontal box with five child widgets"></center> @@ -88,13 +88,13 @@ resized. </pre> <p> You can adjust the layout to some extent by calling -<a href="ntqwidget.html#setMinimumSize">TQWidget::setMinimumSize</a>() or <a href="ntqwidget.html#setFixedSize">TQWidget::setFixedSize</a>() on the child widgets. +<a href="tqwidget.html#setMinimumSize">TQWidget::setMinimumSize</a>() or <a href="tqwidget.html#setFixedSize">TQWidget::setFixedSize</a>() on the child widgets. <p> <h2> Adding Widgets to a Layout </h2> <a name="2"></a><p> When you add widgets to a layout the layout process works as follows: <ol type=1> <li> All the widgets will initially be allocated an amount of space in -accordance with their <a href="ntqwidget.html#sizePolicy">TQWidget::sizePolicy</a>(). +accordance with their <a href="tqwidget.html#sizePolicy">TQWidget::sizePolicy</a>(). <li> If any of the widgets have stretch factors set, with a value greater than zero, then they are allocated space in proportion to their <a href="#stretch">stretch factor</a>. @@ -117,7 +117,7 @@ determining factor.) </h3> <a name="2-1"></a><p> Widgets are normally created without any stretch factor set. When they are laid out in a layout the widgets are given a share of space in -accordance with their <a href="ntqwidget.html#sizePolicy">TQWidget::sizePolicy</a>() or their minimum size hint +accordance with their <a href="tqwidget.html#sizePolicy">TQWidget::sizePolicy</a>() or their minimum size hint whichever is the greater. Stretch factors are used to change how much space widgets are given in proportion to one another. <p> If we have three widgets laid out using a <a href="ntqhbox.html">TQHBox</a> with no stretch @@ -138,7 +138,7 @@ stretch, and placement. <p> The following code makes a grid like the one above, with a couple of improvements: <pre> - <a href="ntqwidget.html">TQWidget</a> *main = new <a href="ntqwidget.html">TQWidget</a>; + <a href="tqwidget.html">TQWidget</a> *main = new <a href="tqwidget.html">TQWidget</a>; // make a 1x1 grid; it will auto-expand <a href="qgridlayout.html">TQGridLayout</a> *grid = new <a href="qgridlayout.html">TQGridLayout</a>( main, 1, 1 ); @@ -162,7 +162,7 @@ improvements: <p> You can insert layouts inside a layout by giving the parent layout as a parameter in the constructor. <pre> - <a href="ntqwidget.html">TQWidget</a> *main = new <a href="ntqwidget.html">TQWidget</a>; + <a href="tqwidget.html">TQWidget</a> *main = new <a href="tqwidget.html">TQWidget</a>; <a href="ntqlineedit.html">TQLineEdit</a> *field = new <a href="ntqlineedit.html">TQLineEdit</a>( main ); <a href="ntqpushbutton.html">TQPushButton</a> *ok = new <a href="ntqpushbutton.html">TQPushButton</a>( "OK", main ); <a href="ntqpushbutton.html">TQPushButton</a> *cancel = new <a href="ntqpushbutton.html">TQPushButton</a>( "Cancel", main ); @@ -196,19 +196,19 @@ in-depth description. <a name="5"></a><p> When you make your own widget class, you should also communicate its layout properties. If the widget has a <a href="ntqlayout.html">TQLayout</a>, this is already taken care of. If the widget does not have any child widgets, or uses manual -layout, you should reimplement the following <a href="ntqwidget.html">TQWidget</a> member functions: +layout, you should reimplement the following <a href="tqwidget.html">TQWidget</a> member functions: <p> <ul> -<li> <a href="ntqwidget.html#sizeHint">TQWidget::sizeHint</a>() returns the preferred size of the widget. -<li> <a href="ntqwidget.html#minimumSizeHint">TQWidget::minimumSizeHint</a>() returns the smallest size the widget can have. -<li> <a href="ntqwidget.html#sizePolicy">TQWidget::sizePolicy</a>() returns a <a href="ntqsizepolicy.html">TQSizePolicy</a>; a value describing +<li> <a href="tqwidget.html#sizeHint">TQWidget::sizeHint</a>() returns the preferred size of the widget. +<li> <a href="tqwidget.html#minimumSizeHint">TQWidget::minimumSizeHint</a>() returns the smallest size the widget can have. +<li> <a href="tqwidget.html#sizePolicy">TQWidget::sizePolicy</a>() returns a <a href="ntqsizepolicy.html">TQSizePolicy</a>; a value describing the space requirements of the widget. </ul> -<p> Call <a href="ntqwidget.html#updateGeometry">TQWidget::updateGeometry</a>() whenever the size hint, minimum size +<p> Call <a href="tqwidget.html#updateGeometry">TQWidget::updateGeometry</a>() whenever the size hint, minimum size hint or size policy changes. This will cause a layout recalculation. Multiple calls to updateGeometry() will only cause one recalculation. <p> If the preferred height of your widget depends on its actual width (e.g. a label with automatic word-breaking), set the <a href="ntqsizepolicy.html#hasHeightForWidth">hasHeightForWidth</a>() flag in -<a href="ntqwidget.html#sizePolicy">sizePolicy</a>(), and reimplement <a href="ntqwidget.html#heightForWidth">TQWidget::heightForWidth</a>(). +<a href="tqwidget.html#sizePolicy">sizePolicy</a>(), and reimplement <a href="tqwidget.html#heightForWidth">TQWidget::heightForWidth</a>(). <p> Even if you implement heightForWidth(), it is still necessary to provide a good sizeHint(). The sizeHint() provides the preferred width of the widget, and it is used by <a href="ntqlayout.html">TQLayout</a> subclasses that do not @@ -219,11 +219,11 @@ requirements to your new widget. <p> <h2> Manual Layout </h2> <a name="6"></a><p> If you are making a one-of-a-kind special layout, you can also make a -custom widget as described above. Reimplement <a href="ntqwidget.html#resizeEvent">TQWidget::resizeEvent</a>() -to calculate the required distribution of sizes and call <a href="ntqwidget.html#setGeometry">setGeometry</a>() on each child. +custom widget as described above. Reimplement <a href="tqwidget.html#resizeEvent">TQWidget::resizeEvent</a>() +to calculate the required distribution of sizes and call <a href="tqwidget.html#setGeometry">setGeometry</a>() on each child. <p> The widget will get an event with <a href="ntqevent.html#type">type</a> <tt>LayoutHint</tt> when the layout needs to be recalculated. Reimplement -<a href="ntqwidget.html#event">TQWidget::event</a>() to be notified of <tt>LayoutHint</tt> events. +<a href="tqwidget.html#event">TQWidget::event</a>() to be notified of <tt>LayoutHint</tt> events. <p> <h2> Layout Issues </h2> <a name="7"></a><p> The use of rich text in a label widget can introduce some problems to |