diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:50:38 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:50:38 -0600 |
commit | d6331f1b56eb6dca7a1950658b2932f208015da0 (patch) | |
tree | f99bf8d1571f93304bdb4a46fb199a1bde60e6ee /scheck/scheck.cpp | |
parent | e738fee8847c1f606df7b338a589cc8c0539a521 (diff) | |
download | tdesdk-d6331f1b56eb6dca7a1950658b2932f208015da0.tar.gz tdesdk-d6331f1b56eb6dca7a1950658b2932f208015da0.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'scheck/scheck.cpp')
-rw-r--r-- | scheck/scheck.cpp | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/scheck/scheck.cpp b/scheck/scheck.cpp index 5d8d3582..60585b2a 100644 --- a/scheck/scheck.cpp +++ b/scheck/scheck.cpp @@ -55,7 +55,7 @@ #include <tqregexp.h> #include <tqscrollbar.h> #include <tqslider.h> -#include <tqstylesheet.h> +#include <stylesheet.h> #include <tqtabbar.h> #include <tqtimer.h> #include <tqtoolbutton.h> @@ -729,7 +729,7 @@ static void renderViolations(const TQValueVector<StyleGuideViolation>& violation // str.setLength() always does a deep copy, so the replacement code below is safe. parStr.setLength( len ); // compatible behaviour to the old implementation. Replace tabs by spaces - TQChar *chr = (TQChar*)parStr.tqunicode(); + TQChar *chr = (TQChar*)parStr.unicode(); int l = len; while ( l-- ) { @@ -900,10 +900,10 @@ void StyleCheckStyle::accelManageRecursive(TQWidget* widget) return; } - const TQObjectList tqchildren = widget->childrenListObject(); - if (tqchildren.isEmpty()) + const TQObjectList children = widget->childrenListObject(); + if (children.isEmpty()) return; - TQObjectListIterator iter(tqchildren); + TQObjectListIterator iter(children); TQObject* walk; while ((walk = iter.current())) @@ -918,7 +918,7 @@ void StyleCheckStyle::accelManageRecursive(TQWidget* widget) void StyleCheckStyle::slotAccelManage() { //Walk through top-levels - TQWidgetList* topLevels = TQApplication::tqtopLevelWidgets(); + TQWidgetList* topLevels = TQApplication::topLevelWidgets(); if (!topLevels) return; @@ -1058,7 +1058,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, if ( sunken ) kDrawBeButton( p, x, y, w, h, cg, true, - &cg.tqbrush(TQColorGroup::Mid) ); + &cg.brush(TQColorGroup::Mid) ); else if ( flags & Style_MouseOver ) { TQBrush brush(cg.button().light(110)); @@ -1071,7 +1071,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, else kDrawBeButton(p, x, y, w, h, cg, false, - &cg.tqbrush(TQColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); break; } @@ -1392,7 +1392,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, case PE_WindowFrame: case PE_PanelLineEdit: { bool sunken = flags & Style_Sunken; - int lw = opt.isDefault() ? tqpixelMetric(PM_DefaultFrameWidth) + int lw = opt.isDefault() ? pixelMetric(PM_DefaultFrameWidth) : opt.lineWidth(); if (lw == 2) { @@ -1502,8 +1502,8 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, p->save(); if ( flags & Style_Down ) - p->translate( tqpixelMetric( PM_ButtonShiftHorizontal ), - tqpixelMetric( PM_ButtonShiftVertical ) ); + p->translate( pixelMetric( PM_ButtonShiftHorizontal ), + pixelMetric( PM_ButtonShiftVertical ) ); if ( flags & Style_Enabled ) { a.translate( r.x() + r.width() / 2, r.y() + r.height() / 2 ); @@ -1705,7 +1705,7 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, } -void StyleCheckStyle::tqdrawControl( ControlElement element, +void StyleCheckStyle::drawControl( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -1727,7 +1727,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, if ( btnDefault || button->autoDefault() ) { // Compensate for default indicator - static int di = tqpixelMetric( PM_ButtonDefaultIndicator ); + static int di = pixelMetric( PM_ButtonDefaultIndicator ); br.addCoords( di, di, -di, -di ); } @@ -1750,14 +1750,14 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, // Shift button contents if pushed. if ( active ) { - x += tqpixelMetric(PM_ButtonShiftHorizontal, widget); - y += tqpixelMetric(PM_ButtonShiftVertical, widget); + x += pixelMetric(PM_ButtonShiftHorizontal, widget); + y += pixelMetric(PM_ButtonShiftVertical, widget); flags |= Style_Sunken; } // Does the button have a popup menu? if ( button->isMenuButton() ) { - int dx = tqpixelMetric( PM_MenuButtonIndicator, widget ); + int dx = pixelMetric( PM_MenuButtonIndicator, widget ); drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4), cg, flags, opt ); w -= dx; @@ -1786,7 +1786,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, // Make the label indicate if the button is a default button or not if ( active || button->isDefault() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in TQPushButton::tqsizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. int i; @@ -1794,25 +1794,25 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, if (button->isEnabled()) // Don't draw double-shadow when disabled for(i=0; i<2; i++) drawItem( p, TQRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix, - button->tqcolorGroup(), button->isEnabled(), button->pixmap(), + button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, - active ? &button->tqcolorGroup().dark() : &button->tqcolorGroup().mid() ); + active ? &button->colorGroup().dark() : &button->colorGroup().mid() ); // Normal Text for(i=0; i<2; i++) drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix, - button->tqcolorGroup(), button->isEnabled(), button->pixmap(), + button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, - active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() ); + active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else - drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->tqcolorGroup(), + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, - active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() ); + active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); // Draw a focus rect if the button has focus if ( flags & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - TQStyle::tqvisualRect(subRect(SR_PushButtonFocusRect, widget), widget), + TQStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), cg, flags ); break; } @@ -1828,7 +1828,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, TQRect tr = r; if ( t->identifier() == tb->currentTab() ) tr.setBottom( tr.bottom() - - tqpixelMetric( TQStyle::PM_DefaultFrameWidth, tb ) ); + pixelMetric( TQStyle::PM_DefaultFrameWidth, tb ) ); TQValueVector<StyleGuideViolation> violations = checkTitleStyle(t->text(), ShortTitle, HasAccels); renderViolations(violations, p, r, AlignCenter |ShowPrefix, t->text()); @@ -1846,18 +1846,18 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, { const TQCheckBox* checkbox = static_cast<const TQCheckBox*>(widget); - int tqalignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; TQValueVector<StyleGuideViolation> violations = checkSentenceStyle(checkbox->text()); - renderViolations(violations, p, r, tqalignment | AlignVCenter | ShowPrefix, checkbox->text()); + renderViolations(violations, p, r, alignment | AlignVCenter | ShowPrefix, checkbox->text()); - drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg, + drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, checkbox->pixmap(), removedXX(stripAccelViolations(checkbox->text()))); if (flags & Style_HasFocus) { - TQRect fr = tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget); + TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); drawPrimitive(PE_FocusRect, p, fr, cg, flags); } break; @@ -1867,18 +1867,18 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, { const TQRadioButton* rb = static_cast<const TQRadioButton*>(widget); - int tqalignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; TQValueVector<StyleGuideViolation> violations = checkSentenceStyle(rb->text()); - renderViolations(violations, p, r,tqalignment | AlignVCenter | ShowPrefix, rb->text()); + renderViolations(violations, p, r,alignment | AlignVCenter | ShowPrefix, rb->text()); - drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg, + drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, rb->pixmap(), removedXX(stripAccelViolations(rb->text()))); if (flags & Style_HasFocus) { - TQRect fr = tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget); + TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); drawPrimitive(PE_FocusRect, p, fr, cg, flags); } break; @@ -1933,7 +1933,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, bool enabled = mi->isEnabled(); bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; - bool etchtext = tqstyleHint( SH_EtchDisabledText ); + bool etchtext = styleHint( SH_EtchDisabledText ); bool reverse = TQApplication::reverseLayout(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1964,7 +1964,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, // Do we have an icon? if ( mi->iconSet() ) { TQIconSet::Mode mode; - TQRect cr = tqvisualRect( TQRect(x, y, checkcol, h), r ); + TQRect cr = visualRect( TQRect(x, y, checkcol, h), r ); // Select the correct icon from the iconset if ( active ) @@ -2110,8 +2110,8 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, // Does the menu item have a submenu? if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; - int dim = tqpixelMetric(PM_MenuButtonIndicator); - TQRect vr = tqvisualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim, + int dim = pixelMetric(PM_MenuButtonIndicator); + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -2164,12 +2164,12 @@ void StyleCheckStyle::tqdrawControl( ControlElement element, } default: - KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt); + KStyle::drawControl(element, p, widget, r, cg, flags, opt); } } -void StyleCheckStyle::tqdrawControlMask( ControlElement element, +void StyleCheckStyle::drawControlMask( ControlElement element, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -2190,12 +2190,12 @@ void StyleCheckStyle::tqdrawControlMask( ControlElement element, } default: - KStyle::tqdrawControlMask(element, p, widget, r, opt); + KStyle::drawControlMask(element, p, widget, r, opt); } } -void StyleCheckStyle::tqdrawComplexControl( ComplexControl control, +void StyleCheckStyle::drawComplexControl( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -2246,7 +2246,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control, p->drawLine(x+1, y+2, x+1, y2-2); // Get the button bounding box - TQRect ar = TQStyle::tqvisualRect( + TQRect ar = TQStyle::visualRect( querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); @@ -2265,7 +2265,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control, if ( controls & SC_ComboBoxEditField ) { const TQComboBox * cb = (const TQComboBox *) widget; - TQRect re = TQStyle::tqvisualRect( + TQRect re = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField), widget ); @@ -2289,7 +2289,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control, p->fillRect( re.x(), re.y(), re.width(), re.height(), cg.brush( TQColorGroup::Highlight ) ); - TQRect re = TQStyle::tqvisualRect( + TQRect re = TQStyle::visualRect( subRect(SR_ComboBoxFocusRect, cb), widget); drawPrimitive( PE_FocusRect, p, re, cg, @@ -2377,14 +2377,14 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control, default: - KStyle::tqdrawComplexControl(control, p, widget, + KStyle::drawComplexControl(control, p, widget, r, cg, flags, controls, active, opt); break; } } -void StyleCheckStyle::tqdrawComplexControlMask( ComplexControl control, +void StyleCheckStyle::drawComplexControlMask( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, @@ -2406,7 +2406,7 @@ void StyleCheckStyle::tqdrawComplexControlMask( ComplexControl control, } default: - KStyle::tqdrawComplexControlMask(control, p, widget, r, opt); + KStyle::drawComplexControlMask(control, p, widget, r, opt); } } @@ -2422,11 +2422,11 @@ TQRect StyleCheckStyle::subRect(SubRect r, const TQWidget *widget) const int dbw1 = 0, dbw2 = 0; if (button->isDefault() || button->autoDefault()) { - dbw1 = tqpixelMetric(PM_ButtonDefaultIndicator, widget); + dbw1 = pixelMetric(PM_ButtonDefaultIndicator, widget); dbw2 = dbw1 * 2; } - int dfw1 = tqpixelMetric(PM_DefaultFrameWidth, widget) * 2, + int dfw1 = pixelMetric(PM_DefaultFrameWidth, widget) * 2, dfw2 = dfw1 * 2; return TQRect(wrect.x() + dfw1 + dbw1 + 1, @@ -2438,7 +2438,7 @@ TQRect StyleCheckStyle::subRect(SubRect r, const TQWidget *widget) const } -int StyleCheckStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const +int StyleCheckStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { @@ -2465,7 +2465,7 @@ int StyleCheckStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const } default: - return KStyle::tqpixelMetric(m, widget); + return KStyle::pixelMetric(m, widget); } } @@ -2483,8 +2483,8 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents, const TQPushButton* button = (const TQPushButton*) widget; int w = contentSize.width(); int h = contentSize.height(); - int bm = tqpixelMetric( PM_ButtonMargin, widget ); - int fw = tqpixelMetric( PM_DefaultFrameWidth, widget ) * 2; + int bm = pixelMetric( PM_ButtonMargin, widget ); + int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2; w += bm + fw + 6; // ### Add 6 to make way for bold font. h += bm + fw; @@ -2495,7 +2495,7 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents, w = 80; // Compensate for default indicator - int di = tqpixelMetric( PM_ButtonDefaultIndicator ); + int di = pixelMetric( PM_ButtonDefaultIndicator ); w += di * 2; h += di * 2; } @@ -2520,8 +2520,8 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents, int w = contentSize.width(), h = contentSize.height(); if ( mi->custom() ) { - w = mi->custom()->tqsizeHint().width(); - h = mi->custom()->tqsizeHint().height(); + w = mi->custom()->sizeHint().width(); + h = mi->custom()->sizeHint().height(); if ( ! mi->custom()->fullSpan() ) h += 2*itemVMargin + 2*itemFrame; } @@ -2571,7 +2571,7 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents, } -// Fix TQt's wacky image tqalignment +// Fix TQt's wacky image alignment TQPixmap StyleCheckStyle::stylePixmap(StylePixmap stylepixmap, const TQWidget* widget, const TQStyleOption& opt) const @@ -2602,12 +2602,12 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) if ( (event->type() == TQEvent::Enter) && (button->isEnabled()) ) { hoverWidget = button; - button->tqrepaint( false ); + button->repaint( false ); } else if ( (event->type() == TQEvent::Leave) && (TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(hoverWidget)) ) { hoverWidget = 0L; - button->tqrepaint( false ); + button->repaint( false ); } } @@ -2629,14 +2629,14 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) m = lb->fontMetrics().width('x') / 2 - lb->margin(); if ( m > 0 ) { - int hAlign = TQApplication::horizontalAlignment( lb->tqalignment() ); + int hAlign = TQApplication::horizontalAlignment( lb->alignment() ); if ( hAlign & AlignLeft ) cr.setLeft( cr.left() + m ); if ( hAlign & AlignRight ) cr.setRight( cr.right() - m ); - if ( lb->tqalignment() & AlignTop ) + if ( lb->alignment() & AlignTop ) cr.setTop( cr.top() + m ); - if ( lb->tqalignment() & AlignBottom ) + if ( lb->alignment() & AlignBottom ) cr.setBottom( cr.bottom() - m ); } @@ -2656,17 +2656,17 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) if (lb->buddy()) { - renderViolations(violations, &p, cr,lb->tqalignment() | ShowPrefix, lb->text() ); + renderViolations(violations, &p, cr,lb->alignment() | ShowPrefix, lb->text() ); // ordinary text or pixmap label - drawItem( &p, cr, lb->tqalignment(), lb->tqcolorGroup(), lb->isEnabled(), + drawItem( &p, cr, lb->alignment(), lb->colorGroup(), lb->isEnabled(), 0, removedXX(stripAccelViolations(lb->text())) ); } else { - renderViolations(violations, &p, cr,lb->tqalignment(), lb->text() ); + renderViolations(violations, &p, cr,lb->alignment(), lb->text() ); // ordinary text or pixmap label - drawItem( &p, cr, lb->tqalignment(), lb->tqcolorGroup(), lb->isEnabled(), + drawItem( &p, cr, lb->alignment(), lb->colorGroup(), lb->isEnabled(), 0, removedXX(stripAccelViolations(lb->text())) ); } @@ -2704,11 +2704,11 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) int h = fm.height(); int tw = fm.width( stripped_title, stripped_title.length() ) + 2*fm.width(TQChar(' ')); int x; - if ( gb->tqalignment() & AlignHCenter ) // center tqalignment + if ( gb->alignment() & AlignHCenter ) // center alignment x = gb->frameRect().width()/2 - tw/2; - else if ( gb->tqalignment() & AlignRight ) // right tqalignment + else if ( gb->alignment() & AlignRight ) // right alignment x = gb->frameRect().width() - tw - 8; - else if ( gb->tqalignment() & AlignLeft ) // left tqalignment + else if ( gb->alignment() & AlignLeft ) // left alignment x = 8; else { // auto align @@ -2723,7 +2723,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) renderViolations( violations, &paint, r, AlignCenter | ShowPrefix, gb->title() ); - drawItem(&paint, r, AlignCenter | ShowPrefix, gb->tqcolorGroup(), + drawItem(&paint, r, AlignCenter | ShowPrefix, gb->colorGroup(), gb->isEnabled(), 0, stripped_title ); paint.setClipRegion( pevent->region().subtract( r ) ); @@ -2740,7 +2740,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) else { tqdrawPrimitive( TQStyle::PE_GroupBoxFrame, &paint, gb->frameRect(), - gb->tqcolorGroup(), TQStyle::Style_Default, + gb->colorGroup(), TQStyle::Style_Default, TQStyleOption(gb->lineWidth(), gb->midLineWidth(), gb->frameShape(), gb->frameShadow()) ); } |