summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/misc_ui.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 /libksirtet/common/misc_ui.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 'libksirtet/common/misc_ui.cpp')
-rw-r--r--libksirtet/common/misc_ui.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp
index 45cfb440..cf802e25 100644
--- a/libksirtet/common/misc_ui.cpp
+++ b/libksirtet/common/misc_ui.cpp
@@ -1,7 +1,7 @@
#include "misc_ui.h"
#include "misc_ui.moc"
-#include <qpainter.h>
+#include <tqpainter.h>
#include "base/piece.h"
#include "base/board.h"
@@ -24,32 +24,32 @@ const uint LED_HEIGHT = 15;
const uint LED_SPACING = 5;
/*****************************************************************************/
-ShowNextPiece::ShowNextPiece(BaseBoard *board, QWidget *parent)
+ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent)
: FixedCanvasView(parent, "show_next_piece")
{
setCanvas(board->next());
- setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ setFrameStyle(TQFrame::Panel | TQFrame::Sunken);
KZoomMainWindow::addWidget(this);
}
/*****************************************************************************/
-Shadow::Shadow(BaseBoard *board, QWidget *parent)
- : QWidget(parent, "shadow"), _xOffset(board->frameWidth()),
+Shadow::Shadow(BaseBoard *board, TQWidget *parent)
+ : TQWidget(parent, "shadow"), _xOffset(board->frameWidth()),
_board(board), _show(false)
{
KZoomMainWindow::addWidget(this);
- connect(board, SIGNAL(updatePieceConfigSignal()), SLOT(update()));
+ connect(board, TQT_SIGNAL(updatePieceConfigSignal()), TQT_SLOT(update()));
}
-QSize Shadow::sizeHint() const
+TQSize Shadow::sizeHint() const
{
- return QSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(),
+ return TQSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(),
SHADOW_HEIGHT);
}
-QSizePolicy Shadow::sizePolicy() const
+TQSizePolicy Shadow::sizePolicy() const
{
- return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
}
void Shadow::setDisplay(bool show)
@@ -58,7 +58,7 @@ void Shadow::setDisplay(bool show)
update();
}
-void Shadow::paintEvent(QPaintEvent *)
+void Shadow::paintEvent(TQPaintEvent *)
{
if ( !_show ) return;
@@ -66,11 +66,11 @@ void Shadow::paintEvent(QPaintEvent *)
uint pf = piece->min().first + _board->currentPos().first;
uint pl = pf + piece->size().first - 1;
- QPainter p(this);
+ TQPainter p(this);
p.setBrush(black);
p.setPen(black);
for (uint i=pf; i<=pl; i++) {
- QRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0,
+ TQRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0,
BasePrefs::blockSize() - 2, SHADOW_HEIGHT);
p.drawRect(r);
}
@@ -81,32 +81,32 @@ void Shadow::paintEvent(QPaintEvent *)
class Led : public QWidget
{
public:
- Led(const QColor &c, QWidget *parent)
- : QWidget(parent), col(c), _on(FALSE) {}
+ Led(const TQColor &c, TQWidget *parent)
+ : TQWidget(parent), col(c), _on(FALSE) {}
- QSizePolicy sizePolicy() const
- { return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); }
- QSize sizeHint() const { return QSize(LED_WIDTH, LED_HEIGHT); }
+ TQSizePolicy sizePolicy() const
+ { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); }
+ TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); }
void on() { if (!_on) { _on = TRUE; repaint(); } }
void off() { if (_on) {_on = FALSE; repaint(); } }
- void setColor(const QColor &c) { if (c!=col) { col = c; repaint(); } }
+ void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } }
protected:
- void paintEvent(QPaintEvent *) {
- QPainter p(this);
+ void paintEvent(TQPaintEvent *) {
+ TQPainter p(this);
p.setBrush((_on ? col.light() : col.dark()));
p.setPen(black);
p.drawEllipse(0, 0, width(), height());
}
private:
- QColor col;
+ TQColor col;
bool _on;
};
-GiftPool::GiftPool(QWidget *parent)
- : QHBox(parent, "gift_pool"), nb(0), ready(false)
+GiftPool::GiftPool(TQWidget *parent)
+ : TQHBox(parent, "gift_pool"), nb(0), ready(false)
{
setSpacing(LED_SPACING);
leds.resize(cfactory->cbi.nbGiftLeds);
@@ -114,23 +114,23 @@ GiftPool::GiftPool(QWidget *parent)
leds.insert(i, new Led(yellow, this));
}
-QSize GiftPool::sizeHint() const
+TQSize GiftPool::sizeHint() const
{
- QSize s = (leds.size() ? leds[0]->sizeHint() : QSize());
- return QSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height());
+ TQSize s = (leds.size() ? leds[0]->sizeHint() : TQSize());
+ return TQSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height());
}
-QSizePolicy GiftPool::sizePolicy() const
+TQSizePolicy GiftPool::sizePolicy() const
{
- return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
}
void GiftPool::put(uint n)
{
if ( n==0 ) return;
if ( nb==0 && !ready )
- QTimer::singleShot(cfactory->cbi.giftPoolTimeout,
- this, SLOT(timeout()));
+ TQTimer::singleShot(cfactory->cbi.giftPoolTimeout,
+ this, TQT_SLOT(timeout()));
uint e = QMIN(nb+n, leds.size());
for (uint i=nb; i<e; i++) leds[i]->on();
uint f = QMIN(nb+n-e, leds.size());
@@ -171,7 +171,7 @@ void GiftPool::reset()
}
//-----------------------------------------------------------------------------
-PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent,
+PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent,
const char *name)
: KGameProgress(0, board->matrix().height(), 0, KGameProgress::Vertical,
parent, name), _board(board)
@@ -182,13 +182,13 @@ PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent,
KZoomMainWindow::addWidget(this);
}
-QSize PlayerProgress::sizeHint() const
+TQSize PlayerProgress::sizeHint() const
{
- return QSize(10, _board->matrix().height() * BasePrefs::blockSize())
- + 2 * QSize(frameWidth(), frameWidth());
+ return TQSize(10, _board->matrix().height() * BasePrefs::blockSize())
+ + 2 * TQSize(frameWidth(), frameWidth());
}
-QSizePolicy PlayerProgress::sizePolicy() const
+TQSizePolicy PlayerProgress::sizePolicy() const
{
- return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
}