summaryrefslogtreecommitdiffstats
path: root/kmines/frame.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kmines/frame.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmines/frame.cpp')
-rw-r--r--kmines/frame.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/kmines/frame.cpp b/kmines/frame.cpp
index a502b87d..6c9446c2 100644
--- a/kmines/frame.cpp
+++ b/kmines/frame.cpp
@@ -18,18 +18,18 @@
#include "frame.h"
-#include <qpainter.h>
-#include <qbitmap.h>
-#include <qstyle.h>
-#include <qdrawutil.h>
+#include <tqpainter.h>
+#include <tqbitmap.h>
+#include <tqstyle.h>
+#include <tqdrawutil.h>
#include "settings.h"
-FieldFrame::FieldFrame(QWidget *parent)
- : QFrame(parent, "field"), _button(0)
+FieldFrame::FieldFrame(TQWidget *parent)
+ : TQFrame(parent, "field"), _button(0)
{
- setFrameStyle( QFrame::Box | QFrame::Raised );
+ setFrameStyle( TQFrame::Box | TQFrame::Raised );
setLineWidth(2);
setMidLineWidth(2);
}
@@ -39,7 +39,7 @@ void FieldFrame::adjustSize()
setFixedSize(sizeHint());
_button.resize(Settings::caseSize(), Settings::caseSize());
- QBitmap mask;
+ TQBitmap mask;
for (uint i=0; i<Nb_Pixmap_Types; i++) {
drawPixmap(mask, (PixmapType)i, true);
drawPixmap(_pixmaps[i], (PixmapType)i, false);
@@ -51,22 +51,22 @@ void FieldFrame::adjustSize()
_advised[i].setMask(mask);
}
- QFont f = font();
+ TQFont f = font();
f.setPointSize(QMAX(1, Settings::caseSize()-6));
f.setBold(true);
setFont(f);
}
-void FieldFrame::initPixmap(QPixmap &pix, bool mask) const
+void FieldFrame::initPixmap(TQPixmap &pix, bool mask) const
{
pix.resize(Settings::caseSize(), Settings::caseSize());
if (mask) pix.fill(color0);
}
-void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const
+void FieldFrame::drawPixmap(TQPixmap &pix, PixmapType type, bool mask) const
{
initPixmap(pix, mask);
- QPainter p(&pix);
+ TQPainter p(&pix);
if ( type==FlagPixmap ) {
p.setWindow(0, 0, 16, 16);
@@ -84,7 +84,7 @@ void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const
p.setWindow(0, 0, 20, 20);
if ( type==ExplodedPixmap )
p.fillRect(2, 2, 16, 16, (mask ? color1 : Settings::color(Settings::EnumType::explosion)));
- QPen pen(mask ? color1 : black, 1);
+ TQPen pen(mask ? color1 : black, 1);
p.setPen(pen);
p.setBrush(mask ? color1 : black);
p.drawLine(10,3,10,18);
@@ -107,37 +107,37 @@ void FieldFrame::drawPixmap(QPixmap &pix, PixmapType type, bool mask) const
}
}
-void FieldFrame::drawAdvised(QPixmap &pix, uint i, bool mask) const
+void FieldFrame::drawAdvised(TQPixmap &pix, uint i, bool mask) const
{
initPixmap(pix, mask);
- QPainter p(&pix);
+ TQPainter p(&pix);
p.setWindow(0, 0, 16, 16);
- p.setPen( QPen(mask ? color1 : Settings::mineColor(i), 2) );
+ p.setPen( TQPen(mask ? color1 : Settings::mineColor(i), 2) );
p.drawRect(3, 3, 11, 11);
}
-void FieldFrame::drawBox(QPainter &painter, const QPoint &p,
- bool pressed, PixmapType type, const QString &text,
+void FieldFrame::drawBox(TQPainter &painter, const TQPoint &p,
+ bool pressed, PixmapType type, const TQString &text,
uint nbMines, int advised,
bool hasFocus) const
{
qDrawShadePanel(&painter, p.x(), p.y(), _button.width(), _button.height(),
colorGroup(), pressed, 2,
- &colorGroup().brush(QColorGroup::Background));
+ &colorGroup().brush(TQColorGroup::Background));
if (hasFocus) {
painter.translate(p.x(), p.y());
- QRect fbr = style().subRect(QStyle::SR_PushButtonFocusRect, &_button);
- style().drawPrimitive(QStyle::PE_FocusRect, &painter, fbr,
- colorGroup(), QStyle::Style_Enabled);
+ TQRect fbr = style().subRect(TQStyle::SR_PushButtonFocusRect, &_button);
+ style().drawPrimitive(TQStyle::PE_FocusRect, &painter, fbr,
+ colorGroup(), TQStyle::Style_Enabled);
painter.resetXForm();
}
- QRect r(p, _button.size());
- const QPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]);
- QColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1));
+ TQRect r(p, _button.size());
+ const TQPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]);
+ TQColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1));
style().drawItem(&painter, r, AlignCenter, colorGroup(), true, pixmap,
text, -1, &color);
if ( advised!=-1 )
style().drawItem(&painter, r, AlignCenter, colorGroup(), true,
- &_advised[advised], QString::null);
+ &_advised[advised], TQString::null);
}