diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /kdevdesigner/designer/styledbutton.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/styledbutton.cpp')
-rw-r--r-- | kdevdesigner/designer/styledbutton.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kdevdesigner/designer/styledbutton.cpp b/kdevdesigner/designer/styledbutton.cpp index 45c425b4..a217fbe0 100644 --- a/kdevdesigner/designer/styledbutton.cpp +++ b/kdevdesigner/designer/styledbutton.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -38,10 +38,10 @@ #include <tqdragobject.h> #include <tqstyle.h> -StyledButton::StyledButton(TQWidget* parent, const char* name) - : TQButton( parent, name ), pix( 0 ), spix( 0 ), s( 0 ), formWindow( 0 ), mousePressed( FALSE ) +StyledButton::StyledButton(TQWidget* tqparent, const char* name) + : TQButton( tqparent, name ), pix( 0 ), spix( 0 ), s( 0 ), formWindow( 0 ), mousePressed( FALSE ) { - setMinimumSize( minimumSizeHint() ); + setMinimumSize( tqminimumSizeHint() ); setAcceptDrops( TRUE ); connect( this, TQT_SIGNAL(clicked()), TQT_SLOT(onEditor())); @@ -49,12 +49,12 @@ StyledButton::StyledButton(TQWidget* parent, const char* name) setEditor( ColorEditor ); } -StyledButton::StyledButton( const TQBrush& b, TQWidget* parent, const char* name, WFlags f ) - : TQButton( parent, name, f ), spix( 0 ), s( 0 ), formWindow( 0 ) +StyledButton::StyledButton( const TQBrush& b, TQWidget* tqparent, const char* name, WFlags f ) + : TQButton( tqparent, name, f ), spix( 0 ), s( 0 ), formWindow( 0 ) { col = b.color(); pix = b.pixmap(); - setMinimumSize( minimumSizeHint() ); + setMinimumSize( tqminimumSizeHint() ); } StyledButton::~StyledButton() @@ -117,12 +117,12 @@ void StyledButton::setScale( bool on ) scalePixmap(); } -TQSize StyledButton::sizeHint() const +TQSize StyledButton::tqsizeHint() const { return TQSize( 50, 25 ); } -TQSize StyledButton::minimumSizeHint() const +TQSize StyledButton::tqminimumSizeHint() const { return TQSize( 50, 25 ); } @@ -151,25 +151,25 @@ void StyledButton::resizeEvent( TQResizeEvent* e ) void StyledButton::drawButton( TQPainter *paint ) { - style().drawPrimitive(TQStyle::PE_ButtonBevel, paint, rect(), colorGroup(), + tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, paint, rect(), tqcolorGroup(), isDown() ? TQStyle::Style_Sunken : TQStyle::Style_Raised); drawButtonLabel(paint); if (hasFocus()) - style().drawPrimitive(TQStyle::PE_FocusRect, paint, - style().subRect(TQStyle::SR_PushButtonFocusRect, this), - colorGroup(), TQStyle::Style_Default); + tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, paint, + tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, this), + tqcolorGroup(), TQStyle::Style_Default); } void StyledButton::drawButtonLabel( TQPainter *paint ) { TQColor pen = isEnabled() ? - hasFocus() ? palette().active().buttonText() : palette().inactive().buttonText() - : palette().disabled().buttonText(); + hasFocus() ? tqpalette().active().buttonText() : tqpalette().inactive().buttonText() + : tqpalette().disabled().buttonText(); paint->setPen( pen ); if(!isEnabled()) { - paint->setBrush( TQBrush( colorGroup().button() ) ); + paint->setBrush( TQBrush( tqcolorGroup().button() ) ); } else if ( edit == PixmapEditor && spix ) { paint->setBrush( TQBrush( col, *spix ) ); @@ -184,7 +184,7 @@ void StyledButton::onEditor() { switch (edit) { case ColorEditor: { - TQColor c = QColorDialog::getColor( palette().active().background(), this ); + TQColor c = TQColorDialog::getColor( tqpalette().active().background(), this ); if ( c.isValid() ) { setColor( c ); emit changed(); @@ -216,7 +216,7 @@ void StyledButton::mousePressEvent(TQMouseEvent* e) void StyledButton::mouseMoveEvent(TQMouseEvent* e) { TQButton::mouseMoveEvent( e ); -#ifndef QT_NO_DRAGANDDROP +#ifndef TQT_NO_DRAGANDDROP if ( !mousePressed ) return; if ( ( pressPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) { @@ -243,7 +243,7 @@ void StyledButton::mouseMoveEvent(TQMouseEvent* e) #endif } -#ifndef QT_NO_DRAGANDDROP +#ifndef TQT_NO_DRAGANDDROP void StyledButton::dragEnterEvent( TQDragEnterEvent *e ) { setFocus(); @@ -258,7 +258,7 @@ void StyledButton::dragEnterEvent( TQDragEnterEvent *e ) void StyledButton::dragLeaveEvent( TQDragLeaveEvent * ) { if ( hasFocus() ) - parentWidget()->setFocus(); + tqparentWidget()->setFocus(); } void StyledButton::dragMoveEvent( TQDragMoveEvent *e ) @@ -292,4 +292,4 @@ void StyledButton::dropEvent( TQDropEvent *e ) e->ignore(); } } -#endif // QT_NO_DRAGANDDROP +#endif // TQT_NO_DRAGANDDROP |