summaryrefslogtreecommitdiffstats
path: root/kcontrol/style/menupreview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kcontrol/style/menupreview.cpp
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/style/menupreview.cpp')
-rw-r--r--kcontrol/style/menupreview.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/kcontrol/style/menupreview.cpp b/kcontrol/style/menupreview.cpp
index a8a74c981..112f2c241 100644
--- a/kcontrol/style/menupreview.cpp
+++ b/kcontrol/style/menupreview.cpp
@@ -19,8 +19,8 @@
#include "menupreview.h"
-#include <qpainter.h>
-#include <qimage.h>
+#include <tqpainter.h>
+#include <tqimage.h>
#include <kpixmap.h>
#include <kpixmapeffect.h>
@@ -29,8 +29,8 @@
#include <kiconloader.h>
-MenuPreview::MenuPreview( QWidget* parent, int opacity, PreviewMode pvm )
- : QWidget( parent, 0, WStyle_Customize | WRepaintNoErase ),
+MenuPreview::MenuPreview( TQWidget* parent, int opacity, PreviewMode pvm )
+ : TQWidget( parent, 0, WStyle_Customize | WRepaintNoErase ),
pixBackground(NULL), pixOverlay(NULL), pixBlended(NULL)
{
setFixedSize(150, 150);
@@ -68,13 +68,13 @@ void MenuPreview::createPixmaps()
if (pixBlended)
pixBlended->resize( w, h );
- QColorGroup cg = colorGroup();
- QColor c1 = cg.background();
- QColor c2 = cg.mid();
+ TQColorGroup cg = colorGroup();
+ TQColor c1 = cg.background();
+ TQColor c2 = cg.mid();
if (pixBackground) {
// Paint checkerboard
- QPainter p;
+ TQPainter p;
p.begin(pixBackground);
for(int x=0; x < pixBackground->width(); x+=5)
for(int y=0; y < pixBackground->height(); y+=5)
@@ -83,7 +83,7 @@ void MenuPreview::createPixmaps()
((y % 2) ? c2 : c1 ) : // See the grid? ;-)
((y % 2) ? c1 : c2 ) );
KIconLoader* icl = KGlobal::iconLoader();
- QPixmap pix = icl->loadIcon("go", KIcon::Desktop, KIcon::SizeLarge, KIcon::ActiveState);
+ TQPixmap pix = icl->loadIcon("go", KIcon::Desktop, KIcon::SizeLarge, KIcon::ActiveState);
p.drawPixmap( (width()-2-pix.width())/2, (height()-2-pix.height())/2, pix );
}
@@ -100,13 +100,13 @@ void MenuPreview::blendPixmaps()
if (pixBlended && pixBackground)
{
if (mode == Blend && pixOverlay) {
- QImage src = pixOverlay->convertToImage();
- QImage dst = pixBackground->convertToImage();
+ TQImage src = pixOverlay->convertToImage();
+ TQImage dst = pixBackground->convertToImage();
KImageEffect::blend(src, dst, menuOpacity);
pixBlended->convertFromImage( dst );
} else if (mode == Tint) {
- QColor clr = colorGroup().button();
- QImage dst = pixBackground->convertToImage();
+ TQColor clr = colorGroup().button();
+ TQImage dst = pixBackground->convertToImage();
KImageEffect::blend(clr, dst, menuOpacity);
pixBlended->convertFromImage( dst );
}
@@ -134,14 +134,14 @@ void MenuPreview::setPreviewMode( PreviewMode pvm )
}
}
-void MenuPreview::paintEvent( QPaintEvent* /* pe */ )
+void MenuPreview::paintEvent( TQPaintEvent* /* pe */ )
{
// Paint the frame and blended pixmap
- QColorGroup cg = colorGroup();
+ TQColorGroup cg = colorGroup();
int x2 = width()-1;
int y2 = height()-1;
- QPainter p(this);
+ TQPainter p(this);
p.setPen(cg.dark());
p.drawLine(0, 0, x2, 0);
p.drawLine(0, 0, 0, y2);
@@ -154,10 +154,10 @@ void MenuPreview::paintEvent( QPaintEvent* /* pe */ )
else if (mode != NoEffect && pixBlended)
p.drawPixmap(1, 1, *pixBlended, 0, 0, --x2, --y2);
- QRect r = rect();
+ TQRect r = rect();
r.moveBy(6,3);
p.setPen( cg.text() );
- p.drawText( r, AlignTop | AlignLeft, QString::number((int)(menuOpacity*100))+i18n("%") );
+ p.drawText( r, AlignTop | AlignLeft, TQString::number((int)(menuOpacity*100))+i18n("%") );
}
#include "menupreview.moc"