From 94844816550ad672ccfcdc25659c625546239998 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:32:11 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kexi/widget/utils/kexiflowlayout.cpp | 88 ++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'kexi/widget/utils/kexiflowlayout.cpp') diff --git a/kexi/widget/utils/kexiflowlayout.cpp b/kexi/widget/utils/kexiflowlayout.cpp index e4bc4207..e2397ede 100644 --- a/kexi/widget/utils/kexiflowlayout.cpp +++ b/kexi/widget/utils/kexiflowlayout.cpp @@ -64,7 +64,7 @@ KexiFlowLayoutIterator::takeCurrent() return (m_idx < (int)count()) ? m_list->take(m_idx) : 0; } -//// The tqlayout itself +//// The layout itself KexiFlowLayout::KexiFlowLayout(TQWidget *parent, int border, int space, const char *name) : TQLayout(parent, border, space, name) @@ -134,10 +134,10 @@ KexiFlowLayout::widgetList() const } void -KexiFlowLayout::tqinvalidate() +KexiFlowLayout::invalidate() { - TQLayout::tqinvalidate(); - m_cached_tqsizeHint = TQSize(); + TQLayout::invalidate(); + m_cached_sizeHint = TQSize(); m_cached_minSize = TQSize(); m_cached_width = 0; } @@ -169,22 +169,22 @@ KexiFlowLayout::heightForWidth(int w) const } TQSize -KexiFlowLayout::tqsizeHint() const +KexiFlowLayout::sizeHint() const { - if(m_cached_tqsizeHint.isEmpty()) { + if(m_cached_sizeHint.isEmpty()) { KexiFlowLayout *mthis = (KexiFlowLayout*)this; TQRect r = TQRect(0, 0, 2000, 2000); mthis->simulateLayout(r); } - return m_cached_tqsizeHint; + return m_cached_sizeHint; } TQSize -KexiFlowLayout::tqminimumSize() const +KexiFlowLayout::minimumSize() const { -//js: do we really need to simulate tqlayout here? -// I commented this out because it was impossible to stretch tqlayout conveniently. -// Now, minimum size is computed automatically based on item's tqminimumSize... +//js: do we really need to simulate layout here? +// I commented this out because it was impossible to stretch layout conveniently. +// Now, minimum size is computed automatically based on item's minimumSize... #if 0 if(m_cached_minSize.isEmpty()) { KexiFlowLayout *mthis = (KexiFlowLayout*)this; @@ -234,7 +234,7 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) TQPtrListIterator it(m_list); TQPtrList currentLine; TQLayoutItem *o; - TQSize minSize, tqsizeHint(20, 20); + TQSize minSize, sizeHint(20, 20); int minSizeHeight = 0 - spacing(); while ( (o = it.current()) != 0 ) { @@ -244,20 +244,20 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) } // kdDebug() << "- doHorizontalLayout(): " << o->widget()->className() << " " << o->widget()->name() << endl; - TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) + TQSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) if ((x + oSizeHint.width()) > r.right() && h > 0) { - // do the tqlayout of current line + // do the layout of current line TQPtrListIterator it2(currentLine); TQLayoutItem *item; int wx = r.x(); int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; while( (item = it2.current()) != 0 ) { - TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take - TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->minimumSize(); // a while to get them TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections) + if(item->expanding() == TQSizePolicy::Horizontally || item->expanding() == TQSizePolicy::BothDirections) s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets , r.width()), itemSizeHint.height() ); else @@ -277,7 +277,7 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() ); ++it2; } - tqsizeHint = tqsizeHint.expandedTo( TQSize(sizeHintWidth, 0) ); + sizeHint = sizeHint.expandedTo( TQSize(sizeHintWidth, 0) ); minSize = minSize.expandedTo( TQSize(minSizeWidth, 0) ); minSizeHeight = minSizeHeight + spacing() + lineMinHeight; // start a new line @@ -292,24 +292,24 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) x = x + spacing() + oSizeHint.width(); h = TQMAX( h, oSizeHint.height() ); currentLine.append(o); - if(o->expandingDirections() == TQSizePolicy::Horizontally || o->expandingDirections() == TQSizePolicy::BothDirections) + if(o->expanding() == TQSizePolicy::Horizontally || o->expanding() == TQSizePolicy::BothDirections) ++expandingWidgets; availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.width()); ++it; } - // don't forget to tqlayout the last line + // don't forget to layout the last line TQPtrListIterator it2(currentLine); TQLayoutItem *item; int wx = r.x(); int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0; while( (item = it2.current()) != 0 ) { - TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take - TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->minimumSize(); // a while to get them TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections) + if(item->expanding() == TQSizePolicy::Horizontally || item->expanding() == TQSizePolicy::BothDirections) s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets , r.width()), itemSizeHint.height() ); else @@ -329,12 +329,12 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly) lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() ); ++it2; } - tqsizeHint = tqsizeHint.expandedTo( TQSize(sizeHintWidth, y + spacing() + h) ); + sizeHint = sizeHint.expandedTo( TQSize(sizeHintWidth, y + spacing() + h) ); minSizeHeight = minSizeHeight + spacing() + lineMinHeight; minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) ); - // store tqsizeHint() and tqminimumSize() - m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin()); + // store sizeHint() and minimumSize() + m_cached_sizeHint = sizeHint + TQSize(2* margin(), 2*margin()); m_cached_minSize = minSize + TQSize(2* margin() , 2*margin()); // return our height return y + h - r.y(); @@ -351,7 +351,7 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) TQPtrListIterator it(m_list); TQPtrList currentLine; TQLayoutItem *o; - TQSize minSize, tqsizeHint(20, 20); + TQSize minSize, sizeHint(20, 20); int minSizeWidth = 0 - spacing(); while ( (o = it.current()) != 0 ) { @@ -360,20 +360,20 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) continue; } - TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) + TQSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts) if (y + oSizeHint.height() > r.bottom() && w > 0) { - // do the tqlayout of current line + // do the layout of current line TQPtrListIterator it2(currentLine); TQLayoutItem *item; int wy = r.y(); int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; while( (item = it2.current()) != 0 ) { - TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take - TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->minimumSize(); // a while to get them TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections) + if(item->expanding() == TQSizePolicy::Vertically || item->expanding() == TQSizePolicy::BothDirections) s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets , r.height()) ); else @@ -393,7 +393,7 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) colMinWidth = TQMAX( colMinWidth, itemMinSize.width() ); ++it2; } - tqsizeHint = tqsizeHint.expandedTo( TQSize(0, sizeHintHeight) ); + sizeHint = sizeHint.expandedTo( TQSize(0, sizeHintHeight) ); minSize = minSize.expandedTo( TQSize(0, minSizeHeight) ); minSizeWidth = minSizeWidth + spacing() + colMinWidth; // start a new column @@ -408,24 +408,24 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) y = y + spacing() + oSizeHint.height(); w = TQMAX( w, oSizeHint.width() ); currentLine.append(o); - if(o->expandingDirections() == TQSizePolicy::Vertically || o->expandingDirections() == TQSizePolicy::BothDirections) + if(o->expanding() == TQSizePolicy::Vertically || o->expanding() == TQSizePolicy::BothDirections) ++expandingWidgets; availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.height()); ++it; } - // don't forget to tqlayout the last line + // don't forget to layout the last line TQPtrListIterator it2(currentLine); TQLayoutItem *item; int wy = r.y(); int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0; while( (item = it2.current()) != 0 ) { - TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take - TQSize itemMinSize = item->tqminimumSize(); // a while to get them + TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take + TQSize itemMinSize = item->minimumSize(); // a while to get them TQSize s; if(m_justify) { if(expandingWidgets != 0) { - if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections) + if(item->expanding() == TQSizePolicy::Vertically || item->expanding() == TQSizePolicy::BothDirections) s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets , r.height()) ); else @@ -445,12 +445,12 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly) colMinWidth = TQMAX( colMinWidth, itemMinSize.width() ); ++it2; } - tqsizeHint = tqsizeHint.expandedTo( TQSize( x + spacing() + w, sizeHintHeight) ); + sizeHint = sizeHint.expandedTo( TQSize( x + spacing() + w, sizeHintHeight) ); minSizeWidth = minSizeWidth + spacing() + colMinWidth; minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) ); - // store tqsizeHint() and tqminimumSize() - m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin()); + // store sizeHint() and minimumSize() + m_cached_sizeHint = sizeHint + TQSize(2* margin(), 2*margin()); m_cached_minSize = minSize + TQSize(2* margin(), 2*margin()); // return our width return x + w - r.x(); @@ -468,7 +468,7 @@ int KexiFlowLayout::count() const { \reimp */ TQLayoutItem* KexiFlowLayout::itemAt(int index) const { - return index >= 0 && index < m_list.count() ? (const_cast&>(m_list).tqat(index)) : 0; + return index >= 0 && index < m_list.count() ? (const_cast&>(m_list).at(index)) : 0; } /*! @@ -477,8 +477,8 @@ TQLayoutItem* KexiFlowLayout::itemAt(int index) const { TQLayoutItem* KexiFlowLayout::takeAt(int index) { if (index < 0 || index >= m_list.count()) return 0; - TQLayoutItem *item = m_list.tqat(index); - m_list.remove(m_list.tqat(index)); + TQLayoutItem *item = m_list.at(index); + m_list.remove(m_list.at(index)); delete item; invalidate(); -- cgit v1.2.1