summaryrefslogtreecommitdiffstats
path: root/fifteenapplet/fifteenapplet.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 21:31:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 21:31:21 +0000
commita1bd60b34891ccc77056c190d7871bc4b14fe654 (patch)
tree713f2f72c8f08a18df12f5bbeef7f9b61b19d4f1 /fifteenapplet/fifteenapplet.cpp
parent8d92c3c2a4131996726cc7b625d3cd3caec296de (diff)
downloadtdetoys-a1bd60b34891ccc77056c190d7871bc4b14fe654.tar.gz
tdetoys-a1bd60b34891ccc77056c190d7871bc4b14fe654.zip
TQt4 port kdetoys
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1238103 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'fifteenapplet/fifteenapplet.cpp')
-rw-r--r--fifteenapplet/fifteenapplet.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/fifteenapplet/fifteenapplet.cpp b/fifteenapplet/fifteenapplet.cpp
index 46e3549..3dc453f 100644
--- a/fifteenapplet/fifteenapplet.cpp
+++ b/fifteenapplet/fifteenapplet.cpp
@@ -38,23 +38,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern "C"
{
- KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
+ KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kfifteenapplet");
return new FifteenApplet(configFile, KPanelApplet::Normal,
- KPanelApplet::About, parent, "kfifteenapplet");
+ KPanelApplet::About, tqparent, "kfifteenapplet");
}
}
FifteenApplet::FifteenApplet(const TQString& configFile, Type type, int actions,
- TQWidget *parent, const char *name)
- : KPanelApplet(configFile, type, actions, parent, name), _aboutData(0)
+ TQWidget *tqparent, const char *name)
+ : KPanelApplet(configFile, type, actions, tqparent, name), _aboutData(0)
{
// setup table
_table = new PiecesTable(this);
setCustomMenu(_table->popup());
- // setup layout
+ // setup tqlayout
TQHBoxLayout *_layout = new TQHBoxLayout(this);
_layout->add(_table);
@@ -87,8 +87,8 @@ void FifteenApplet::about()
dialog.exec();
}
-PiecesTable::PiecesTable(TQWidget* parent, const char* name )
- : QtTableView(parent, name), _activeRow(-1), _activeCol(-1), _randomized(false)
+PiecesTable::PiecesTable(TQWidget* tqparent, const char* name )
+ : QtTableView(tqparent, name), _activeRow(-1), _activeCol(-1), _randomized(false)
{
_menu = new TQPopupMenu(this);
_menu->insertItem(i18n("R&andomize Pieces"), this, TQT_SLOT(randomizeMap()));
@@ -120,7 +120,7 @@ void PiecesTable::paintCell(TQPainter *p, int row, int col)
// draw cell background
if(number == 16)
- p->setBrush(colorGroup().background());
+ p->setBrush(tqcolorGroup().background());
else
p->setBrush(_colors[number-1]);
p->setPen(NoPen);
@@ -128,7 +128,7 @@ void PiecesTable::paintCell(TQPainter *p, int row, int col)
// draw borders
if (height() > 40) {
- p->setPen(colorGroup().text());
+ p->setPen(tqcolorGroup().text());
if(col < numCols()-1)
p->drawLine(x2, 0, x2, y2); // right border line
@@ -198,14 +198,14 @@ void PiecesTable::randomizeMap()
}
}
}
- repaint();
+ tqrepaint();
_randomized = true;
}
void PiecesTable::resetMap()
{
initMap();
- repaint();
+ tqrepaint();
}
void PiecesTable::checkwin()
@@ -225,7 +225,7 @@ void PiecesTable::mousePressEvent(TQMouseEvent* e)
{
QtTableView::mousePressEvent(e);
- if (e->button() == RightButton) {
+ if (e->button() == Qt::RightButton) {
// execute RMB popup and check result
_menu->exec(mapToGlobal(e->pos()));
e->accept();
@@ -235,7 +235,7 @@ void PiecesTable::mousePressEvent(TQMouseEvent* e)
// GAME LOGIC
// find the free position
- int pos = _map.find(15);
+ int pos = _map.tqfind(15);
if(pos < 0) return;
int frow = pos / numCols();