diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:51:21 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:51:21 -0600 |
commit | b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04 (patch) | |
tree | 76f49820693d443128d3720322ff1605e9bcd558 /lib/widgets/qcomboview.cpp | |
parent | 247f828db1b8dcdc9346c1568d81cfa00db99c9e (diff) | |
download | tdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.tar.gz tdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'lib/widgets/qcomboview.cpp')
-rw-r--r-- | lib/widgets/qcomboview.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/widgets/qcomboview.cpp b/lib/widgets/qcomboview.cpp index 2dcfb9f3..113c8d38 100644 --- a/lib/widgets/qcomboview.cpp +++ b/lib/widgets/qcomboview.cpp @@ -39,7 +39,7 @@ public: QComboViewData( QComboView *cb ): current(0), lView( 0 ), combo( cb ) { duplicatesEnabled = TRUE; - cb->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ) ); + cb->setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ) ); } inline TQListView * listView() { return lView; } @@ -68,7 +68,7 @@ public: TQLineEdit * ed; // /bin/ed rules! TQTimer *completionTimer; - TQSize tqsizeHint; + TQSize sizeHint; private: bool usinglView; @@ -81,14 +81,14 @@ void QComboViewData::updateLinedGeometry() { if ( !ed || !combo ) return; - TQRect r = TQStyle::tqvisualRect( combo->tqstyle().querySubControlMetrics(TQStyle::CC_ComboBox, combo, + TQRect r = TQStyle::visualRect( combo->tqstyle().querySubControlMetrics(TQStyle::CC_ComboBox, combo, TQStyle::SC_ComboBoxEditField), combo ); // qWarning("updateLinedGeometry(): currentItem is %d", combo->currentItem() == 0 ? 0 : 1); const TQPixmap *pix = combo->currentItem() ? combo->currentItem()->pixmap(0) : 0; if ( pix && pix->width() < r.width() ) r.setLeft( r.left() + pix->width() + 4 ); - if ( r != ed->tqgeometry() ) + if ( r != ed->geometry() ) ed->setGeometry( r ); } @@ -204,7 +204,7 @@ void QComboView::clear() d->current = 0; if ( d->ed ) { - d->ed->setText( TQString::tqfromLatin1("") ); + d->ed->setText( TQString::fromLatin1("") ); d->updateLinedGeometry(); } currentChanged(); @@ -269,13 +269,13 @@ void QComboView::setAutoResize( bool enable ) reimp This implementation caches the size hint to avoid resizing when - the contents change dynamically. To tqinvalidate the cached value + the contents change dynamically. To invalidate the cached value call setFont(). */ -TQSize QComboView::tqsizeHint() const +TQSize QComboView::sizeHint() const { - if ( isVisible() && d->tqsizeHint.isValid() ) - return d->tqsizeHint; + if ( isVisible() && d->sizeHint.isValid() ) + return d->sizeHint; constPolish(); // int i, w; @@ -290,10 +290,10 @@ TQSize QComboView::tqsizeHint() const maxW = w; } */ - d->tqsizeHint = (tqstyle().tqsizeFromContents(TQStyle::CT_ComboBox, this, + d->sizeHint = (tqstyle().tqsizeFromContents(TQStyle::CT_ComboBox, this, TQSize(maxW, maxH)).expandedTo(TQApplication::globalStrut())); - return d->tqsizeHint; + return d->sizeHint; } @@ -385,7 +385,7 @@ void QComboView::setPalette( const TQPalette &palette ) void QComboView::setFont( const TQFont &font ) { - d->tqsizeHint = TQSize(); // tqinvalidate size hint + d->sizeHint = TQSize(); // invalidate size hint TQWidget::setFont( font ); d->listView()->setFont( font ); if (d->ed) @@ -412,7 +412,7 @@ void QComboView::resizeEvent( TQResizeEvent * e ) void QComboView::paintEvent( TQPaintEvent * ) { TQPainter p( this ); - const TQColorGroup & g = tqcolorGroup(); + const TQColorGroup & g = colorGroup(); p.setPen(g.text()); TQStyle::SFlags flags = TQStyle::Style_Default; @@ -428,7 +428,7 @@ void QComboView::paintEvent( TQPaintEvent * ) } // bool reverse = TQApplication::reverseLayout(); - tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, + tqstyle().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, flags, TQStyle::SC_All, (d->arrowDown ? TQStyle::SC_ComboBoxArrow : @@ -436,7 +436,7 @@ void QComboView::paintEvent( TQPaintEvent * ) TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxEditField ); - re = TQStyle::tqvisualRect(re, this); + re = TQStyle::visualRect(re, this); p.setClipRect( re ); if ( !d->ed ) { @@ -445,14 +445,14 @@ void QComboView::paintEvent( TQPaintEvent * ) // we calculate the TQListBoxTexts height (ignoring strut) int itemh = d->listView()->fontMetrics().lineSpacing() + 2; p.translate( re.x(), re.y() + (re.height() - itemh)/2 ); - item->paintCell( &p, d->listView()->tqcolorGroup(), 0, width(), AlignLeft | AlignVCenter ); + item->paintCell( &p, d->listView()->colorGroup(), 0, width(), AlignLeft | AlignVCenter ); } } else if ( d->listView() && d->listView()->currentItem( ) && d->current ) { TQListViewItem * item = d->current ; const TQPixmap *pix = item->pixmap(0); if ( pix ) { p.fillRect( re.x(), re.y(), pix->width() + 4, re.height(), - tqcolorGroup().brush( TQColorGroup::Base ) ); + colorGroup().brush( TQColorGroup::Base ) ); p.drawPixmap( re.x() + 2, re.y() + ( re.height() - pix->height() ) / 2, *pix ); } @@ -474,7 +474,7 @@ void QComboView::mousePressEvent( TQMouseEvent *e ) } TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxArrow); - arrowRect = TQStyle::tqvisualRect(arrowRect, this); + arrowRect = TQStyle::visualRect(arrowRect, this); // Correction for motif style, where arrow is smaller // and thus has a rect that doesn't fit the button. @@ -489,7 +489,7 @@ void QComboView::mousePressEvent( TQMouseEvent *e ) if ( arrowRect.contains( e->pos() ) ) { d->arrowPressed = TRUE; d->arrowDown = TRUE; - tqrepaint( FALSE ); + repaint( FALSE ); } TQTimer::singleShot( 200, this, TQT_SLOT(internalClickTimeout())); d->shortClick = TRUE; @@ -700,12 +700,12 @@ static int listHeight( TQListView *l, int /*sl*/ ) prefH = ch * l->firstChild()->height(); } else - prefH = l->tqsizeHint().height(); + prefH = l->sizeHint().height(); if (l->header()->isVisible()) - prefH += l->header()->tqsizeHint().height(); + prefH += l->header()->sizeHint().height(); -// return prefH < l->tqsizeHint().height() ? prefH : l->tqsizeHint().height(); +// return prefH < l->sizeHint().height() ? prefH : l->sizeHint().height(); return prefH+2; } @@ -727,7 +727,7 @@ void QComboView::popup() lb->installEventFilter( this ); lb->viewport()->installEventFilter( this ); d->mouseWasInsidePopup = FALSE; -// int w = lb->variableWidth() ? lb->tqsizeHint().width() : width(); +// int w = lb->variableWidth() ? lb->sizeHint().width() : width(); int w = width(); int h = listHeight( lb, d->sizeLimit ); TQRect screen = TQApplication::desktop()->availableGeometry( const_cast<QComboView*>(this) ); @@ -790,7 +790,7 @@ void QComboView::updateMask() { TQPainter p( &bm, this ); - tqstyle().tqdrawComplexControlMask(TQStyle::CC_ComboBox, &p, this, rect()); + tqstyle().drawComplexControlMask(TQStyle::CC_ComboBox, &p, this, rect()); } setMask( bm ); @@ -808,7 +808,7 @@ void QComboView::popDownListView() d->listView()->setCurrentItem( d->current ); if ( d->arrowDown ) { d->arrowDown = FALSE; - tqrepaint( FALSE ); + repaint( FALSE ); } d->poppedUp = FALSE; } @@ -904,21 +904,21 @@ bool QComboView::eventFilter( TQObject *object, TQEvent *event ) TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxArrow); - arrowRect = TQStyle::tqvisualRect(arrowRect, this); + arrowRect = TQStyle::visualRect(arrowRect, this); if ( arrowRect.contains( comboPos ) ) { if ( !d->arrowDown ) { d->arrowDown = TRUE; - tqrepaint( FALSE ); + repaint( FALSE ); } } else { if ( d->arrowDown ) { d->arrowDown = FALSE; - tqrepaint( FALSE ); + repaint( FALSE ); } } } } else if ((e->state() & ( Qt::RightButton | Qt::LeftButton | Qt::MidButton ) ) == 0 && - tqstyle().tqstyleHint(TQStyle::SH_ComboBox_ListMouseTracking, this)) { + tqstyle().styleHint(TQStyle::SH_ComboBox_ListMouseTracking, this)) { // qWarning("event filter:: emu"); TQWidget *mouseW = TQApplication::widgetAt( e->globalPos(), TRUE ); // if ( mouseW == d->listView()->viewport() ) { //### @@ -948,7 +948,7 @@ bool QComboView::eventFilter( TQObject *object, TQEvent *event ) d->arrowPressed = FALSE; if ( d->arrowDown ) { d->arrowDown = FALSE; - tqrepaint( FALSE ); + repaint( FALSE ); } } } @@ -1333,7 +1333,7 @@ bool QComboView::autoCompletion() const */ void QComboView::styleChange( TQStyle& s ) { - d->tqsizeHint = TQSize(); // tqinvalidate size hint... + d->sizeHint = TQSize(); // invalidate size hint... if ( d->ed ) d->updateLinedGeometry(); TQWidget::styleChange( s ); |