diff options
Diffstat (limited to 'src/widgets/tqheader.cpp')
| -rw-r--r-- | src/widgets/tqheader.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/widgets/tqheader.cpp b/src/widgets/tqheader.cpp index 540a90508..9ea079d8e 100644 --- a/src/widgets/tqheader.cpp +++ b/src/widgets/tqheader.cpp @@ -54,8 +54,8 @@ public: TQHeaderData(int n) { count = n; - labels.setAutoDelete( TRUE ); - iconsets.setAutoDelete( TRUE ); + labels.setAutoDelete( true ); + iconsets.setAutoDelete( true ); sizes.resize(n); positions.resize(n); labels.resize(n); @@ -73,18 +73,18 @@ public: positions[i] = p; p += sizes[i]; } - clicks_default = TRUE; - resize_default = TRUE; + clicks_default = true; + resize_default = true; clicks.fill( clicks_default ); resize.fill( resize_default ); - move = TRUE; + move = true; sortSection = -1; - sortDirection = TRUE; - positionsDirty = TRUE; + sortDirection = true; + positionsDirty = true; lastPos = 0; fullSize = -2; - pos_dirty = FALSE; - is_a_table_header = FALSE; + pos_dirty = false; + is_a_table_header = false; focusIdx = 0; } @@ -157,14 +157,14 @@ public: sections in the header. The orientation of the header is set with setOrientation(). If - setStretchEnabled() is TRUE, the sections will expand to take up + setStretchEnabled() is true, the sections will expand to take up the full width (height for vertical headers) of the header. The user can resize the sections manually if setResizeEnabled() is - TRUE. Call adjustHeaderSize() to have the sections resize to + true. Call adjustHeaderSize() to have the sections resize to occupy the full width (or height). A section can be moved with moveSection(). If setMovingEnabled() - is TRUE (the default)the user may drag a section from one position + is true (the default)the user may drag a section from one position to another. If a section is moved, the index positions at which sections were added (with addLabel()), may not be the same after the move. You don't have to worry about this in practice because the @@ -271,7 +271,7 @@ void TQHeader::showEvent( TQShowEvent *e ) /*! \fn void TQHeader::clicked( int section ) - If isClickEnabled() is TRUE, this signal is emitted when the user + If isClickEnabled() is true, this signal is emitted when the user clicks section \a section. \sa pressed(), released() @@ -378,7 +378,7 @@ int TQHeader::count() const otherwise it is only emitted when the mouse button is released at the end of resizing. - Tracking defaults to FALSE. + Tracking defaults to false. */ @@ -391,14 +391,14 @@ void TQHeader::init( int n ) cachedPos = 0; // unused d = new TQHeaderData( n ); d->height = 0; - d->heightDirty = TRUE; + d->heightDirty = true; offs = 0; if( reverse() ) offs = d->lastPos - width(); oldHandleIdx = oldHIdxSize = handleIdx = 0; - setMouseTracking( TRUE ); - trackingIsOn = FALSE; + setMouseTracking( true ); + trackingIsOn = false; setBackgroundMode( PaletteButton ); setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) ); } @@ -612,7 +612,7 @@ void TQHeader::keyPressEvent( TQKeyEvent *e ) //resize int step = e->state() & ShiftButton ? dir : 10*dir; int c = d->positions[i] + d->sizes[s] + step; - handleColumnResize( i, c, TRUE ); + handleColumnResize( i, c, true ); } else if ( e->state() & (AltButton|MetaButton) && d->move ) { //move section int i2 = ( i + count() + dir ) % count(); @@ -639,7 +639,7 @@ void TQHeader::keyReleaseEvent( TQKeyEvent *e ) case Key_Space: //double check that this wasn't started with the mouse if ( state == Pressed && handleIdx == d->focusIdx ) { - repaint(sRect( handleIdx ), FALSE); + repaint(sRect( handleIdx ), false); int section = d->i2s[d->focusIdx]; emit released( section ); emit sectionClicked( handleIdx ); @@ -723,16 +723,16 @@ void TQHeader::mouseReleaseEvent( TQMouseEvent *e ) } else { handleIdx = oldHandleIdx; } - repaint(sRect( handleIdx ), FALSE); + repaint(sRect( handleIdx ), false); if ( oldOldHandleIdx != handleIdx ) - repaint(sRect(oldOldHandleIdx ), FALSE ); + repaint(sRect(oldOldHandleIdx ), false ); } break; case Sliding: { int c = orient == Horizontal ? e->pos().x() : e->pos().y(); c += offset(); if ( reverse() ) c = d->lastPos - c; - handleColumnResize( handleIdx, c - d->pressDelta, TRUE ); + handleColumnResize( handleIdx, c - d->pressDelta, true ); } break; case Moving: { #ifndef TQT_NO_CURSOR @@ -755,9 +755,9 @@ void TQHeader::mouseReleaseEvent( TQMouseEvent *e ) } else { handleIdx = oldHandleIdx; } - repaint(sRect( handleIdx ), FALSE ); + repaint(sRect( handleIdx ), false ); if(oldOldHandleIdx != handleIdx) - repaint(sRect(oldOldHandleIdx ), FALSE ); + repaint(sRect(oldOldHandleIdx ), false ); } break; } @@ -808,7 +808,7 @@ void TQHeader::mouseMoveEvent( TQMouseEvent *e ) } break; case Sliding: - handleColumnResize( handleIdx, c, FALSE, FALSE ); + handleColumnResize( handleIdx, c, false, false ); break; case Moving: { int newPos = findLine( pos ); @@ -992,7 +992,7 @@ void TQHeader::setLabel( int section, const TQString &s, int size ) } -bool tqt_qheader_label_return_null_strings = FALSE; +bool tqt_qheader_label_return_null_strings = false; /*! Returns the text for section \a section. If the section does not exist, a TQString::null is returned. @@ -1154,7 +1154,7 @@ void TQHeader::setSectionSizeAndHeight( int section, int size ) only for users with many columns and '\n's in their headers at the same time. */ - d->heightDirty = TRUE; + d->heightDirty = true; } } @@ -1239,7 +1239,7 @@ TQSize TQHeader::sizeHint() const sectionSizeHint( i, fm ).height() : sectionSizeHint( i, fm ).width(); d->height = TQMAX( d->height, h ); } - d->heightDirty = FALSE; + d->heightDirty = false; } if ( orient == Horizontal ) { @@ -1373,7 +1373,7 @@ void TQHeader::setCellSize( int section, int s ) /*! - If \a enable is TRUE the user may resize section \a section; + If \a enable is true the user may resize section \a section; otherwise the section may not be manually resized. If \a section is negative (the default) then the \a enable value @@ -1382,9 +1382,9 @@ void TQHeader::setCellSize( int section, int s ) Example: \code // Allow resizing of all current and future sections - header->setResizeEnabled(TRUE); + header->setResizeEnabled(true); // Disable resizing of section 3, (the fourth section added) - header->setResizeEnabled(FALSE, 3); + header->setResizeEnabled(false, 3); \endcode If the user resizes a section, a sizeChange() signal is emitted. @@ -1408,7 +1408,7 @@ void TQHeader::setResizeEnabled( bool enable, int section ) \property TQHeader::moving \brief whether the header sections can be moved - If this property is TRUE (the default) the user can move sections. + If this property is true (the default) the user can move sections. If the user moves a section the indexChange() signal is emitted. \sa setClickEnabled(), setResizeEnabled() @@ -1421,7 +1421,7 @@ void TQHeader::setMovingEnabled( bool enable ) /*! - If \a enable is TRUE, any clicks on section \a section will result + If \a enable is true, any clicks on section \a section will result in clicked() signals being emitted; otherwise the section will ignore clicks. @@ -1812,12 +1812,12 @@ void TQHeader::moveSection( int section, int toIndex ) } /*! - Returns TRUE if section \a section is clickable; otherwise returns - FALSE. + Returns true if section \a section is clickable; otherwise returns + false. If \a section is out of range (negative or larger than count() - - 1): returns TRUE if all sections are clickable; otherwise returns - FALSE. + 1): returns true if all sections are clickable; otherwise returns + false. \sa setClickEnabled() */ @@ -1830,18 +1830,18 @@ bool TQHeader::isClickEnabled( int section ) const for ( int i = 0; i < count(); ++i ) { if ( !d->clicks[ i ] ) - return FALSE; + return false; } - return TRUE; + return true; } /*! - Returns TRUE if section \a section is resizeable; otherwise - returns FALSE. + Returns true if section \a section is resizeable; otherwise + returns false. If \a section is -1 then this function applies to all sections, - i.e. returns TRUE if all sections are resizeable; otherwise - returns FALSE. + i.e. returns true if all sections are resizeable; otherwise + returns false. \sa setResizeEnabled() */ @@ -1854,9 +1854,9 @@ bool TQHeader::isResizeEnabled( int section ) const for ( int i = 0; i < count();++i ) { if ( !d->resize[ i ] ) - return FALSE; + return false; } - return TRUE; + return true; } bool TQHeader::isMovingEnabled() const @@ -1879,7 +1879,7 @@ bool TQHeader::reverse () const #if 0 return ( orient == TQt::Horizontal && TQApplication::reverseLayout() ); #else - return FALSE; + return false; #endif } @@ -1908,7 +1908,7 @@ void TQHeader::resizeEvent( TQResizeEvent *e ) Adjusts the size of the sections to fit the size of the header as completely as possible. Only sections for which isStretchEnabled() - is TRUE will be resized. + is true will be resized. */ void TQHeader::adjustHeaderSize( int diff ) @@ -1931,7 +1931,7 @@ void TQHeader::adjustHeaderSize( int diff ) if ( ns < 20 ) ns = 20; setCellSize( sec, ns ); - repaint( FALSE ); + repaint( false ); emit sizeChange( sec, os, ns ); } else if ( d->fullSize == -1 ) { int df = diff / count(); @@ -1951,7 +1951,7 @@ void TQHeader::adjustHeaderSize( int diff ) if ( ns < 20 ) ns = 20; setCellSize( sec, ns ); - repaint( FALSE ); + repaint( false ); emit sizeChange( sec, os, ns ); } } @@ -1963,14 +1963,14 @@ int TQHeader::headerWidth() const { if ( d->pos_dirty ) { ( (TQHeader*)this )->calculatePositions(); - d->pos_dirty = FALSE; + d->pos_dirty = false; } return d->lastPos; } void TQHeader::calculatePositions( bool onlyVisible, int start ) { - d->positionsDirty = FALSE; + d->positionsDirty = false; d->lastPos = count() > 0 ? d->positions[start] : 0; for ( int i = start; i < count(); i++ ) { d->positions[i] = d->lastPos; @@ -1991,13 +1991,13 @@ void TQHeader::calculatePositions( bool onlyVisible, int start ) /*! - If \a b is TRUE, section \a section will be resized when the + If \a b is true, section \a section will be resized when the header is resized, so that the sections take up the full width (or height for vertical headers) of the header; otherwise section \a section will be set to be unstretchable and will not resize when the header is resized. - If \a section is -1, and if \a b is TRUE, then all sections will + If \a section is -1, and if \a b is true, then all sections will be resized equally when the header is resized so that they take up the full width (or height for vertical headers) of the header; otherwise all the sections will be set to be unstretchable and @@ -2023,8 +2023,8 @@ bool TQHeader::isStretchEnabled() const /*! \overload - Returns TRUE if section \a section will resize to take up the full - width (or height) of the header; otherwise returns FALSE. If at + Returns true if section \a section will resize to take up the full + width (or height) of the header; otherwise returns false. If at least one section has stretch enabled the sections will always take up the full width of the header. |
