diff options
Diffstat (limited to 'doc/html/customlayout-example.html')
-rw-r--r-- | doc/html/customlayout-example.html | 330 |
1 files changed, 165 insertions, 165 deletions
diff --git a/doc/html/customlayout-example.html b/doc/html/customlayout-example.html index 30fb9f1ff..09ec8dacd 100644 --- a/doc/html/customlayout-example.html +++ b/doc/html/customlayout-example.html @@ -55,21 +55,21 @@ like card layouts, border layout and flow layouts. #ifndef FLOW_H #define FLOW_H -#include <<a href="qlayout-h.html">qlayout.h</a>> -#include <<a href="qptrlist-h.html">qptrlist.h</a>> +#include <<a href="qlayout-h.html">ntqlayout.h</a>> +#include <<a href="qptrlist-h.html">ntqptrlist.h</a>> -class SimpleFlow : public <a href="qlayout.html">TQLayout</a> +class SimpleFlow : public <a href="ntqlayout.html">TQLayout</a> { public: - SimpleFlow( <a href="qwidget.html">TQWidget</a> *parent, int border=0, int space=-1, + SimpleFlow( <a href="ntqwidget.html">TQWidget</a> *parent, int border=0, int space=-1, const char *name=0 ) - : <a href="qlayout.html">TQLayout</a>( parent, border, space, name ), + : <a href="ntqlayout.html">TQLayout</a>( parent, border, space, name ), cached_width(0) {} - SimpleFlow( <a href="qlayout.html">TQLayout</a>* parent, int space=-1, const char *name=0 ) - : <a href="qlayout.html">TQLayout</a>( parent, space, name ), + SimpleFlow( <a href="ntqlayout.html">TQLayout</a>* parent, int space=-1, const char *name=0 ) + : <a href="ntqlayout.html">TQLayout</a>( parent, space, name ), cached_width(0) {} SimpleFlow( int space=-1, const char *name=0 ) - : <a href="qlayout.html">TQLayout</a>( space, name ), + : <a href="ntqlayout.html">TQLayout</a>( space, name ), cached_width(0) {} ~SimpleFlow(); @@ -77,17 +77,17 @@ public: void addItem( <a href="qlayoutitem.html">TQLayoutItem</a> *item); bool hasHeightForWidth() const; int heightForWidth( int ) const; - <a href="qsize.html">TQSize</a> sizeHint() const; - <a href="qsize.html">TQSize</a> minimumSize() const; + <a href="ntqsize.html">TQSize</a> sizeHint() const; + <a href="ntqsize.html">TQSize</a> minimumSize() const; <a href="qlayoutiterator.html">TQLayoutIterator</a> iterator(); TQSizePolicy::ExpandData expanding() const; protected: - void setGeometry( const <a href="qrect.html">TQRect</a>& ); + void setGeometry( const <a href="ntqrect.html">TQRect</a>& ); private: - int doLayout( const <a href="qrect.html">TQRect</a>&, bool testonly = FALSE ); - <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> list; + int doLayout( const <a href="ntqrect.html">TQRect</a>&, bool testonly = FALSE ); + <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> list; int cached_width; int cached_hfw; @@ -115,7 +115,7 @@ private: class SimpleFlowIterator :public <a href="qglayoutiterator.html">TQGLayoutIterator</a> { public: - SimpleFlowIterator( <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> *l ) :idx(0), list(l) {} + SimpleFlowIterator( <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> *l ) :idx(0), list(l) {} uint count() const; <a href="qlayoutitem.html">TQLayoutItem</a> *current(); <a href="qlayoutitem.html">TQLayoutItem</a> *next(); @@ -123,18 +123,18 @@ public: private: int idx; - <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> *list; + <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> *list; }; uint <a name="f452"></a>SimpleFlowIterator::count() const { -<a name="x1479"></a> return list-><a href="qptrlist.html#count">count</a>(); +<a name="x1479"></a> return list-><a href="ntqptrlist.html#count">count</a>(); } <a name="x1464"></a>TQLayoutItem *SimpleFlowIterator::<a href="qglayoutiterator.html#current">current</a>() { -<a name="x1478"></a> return idx < int(count()) ? list-><a href="qptrlist.html#at">at</a>(idx) : 0; +<a name="x1478"></a> return idx < int(count()) ? list-><a href="ntqptrlist.html#at">at</a>(idx) : 0; } <a name="x1465"></a>TQLayoutItem *SimpleFlowIterator::<a href="qglayoutiterator.html#next">next</a>() @@ -144,12 +144,12 @@ uint <a name="f452"></a>SimpleFlowIterator::count() const <a name="x1466"></a>TQLayoutItem *SimpleFlowIterator::<a href="qglayoutiterator.html#takeCurrent">takeCurrent</a>() { -<a name="x1480"></a> return idx < int(count()) ? list-><a href="qptrlist.html#take">take</a>( idx ) : 0; +<a name="x1480"></a> return idx < int(count()) ? list-><a href="ntqptrlist.html#take">take</a>( idx ) : 0; } SimpleFlow::~SimpleFlow() { - <a href="qlayout.html#deleteAllItems">deleteAllItems</a>(); + <a href="ntqlayout.html#deleteAllItems">deleteAllItems</a>(); } @@ -166,9 +166,9 @@ SimpleFlow::~SimpleFlow() return cached_hfw; } -<a name="x1467"></a>void SimpleFlow::<a href="qlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item) +<a name="x1467"></a>void SimpleFlow::<a href="ntqlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item) { -<a name="x1477"></a> list.<a href="qptrlist.html#append">append</a>( item ); +<a name="x1477"></a> list.<a href="ntqptrlist.html#append">append</a>( item ); } <a name="x1472"></a>bool SimpleFlow::<a href="qlayoutitem.html#hasHeightForWidth">hasHeightForWidth</a>() const @@ -181,34 +181,34 @@ SimpleFlow::~SimpleFlow() return minimumSize(); } -<a name="x1468"></a>TQSizePolicy::ExpandData SimpleFlow::<a href="qlayout.html#expanding">expanding</a>() const +<a name="x1468"></a>TQSizePolicy::ExpandData SimpleFlow::<a href="ntqlayout.html#expanding">expanding</a>() const { return TQSizePolicy::NoDirection; } -<a name="x1469"></a>TQLayoutIterator SimpleFlow::<a href="qlayout.html#iterator">iterator</a>() +<a name="x1469"></a>TQLayoutIterator SimpleFlow::<a href="ntqlayout.html#iterator">iterator</a>() { return TQLayoutIterator( new SimpleFlowIterator( &list ) ); } -<a name="x1471"></a>void SimpleFlow::<a href="qlayout.html#setGeometry">setGeometry</a>( const <a href="qrect.html">TQRect</a> &r ) +<a name="x1471"></a>void SimpleFlow::<a href="ntqlayout.html#setGeometry">setGeometry</a>( const <a href="ntqrect.html">TQRect</a> &r ) { - TQLayout::<a href="qlayout.html#setGeometry">setGeometry</a>( r ); + TQLayout::<a href="ntqlayout.html#setGeometry">setGeometry</a>( r ); doLayout( r ); } -int <a name="f451"></a>SimpleFlow::doLayout( const <a href="qrect.html">TQRect</a> &r, bool testonly ) +int <a name="f451"></a>SimpleFlow::doLayout( const <a href="ntqrect.html">TQRect</a> &r, bool testonly ) { - int x = r.<a href="qrect.html#x">x</a>(); - int y = r.<a href="qrect.html#y">y</a>(); + int x = r.<a href="ntqrect.html#x">x</a>(); + int y = r.<a href="ntqrect.html#y">y</a>(); int h = 0; //height of this line so far. <a href="qptrlistiterator.html">TQPtrListIterator</a><TQLayoutItem> it(list); <a href="qlayoutitem.html">TQLayoutItem</a> *o; <a name="x1481"></a> while ( (o=it.<a href="qptrlistiterator.html#current">current</a>()) != 0 ) { ++it; int nextX = x + o-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().width() + spacing(); -<a name="x1482"></a> if ( nextX - spacing() > r.<a href="qrect.html#right">right</a>() && h > 0 ) { - x = r.<a href="qrect.html#x">x</a>(); +<a name="x1482"></a> if ( nextX - spacing() > r.<a href="ntqrect.html#right">right</a>() && h > 0 ) { + x = r.<a href="ntqrect.html#x">x</a>(); y = y + h + spacing(); nextX = x + o-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().width() + spacing(); h = 0; @@ -218,17 +218,17 @@ int <a name="f451"></a>SimpleFlow::doLayout( const <a href="qrect.html">TQRect</ x = nextX; h = TQMAX( h, o-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().height() ); } - return y + h - r.<a href="qrect.html#y">y</a>(); + return y + h - r.<a href="ntqrect.html#y">y</a>(); } -<a name="x1470"></a>TQSize SimpleFlow::<a href="qlayout.html#minimumSize">minimumSize</a>() const +<a name="x1470"></a>TQSize SimpleFlow::<a href="ntqlayout.html#minimumSize">minimumSize</a>() const { - <a href="qsize.html">TQSize</a> s(0,0); + <a href="ntqsize.html">TQSize</a> s(0,0); <a href="qptrlistiterator.html">TQPtrListIterator</a><TQLayoutItem> it(list); <a href="qlayoutitem.html">TQLayoutItem</a> *o; while ( (o=it.<a href="qptrlistiterator.html#current">current</a>()) != 0 ) { ++it; -<a name="x1485"></a><a name="x1474"></a> s = s.<a href="qsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); +<a name="x1485"></a><a name="x1474"></a> s = s.<a href="ntqsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); } return s; } @@ -253,22 +253,22 @@ int <a name="f451"></a>SimpleFlow::doLayout( const <a href="qrect.html">TQRect</ #ifndef BORDER_H #define BORDER_H -#include <<a href="qlayout-h.html">qlayout.h</a>> -#include <<a href="qptrlist-h.html">qptrlist.h</a>> +#include <<a href="qlayout-h.html">ntqlayout.h</a>> +#include <<a href="qptrlist-h.html">ntqptrlist.h</a>> class BorderWidgetItem : public <a href="qwidgetitem.html">TQWidgetItem</a> { public: - BorderWidgetItem( <a href="qwidget.html">TQWidget</a> *w ) + BorderWidgetItem( <a href="ntqwidget.html">TQWidget</a> *w ) : <a href="qwidgetitem.html">TQWidgetItem</a>( w ) {} - void setGeometry( const <a href="qrect.html">TQRect</a> &r ) + void setGeometry( const <a href="ntqrect.html">TQRect</a> &r ) { widget()->setGeometry( r ); } }; -class BorderLayout : public <a href="qlayout.html">TQLayout</a> +class BorderLayout : public <a href="ntqlayout.html">TQLayout</a> { public: enum Position { @@ -295,19 +295,19 @@ public: SizeHint }; - BorderLayout( <a href="qwidget.html">TQWidget</a> *parent, int border = 0, int autoBorder = -1, + BorderLayout( <a href="ntqwidget.html">TQWidget</a> *parent, int border = 0, int autoBorder = -1, const char *name = 0 ) - : <a href="qlayout.html">TQLayout</a>( parent, border, autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), + : <a href="ntqlayout.html">TQLayout</a>( parent, border, autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), sizeDirty( TRUE ), msizeDirty( TRUE ) {} - BorderLayout( <a href="qlayout.html">TQLayout</a>* parent, int autoBorder = -1, const char *name = 0 ) - : <a href="qlayout.html">TQLayout</a>( parent, autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), + BorderLayout( <a href="ntqlayout.html">TQLayout</a>* parent, int autoBorder = -1, const char *name = 0 ) + : <a href="ntqlayout.html">TQLayout</a>( parent, autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), sizeDirty( TRUE ), msizeDirty( TRUE ) {} BorderLayout( int autoBorder = -1, const char *name = 0 ) - : <a href="qlayout.html">TQLayout</a>( autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), + : <a href="ntqlayout.html">TQLayout</a>( autoBorder, name ), cached( 0, 0 ), mcached( 0, 0 ), sizeDirty( TRUE ), msizeDirty( TRUE ) {} @@ -315,27 +315,27 @@ public: void addItem( <a href="qlayoutitem.html">TQLayoutItem</a> *item ); - void addWidget( <a href="qwidget.html">TQWidget</a> *widget, Position pos ); + void addWidget( <a href="ntqwidget.html">TQWidget</a> *widget, Position pos ); void add( <a href="qlayoutitem.html">TQLayoutItem</a> *item, Position pos ); bool hasHeightForWidth() const; - <a href="qsize.html">TQSize</a> sizeHint() const; - <a href="qsize.html">TQSize</a> minimumSize() const; + <a href="ntqsize.html">TQSize</a> sizeHint() const; + <a href="ntqsize.html">TQSize</a> minimumSize() const; <a href="qlayoutiterator.html">TQLayoutIterator</a> iterator(); TQSizePolicy::ExpandData expanding() const; protected: - void setGeometry( const <a href="qrect.html">TQRect</a> &rect ); + void setGeometry( const <a href="ntqrect.html">TQRect</a> &rect ); private: - void doLayout( const <a href="qrect.html">TQRect</a> &rect, bool testonly = FALSE ); + void doLayout( const <a href="ntqrect.html">TQRect</a> &rect, bool testonly = FALSE ); void calcSize( SizeType st ); - <a href="qptrlist.html">TQPtrList</a><BorderLayoutStruct> list; - <a href="qsize.html">TQSize</a> cached, mcached; + <a href="ntqptrlist.html">TQPtrList</a><BorderLayoutStruct> list; + <a href="ntqsize.html">TQSize</a> cached, mcached; bool sizeDirty, msizeDirty; }; @@ -362,7 +362,7 @@ private: class BorderLayoutIterator : public <a href="qglayoutiterator.html">TQGLayoutIterator</a> { public: - BorderLayoutIterator( const <a href="qptrlist.html">TQPtrList</a><BorderLayout::BorderLayoutStruct> *l ) + BorderLayoutIterator( const <a href="ntqptrlist.html">TQPtrList</a><BorderLayout::BorderLayoutStruct> *l ) : idx( 0 ) , list( (TQPtrList<BorderLayout::BorderLayoutStruct>*)l ) {} @@ -376,23 +376,23 @@ public: private: int idx; - <a href="qptrlist.html">TQPtrList</a><BorderLayout::BorderLayoutStruct> *list; + <a href="ntqptrlist.html">TQPtrList</a><BorderLayout::BorderLayoutStruct> *list; }; uint <a name="f456"></a>BorderLayoutIterator::count() const { -<a name="x1502"></a> return list-><a href="qptrlist.html#count">count</a>(); +<a name="x1502"></a> return list-><a href="ntqptrlist.html#count">count</a>(); } <a name="x1486"></a>TQLayoutItem *BorderLayoutIterator::<a href="qglayoutiterator.html#current">current</a>() { -<a name="x1501"></a> return idx < (int)count() ? list-><a href="qptrlist.html#at">at</a>( idx )->item : 0; +<a name="x1501"></a> return idx < (int)count() ? list-><a href="ntqptrlist.html#at">at</a>( idx )->item : 0; } BorderLayout::BorderLayoutStruct *<a name="f457"></a>BorderLayoutIterator::currentStruct() { - return idx < (int)count() ? list-><a href="qptrlist.html#at">at</a>( idx ) : 0; + return idx < (int)count() ? list-><a href="ntqptrlist.html#at">at</a>( idx ) : 0; } void <a name="f458"></a>BorderLayoutIterator::toFirst() @@ -409,7 +409,7 @@ void <a name="f458"></a>BorderLayoutIterator::toFirst() <a name="x1488"></a>TQLayoutItem *BorderLayoutIterator::<a href="qglayoutiterator.html#takeCurrent">takeCurrent</a>() { BorderLayout::BorderLayoutStruct *b -<a name="x1503"></a> = idx < int( list-><a href="qptrlist.html#count">count</a>() ) ? list-><a href="qptrlist.html#take">take</a>( idx ) : 0; +<a name="x1503"></a> = idx < int( list-><a href="ntqptrlist.html#count">count</a>() ) ? list-><a href="ntqptrlist.html#take">take</a>( idx ) : 0; <a href="qlayoutitem.html">TQLayoutItem</a> *item = b ? b->item : 0; delete b; return item; @@ -423,23 +423,23 @@ BorderLayoutIterator &BorderLayoutIterator::operator++() BorderLayout::~BorderLayout() { - <a href="qlayout.html#deleteAllItems">deleteAllItems</a>(); + <a href="ntqlayout.html#deleteAllItems">deleteAllItems</a>(); } -<a name="x1490"></a>void BorderLayout::<a href="qlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item ) +<a name="x1490"></a>void BorderLayout::<a href="ntqlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item ) { - <a href="qlayout.html#add">add</a>( item, West ); + <a href="ntqlayout.html#add">add</a>( item, West ); } -void <a name="f453"></a>BorderLayout::addWidget( <a href="qwidget.html">TQWidget</a> *widget, Position pos ) +void <a name="f453"></a>BorderLayout::addWidget( <a href="ntqwidget.html">TQWidget</a> *widget, Position pos ) { - <a href="qlayout.html#add">add</a>( new BorderWidgetItem( widget ), pos ); + <a href="ntqlayout.html#add">add</a>( new BorderWidgetItem( widget ), pos ); } -<a name="x1489"></a>void BorderLayout::<a href="qlayout.html#add">add</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item, Position pos ) +<a name="x1489"></a>void BorderLayout::<a href="ntqlayout.html#add">add</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item, Position pos ) { -<a name="x1500"></a> list.<a href="qptrlist.html#append">append</a>( new BorderLayoutStruct( item, pos ) ); +<a name="x1500"></a> list.<a href="ntqptrlist.html#append">append</a>( new BorderLayoutStruct( item, pos ) ); sizeDirty = TRUE; msizeDirty = TRUE; calcSize( SizeHint ); calcSize( Minimum ); } @@ -454,29 +454,29 @@ void <a name="f453"></a>BorderLayout::addWidget( <a href="qwidget.html">TQWidget return cached; } -<a name="x1493"></a>TQSize BorderLayout::<a href="qlayout.html#minimumSize">minimumSize</a>() const +<a name="x1493"></a>TQSize BorderLayout::<a href="ntqlayout.html#minimumSize">minimumSize</a>() const { return cached; } -<a name="x1491"></a>TQSizePolicy::ExpandData BorderLayout::<a href="qlayout.html#expanding">expanding</a>() const +<a name="x1491"></a>TQSizePolicy::ExpandData BorderLayout::<a href="ntqlayout.html#expanding">expanding</a>() const { return TQSizePolicy::BothDirections; } -<a name="x1492"></a>TQLayoutIterator BorderLayout::<a href="qlayout.html#iterator">iterator</a>() +<a name="x1492"></a>TQLayoutIterator BorderLayout::<a href="ntqlayout.html#iterator">iterator</a>() { return TQLayoutIterator( new BorderLayoutIterator( &list ) ); } -<a name="x1494"></a>void BorderLayout::<a href="qlayout.html#setGeometry">setGeometry</a>( const <a href="qrect.html">TQRect</a> &rct ) +<a name="x1494"></a>void BorderLayout::<a href="ntqlayout.html#setGeometry">setGeometry</a>( const <a href="ntqrect.html">TQRect</a> &rct ) { - TQLayout::<a href="qlayout.html#setGeometry">setGeometry</a>( rct ); + TQLayout::<a href="ntqlayout.html#setGeometry">setGeometry</a>( rct ); doLayout( rct ); } -void <a name="f454"></a>BorderLayout::doLayout( const <a href="qrect.html">TQRect</a> &rct, bool /*testonly*/ ) +void <a name="f454"></a>BorderLayout::doLayout( const <a href="ntqrect.html">TQRect</a> &rct, bool /*testonly*/ ) { int ew = 0, ww = 0, nh = 0, sh = 0; int h = 0; @@ -488,41 +488,41 @@ void <a name="f454"></a>BorderLayout::doLayout( const <a href="qrect.html">TQRec ++it; if ( o->pos == North ) { -<a name="x1506"></a><a name="x1505"></a><a name="x1498"></a> o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="qrect.html#x">x</a>(), nh, rct.<a href="qrect.html#width">width</a>(), o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().height() ) ); +<a name="x1506"></a><a name="x1505"></a><a name="x1498"></a> o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="ntqrect.html#x">x</a>(), nh, rct.<a href="ntqrect.html#width">width</a>(), o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().height() ) ); <a name="x1495"></a> nh += o->item-><a href="qlayoutitem.html#geometry">geometry</a>().height() + spacing(); } if ( o->pos == South ) { o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( o->item-><a href="qlayoutitem.html#geometry">geometry</a>().x(), o->item-><a href="qlayoutitem.html#geometry">geometry</a>().y(), - rct.<a href="qrect.html#width">width</a>(), o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().height() ) ); + rct.<a href="ntqrect.html#width">width</a>(), o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().height() ) ); sh += o->item-><a href="qlayoutitem.html#geometry">geometry</a>().height() + spacing(); - o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="qrect.html#x">x</a>(), rct.<a href="qrect.html#y">y</a>() + rct.<a href="qrect.html#height">height</a>() - sh + spacing(), + o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="ntqrect.html#x">x</a>(), rct.<a href="ntqrect.html#y">y</a>() + rct.<a href="ntqrect.html#height">height</a>() - sh + spacing(), o->item-><a href="qlayoutitem.html#geometry">geometry</a>().width(), o->item-><a href="qlayoutitem.html#geometry">geometry</a>().height() ) ); } if ( o->pos == Center ) center = o; } - h = rct.<a href="qrect.html#height">height</a>() - nh - sh; + h = rct.<a href="ntqrect.html#height">height</a>() - nh - sh; it.toFirst(); while ( ( o = it.currentStruct() ) != 0 ) { ++it; if ( o->pos == West ) { - o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="qrect.html#x">x</a>() + ww, nh, o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().width(), h ) ); + o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="ntqrect.html#x">x</a>() + ww, nh, o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().width(), h ) ); ww += o->item-><a href="qlayoutitem.html#geometry">geometry</a>().width() + spacing(); } if ( o->pos == East ) { o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( o->item-><a href="qlayoutitem.html#geometry">geometry</a>().x(), o->item-><a href="qlayoutitem.html#geometry">geometry</a>().y(), o->item-><a href="qlayoutitem.html#sizeHint">sizeHint</a>().width(), h ) ); ew += o->item-><a href="qlayoutitem.html#geometry">geometry</a>().width() + spacing(); - o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="qrect.html#x">x</a>() + rct.<a href="qrect.html#width">width</a>() - ew + spacing(), nh, + o->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( rct.<a href="ntqrect.html#x">x</a>() + rct.<a href="ntqrect.html#width">width</a>() - ew + spacing(), nh, o->item-><a href="qlayoutitem.html#geometry">geometry</a>().width(), o->item-><a href="qlayoutitem.html#geometry">geometry</a>().height() ) ); } } if ( center ) - center->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( ww, nh, rct.<a href="qrect.html#width">width</a>() - ew - ww, h ) ); + center->item-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( TQRect( ww, nh, rct.<a href="ntqrect.html#width">width</a>() - ew - ww, h ) ); } void <a name="f455"></a>BorderLayout::calcSize( SizeType st ) @@ -593,28 +593,28 @@ void <a name="f455"></a>BorderLayout::calcSize( SizeType st ) #ifndef CARD_H #define CARD_H -#include <<a href="qlayout-h.html">qlayout.h</a>> -#include <<a href="qptrlist-h.html">qptrlist.h</a>> +#include <<a href="qlayout-h.html">ntqlayout.h</a>> +#include <<a href="qptrlist-h.html">ntqptrlist.h</a>> -class CardLayout : public <a href="qlayout.html">TQLayout</a> +class CardLayout : public <a href="ntqlayout.html">TQLayout</a> { public: - CardLayout( <a href="qwidget.html">TQWidget</a> *parent, int dist ) - : <a href="qlayout.html">TQLayout</a>( parent, 0, dist ) {} - CardLayout( <a href="qlayout.html">TQLayout</a>* parent, int dist) - : <a href="qlayout.html">TQLayout</a>( parent, dist ) {} + CardLayout( <a href="ntqwidget.html">TQWidget</a> *parent, int dist ) + : <a href="ntqlayout.html">TQLayout</a>( parent, 0, dist ) {} + CardLayout( <a href="ntqlayout.html">TQLayout</a>* parent, int dist) + : <a href="ntqlayout.html">TQLayout</a>( parent, dist ) {} CardLayout( int dist ) - : <a href="qlayout.html">TQLayout</a>( dist ) {} + : <a href="ntqlayout.html">TQLayout</a>( dist ) {} ~CardLayout(); void addItem( <a href="qlayoutitem.html">TQLayoutItem</a> *item ); - <a href="qsize.html">TQSize</a> sizeHint() const; - <a href="qsize.html">TQSize</a> minimumSize() const; + <a href="ntqsize.html">TQSize</a> sizeHint() const; + <a href="ntqsize.html">TQSize</a> minimumSize() const; <a href="qlayoutiterator.html">TQLayoutIterator</a> iterator(); - void setGeometry( const <a href="qrect.html">TQRect</a> &rect ); + void setGeometry( const <a href="ntqrect.html">TQRect</a> &rect ); private: - <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> list; + <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> list; }; @@ -640,7 +640,7 @@ private: class CardLayoutIterator :public <a href="qglayoutiterator.html">TQGLayoutIterator</a> { public: - CardLayoutIterator( <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> *l ) + CardLayoutIterator( <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> *l ) : idx( 0 ), list( l ) {} <a href="qlayoutitem.html">TQLayoutItem</a> *current(); @@ -649,12 +649,12 @@ public: private: int idx; - <a href="qptrlist.html">TQPtrList</a><TQLayoutItem> *list; + <a href="ntqptrlist.html">TQPtrList</a><TQLayoutItem> *list; }; <a name="x1508"></a>TQLayoutItem *CardLayoutIterator::<a href="qglayoutiterator.html#current">current</a>() { -<a name="x1520"></a><a name="x1519"></a> return idx < int( list-><a href="qptrlist.html#count">count</a>() ) ? list-><a href="qptrlist.html#at">at</a>( idx ) : 0; +<a name="x1520"></a><a name="x1519"></a> return idx < int( list-><a href="ntqptrlist.html#count">count</a>() ) ? list-><a href="ntqptrlist.html#at">at</a>( idx ) : 0; } <a name="x1509"></a>TQLayoutItem *CardLayoutIterator::<a href="qglayoutiterator.html#next">next</a>() @@ -664,29 +664,29 @@ private: <a name="x1510"></a>TQLayoutItem *CardLayoutIterator::<a href="qglayoutiterator.html#takeCurrent">takeCurrent</a>() { -<a name="x1521"></a> return idx < int( list-><a href="qptrlist.html#count">count</a>() ) ?list-><a href="qptrlist.html#take">take</a>( idx ) : 0; +<a name="x1521"></a> return idx < int( list-><a href="ntqptrlist.html#count">count</a>() ) ?list-><a href="ntqptrlist.html#take">take</a>( idx ) : 0; } -<a name="x1512"></a>TQLayoutIterator CardLayout::<a href="qlayout.html#iterator">iterator</a>() +<a name="x1512"></a>TQLayoutIterator CardLayout::<a href="ntqlayout.html#iterator">iterator</a>() { return TQLayoutIterator( new CardLayoutIterator( &list ) ); } CardLayout::~CardLayout() { - <a href="qlayout.html#deleteAllItems">deleteAllItems</a>(); + <a href="ntqlayout.html#deleteAllItems">deleteAllItems</a>(); } -<a name="x1511"></a>void CardLayout::<a href="qlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item ) +<a name="x1511"></a>void CardLayout::<a href="ntqlayout.html#addItem">addItem</a>( <a href="qlayoutitem.html">TQLayoutItem</a> *item ) { -<a name="x1518"></a> list.<a href="qptrlist.html#append">append</a>( item ); +<a name="x1518"></a> list.<a href="ntqptrlist.html#append">append</a>( item ); } -<a name="x1514"></a>void CardLayout::<a href="qlayout.html#setGeometry">setGeometry</a>( const <a href="qrect.html">TQRect</a> &rct ) +<a name="x1514"></a>void CardLayout::<a href="ntqlayout.html#setGeometry">setGeometry</a>( const <a href="ntqrect.html">TQRect</a> &rct ) { - TQLayout::<a href="qlayout.html#setGeometry">setGeometry</a>( rct ); + TQLayout::<a href="ntqlayout.html#setGeometry">setGeometry</a>( rct ); <a href="qptrlistiterator.html">TQPtrListIterator</a><TQLayoutItem> it( list ); <a name="x1522"></a> if ( it.<a href="qptrlistiterator.html#count">count</a>() == 0 ) @@ -696,12 +696,12 @@ CardLayout::~CardLayout() int i = 0; - int w = rct.<a href="qrect.html#width">width</a>() - ( list.<a href="qptrlist.html#count">count</a>() - 1 ) * spacing(); - int h = rct.<a href="qrect.html#height">height</a>() - ( list.<a href="qptrlist.html#count">count</a>() - 1 ) * spacing(); + int w = rct.<a href="ntqrect.html#width">width</a>() - ( list.<a href="ntqptrlist.html#count">count</a>() - 1 ) * spacing(); + int h = rct.<a href="ntqrect.html#height">height</a>() - ( list.<a href="ntqptrlist.html#count">count</a>() - 1 ) * spacing(); <a name="x1523"></a> while ( ( o=it.<a href="qptrlistiterator.html#current">current</a>() ) != 0 ) { ++it; - <a href="qrect.html">TQRect</a> geom( rct.<a href="qrect.html#x">x</a>() + i * spacing(), rct.<a href="qrect.html#y">y</a>() + i * spacing(), + <a href="ntqrect.html">TQRect</a> geom( rct.<a href="ntqrect.html#x">x</a>() + i * spacing(), rct.<a href="ntqrect.html#y">y</a>() + i * spacing(), w, h ); <a name="x1516"></a> o-><a href="qlayoutitem.html#setGeometry">setGeometry</a>( geom ); ++i; @@ -710,30 +710,30 @@ CardLayout::~CardLayout() <a name="x1517"></a>TQSize CardLayout::<a href="qlayoutitem.html#sizeHint">sizeHint</a>() const { - <a href="qsize.html">TQSize</a> s(0,0); - int n = list.<a href="qptrlist.html#count">count</a>(); + <a href="ntqsize.html">TQSize</a> s(0,0); + int n = list.<a href="ntqptrlist.html#count">count</a>(); if ( n > 0 ) s = TQSize(100,70); //start with a nice default size <a href="qptrlistiterator.html">TQPtrListIterator</a><TQLayoutItem> it(list); <a href="qlayoutitem.html">TQLayoutItem</a> *o; while ( (o=it.<a href="qptrlistiterator.html#current">current</a>()) != 0 ) { ++it; -<a name="x1528"></a><a name="x1515"></a> s = s.<a href="qsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); +<a name="x1528"></a><a name="x1515"></a> s = s.<a href="ntqsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); } - return s + n*TQSize(<a href="qlayout.html#spacing">spacing</a>(),spacing()); + return s + n*TQSize(<a href="ntqlayout.html#spacing">spacing</a>(),spacing()); } -<a name="x1513"></a>TQSize CardLayout::<a href="qlayout.html#minimumSize">minimumSize</a>() const +<a name="x1513"></a>TQSize CardLayout::<a href="ntqlayout.html#minimumSize">minimumSize</a>() const { - <a href="qsize.html">TQSize</a> s(0,0); - int n = list.<a href="qptrlist.html#count">count</a>(); + <a href="ntqsize.html">TQSize</a> s(0,0); + int n = list.<a href="ntqptrlist.html#count">count</a>(); <a href="qptrlistiterator.html">TQPtrListIterator</a><TQLayoutItem> it(list); <a href="qlayoutitem.html">TQLayoutItem</a> *o; while ( (o=it.<a href="qptrlistiterator.html#current">current</a>()) != 0 ) { ++it; - s = s.<a href="qsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); + s = s.<a href="ntqsize.html#expandedTo">expandedTo</a>( o-><a href="qlayoutitem.html#minimumSize">minimumSize</a>() ); } - return s + n*TQSize(<a href="qlayout.html#spacing">spacing</a>(),spacing()); + return s + n*TQSize(<a href="ntqlayout.html#spacing">spacing</a>(),spacing()); } </pre> @@ -755,85 +755,85 @@ CardLayout::~CardLayout() #include "border.h" #include "card.h" -#include <<a href="qapplication-h.html">qapplication.h</a>> -#include <<a href="qlabel-h.html">qlabel.h</a>> -#include <<a href="qcolor-h.html">qcolor.h</a>> -#include <<a href="qgroupbox-h.html">qgroupbox.h</a>> -#include <<a href="qpushbutton-h.html">qpushbutton.h</a>> -#include <<a href="qmultilineedit-h.html">qmultilineedit.h</a>> -#include <<a href="qcolor-h.html">qcolor.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> +#include <<a href="qlabel-h.html">ntqlabel.h</a>> +#include <<a href="qcolor-h.html">ntqcolor.h</a>> +#include <<a href="qgroupbox-h.html">ntqgroupbox.h</a>> +#include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> +#include <<a href="qmultilineedit-h.html">ntqmultilineedit.h</a>> +#include <<a href="qcolor-h.html">ntqcolor.h</a>> int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); - <a href="qwidget.html">TQWidget</a> *f = new <a href="qwidget.html">TQWidget</a>; + <a href="ntqwidget.html">TQWidget</a> *f = new <a href="ntqwidget.html">TQWidget</a>; <a href="qboxlayout.html">TQBoxLayout</a> *gm = new <a href="qvboxlayout.html">TQVBoxLayout</a>( f, 5 ); SimpleFlow *b1 = new SimpleFlow( gm ); -<a name="x1536"></a> b1-><a href="qlayout.html#add">add</a>( new <a href="qpushbutton.html">TQPushButton</a>( "Short", f ) ); - b1-><a href="qlayout.html#add">add</a>( new <a href="qpushbutton.html">TQPushButton</a>( "Longer", f ) ); - b1-><a href="qlayout.html#add">add</a>( new <a href="qpushbutton.html">TQPushButton</a>( "Different text", f ) ); - b1-><a href="qlayout.html#add">add</a>( new <a href="qpushbutton.html">TQPushButton</a>( "More text", f ) ); - b1-><a href="qlayout.html#add">add</a>( new <a href="qpushbutton.html">TQPushButton</a>( "Even longer button text", f ) ); - <a href="qpushbutton.html">TQPushButton</a>* qb = new <a href="qpushbutton.html">TQPushButton</a>( "Quit", f ); - a.<a href="qobject.html#connect">connect</a>( qb, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), SLOT( quit() ) ); - b1-><a href="qlayout.html#add">add</a>( qb ); +<a name="x1536"></a> b1-><a href="ntqlayout.html#add">add</a>( new <a href="ntqpushbutton.html">TQPushButton</a>( "Short", f ) ); + b1-><a href="ntqlayout.html#add">add</a>( new <a href="ntqpushbutton.html">TQPushButton</a>( "Longer", f ) ); + b1-><a href="ntqlayout.html#add">add</a>( new <a href="ntqpushbutton.html">TQPushButton</a>( "Different text", f ) ); + b1-><a href="ntqlayout.html#add">add</a>( new <a href="ntqpushbutton.html">TQPushButton</a>( "More text", f ) ); + b1-><a href="ntqlayout.html#add">add</a>( new <a href="ntqpushbutton.html">TQPushButton</a>( "Even longer button text", f ) ); + <a href="ntqpushbutton.html">TQPushButton</a>* qb = new <a href="ntqpushbutton.html">TQPushButton</a>( "Quit", f ); + a.<a href="ntqobject.html#connect">connect</a>( qb, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), SLOT( quit() ) ); + b1-><a href="ntqlayout.html#add">add</a>( qb ); - <a href="qwidget.html">TQWidget</a> *wid = new <a href="qwidget.html">TQWidget</a>( f ); + <a href="ntqwidget.html">TQWidget</a> *wid = new <a href="ntqwidget.html">TQWidget</a>( f ); BorderLayout *large = new BorderLayout( wid ); -<a name="x1537"></a> large-><a href="qlayout.html#setSpacing">setSpacing</a>( 5 ); - large->addWidget( new <a href="qpushbutton.html">TQPushButton</a>( "North", wid ), BorderLayout::North ); - large->addWidget( new <a href="qpushbutton.html">TQPushButton</a>( "West", wid ), BorderLayout::West ); - <a href="qmultilineedit.html">TQMultiLineEdit</a>* m = new <a href="qmultilineedit.html">TQMultiLineEdit</a>( wid ); - m-><a href="qtextedit.html#setText">setText</a>( "Central\nWidget" ); +<a name="x1537"></a> large-><a href="ntqlayout.html#setSpacing">setSpacing</a>( 5 ); + large->addWidget( new <a href="ntqpushbutton.html">TQPushButton</a>( "North", wid ), BorderLayout::North ); + large->addWidget( new <a href="ntqpushbutton.html">TQPushButton</a>( "West", wid ), BorderLayout::West ); + <a href="ntqmultilineedit.html">TQMultiLineEdit</a>* m = new <a href="ntqmultilineedit.html">TQMultiLineEdit</a>( wid ); + m-><a href="ntqtextedit.html#setText">setText</a>( "Central\nWidget" ); large->addWidget( m, BorderLayout::Center ); - <a href="qwidget.html">TQWidget</a> *east1 = new <a href="qpushbutton.html">TQPushButton</a>( "East", wid ); + <a href="ntqwidget.html">TQWidget</a> *east1 = new <a href="ntqpushbutton.html">TQPushButton</a>( "East", wid ); large->addWidget( east1, BorderLayout::East ); - <a href="qwidget.html">TQWidget</a> *east2 = new <a href="qpushbutton.html">TQPushButton</a>( "East 2", wid ); + <a href="ntqwidget.html">TQWidget</a> *east2 = new <a href="ntqpushbutton.html">TQPushButton</a>( "East 2", wid ); large->addWidget( east2 , BorderLayout::East ); - large->addWidget( new <a href="qpushbutton.html">TQPushButton</a>( "South", wid ), BorderLayout::South ); + large->addWidget( new <a href="ntqpushbutton.html">TQPushButton</a>( "South", wid ), BorderLayout::South ); //Left-to-right tab order looks better: -<a name="x1542"></a> <a href="qwidget.html">TQWidget</a>::<a href="qwidget.html#setTabOrder">setTabOrder</a>( east2, east1 ); +<a name="x1542"></a> <a href="ntqwidget.html">TQWidget</a>::<a href="ntqwidget.html#setTabOrder">setTabOrder</a>( east2, east1 ); gm-><a href="qboxlayout.html#addWidget">addWidget</a>( wid ); - wid = new <a href="qwidget.html">TQWidget</a>( f ); + wid = new <a href="ntqwidget.html">TQWidget</a>( f ); CardLayout *card = new CardLayout( wid, 10 ); - <a href="qwidget.html">TQWidget</a> *crd = new <a href="qwidget.html">TQWidget</a>( wid ); -<a name="x1540"></a> crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::red ); - card-><a href="qlayout.html#add">add</a>( crd ); - crd = new <a href="qwidget.html">TQWidget</a>( wid ); - crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::green ); - card-><a href="qlayout.html#add">add</a>( crd ); - crd = new <a href="qwidget.html">TQWidget</a>( wid ); - crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::blue ); - card-><a href="qlayout.html#add">add</a>( crd ); - crd = new <a href="qwidget.html">TQWidget</a>( wid ); - crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::white ); - card-><a href="qlayout.html#add">add</a>( crd ); - crd = new <a href="qwidget.html">TQWidget</a>( wid ); - crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::black ); - card-><a href="qlayout.html#add">add</a>( crd ); - crd = new <a href="qwidget.html">TQWidget</a>( wid ); - crd-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::yellow ); - card-><a href="qlayout.html#add">add</a>( crd ); + <a href="ntqwidget.html">TQWidget</a> *crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); +<a name="x1540"></a> crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::red ); + card-><a href="ntqlayout.html#add">add</a>( crd ); + crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); + crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::green ); + card-><a href="ntqlayout.html#add">add</a>( crd ); + crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); + crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::blue ); + card-><a href="ntqlayout.html#add">add</a>( crd ); + crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); + crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::white ); + card-><a href="ntqlayout.html#add">add</a>( crd ); + crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); + crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::black ); + card-><a href="ntqlayout.html#add">add</a>( crd ); + crd = new <a href="ntqwidget.html">TQWidget</a>( wid ); + crd-><a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( TQt::yellow ); + card-><a href="ntqlayout.html#add">add</a>( crd ); gm-><a href="qboxlayout.html#addWidget">addWidget</a>( wid ); - <a href="qlabel.html">TQLabel</a>* s = new <a href="qlabel.html">TQLabel</a>( f ); - s-><a href="qlabel.html#setText">setText</a>( "outermost box" ); - s-><a href="qframe.html#setFrameStyle">setFrameStyle</a>( TQFrame::Panel | TQFrame::Sunken ); - s-><a href="qlabel.html#setAlignment">setAlignment</a>( TQt::AlignVCenter | TQt::AlignHCenter ); + <a href="ntqlabel.html">TQLabel</a>* s = new <a href="ntqlabel.html">TQLabel</a>( f ); + s-><a href="ntqlabel.html#setText">setText</a>( "outermost box" ); + s-><a href="ntqframe.html#setFrameStyle">setFrameStyle</a>( TQFrame::Panel | TQFrame::Sunken ); + s-><a href="ntqlabel.html#setAlignment">setAlignment</a>( TQt::AlignVCenter | TQt::AlignHCenter ); gm-><a href="qboxlayout.html#addWidget">addWidget</a>( s ); - a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( f ); - f-><a href="qwidget.html#setCaption">setCaption</a>("TQt Example - Custom Layout"); - f-><a href="qwidget.html#show">show</a>(); + a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( f ); + f-><a href="ntqwidget.html#setCaption">setCaption</a>("TQt Example - Custom Layout"); + f-><a href="ntqwidget.html#show">show</a>(); - int result = a.<a href="qapplication.html#exec">exec</a>(); + int result = a.<a href="ntqapplication.html#exec">exec</a>(); delete f; return result; } |