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
v3.5.13-sru
tpearson 13 years ago
parent 8d92c3c2a4
commit a1bd60b348

@ -152,7 +152,7 @@ Amor::Amor() : DCOPObject( "AmorIface" ), TQObject()
TQT_SLOT(slotMouseClicked(const TQPoint &)));
connect(mAmor, TQT_SIGNAL(dragged(const TQPoint &, bool)),
TQT_SLOT(slotWidgetDragged(const TQPoint &, bool)));
mAmor->resize(mTheme.maximumSize());
mAmor->resize(mTheme.tqmaximumSize());
mTimer = new TQTimer(this);
connect(mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()));
@ -288,7 +288,7 @@ void Amor::reset()
mPosition = mCurrAnim->hotspot().x();
mState = Normal;
mAmor->resize(mTheme.maximumSize());
mAmor->resize(mTheme.tqmaximumSize());
mCurrAnim->reset();
mTimer->start(0, true);
@ -562,14 +562,14 @@ void Amor::restack()
#endif
Window sibling = mTargetWin;
Window dw, parent = None, *wins;
Window dw, tqparent = None, *wins;
do {
unsigned int nwins = 0;
// We must use the target window's parent as our sibling.
// Is there a faster way to get parent window than XQueryTree?
if (XQueryTree(qt_xdisplay(), sibling, &dw, &parent, &wins, &nwins))
// We must use the target window's tqparent as our sibling.
// Is there a faster way to get tqparent window than XQueryTree?
if (XQueryTree(qt_xdisplay(), sibling, &dw, &tqparent, &wins, &nwins))
{
if (nwins)
{
@ -577,9 +577,9 @@ void Amor::restack()
}
}
if (parent != None && parent != dw )
sibling = parent;
} while ( parent != None && parent != dw );
if (tqparent != None && tqparent != dw )
sibling = tqparent;
} while ( tqparent != None && tqparent != dw );
// Set animation's stacking order to be above the window manager's
// decoration of target window.
@ -748,7 +748,7 @@ void Amor::slotOffsetChanged(int off)
//
void Amor::slotAbout()
{
TQString about = i18n("Amor Version %1\n\n").arg(AMOR_VERSION) +
TQString about = i18n("Amor Version %1\n\n").tqarg(AMOR_VERSION) +
i18n("Amusing Misuse Of Resources\n\n") +
i18n("Copyright (c) 1999 Martin R. Jones <mjones@kde.org>\n\n") +
i18n("Original Author: Martin R. Jones <mjones@kde.org>\n") +

@ -55,7 +55,7 @@ public:
QueueItem(itemType ty, TQString te, int ti = -1);
itemType type() { return iType; }
QString text() { return iText; };
TQString text() { return iText; };
int time() { return iTime; };
void setTime(int newTime) { if (iTime > 0) iTime = newTime; };
@ -73,6 +73,7 @@ private:
class Amor : public TQObject, virtual public AmorIface
{
Q_OBJECT
TQ_OBJECT
public:
Amor();
virtual ~Amor();
@ -150,9 +151,10 @@ private:
//---------------------------------------------------------------------------
class AmorSessionWidget : public QWidget
class AmorSessionWidget : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
AmorSessionWidget();
~AmorSessionWidget() {};

@ -170,7 +170,7 @@ bool AmorThemeManager::setTheme(const TQString & file)
else
{
// relative to config file.
mPath.truncate(mPath.findRev('/')+1);
mPath.truncate(mPath.tqfindRev('/')+1);
mPath += pixmapPath;
}
@ -195,7 +195,7 @@ AmorAnim *AmorThemeManager::random(const TQString & group)
if (mStatic)
grp = "Base";
AmorAnimationGroup *animGroup = mAnimations.find(grp);
AmorAnimationGroup *animGroup = mAnimations.tqfind(grp);
if (animGroup) {
int idx = kapp->random()%animGroup->count();
@ -227,7 +227,7 @@ bool AmorThemeManager::readGroup(const TQString & seq)
mConfig->setGroup(list.at(i));
AmorAnim *anim = new AmorAnim(*mConfig);
animList->append(anim);
mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize());
mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize());
}
// If no animations were available for this group, just add the base anim
@ -238,7 +238,7 @@ bool AmorThemeManager::readGroup(const TQString & seq)
if (anim)
{
animList->append(anim);
mMaximumSize = mMaximumSize.expandedTo(anim->maximumSize());
mMaximumSize = mMaximumSize.expandedTo(anim->tqmaximumSize());
entries++;
}
}

@ -59,7 +59,7 @@ public:
{ return (mCurrent < mSequence.count()); }
int totalMovement() const
{ return mTotalMovement; }
TQSize maximumSize() const
TQSize tqmaximumSize() const
{ return mMaximumSize; }
int delay() const
@ -103,7 +103,7 @@ public:
AmorAnim *random(const TQString & group);
TQSize maximumSize() const { return mMaximumSize; }
TQSize tqmaximumSize() const { return mMaximumSize; }
protected:
TQString mPath;

@ -55,8 +55,8 @@ AmorBubble::AmorBubble()
mBrowser->setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); // too long to fit in one line?
TQColorGroup clgrp = mBrowser->colorGroup();
clgrp.setColor(TQColorGroup::Text, Qt::black);
TQColorGroup clgrp = mBrowser->tqcolorGroup();
clgrp.setColor(TQColorGroup::Text, TQt::black);
//Laurent TQTextBrowser didn't have this function FIX me
//mBrowser->setPaperColorGroup( clgrp );
mBrowser->setPaper( TQToolTip::palette().active().brush( TQColorGroup::Background ) );
@ -83,12 +83,12 @@ AmorBubble::~AmorBubble()
//---------------------------------------------------------------------------
//
// Set the message to display in the bubble. Causes the geometry of the
// Set the message to display in the bubble. Causes the tqgeometry of the
// widget to be recalculated.
//
void AmorBubble::setMessage(const TQString& message)
{
mMessage = TQString( "<html>%1</html>" ).arg( message );
mMessage = TQString( "<html>%1</html>" ).tqarg( message );
// hacks because heightForWidth() doesn't work.
setGeometry( -1000, 0, 300, 1000 );
show();
@ -99,7 +99,7 @@ void AmorBubble::setMessage(const TQString& message)
//---------------------------------------------------------------------------
//
// Calculates the size, position and mask of the bubble
// Calculates the size, position and tqmask of the bubble
//
void AmorBubble::calcGeometry()
{
@ -108,7 +108,7 @@ void AmorBubble::calcGeometry()
mBound.setHeight( mBrowser->contentsHeight() );
mBound.moveBy(ARROW_WIDTH+BORDER_SIZE, BORDER_SIZE);
// initialise the default geometry of the bubble
// initialise the default tqgeometry of the bubble
int w = mBound.width() + BORDER_SIZE * 2 + ARROW_WIDTH;
int h = mBound.height() + BORDER_SIZE * 2;
int xpos = mOriginX + BUBBLE_OFFSET;
@ -141,13 +141,13 @@ void AmorBubble::calcGeometry()
setGeometry(xpos, ypos, w, h);
mBrowser->setGeometry( mBound );
// create and apply the shape mask
// create and apply the tqshape tqmask
mMask.resize(w, h);
mMask.fill(color0);
TQPainter maskPainter(&mMask);
maskPainter.setPen(color1);
maskPainter.setBrush(color1);
drawBubble(maskPainter);
TQPainter tqmaskPainter(&mMask);
tqmaskPainter.setPen(color1);
tqmaskPainter.setBrush(color1);
drawBubble(tqmaskPainter);
XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0,
mMask.handle(), ShapeSet );
}
@ -195,7 +195,7 @@ void AmorBubble::drawBubble(TQPainter &p)
p.drawPolygon(pointArray);
p.setPen(pen);
p.drawPolyline(pointArray, 0, 3);
p.tqdrawPolyline(pointArray, 0, 3);
}
//---------------------------------------------------------------------------

@ -40,11 +40,12 @@ class TQTimer;
//---------------------------------------------------------------------------
//
// AmorBubble displays a message in a shaped window
// AmorBubble displays a message in a tqshaped window
//
class AmorBubble : public QWidget
class AmorBubble : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
AmorBubble();
virtual ~AmorBubble();
@ -69,7 +70,7 @@ protected:
int mOriginX; // X origin of bubble arrow
int mOriginY; // Y origin of bubble arrow
TQRect mBound; // bounds of the text
TQBitmap mMask; // shape mask
TQBitmap mMask; // tqshape tqmask
VertPos mArrowVert; // vertical position of the arrow
HorzPos mArrowHorz; // horizontal position of the arrow
TQTextBrowser *mBrowser; // displays the message

@ -74,7 +74,7 @@ AmorDialog::AmorDialog()
label = new TQLabel(i18n("Offset:"), offsetBox);
TQSlider *slider = new TQSlider(-40, 40, 5, mConfig.mOffset,
TQSlider::Vertical, offsetBox);
Qt::Vertical, offsetBox);
connect(slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotOffset(int)));
// Always on top
@ -84,7 +84,7 @@ AmorDialog::AmorDialog()
checkBox = new TQCheckBox(i18n("Show random tips"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTips(bool)));
checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the QList would not be grayed when it should
checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the TQList would not be grayed when it should
checkBox = new TQCheckBox(i18n("Use a random character"), mainwidget);
connect(checkBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotRandomTheme(bool)));
@ -275,7 +275,7 @@ void AmorListBoxItem::paint( TQPainter *p )
int AmorListBoxItem::height(const TQListBox *lb ) const
{
return QMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 );
return TQMAX( mPixmap.height(), lb->fontMetrics().lineSpacing() + 1 );
}
int AmorListBoxItem::width(const TQListBox *lb ) const

@ -41,6 +41,7 @@
class AmorDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
AmorDialog();
@ -86,7 +87,7 @@ protected:
//
// AmorListBoxItem implements a list box items for selection of themes
//
class AmorListBoxItem : public QListBoxItem
class AmorListBoxItem : public TQListBoxItem
{
public:
AmorListBoxItem(const TQString & s, const TQPixmap& p)

@ -56,7 +56,7 @@ AmorPixmapManager::~AmorPixmapManager()
//
const TQPixmap *AmorPixmapManager::load(const TQString & img)
{
TQPixmap *pixmap = mPixmaps.find(img);
TQPixmap *pixmap = mPixmaps.tqfind(img);
if (!pixmap)
{

@ -50,7 +50,7 @@ public:
{ mPixmapDir = "."; mPixmaps.clear(); }
const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const TQString & img) const
{ return mPixmaps.find(img); }
{ return mPixmaps.tqfind(img); }
static AmorPixmapManager *manager();

@ -103,11 +103,11 @@ bool AmorTips::readKTips()
const TQRegExp rx("\\n+");
int pos = -1;
while ((pos = content.find("<html>", pos + 1, false)) != -1)
while ((pos = content.tqfind("<html>", pos + 1, false)) != -1)
{
TQString tip = content
.mid(pos + 6, content.find("</html>", pos, false) - pos - 6)
.replace(rx, "\n");
.mid(pos + 6, content.tqfind("</html>", pos, false) - pos - 6)
.tqreplace(rx, "\n");
if (!tip.endsWith("\n"))
tip += "\n";
if (tip.startsWith("\n"))

@ -60,11 +60,11 @@ void AmorWidget::setPixmap(const TQPixmap *pixmap)
if (mPixmap)
{
if (mPixmap->mask())
if (mPixmap->tqmask())
{
XShapeCombineMask( x11Display(), winId(), ShapeBounding, 0, 0,
mPixmap->mask()->handle(), ShapeSet );
repaint(false);
mPixmap->tqmask()->handle(), ShapeSet );
tqrepaint(false);
}
update();
@ -98,7 +98,7 @@ void AmorWidget::mousePressEvent(TQMouseEvent *me)
//
void AmorWidget::mouseMoveEvent(TQMouseEvent *me)
{
if ( me->state() == LeftButton ) {
if ( me->state() == Qt::LeftButton ) {
if ( !dragging && (clickPos-me->globalPos()).manhattanLength() > 3 )
dragging = true;
if ( dragging ) {
@ -116,7 +116,7 @@ void AmorWidget::mouseReleaseEvent(TQMouseEvent *me)
{
if ( dragging )
emit dragged( me->globalPos() - clickPos, true );
else if ( me->state() == RightButton )
else if ( me->state() == Qt::RightButton )
emit mouseClicked(clickPos);
clickPos = TQPoint();

@ -36,11 +36,12 @@
//---------------------------------------------------------------------------
//
// AmorWidget displays a shaped pixmap
// AmorWidget displays a tqshaped pixmap
//
class AmorWidget : public QWidget
class AmorWidget : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
AmorWidget();
virtual ~AmorWidget();

@ -33,17 +33,17 @@
extern "C"
{
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("keyesapplet");
EyesApplet *applet = new EyesApplet(configFile, KPanelApplet::Normal, 0, parent, "keyesapplet");
EyesApplet *applet = new EyesApplet(configFile, KPanelApplet::Normal, 0, tqparent, "keyesapplet");
return applet;
}
}
EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name)
: KPanelApplet( configFile, t, actions, parent, name )
TQWidget *tqparent, const char *name)
: KPanelApplet( configFile, t, actions, tqparent, name )
{
setWFlags(WNoAutoErase);
setBackgroundOrigin(AncestorOrigin);
@ -55,11 +55,11 @@ EyesApplet::EyesApplet(const TQString& configFile, Type t, int actions,
int EyesApplet::widthForHeight(int h) const
{
return static_cast<int>(1.4 * h); // rectangular shape.
return static_cast<int>(1.4 * h); // rectangular tqshape.
}
int EyesApplet::heightForWidth(int w) const
{
return static_cast<int>(w / 1.4); // rectangular shape.
return static_cast<int>(w / 1.4); // rectangular tqshape.
}
void EyesApplet::resizeEvent( TQResizeEvent*e )
@ -133,7 +133,7 @@ void EyesApplet::drawPupils(TQPainter* p)
oldMouse = mapFromGlobal(TQCursor::pos());
mouse = oldMouse * AAFACTOR;
int tmp = QMIN(h, w)/6;
int tmp = TQMIN(h, w)/6;
// left pupil
vect.setX(mouse.x() - h / 4);
@ -152,7 +152,7 @@ void EyesApplet::drawPupils(TQPainter* p)
if(pos != oldleft) {
int sizeEye=QMIN(h,w)/6;
int sizeEye=TQMIN(h,w)/6;
// // draw over old pos
// p->setPen(TQPen(NoPen));
@ -185,7 +185,7 @@ void EyesApplet::drawPupils(TQPainter* p)
if(pos != oldright) {
int sizeEye=QMIN(h,w)/6;
int sizeEye=TQMIN(h,w)/6;
// // draw over old pos
// p->setPen(TQPen(NoPen));

@ -25,10 +25,11 @@
class EyesApplet : public KPanelApplet
{
Q_OBJECT
TQ_OBJECT
public:
EyesApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
TQWidget *tqparent = 0, const char *name = 0);
int widthForHeight(int height) const;
int heightForWidth(int width) const;

@ -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();

@ -35,9 +35,10 @@ class KAboutData;
class PiecesTable : public QtTableView
{
Q_OBJECT
TQ_OBJECT
public:
PiecesTable(TQWidget* parent = 0, const char* name = 0);
PiecesTable(TQWidget* tqparent = 0, const char* name = 0);
TQPopupMenu* popup() { return _menu; }
protected:
@ -66,10 +67,11 @@ private:
class FifteenApplet : public KPanelApplet
{
Q_OBJECT
TQ_OBJECT
public:
FifteenApplet(const TQString& configFile, Type t = Stretch, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
TQWidget *tqparent = 0, const char *name = 0);
int widthForHeight(int height) const;
int heightForWidth(int width) const;

@ -7,14 +7,14 @@
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file contains a class moved out of the Qt GUI Toolkit API. It
** This file contains a class moved out of the TQt GUI Toolkit API. It
** may be used, distributed and modified without limitation.
**
**********************************************************************/
#include "qttableview.h"
#include "qttableview.moc"
#ifndef QT_NO_QTTABLEVIEW
#ifndef TQT_NO_TQTTABLEVIEW
#include "tqscrollbar.h"
#include "tqpainter.h"
#include "tqdrawutil.h"
@ -34,19 +34,19 @@ enum ScrollBarDirtyFlags {
};
#define HSBEXT horizontalScrollBar()->sizeHint().height()
#define VSBEXT verticalScrollBar()->sizeHint().width()
#define HSBEXT horizontalScrollBar()->tqsizeHint().height()
#define VSBEXT verticalScrollBar()->tqsizeHint().width()
class QCornerSquare : public QWidget // internal class
class QCornerSquare : public TQWidget // internal class
{
public:
QCornerSquare( TQWidget *, const char* = 0 );
void paintEvent( TQPaintEvent * );
};
QCornerSquare::QCornerSquare( TQWidget *parent, const char *name )
: TQWidget( parent, name )
QCornerSquare::QCornerSquare( TQWidget *tqparent, const char *name )
: TQWidget( tqparent, name )
{
}
@ -88,7 +88,7 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
used by functions such as setXOffset() or maxYOffset().
\i The \e widget coordinates. (0,0) is the top-left corner of the widget,
\e including the frame. They are used by functions such as repaint().
\e including the frame. They are used by functions such as tqrepaint().
\i The \e view coordinates. (0,0) is the top-left corner of the view, \e
excluding the frame. This is the least-used coordinate system; it is used by
@ -119,13 +119,13 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
it easy to have child widgets inside tables, which QtTableView
doesn't support at all.
\sa QScrollView
\sa TQScrollView
\link guibooks.html#fowler GUI Design Handbook: Table\endlink
*/
/*!
Constructs a table view. The \a parent, \a name and \f arguments
Constructs a table view. The \a tqparent, \a name and \f arguments
are passed to the TQFrame constructor.
The \link setTableFlags() table flags\endlink are all cleared (set to 0).
@ -135,7 +135,7 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
The \link setCellHeight() cell height\endlink and \link setCellWidth()
cell width\endlink are set to 0.
Frame line shapes (TQFrame::HLink and TQFrame::VLine) are disallowed;
Frame line tqshapes (TQFrame::HLink and TQFrame::VLine) are disallowed;
see TQFrame::setFrameStyle().
Note that the \a f argument is \e not \link setTableFlags() table
@ -144,8 +144,8 @@ void QCornerSquare::paintEvent( TQPaintEvent * )
*/
QtTableView::QtTableView( TQWidget *parent, const char *name, WFlags f )
: TQFrame( parent, name, f )
QtTableView::QtTableView( TQWidget *tqparent, const char *name, WFlags f )
: TQFrame( tqparent, name, f )
{
nRows = nCols = 0; // zero rows/cols
xCellOffs = yCellOffs = 0; // zero offset
@ -207,7 +207,7 @@ void QtTableView::show()
/*!
\overload void QtTableView::repaint( bool erase )
\overload void QtTableView::tqrepaint( bool erase )
Repaints the entire view.
*/
@ -221,16 +221,16 @@ void QtTableView::show()
If \a w is negative, it is replaced with <code>width() - x</code>.
If \a h is negative, it is replaced with <code>height() - y</code>.
Doing a repaint() usually is faster than doing an update(), but
Doing a tqrepaint() usually is faster than doing an update(), but
calling update() many times in a row will generate a single paint
event.
At present, QtTableView is the only widget that reimplements \link
TQWidget::repaint() repaint()\endlink. It does this because by
clearing and then repainting one cell at at time, it can make the
TQWidget::tqrepaint() tqrepaint()\endlink. It does this because by
clearing and then tqrepainting one cell at at time, it can make the
screen flicker less than it would otherwise. */
void QtTableView::repaint( int x, int y, int w, int h, bool erase )
void QtTableView::tqrepaint( int x, int y, int w, int h, bool erase )
{
if ( !isVisible() || testWState(WState_BlockUpdates) )
return;
@ -249,7 +249,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
}
/*!
\overload void QtTableView::repaint( const TQRect &r, bool erase )
\overload void QtTableView::tqrepaint( const TQRect &r, bool erase )
Replaints rectangle \a r. If \a erase is TRUE draws the background
using the palette's background.
*/
@ -265,7 +265,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
Sets the number of rows of the table to \a rows (must be non-negative).
Does not change topCell().
The table repaints itself automatically if autoUpdate() is set.
The table tqrepaints itself automatically if autoUpdate() is set.
\sa numCols(), setNumCols(), numRows()
*/
@ -273,7 +273,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase )
void QtTableView::setNumRows( int rows )
{
if ( rows < 0 ) {
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::setNumRows: (%s) Negative argument %d.",
name( "unnamed" ), rows );
#endif
@ -288,7 +288,7 @@ void QtTableView::setNumRows( int rows )
nRows = rows;
if ( autoUpdate() && isVisible() &&
( oldLastVisible != lastRowVisible() || oldTopCell != topCell() ) )
repaint( oldTopCell != topCell() );
tqrepaint( oldTopCell != topCell() );
} else {
// Be more careful - if destructing, bad things might happen.
nRows = rows;
@ -307,7 +307,7 @@ void QtTableView::setNumRows( int rows )
Sets the number of columns of the table to \a cols (must be non-negative).
Does not change leftCell().
The table repaints itself automatically if autoUpdate() is set.
The table tqrepaints itself automatically if autoUpdate() is set.
\sa numCols(), numRows(), setNumRows()
*/
@ -315,7 +315,7 @@ void QtTableView::setNumRows( int rows )
void QtTableView::setNumCols( int cols )
{
if ( cols < 0 ) {
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::setNumCols: (%s) Negative argument %d.",
name( "unnamed" ), cols );
#endif
@ -328,7 +328,7 @@ void QtTableView::setNumCols( int cols )
if ( autoUpdate() && isVisible() ) {
int maxCol = lastColVisible();
if ( maxCol >= oldCols || maxCol >= nCols )
repaint();
tqrepaint();
}
updateScrollBars( horRange );
updateFrameSize();
@ -580,7 +580,7 @@ void QtTableView::setCellWidth( int cellWidth )
{
if ( cellW == cellWidth )
return;
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
if ( cellWidth < 0 || cellWidth > SHRT_MAX ) {
qWarning( "QtTableView::setCellWidth: (%s) Argument out of range (%d)",
name( "unnamed" ), cellWidth );
@ -591,7 +591,7 @@ void QtTableView::setCellWidth( int cellWidth )
updateScrollBars( horSteps | horRange );
if ( autoUpdate() && isVisible() )
repaint();
tqrepaint();
}
@ -634,7 +634,7 @@ void QtTableView::setCellHeight( int cellHeight )
{
if ( cellH == cellHeight )
return;
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
if ( cellHeight < 0 || cellHeight > SHRT_MAX ) {
qWarning( "QtTableView::setCellHeight: (%s) Argument out of range (%d)",
name( "unnamed" ), cellHeight );
@ -643,7 +643,7 @@ void QtTableView::setCellHeight( int cellHeight )
#endif
cellH = (short)cellHeight;
if ( autoUpdate() && isVisible() )
repaint();
tqrepaint();
updateScrollBars( verSteps | verRange );
}
@ -717,7 +717,7 @@ int QtTableView::totalHeight()
Sets the table flags to \a f.
If a flag setting changes the appearance of the table, the table is
repainted if - and only if - autoUpdate() is TRUE.
tqrepainted if - and only if - autoUpdate() is TRUE.
The table flags are mostly single bits, though there are some multibit
flags for convenience. Here is a complete list:
@ -786,7 +786,7 @@ void QtTableView::setTableFlags( uint f )
bool updateOn = autoUpdate();
setAutoUpdate( FALSE );
uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
uint tqrepaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
if ( f & Tbl_vScrollBar ) {
setVerScrollBar( TRUE );
@ -817,15 +817,15 @@ void QtTableView::setTableFlags( uint f )
(f & Tbl_snapToVGrid) != 0 && yCellDelta != 0 ) {
snapToGrid( (f & Tbl_snapToHGrid) != 0, // do snapping
(f & Tbl_snapToVGrid) != 0 );
repaintMask |= Tbl_snapToGrid; // repaint table
tqrepaintMask |= Tbl_snapToGrid; // tqrepaint table
}
}
if ( updateOn ) {
setAutoUpdate( TRUE );
updateScrollBars();
if ( isVisible() && (f & repaintMask) )
repaint();
if ( isVisible() && (f & tqrepaintMask) )
tqrepaint();
}
}
@ -852,7 +852,7 @@ void QtTableView::clearTableFlags( uint f )
bool updateOn = autoUpdate();
setAutoUpdate( FALSE );
uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
uint tqrepaintMask = Tbl_cutCellsV | Tbl_cutCellsH;
if ( f & Tbl_vScrollBar ) {
setVerScrollBar( FALSE );
@ -864,7 +864,7 @@ void QtTableView::clearTableFlags( uint f )
int maxX = maxXOffset();
if ( xOffs > maxX ) {
setOffset( maxX, yOffs );
repaintMask |= Tbl_scrollLastHCell;
tqrepaintMask |= Tbl_scrollLastHCell;
}
updateScrollBars( horRange );
}
@ -872,7 +872,7 @@ void QtTableView::clearTableFlags( uint f )
int maxY = maxYOffset();
if ( yOffs > maxY ) {
setOffset( xOffs, maxY );
repaintMask |= Tbl_scrollLastVCell;
tqrepaintMask |= Tbl_scrollLastVCell;
}
updateScrollBars( verRange );
}
@ -881,7 +881,7 @@ void QtTableView::clearTableFlags( uint f )
(f & Tbl_smoothVScrolling) != 0 && yCellDelta != 0 ) {
snapToGrid( (f & Tbl_smoothHScrolling) != 0, // do snapping
(f & Tbl_smoothVScrolling) != 0 );
repaintMask |= Tbl_smoothScrolling; // repaint table
tqrepaintMask |= Tbl_smoothScrolling; // tqrepaint table
}
}
if ( f & Tbl_snapToHGrid ) {
@ -893,8 +893,8 @@ void QtTableView::clearTableFlags( uint f )
if ( updateOn ) {
setAutoUpdate( TRUE );
updateScrollBars(); // returns immediately if nothing to do
if ( isVisible() && (f & repaintMask) )
repaint();
if ( isVisible() && (f & tqrepaintMask) )
tqrepaint();
}
}
@ -916,20 +916,20 @@ void QtTableView::clearTableFlags( uint f )
automatically whenever it has changed in some way (for example, when a
\link setTableFlags() flag\endlink is changed).
If \a enable is FALSE, the view does NOT repaint itself or update
If \a enable is FALSE, the view does NOT tqrepaint itself or update
its internal state variables when it is changed. This can be
useful to avoid flicker during large changes and is singularly
useless otherwise. Disable auto-update, do the changes, re-enable
auto-update and call repaint().
auto-update and call tqrepaint().
\warning Do not leave the view in this state for a long time
(i.e., between events). If, for example, the user interacts with the
view when auto-update is off, strange things can happen.
Setting auto-update to TRUE does not repaint the view; you must call
repaint() to do this.
Setting auto-update to TRUE does not tqrepaint the view; you must call
tqrepaint() to do this.
\sa autoUpdate(), repaint()
\sa autoUpdate(), tqrepaint()
*/
void QtTableView::setAutoUpdate( bool enable )
@ -948,7 +948,7 @@ void QtTableView::setAutoUpdate( bool enable )
Repaints the cell at row \a row, column \a col if it is inside the view.
If \a erase is TRUE, the relevant part of the view is cleared to the
background color/pixmap before the contents are repainted.
background color/pixmap before the contents are tqrepainted.
\sa isVisible()
*/
@ -963,7 +963,7 @@ void QtTableView::updateCell( int row, int col, bool erase )
TQRect uR = TQRect( xPos, yPos,
cellW ? cellW : cellWidth(col),
cellH ? cellH : cellHeight(row) );
repaint( uR.intersect(viewRect()), erase );
tqrepaint( uR.intersect(viewRect()), erase );
}
@ -1266,7 +1266,7 @@ void QtTableView::setupPainter( TQPainter * )
/*!
Handles paint events, \a e, for the table view.
Calls paintCell() for the cells that needs to be repainted.
Calls paintCell() for the cells that needs to be tqrepainted.
*/
void QtTableView::paintEvent( TQPaintEvent *e )
@ -1280,7 +1280,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
TQPainter paint( this );
if ( !contentsRect().contains( updateR, TRUE ) ) {// update frame ?
if ( !contentsRect().tqcontains( updateR, TRUE ) ) {// update frame ?
drawFrame( &paint );
if ( updateR.left() < frameWidth() ) //###
updateR.setLeft( frameWidth() );
@ -1315,7 +1315,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
TQRect winR = viewRect();
TQRect cellR;
TQRect cellUR;
#ifndef QT_NO_TRANSFORMATIONS
#ifndef TQT_NO_TRANSFORMATIONS
TQWMatrix matrix;
#endif
@ -1339,11 +1339,11 @@ void QtTableView::paintEvent( TQPaintEvent *e )
if ( eraseInPaint )
paint.eraseRect( cellUR );
#ifndef QT_NO_TRANSFORMATIONS
#ifndef TQT_NO_TRANSFORMATIONS
matrix.translate( xPos, yPos );
paint.setWorldMatrix( matrix );
if ( testTableFlags(Tbl_clipCellPainting) ||
frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt
frameWidth() > 0 && !winR.tqcontains( cellR ) ) { //##arnt
paint.setClipRect( cellUR );
paintCell( &paint, row, col );
paint.setClipping( FALSE );
@ -1355,7 +1355,7 @@ void QtTableView::paintEvent( TQPaintEvent *e )
#else
paint.translate( xPos, yPos );
if ( testTableFlags(Tbl_clipCellPainting) ||
frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt
frameWidth() > 0 && !winR.tqcontains( cellR ) ) { //##arnt
paint.setClipRect( cellUR );
paintCell( &paint, row, col );
paint.setClipping( FALSE );
@ -1379,13 +1379,13 @@ void QtTableView::paintEvent( TQPaintEvent *e )
// Note that this needs to be done regardless whether we do
// eraseInPaint or not. Reason: a subclass may implement
// flicker-freeness and encourage the use of repaint(FALSE).
// flicker-freeness and encourage the use of tqrepaint(FALSE).
// The subclass, however, cannot draw all pixels, just those
// inside the cells. So QtTableView is reponsible for all pixels
// outside the cells.
TQRect viewR = viewRect();
const TQColorGroup g = colorGroup();
const TQColorGroup g = tqcolorGroup();
if ( xPos <= maxX ) {
TQRect r = viewR;
@ -1414,8 +1414,8 @@ void QtTableView::resizeEvent( TQResizeEvent * )
verSteps | verGeometry | verRange );
showOrHideScrollBars();
updateFrameSize();
int maxX = QMIN( xOffs, maxXOffset() ); // ### can be slow
int maxY = QMIN( yOffs, maxYOffset() );
int maxX = TQMIN( xOffs, maxXOffset() ); // ### can be slow
int maxY = TQMIN( yOffs, maxYOffset() );
setOffset( maxX, maxY );
}
@ -1426,7 +1426,7 @@ void QtTableView::resizeEvent( TQResizeEvent * )
void QtTableView::updateView()
{
repaint( viewRect() );
tqrepaint( viewRect() );
}
/*!
@ -1439,14 +1439,14 @@ TQScrollBar *QtTableView::verticalScrollBar() const
{
QtTableView *that = (QtTableView*)this; // semantic const
if ( !vScrollBar ) {
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Vertical, that );
#ifndef QT_NO_CURSOR
TQScrollBar *sb = new TQScrollBar( Qt::Vertical, that );
#ifndef TQT_NO_CURSOR
sb->setCursor( arrowCursor );
#endif
sb->resize( sb->sizeHint() ); // height is irrelevant
sb->resize( sb->tqsizeHint() ); // height is irrelevant
Q_CHECK_PTR(sb);
sb->setTracking( FALSE );
sb->setFocusPolicy( NoFocus );
sb->setFocusPolicy( TQ_NoFocus );
connect( sb, TQT_SIGNAL(valueChanged(int)),
TQT_SLOT(verSbValue(int)));
connect( sb, TQT_SIGNAL(sliderMoved(int)),
@ -1470,12 +1470,12 @@ TQScrollBar *QtTableView::horizontalScrollBar() const
{
QtTableView *that = (QtTableView*)this; // semantic const
if ( !hScrollBar ) {
TQScrollBar *sb = new TQScrollBar( TQScrollBar::Horizontal, that );
#ifndef QT_NO_CURSOR
TQScrollBar *sb = new TQScrollBar( Qt::Horizontal, that );
#ifndef TQT_NO_CURSOR
sb->setCursor( arrowCursor );
#endif
sb->resize( sb->sizeHint() ); // width is irrelevant
sb->setFocusPolicy( NoFocus );
sb->resize( sb->tqsizeHint() ); // width is irrelevant
sb->setFocusPolicy( TQ_NoFocus );
Q_CHECK_PTR(sb);
sb->setTracking( FALSE );
connect( sb, TQT_SIGNAL(valueChanged(int)),
@ -1522,7 +1522,7 @@ void QtTableView::setHorScrollBar( bool on, bool update )
else
sbDirty = sbDirty | verMask;
if ( hideScrollBar && isVisible() )
repaint( hScrollBar->x(), hScrollBar->y(),
tqrepaint( hScrollBar->x(), hScrollBar->y(),
width() - hScrollBar->x(), hScrollBar->height() );
}
if ( update )
@ -1561,7 +1561,7 @@ void QtTableView::setVerScrollBar( bool on, bool update )
else
sbDirty = sbDirty | horMask;
if ( hideScrollBar && isVisible() )
repaint( vScrollBar->x(), vScrollBar->y(),
tqrepaint( vScrollBar->x(), vScrollBar->y(),
vScrollBar->width(), height() - vScrollBar->y() );
}
if ( update )
@ -1579,7 +1579,7 @@ int QtTableView::findRawRow( int yPos, int *cellMaxY, int *cellMinY,
return r;
if ( goOutsideView || yPos >= minViewY() && yPos <= maxViewY() ) {
if ( yPos < minViewY() ) {
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::findRawRow: (%s) internal error: "
"yPos < minViewY() && goOutsideView "
"not supported. (%d,%d)",
@ -1626,7 +1626,7 @@ int QtTableView::findRawCol( int xPos, int *cellMaxX, int *cellMinX ,
return c;
if ( goOutsideView || xPos >= minViewX() && xPos <= maxViewX() ) {
if ( xPos < minViewX() ) {
#if defined(QT_CHECK_RANGE)
#if defined(TQT_CHECK_RANGE)
qWarning( "QtTableView::findRawCol: (%s) internal error: "
"xPos < minViewX() && goOutsideView "
"not supported. (%d,%d)",
@ -1995,7 +1995,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & horSteps ) {
if ( cellW )
hScrollBar->setSteps( QMIN(cellW,viewWidth()/2), viewWidth() );
hScrollBar->setSteps( TQMIN(cellW,viewWidth()/2), viewWidth() );
else
hScrollBar->setSteps( 16, viewWidth() );
}
@ -2006,7 +2006,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & horValue )
hScrollBar->setValue( xOffs );
// show scrollbar only when it has a sane geometry
// show scrollbar only when it has a sane tqgeometry
if ( !hScrollBar->isVisible() )
hScrollBar->show();
}
@ -2019,7 +2019,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & verSteps ) {
if ( cellH )
vScrollBar->setSteps( QMIN(cellH,viewHeight()/2), viewHeight() );
vScrollBar->setSteps( TQMIN(cellH,viewHeight()/2), viewHeight() );
else
vScrollBar->setSteps( 16, viewHeight() ); // fttb! ###
}
@ -2030,7 +2030,7 @@ void QtTableView::updateScrollBars( uint f )
if ( sbDirty & verValue )
vScrollBar->setValue( yOffs );
// show scrollbar only when it has a sane geometry
// show scrollbar only when it has a sane tqgeometry
if ( !vScrollBar->isVisible() )
vScrollBar->show();
}
@ -2061,9 +2061,9 @@ void QtTableView::updateFrameSize()
setFrameRect( TQRect(0,0,rw,rh) );
if ( rw != fw )
update( QMIN(fw,rw) - frameWidth() - 2, 0, frameWidth()+4, rh );
update( TQMIN(fw,rw) - frameWidth() - 2, 0, frameWidth()+4, rh );
if ( rh != fh )
update( 0, QMIN(fh,rh) - frameWidth() - 2, rw, frameWidth()+4 );
update( 0, TQMIN(fh,rh) - frameWidth() - 2, rw, frameWidth()+4 );
}
}
@ -2253,7 +2253,7 @@ void QtTableView::showOrHideScrollBars()
Call this function when the table view's total size is changed;
typically because the result of cellHeight() or cellWidth() have changed.
This function does not repaint the widget.
This function does not tqrepaint the widget.
*/
void QtTableView::updateTableSize()

@ -7,38 +7,39 @@
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file contains a class moved out of the Qt GUI Toolkit API. It
** This file contains a class moved out of the TQt GUI Toolkit API. It
** may be used, distributed and modified without limitation.
**
**********************************************************************/
#ifndef QTTABLEVIEW_H
#define QTTABLEVIEW_H
#ifndef TQTTABLEVIEW_H
#define TQTTABLEVIEW_H
#ifndef QT_H
#ifndef TQT_H
#include "tqframe.h"
#endif // QT_H
#endif // TQT_H
#ifndef QT_NO_QTTABLEVIEW
#ifndef TQT_NO_TQTTABLEVIEW
class TQScrollBar;
class QCornerSquare;
class QtTableView : public QFrame
class QtTableView : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
virtual void setBackgroundColor( const TQColor & );
virtual void setPalette( const TQPalette & );
void show();
void repaint( bool erase=TRUE );
void repaint( int x, int y, int w, int h, bool erase=TRUE );
void repaint( const TQRect &, bool erase=TRUE );
void tqrepaint( bool erase=TRUE );
void tqrepaint( int x, int y, int w, int h, bool erase=TRUE );
void tqrepaint( const TQRect &, bool erase=TRUE );
protected:
QtTableView( TQWidget *parent=0, const char *name=0, WFlags f=0 );
QtTableView( TQWidget *tqparent=0, const char *name=0, WFlags f=0 );
~QtTableView();
int numRows() const;
@ -78,8 +79,8 @@ protected:
void updateCell( int row, int column, bool erase=TRUE );
QRect cellUpdateRect() const;
QRect viewRect() const;
TQRect cellUpdateRect() const;
TQRect viewRect() const;
int lastRowVisible() const;
int lastColVisible() const;
@ -162,14 +163,14 @@ private:
uint inSbUpdate : 1;
uint tFlags;
QRect cellUpdateR;
TQRect cellUpdateR;
TQScrollBar *vScrollBar;
TQScrollBar *hScrollBar;
QCornerSquare *cornerSquare;
private: // Disabled copy constructor and operator=
#if defined(Q_DISABLE_COPY)
#if defined(TQ_DISABLE_COPY)
QtTableView( const QtTableView & );
QtTableView &operator=( const QtTableView & );
#endif
@ -236,16 +237,16 @@ inline TQRect QtTableView::cellUpdateRect() const
inline bool QtTableView::autoUpdate() const
{ return isUpdatesEnabled(); }
inline void QtTableView::repaint( bool erase )
{ repaint( 0, 0, width(), height(), erase ); }
inline void QtTableView::tqrepaint( bool erase )
{ tqrepaint( 0, 0, width(), height(), erase ); }
inline void QtTableView::repaint( const TQRect &r, bool erase )
{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); }
inline void QtTableView::tqrepaint( const TQRect &r, bool erase )
{ tqrepaint( r.x(), r.y(), r.width(), r.height(), erase ); }
inline void QtTableView::updateScrollBars()
{ updateScrollBars( 0 ); }
#endif // QT_NO_QTTABLEVIEW
#endif // TQT_NO_TQTTABLEVIEW
#endif // QTTABLEVIEW_H
#endif // TQTTABLEVIEW_H

@ -53,18 +53,18 @@ const char *description = I18N_NOOP("Moon Phase Indicator for KDE");
extern "C"
{
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile)
KDE_EXPORT KPanelApplet *init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kmoon");
return new MoonPAWidget(configFile, KPanelApplet::Normal,
KPanelApplet::About|KPanelApplet::Preferences,
parent, "kmoonapplet");
tqparent, "kmoonapplet");
}
}
MoonPAWidget::MoonPAWidget(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
TQWidget *tqparent, const char *name)
: KPanelApplet(configFile, type, actions, tqparent, name)
{
KConfig *config = KGlobal::config();
config->setGroup("General");
@ -104,7 +104,7 @@ void MoonPAWidget::showAbout()
KStdGuiItem::ok() );
TQPixmap ret = DesktopIcon("kmoon");
TQString text = i18n(description) + TQString::fromLatin1("\n\n") +
TQString text = i18n(description) + TQString::tqfromLatin1("\n\n") +
i18n("Written by Stephan Kulow <coolo@kde.org>\n"
"\n"
"Made an applet by M G Berberich "
@ -118,12 +118,12 @@ void MoonPAWidget::showAbout()
dialog->setIcon(ret);
KMessageBox::createKMessageBox(dialog, ret, text, TQStringList(), TQString::null, 0, KMessageBox::Notify);
KMessageBox::createKMessageBox(dialog, ret, text, TQStringList(), TQString(), 0, KMessageBox::Notify);
}
void MoonPAWidget::settings()
{
KMoonDlg dlg(moon->angle(), moon->northHemi(), moon->mask(),
KMoonDlg dlg(moon->angle(), moon->northHemi(), moon->tqmask(),
this, "moondlg");
if (dlg.exec() == KMoonDlg::Accepted) {
moon->setAngle(dlg.getAngle());
@ -133,10 +133,10 @@ void MoonPAWidget::settings()
config->setGroup("General");
config->writeEntry("Rotation", moon->angle());
config->writeEntry("Northern", moon->northHemi());
config->writeEntry("Mask", moon->mask());
config->writeEntry("Mask", moon->tqmask());
config->sync();
}
repaint();
tqrepaint();
}
void MoonPAWidget::timerEvent( TQTimerEvent * )
@ -144,8 +144,8 @@ void MoonPAWidget::timerEvent( TQTimerEvent * )
time_t clock;
time(&clock);
struct tm *t = localtime(&clock);
moon->calcStatus(mktime(t));
moon->repaint();
moon->calctqStatus(mktime(t));
moon->tqrepaint();
}
void MoonPAWidget::mousePressEvent( TQMouseEvent *e)
@ -153,11 +153,11 @@ void MoonPAWidget::mousePressEvent( TQMouseEvent *e)
if (!popup)
return;
if (e->button() == RightButton) {
if (e->button() == Qt::RightButton) {
popup->popup(mapToGlobal(e->pos()));
popup->exec();
}
if (e->button() == LeftButton) {
if (e->button() == Qt::LeftButton) {
showAbout();
}
}

@ -37,10 +37,11 @@ class MoonWidget;
class MoonPAWidget : public KPanelApplet
{
Q_OBJECT
TQ_OBJECT
public:
MoonPAWidget(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
TQWidget *tqparent = 0, const char *name = 0);
~MoonPAWidget();
int widthForHeight(int height) const { return height; }

@ -29,9 +29,9 @@
#include "kmoondlg.h"
#include "kmoonwidget.h"
KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *parent, const char *name)
: KDialogBase(parent, name, true, i18n("Change View"),
Ok|Cancel|Help), angle(a), north(n), mask(m)
KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *tqparent, const char *name)
: KDialogBase(tqparent, name, true, i18n("Change View"),
Ok|Cancel|Help), angle(a), north(n), tqmask(m)
{
TQWidget *page = new TQWidget( this );
setMainWidget(page);
@ -71,11 +71,11 @@ KMoonDlg::KMoonDlg(int a, bool n, bool m, TQWidget *parent, const char *name)
connect(hemitoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleHemi()));
masktoggle = new TQPushButton(hbox2);
masktoggle->setText(mask ? i18n("Switch Masking Off") :
tqmasktoggle = new TQPushButton(hbox2);
tqmasktoggle->setText(tqmask ? i18n("Switch Masking Off") :
i18n("Switch Masking On"));
connect(masktoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleMask()));
connect(tqmasktoggle, TQT_SIGNAL(clicked()), TQT_SLOT(toggleMask()));
topLayout->addWidget(vbox);
moon = new MoonWidget(page, "preview");
@ -94,7 +94,7 @@ void KMoonDlg::angleChanged(int value) {
}
void KMoonDlg::help() {
kapp->invokeHelp(TQString::fromLatin1("config"));
kapp->invokeHelp(TQString::tqfromLatin1("config"));
}
void KMoonDlg::toggleHemi() {
@ -105,9 +105,9 @@ void KMoonDlg::toggleHemi() {
}
void KMoonDlg::toggleMask() {
moon->setMask(!moon->mask());
mask = moon->mask();
masktoggle->setText(mask ? i18n("Switch Masking Off") :
moon->setMask(!moon->tqmask());
tqmask = moon->tqmask();
tqmasktoggle->setText(tqmask ? i18n("Switch Masking Off") :
i18n("Switch Masking On"));
}

@ -29,21 +29,22 @@ class TQPushButton;
class KMoonDlg : public KDialogBase {
Q_OBJECT
TQ_OBJECT
public:
KMoonDlg(int angle, bool north, bool mask, TQWidget *parent, const char *name);
KMoonDlg(int angle, bool north, bool tqmask, TQWidget *tqparent, const char *name);
int getAngle() const { return angle; }
bool getNorthHemi() const { return north; }
bool getMask() const { return mask; }
bool getMask() const { return tqmask; }
private:
TQSlider *slider;
MoonWidget *moon;
int angle;
bool north;
bool mask;
bool tqmask;
TQPushButton *hemitoggle;
TQPushButton *masktoggle;
TQPushButton *tqmasktoggle;
private slots:
void help();

@ -50,8 +50,8 @@
extern double moonphasebylunation(int lun, int phi);
extern time_t JDtoDate(double jd, struct tm *event_date);
MoonWidget::MoonWidget(TQWidget *parent, const char *name)
: TQWidget(parent, name)
MoonWidget::MoonWidget(TQWidget *tqparent, const char *name)
: TQWidget(tqparent, name)
{
struct tm * t;
time_t clock;
@ -61,23 +61,23 @@ MoonWidget::MoonWidget(TQWidget *parent, const char *name)
config->setGroup("General");
_angle = config->readNumEntry("Rotation", 0);
_north = config->readBoolEntry("Northern", true);
_mask = config->readBoolEntry("Mask", true);
_tqmask = config->readBoolEntry("Mask", true);
old_angle = old_w = old_h = old_counter = -1;
old_north = false;
old_mask = false;
old_tqmask = false;
startTimer(1000 * 60 * 20);
time(&clock);
t = gmtime(&clock);
// kdDebug() << "time " << t->tm_isdst << " " << timezone << " " << daylight << endl ;
calcStatus(mktime(t));
calctqStatus(mktime(t));
}
MoonWidget::~MoonWidget()
{
}
void MoonWidget::calcStatus( time_t time )
void MoonWidget::calctqStatus( time_t time )
{
uint lun = 0;
time_t last_new = 0;
@ -217,17 +217,17 @@ void MoonWidget::calcStatus( time_t time )
}
renderGraphic();
repaint();
tqrepaint();
}
TQImage MoonWidget::loadMoon(int index)
{
if (index == 0) // the new moon has the wrong filename
index = 29;
TQString filename = TQString("kmoon/pics/moon%1.png").arg(index);
TQString filename = TQString("kmoon/pics/moon%1.png").tqarg(index);
TQString path = locate("data", filename);
if (path.isNull())
kdFatal() << "cound't find " << filename << ". Exiting.\n";
kdFatal() << "cound't tqfind " << filename << ". Exiting.\n";
TQImage image(path);
KIconEffect iconeffect;
image=iconeffect.apply(image, KIcon::Panel, KIcon::DefaultState);
@ -238,21 +238,21 @@ void MoonWidget::setAngle(int value)
{
_angle = value;
renderGraphic();
repaint();
tqrepaint();
}
void MoonWidget::setNorthHemi(bool n)
{
_north = n;
renderGraphic();
repaint();
tqrepaint();
}
void MoonWidget::setMask(bool value)
{
_mask = value;
_tqmask = value;
renderGraphic();
repaint();
tqrepaint();
}
void MoonWidget::paintEvent(TQPaintEvent *)
@ -263,7 +263,7 @@ void MoonWidget::paintEvent(TQPaintEvent *)
void MoonWidget::resizeEvent(TQResizeEvent *)
{
renderGraphic();
repaint();
tqrepaint();
}
void MoonWidget::renderGraphic()
@ -280,7 +280,7 @@ void MoonWidget::renderGraphic()
im = im.convertDepth(32, 0);
assert(!im.isNull());
int mw = QMIN(width(), height());
int mw = TQMIN(width(), height());
TQImage dest;
if (TQPixmap::defaultDepth() > 8) {
@ -300,7 +300,7 @@ void MoonWidget::renderGraphic()
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p;
p.begin(&pixmap);
p.fillRect(0, 0, dmw, dmw, Qt::black);
p.fillRect(0, 0, dmw, dmw, TQt::black);
p.setClipRegion(r);
p.drawPixmap(0, 0, rotated, (rotated.width() - dmw) / 2,
(rotated.height() - dmw) / 2,
@ -311,41 +311,41 @@ void MoonWidget::renderGraphic()
im = pixmap.convertToImage();
dest = im.copy(0, 0, mw, mw);
for (int y = 0; y < mw; y++) {
QRgb *destline = (QRgb*)dest.scanLine(y);
QRgb *sourceline1 = (QRgb*)im.scanLine(2*y);
QRgb *sourceline2 = (QRgb*)im.scanLine(2*y + 1);
TQRgb *destline = (TQRgb*)dest.scanLine(y);
TQRgb *sourceline1 = (TQRgb*)im.scanLine(2*y);
TQRgb *sourceline2 = (TQRgb*)im.scanLine(2*y + 1);
for (int x = 0; x < mw; x++) {
int r = qRed(sourceline1[2*x]) + qRed(sourceline1[2*x+1]);
r = r + qRed(sourceline2[2*x]) + qRed(sourceline2[2*x+1]);
int g = qGreen(sourceline1[2*x]) + qGreen(sourceline1[2*x+1]);
g = g + qGreen(sourceline2[2*x]) + qGreen(sourceline2[2*x+1]);
int b = qBlue(sourceline1[2*x]) + qBlue(sourceline1[2*x+1]);
b = b + qBlue(sourceline2[2*x]) + qBlue(sourceline2[2*x+1]);
destline[x] = qRgb(qRound(r / 4), qRound(g / 4),
qRound(b / 4));
int r = tqRed(sourceline1[2*x]) + tqRed(sourceline1[2*x+1]);
r = r + tqRed(sourceline2[2*x]) + tqRed(sourceline2[2*x+1]);
int g = tqGreen(sourceline1[2*x]) + tqGreen(sourceline1[2*x+1]);
g = g + tqGreen(sourceline2[2*x]) + tqGreen(sourceline2[2*x+1]);
int b = tqBlue(sourceline1[2*x]) + tqBlue(sourceline1[2*x+1]);
b = b + tqBlue(sourceline2[2*x]) + tqBlue(sourceline2[2*x+1]);
destline[x] = tqRgb(tqRound(r / 4), tqRound(g / 4),
tqRound(b / 4));
}
}
} else {
dest = im.smoothScale(mw, mw).convertDepth(32);
}
if (_mask) {
if (_tqmask) {
// generate alpha-channel
int dmw = mw*2;
TQBitmap dMask(dmw, dmw);
TQRegion r(TQRect(0, 0, dmw, dmw), TQRegion::Ellipse);
TQPainter p;
p.begin(&dMask);
p.fillRect(0, 0, dmw, dmw, Qt::white);
p.fillRect(0, 0, dmw, dmw, TQt::white);
p.setClipRegion(r);
p.fillRect(0, 0, dmw, dmw, Qt::black);
p.fillRect(0, 0, dmw, dmw, TQt::black);
p.end();
TQImage Mask2 = dMask.convertToImage().convertDepth(32).smoothScale(mw, mw);
TQImage Mask2 = TQImage(dMask.convertToImage()).convertDepth(32).smoothScale(mw, mw);
dest.setAlphaBuffer(true);
for (int y = 0; y < mw; y++) {
QRgb *destline = (QRgb*)dest.scanLine(y);
QRgb *sourceline = (QRgb*)Mask2.scanLine(y);
TQRgb *destline = (TQRgb*)dest.scanLine(y);
TQRgb *sourceline = (TQRgb*)Mask2.scanLine(y);
for (int x = 0; x < mw; x++) {
destline[x] = (destline[x] & RGB_MASK)|(qRed(sourceline[x]) << 24);
destline[x] = (destline[x] & TQRGB_MASK)|(tqRed(sourceline[x]) << 24);
}
}
}

@ -28,15 +28,16 @@
#include <ksystemtray.h>
class TQPopupMenu;
class MoonWidget : public QWidget
class MoonWidget : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
MoonWidget(TQWidget *parent = 0, const char *name = 0);
MoonWidget(TQWidget *tqparent = 0, const char *name = 0);
~MoonWidget();
void calcStatus( time_t time );
void calctqStatus( time_t time );
int angle() const { return _angle; }
void setAngle(int angle);
@ -44,14 +45,14 @@ public:
bool northHemi() const { return _north; }
void setNorthHemi(bool b);
bool mask() const { return _mask; }
bool tqmask() const { return _tqmask; }
void setMask(bool b);
protected:
int old_w, old_h;
int counter, old_counter;
int _angle, old_angle;
int _mask, old_mask;
int _tqmask, old_tqmask;
bool old_north, _north;
TQPixmap pixmap;

@ -166,9 +166,9 @@ double torad(double x)
** since the New Moon of 2000 January 6.
**
** int phi: another phase parameter, selecting the phase of the
** moon. 0 = New, 1 = First Qtr, 2 = Full, 3 = Last Qtr
** moon. 0 = New, 1 = First TQtr, 2 = Full, 3 = Last TQtr
**
** Return: Apparent JD of the needed phase
** Return: Aptqparent JD of the needed phase
*/
#include <stdio.h>

@ -25,12 +25,12 @@
#include "kimagenumber.h"
KImageNumber::KImageNumber(const TQString& font, TQWidget* parent,const char* name) :
TQFrame(parent,name),
KImageNumber::KImageNumber(const TQString& font, TQWidget* tqparent,const char* name) :
TQFrame(tqparent,name),
m_value(0)
{
fontPix = new TQPixmap(font);
resize(sizeHint());
resize(tqsizeHint());
}
KImageNumber::~KImageNumber()
@ -47,7 +47,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
data.sprintf("%06.1f", m_value);
for(unsigned int i=0; i < data.length(); i++) {
int wl = data.at(i).latin1() - '0';
int wl = data.tqat(i).latin1() - '0';
if(data.at(i) == '.')
wl = 10;
bitBlt(this, i*each, 0, fontPix, wl*each, 0, each, fontPix->height());
@ -57,7 +57,7 @@ void KImageNumber::paintEvent(TQPaintEvent*)
void KImageNumber::setValue(double v)
{
m_value = v;
repaint(false);
tqrepaint(false);
}
double KImageNumber::value() const
@ -65,7 +65,7 @@ double KImageNumber::value() const
return m_value;
}
TQSize KImageNumber::sizeHint() const
TQSize KImageNumber::tqsizeHint() const
{
int w = fontPix->width();
int each = w/11;

@ -29,17 +29,18 @@
#include <tqframe.h>
#include <tqpixmap.h>
class KImageNumber : public QFrame
class KImageNumber : public TQFrame
{
Q_OBJECT
Q_PROPERTY( double m_value READ value WRITE setValue )
TQ_OBJECT
TQ_PROPERTY( double m_value READ value WRITE setValue )
public:
KImageNumber(const TQString& font, TQWidget* parent=0, const char* name=0);
KImageNumber(const TQString& font, TQWidget* tqparent=0, const char* name=0);
virtual ~KImageNumber();
void paintEvent(TQPaintEvent*);
virtual TQSize sizeHint() const;
virtual TQSize tqsizeHint() const;
double value() const;
public slots:

@ -42,8 +42,8 @@ static struct conversionEntry ConversionTable[MAX_UNIT] = {
* Note that we use installEventFilter on the two KImageNumber's
* to make clicks on them bring up the context-menu.
*/
Kodometer::Kodometer(TQWidget* parent, const char* name)
: TQFrame(parent, name),
Kodometer::Kodometer(TQWidget* tqparent, const char* name)
: TQFrame(tqparent, name),
dontRefresh(false),
speed(0.0),
lastDistance(0.0),
@ -121,7 +121,7 @@ Kodometer::Kodometer(TQWidget* parent, const char* name)
}
/*
* Now I'm not really sure what this does. I assume its here to find
* Now I'm not really sure what this does. I assume its here to tqfind
* all the displays on your system, and measure them. During the mouse
* tracking phase, we use the information stored here to determine how
* far the mouse moved on a given screen.
@ -156,9 +156,9 @@ void Kodometer::FindAllScreens(void)
vPixelsPerMM = (double)Dh / (double)DhMM;
hPixelsPerMM = (double)Dw / (double)DwMM;
screenInfo[i].PixelsPerMM = (vPixelsPerMM + hPixelsPerMM) / 2.0;
// kdDebug() << " Vertical pixels/mm are " << vPixelsPerMM <<
// kdDebug() << " Qt::Vertical pixels/mm are " << vPixelsPerMM <<
// "mm" << endl;
// kdDebug() << " Horizontal pixels/mm are " << hPixelsPerMM <<
// kdDebug() << " Qt::Horizontal pixels/mm are " << hPixelsPerMM <<
// "mm" << endl;
// kdDebug() << " Average pixels/mm are " <<
// screenInfo[i].PixelsPerMM << "mm" << endl;
@ -389,12 +389,12 @@ int Kodometer::CalcDistance(void)
case K_Left:
case K_Top:
finalScreen = 0;
j = QMAX(pointerScreen,lastPointerScreen) - 1;
j = TQMAX(pointerScreen,lastPointerScreen) - 1;
increment = -1;
break;
case K_Right:
case K_Bottom:
finalScreen = QMAX(pointerScreen,lastPointerScreen) - 1;
finalScreen = TQMAX(pointerScreen,lastPointerScreen) - 1;
j = 0;
increment = 1;
break;

@ -89,9 +89,10 @@ typedef struct conversionEntry {
int printPrecision;
} conversionEntry;
class Kodometer : public QFrame
class Kodometer : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
Kodometer(TQWidget* = 0, const char* = 0);

@ -15,24 +15,24 @@ TQString int2time(int time)
{
TQString str;
if (time / 60)
str.append(i18n("%1 min").arg(time / 60));
str.append(i18n("%1 min").tqarg(time / 60));
if (time % 60)
if (str.isEmpty())
str.append(i18n("%1 s").arg(time % 60));
str.append(i18n("%1 s").tqarg(time % 60));
else
str.append(i18n(" %1 s").arg(time % 60));
str.append(i18n(" %1 s").tqarg(time % 60));
return str;
}
TeaListItem::TeaListItem(TQListView * parent)
:TQListViewItem(parent)
TeaListItem::TeaListItem(TQListView * tqparent)
:TQListViewItem(tqparent)
{
}
TeaListItem::TeaListItem(TQListView * parent, TQListViewItem *after)
:TQListViewItem(parent, after)
TeaListItem::TeaListItem(TQListView * tqparent, TQListViewItem *after)
:TQListViewItem(tqparent, after)
{
}

@ -14,12 +14,12 @@ class TQListView;
class TQListViewItem;
class TeaListItem : public QListViewItem
class TeaListItem : public TQListViewItem
{
public:
TeaListItem(TQListView *parent);
TeaListItem(TQListView *parent, TQListViewItem *after);
TeaListItem(TQListView *tqparent);
TeaListItem(TQListView *tqparent, TQListViewItem *after);
~TeaListItem();
int time();

@ -13,8 +13,8 @@
#include "timeedit.h"
#include "timeedit.moc"
WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *parent, const char *name)
: TQSpinBox(minValue, maxValue, step, parent, name)
WrappingSpinBox::WrappingSpinBox(int minValue, int maxValue, int step, TQWidget *tqparent, const char *name)
: TQSpinBox(minValue, maxValue, step, tqparent, name)
{
}
@ -49,27 +49,27 @@ void WrappingSpinBox::stepDown()
// -------------------------------------------------------------------------
TimeEdit::TimeEdit(TQWidget* parent, const char* name)
: TQWidget(parent, name)
TimeEdit::TimeEdit(TQWidget* tqparent, const char* name)
: TQWidget(tqparent, name)
{
layout = new TQHBoxLayout(this);
tqlayout = new TQHBoxLayout(this);
minuteBox = new TQSpinBox(0, 300, 1, this);
// minuteBox->setFixedSize(minuteBox->sizeHint());
// minuteBox->setFixedSize(minuteBox->tqsizeHint());
TQLabel* min = new TQLabel(i18n(" min"), this);
min->setFixedSize(min->sizeHint());
min->setFixedSize(min->tqsizeHint());
secondBox = new WrappingSpinBox(0, 59, 1, this);
secondBox->setWrapping(true);
// secondBox->setFixedSize(secondBox->sizeHint());
// secondBox->setFixedSize(secondBox->tqsizeHint());
TQLabel* sec = new TQLabel(i18n(" sec"),this);
sec->setFixedSize(sec->sizeHint());
sec->setFixedSize(sec->tqsizeHint());
layout->addWidget(minuteBox);
layout->addWidget(min);
tqlayout->addWidget(minuteBox);
tqlayout->addWidget(min);
layout->addWidget(secondBox);
layout->addWidget(sec);
tqlayout->addWidget(secondBox);
tqlayout->addWidget(sec);
connect(minuteBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );
connect(secondBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)) );

@ -18,12 +18,13 @@ class TQBoxLayout;
* @short A spinbox that wraps around after reaching minValue resp. maxValue.
* @author Daniel Teske
*/
class WrappingSpinBox : public QSpinBox
class WrappingSpinBox : public TQSpinBox
{
Q_OBJECT
TQ_OBJECT
public:
WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *parent=0, const char *name=0);
WrappingSpinBox(int minValue, int maxValue, int step = 1, TQWidget *tqparent=0, const char *name=0);
~WrappingSpinBox();
void stepUp();
@ -39,12 +40,13 @@ signals:
* @short A widget for entering a timeout in minutes and seconds.
* @author Daniel Teske
*/
class TimeEdit : public QWidget
class TimeEdit : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
TimeEdit(TQWidget* parent = 0, const char* name = 0);
TimeEdit(TQWidget* tqparent = 0, const char* name = 0);
~TimeEdit();
void setValue(int value);
@ -65,7 +67,7 @@ signals:
protected:
TQSpinBox *minuteBox;
WrappingSpinBox *secondBox;
TQBoxLayout* layout;
TQBoxLayout* tqlayout;
};
#endif

@ -118,13 +118,13 @@ TopLevel::TopLevel() : KSystemTray()
startAct = new KAction(i18n("&Start"), "1rightarrow", 0,
this, TQT_SLOT(start()), actionCollection(), "start");
TQT_TQOBJECT(this), TQT_SLOT(start()), actionCollection(), "start");
stopAct = new KAction(i18n("Sto&p"), "cancel", 0,
this, TQT_SLOT(stop()), actionCollection(), "stop");
TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "stop");
confAct = new KAction(i18n("&Configure..."), "configure", 0,
this, TQT_SLOT(config()), actionCollection(), "configure");
TQT_TQOBJECT(this), TQT_SLOT(config()), actionCollection(), "configure");
anonAct = new KAction(i18n("&Anonymous..."), 0, 0,
this, TQT_SLOT(anonymous()), actionCollection(), "anonymous");
TQT_TQOBJECT(this), TQT_SLOT(anonymous()), actionCollection(), "anonymous");
// KAction *quitAct = actionCollection()->action("file_quit");
// create app menu (displayed on right-click)
@ -198,7 +198,7 @@ TopLevel::~TopLevel()
delete menu;
delete steeping_menu;
delete start_menu;
// FIXME: must delete more (like all the QWidgets in config-window)?
// FIXME: must delete more (like all the TQWidgets in config-window)?
}
void TopLevel::resizeEvent ( TQResizeEvent * )
@ -207,13 +207,13 @@ void TopLevel::resizeEvent ( TQResizeEvent * )
teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width());
teaAnim1Pixmap = loadSizedIcon("tea_anim1", width());
teaAnim2Pixmap = loadSizedIcon("tea_anim2", width());
repaint();
tqrepaint();
}
/** Handle mousePressEvent */
void TopLevel::mousePressEvent(TQMouseEvent *event)
{
if (event->button() == LeftButton) {
if (event->button() == Qt::LeftButton) {
if (ready) {
stop(); // reset tooltip and stop animation
} else {
@ -222,7 +222,7 @@ void TopLevel::mousePressEvent(TQMouseEvent *event)
else
start_menu->popup(TQCursor::pos());
}
} else if (event->button() == RightButton)
} else if (event->button() == Qt::RightButton)
menu->popup(TQCursor::pos());
// else if (event->button() == MidButton) // currently unused
}
@ -251,19 +251,19 @@ void TopLevel::paintEvent(TQPaintEvent *)
// overlay pie chart onto tray icon
TQPixmap base(*pm); // make copy of base pixmap
if (useTrayVis && running) {
// extend mask
TQBitmap mask = *(base.mask());
TQPainter pm(&mask);
pm.setBrush(Qt::color1); // fill with "foreground-colour"
pm.setPen(Qt::NoPen); // no border needed/wanted
// extend tqmask
TQBitmap tqmask = *(base.tqmask());
TQPainter pm(&tqmask);
pm.setBrush(TQt::color1); // fill with "foreground-colour"
pm.setPen(TQt::NoPen); // no border needed/wanted
pm.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16); // full circle of small size
pm.drawPie(0, ((float) width()/(float) 2.44444444444), ((float) width()/(float) 1.69230769231), ((float) width()/(float) 1.69230769231), 90*16, percentDone*16); // pie part of big size
pm.end();
base.setMask(mask);
base.setMask(tqmask);
// draw pie chart
TQPainter px(&base);
px.setPen(TQPen(Qt::black, 0)); // black border
px.setPen(TQPen(TQt::black, 0)); // black border
px.setBrush(TQColor(192, 0, 0)); // red fill colour for small circle
px.drawPie(0+1, ((float) width()/(float) 2.44444444444)+1, (width()/2), (width()/2), 90*16, -360*16);
@ -302,14 +302,14 @@ void TopLevel::timerEvent(TQTimerEvent *)
menu->setItemChecked(current_selected, true);
}
TQString teaMessage = i18n("The %1 is now ready!").arg(current_name);
TQString teaMessage = i18n("The %1 is now ready!").tqarg(current_name);
// invoke action
if (useNotify) {
KNotifyClient::event(winId(), "tea", teaMessage);
}
if (useAction && (!action.isEmpty())) {
TQString cmd = action;
cmd.replace("%t", current_name);
cmd.tqreplace("%t", current_name);
system(TQFile::encodeName(cmd));
}
if (usePopup)
@ -317,7 +317,7 @@ void TopLevel::timerEvent(TQTimerEvent *)
teaMessage, teaAnim1Pixmap, this, "popup", 0);
// FIXME: does auto-deletion work without timeout?
setToolTip(teaMessage);
repaint();
tqrepaint();
} else {
// timer not yet run out; just update tray-icon (if configured)...
if (useTrayVis) {
@ -325,18 +325,18 @@ void TopLevel::timerEvent(TQTimerEvent *)
if (pDone - percentDone > 8) {
// update icon not every second, but only if somewhat noticable
percentDone = pDone;
repaint();
tqrepaint();
}
}
// ...and Tooltip
TQString min = int2time(seconds);
setToolTip(i18n("%1 left for %2").arg(min).arg(current_name));
setToolTip(i18n("%1 left for %2").tqarg(min).tqarg(current_name));
}
} else {
// no tea is steeping; just animate icon
if (ready) {
firstFrame = !firstFrame;
repaint();
tqrepaint();
}
}
}
@ -440,21 +440,21 @@ void TopLevel::start()
}
// else both are already defined by dialog handler
killTimers();
TQT_TQOBJECT(this)->killTimers();
startTimer(1000); // 1000ms = 1s (sufficient resolution)
running = true;
ready = false;
enable_menuEntries(); // disable "start", enable "stop"
repaint();
tqrepaint();
}
}
/* menu-slot: "stop" selected in menu */
void TopLevel::stop()
{
killTimers();
TQT_TQOBJECT(this)->killTimers();
running = false;
ready = false;
@ -467,7 +467,7 @@ void TopLevel::stop()
}
setToolTip(i18n("The Tea Cooker"), true);
repaint();
tqrepaint();
}
/* open dialog to start an 'anonymous' tea */
@ -487,10 +487,10 @@ void TopLevel::anonymous()
prop_box->addWidget(propright);
anon_time = new TimeEdit(propright);
anon_time->setFixedHeight(anon_time->sizeHint().height());
anon_time->setFixedHeight(anon_time->tqsizeHint().height());
anon_time->setValue(DEFAULT_TEA_TIME);
TQLabel *l = new TQLabel(anon_time, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint());
l->setFixedSize(l->tqsizeHint());
top_box->addStretch();
@ -670,7 +670,7 @@ void TopLevel::config()
/* left side - tea list and list-modifying buttons */
TQBoxLayout *leftside = new TQVBoxLayout(box);
TQGroupBox *listgroup = new TQGroupBox(2, Vertical, i18n("Tea List"), page);
TQGroupBox *listgroup = new TQGroupBox(2,Qt::Vertical, i18n("Tea List"), page);
leftside->addWidget(listgroup, 0, 0);
listbox = new TQListView(listgroup, "listBox");
@ -685,31 +685,31 @@ void TopLevel::config()
TQWidget *listgroup_widget = new TQWidget(listgroup);
TQBoxLayout *hbox = new TQHBoxLayout(listgroup_widget);
hbox->setSpacing(4);
btn_new = new TQPushButton(TQString::null, listgroup_widget);
btn_new = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_new, i18n("New"));
btn_new->setPixmap(SmallIcon("filenew"));
btn_new->setMinimumSize(btn_new->sizeHint() * 1.2);
btn_new->setMinimumSize(btn_new->tqsizeHint() * 1.2);
connect(btn_new, TQT_SIGNAL(clicked()), TQT_SLOT(newButtonClicked()));
hbox->addWidget(btn_new);
btn_del = new TQPushButton(TQString::null, listgroup_widget);
btn_del = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_del, i18n("Delete"));
btn_del->setIconSet(SmallIconSet("editdelete"));
btn_del->setMinimumSize(btn_new->sizeHint() * 1.2);
btn_del->setMinimumSize(btn_new->tqsizeHint() * 1.2);
connect(btn_del, TQT_SIGNAL(clicked()), TQT_SLOT(delButtonClicked()));
hbox->addWidget(btn_del);
btn_up = new TQPushButton(TQString::null, listgroup_widget);
btn_up = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_up, i18n("Up"));
btn_up->setIconSet(SmallIconSet("up"));
btn_up->setMinimumSize(btn_up->sizeHint() * 1.2);
btn_up->setMinimumSize(btn_up->tqsizeHint() * 1.2);
connect(btn_up, TQT_SIGNAL(clicked()), TQT_SLOT(upButtonClicked()));
hbox->addWidget(btn_up);
btn_down = new TQPushButton(TQString::null, listgroup_widget);
btn_down = new TQPushButton(TQString(), listgroup_widget);
TQToolTip::add(btn_down, i18n("Down"));
btn_down->setIconSet(SmallIconSet("down"));
btn_down->setMinimumSize(btn_down->sizeHint() * 1.2);
btn_down->setMinimumSize(btn_down->tqsizeHint() * 1.2);
connect(btn_down, TQT_SIGNAL(clicked()), TQT_SLOT(downButtonClicked()));
hbox->addWidget(btn_down);
@ -717,29 +717,29 @@ void TopLevel::config()
/* right side - tea properties */
TQBoxLayout *rightside = new TQVBoxLayout(box);
editgroup = new TQGroupBox(2, Vertical, i18n("Tea Properties"), page);
editgroup = new TQGroupBox(2,Qt::Vertical, i18n("Tea Properties"), page);
rightside->addWidget(editgroup, 0, 0);
TQHBox *propbox = new TQHBox(editgroup);
// FIXME: - must enforce correct vertical alignment of each label-editor pair
// FIXME: - must enforce correct vertical tqalignment of each label-editor pair
// (better use one HBox for each label-editor pair?)
TQVBox *propleft = new TQVBox(propbox);
TQVBox *propright = new TQVBox(propbox);
nameEdit = new TQLineEdit(propright);
nameEdit->setFixedHeight(nameEdit->sizeHint().height());
nameEdit->setAlignment(TQLineEdit::AlignLeft);
nameEdit->setFixedHeight(nameEdit->tqsizeHint().height());
nameEdit->tqsetAlignment(TQLineEdit::AlignLeft);
TQLabel *l = new TQLabel(nameEdit, i18n("Name:"), propleft);
l->setFixedSize(l->sizeHint());
l->setFixedSize(l->tqsizeHint());
connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(nameEditTextChanged(const TQString&)) );
timeEdit = new TimeEdit(propright);
timeEdit->setFixedHeight(timeEdit->sizeHint().height());
timeEdit->setFixedHeight(timeEdit->tqsizeHint().height());
l = new TQLabel(timeEdit, i18n("Tea time:"), propleft);
l->setFixedSize(l->sizeHint());
l->setFixedSize(l->tqsizeHint());
connect(timeEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(spinBoxValueChanged(int)));
/* bottom - timeout actions */
TQGroupBox *actiongroup = new TQGroupBox(4, Vertical, i18n("Action"), page);
TQGroupBox *actiongroup = new TQGroupBox(4,Qt::Vertical, i18n("Action"), page);
top_box->addWidget(actiongroup, 0, 0);
TQWidget *actionconf_widget = new TQWidget(actiongroup);
@ -751,15 +751,15 @@ void TopLevel::config()
eventEnable = new TQCheckBox(i18n("Event"), actiongroup);
popupEnable = new TQCheckBox(i18n("Popup"), actiongroup);
eventEnable->setFixedHeight(eventEnable->sizeHint().height());
popupEnable->setFixedHeight(popupEnable->sizeHint().height());
eventEnable->setFixedHeight(eventEnable->tqsizeHint().height());
popupEnable->setFixedHeight(popupEnable->tqsizeHint().height());
TQHBox *actionbox = new TQHBox(actiongroup);
actionEnable = new TQCheckBox(actionbox);
// FIXME: add text to this line:
// TQLabel *actionLabel = new TQLabel(i18n("Execute: "), actiongroup);
actionEdit = new TQLineEdit(actionbox);
actionEdit->setFixedHeight(actionEdit->sizeHint().height());
actionEdit->setFixedHeight(actionEdit->tqsizeHint().height());
TQToolTip::add(actionEdit, i18n("Enter command here; '%t' will be replaced with name of steeping tea"));
connect(actionEnable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(actionEnableToggled(bool)));
rightside->addStretch();
@ -776,7 +776,7 @@ void TopLevel::config()
}
// now add all defined teas (and their times) to the listview
// this is done backwards because QListViewItems are inserted at the top
// this is done backwards because TQListViewItems are inserted at the top
listbox->clear();
for (int i=teas.count()-1; i>=0; i--) {
TeaListItem *item = new TeaListItem(listbox);
@ -816,7 +816,7 @@ void TopLevel::config()
teas.clear();
// Copy over teas and times from the QListView
// Copy over teas and times from the TQListView
int i = 0;
teas.clear();
teas.resize(listbox->childCount());

@ -43,6 +43,7 @@ class TimeEdit;
class TopLevel : public KSystemTray
{
Q_OBJECT
TQ_OBJECT
public:

@ -43,8 +43,8 @@ extern "C"
//-----------------------------------------------------------------------------
KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
: TQDialog( parent, name, TRUE )
KSpriteSetup::KSpriteSetup( TQWidget *tqparent, const char *name )
: TQDialog( tqparent, name, TRUE )
{
KGlobal::locale()->insertCatalogue("ktux");
saver = 0;
@ -60,11 +60,11 @@ KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
tl1->addLayout(tl11);
TQLabel *label = new TQLabel( i18n("Speed:"), this );
label->setMinimumSize(label->sizeHint());
label->setMinimumSize(label->tqsizeHint());
tl11->addStretch(1);
tl11->addWidget(label);
TQSlider *sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, this );
TQSlider *sb = new TQSlider(0, 100, 10, speed, Qt::Horizontal, this );
tl11->addWidget(sb);
connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) );
@ -85,7 +85,7 @@ KSpriteSetup::KSpriteSetup( TQWidget *parent, const char *name )
button = bbox->addButton(KStdGuiItem::cancel());
connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) );
bbox->layout();
bbox->tqlayout();
tl->addWidget(bbox);
tl->freeze();
@ -203,7 +203,7 @@ void KSpriteSaver::initialise()
{
mCanvas = new TQCanvas();
TQPixmap pm( locate("sprite", "bg.png") );
mCanvas->setBackgroundPixmap( pm );
mCanvas->tqsetBackgroundPixmap( pm );
mCanvas->resize( width(), height() );
mView = new TQCanvasView(mCanvas);
mView->viewport()->setBackgroundColor( black );

@ -20,6 +20,7 @@
class KSpriteSaver : public KScreenSaver
{
Q_OBJECT
TQ_OBJECT
public:
KSpriteSaver( WId id );
virtual ~KSpriteSaver();
@ -38,19 +39,20 @@ protected:
virtual void timerEvent(TQTimerEvent *);
protected:
QCanvas *mCanvas;
QCanvasView *mView;
QTimer mTimer;
TQCanvas *mCanvas;
TQCanvasView *mView;
TQTimer mTimer;
int mSpeed;
TQPtrList<SpriteGroup> mGroups;
TQMemArray<int> mTimerIds;
};
class KSpriteSetup : public QDialog
class KSpriteSetup : public TQDialog
{
Q_OBJECT
TQ_OBJECT
public:
KSpriteSetup( TQWidget *parent = NULL, const char *name = NULL );
KSpriteSetup( TQWidget *tqparent = NULL, const char *name = NULL );
~KSpriteSetup();
protected:

@ -44,7 +44,7 @@ void SpriteObject::setBounds( int x1, int y1, int x2, int y2 )
bool SpriteObject::outOfBounds() const
{
bool in = mBound.contains( static_cast<int>(x()), static_cast<int>(y()) );
bool in = mBound.tqcontains( static_cast<int>(x()), static_cast<int>(y()) );
return !in;
}

@ -24,7 +24,7 @@
//
// SpriteObject stores the animations that create an object
//
class SpriteObject : public QCanvasSprite
class SpriteObject : public TQCanvasSprite
{
public:
SpriteObject(SpritePixmapSequence *seq, TQCanvas *c);
@ -39,7 +39,7 @@ protected:
int mCycle;
int mLifeSpan;
SpritePixmapSequence *mSeq;
QRect mBound;
TQRect mBound;
};
//---------------------------------------------------------------------------
@ -89,7 +89,7 @@ protected:
TQPtrList<SpriteObject> mActive;
int mCount;
SpriteRange mRefresh;
QCanvas *mCanvas;
TQCanvas *mCanvas;
};
#endif // SPRITEANIM_H

@ -29,7 +29,7 @@ int SpriteRange::random() const
void SpriteRange::set(const TQString &str)
{
int r = str.find("..");
int r = str.tqfind("..");
if (r > 0)
{

@ -39,7 +39,7 @@ SpritePixmapManager::~SpritePixmapManager()
//
const TQPixmap *SpritePixmapManager::load(const TQString & img)
{
TQPixmap *pixmap = mPixmaps.find(img);
TQPixmap *pixmap = mPixmaps.tqfind(img);
if (!pixmap)
{
@ -115,7 +115,7 @@ SpriteSequenceManager::~SpriteSequenceManager()
SpritePixmapSequence *SpriteSequenceManager::load(KConfigBase &config,
const TQString & name)
{
SpritePixmapSequence *sprite = mSprites.find(name);
SpritePixmapSequence *sprite = mSprites.tqfind(name);
if (!sprite)
{

@ -34,7 +34,7 @@ public:
{ mPixmapDir = "."; mPixmaps.clear(); }
const TQPixmap *load(const TQString & img);
const TQPixmap *pixmap(const char *img) const
{ return mPixmaps.find(img); }
{ return mPixmaps.tqfind(img); }
static SpritePixmapManager *manager();
@ -46,7 +46,7 @@ public:
//---------------------------------------------------------------------------
//
class SpritePixmapSequence : public QCanvasPixmapArray
class SpritePixmapSequence : public TQCanvasPixmapArray
{
public:
SpritePixmapSequence(TQPtrList<TQPixmap> pm, TQPtrList<TQPoint> hs, TQMemArray<int> d);
@ -69,7 +69,7 @@ public:
SpritePixmapSequence *load(KConfigBase &config, const TQString & name);
SpritePixmapSequence *sprite(const char *name)
{ return mSprites.find(name); }
{ return mSprites.tqfind(name); }
static SpriteSequenceManager *manager();

@ -30,8 +30,8 @@
#include <kglobalsettings.h>
#include <klocale.h>
dockwidget::dockwidget(const TQString &location, TQWidget *parent,
const char *name) : TQWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal )
dockwidget::dockwidget(const TQString &location, TQWidget *tqparent,
const char *name) : TQWidget(tqparent,name), m_locationCode( location ), m_orientation(Qt::Horizontal )
{
m_font = KGlobalSettings::generalFont();
setBackgroundOrigin( AncestorOrigin );
@ -112,19 +112,19 @@ void dockwidget::showWeather()
"<th><nobr>" + i18n( "Rel. Humidity:" ) + "</nobr></th><td><nobr>%4</nobr></td></nobr></tr>"
"<tr><th><nobr>" + i18n( "Wind Speed:" ) + "</nobr></th><td><nobr>%5</nobr></td>")
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity).arg(wind);
.tqarg(temp).tqarg(dewPoint).tqarg(pressure).tqarg(relHumidity).tqarg(wind);
if ( !heatIndex.isEmpty() )
tip += TQString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(heatIndex);
tip += TQString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").tqarg(heatIndex);
else if ( !windChill.isEmpty() )
tip += TQString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(windChill);
tip += TQString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").tqarg(windChill);
else
tip += "<td>&nbsp;</td><td>&nbsp;</td>";
tip += "</tr>";
tip += TQString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" +
"<th><nobr>" + i18n( "Sunset:" ) + "</nobr></th><td><nobr>%2</nobr></td>")
.arg(sunRiseTime).arg(sunSetTime);
.tqarg(sunRiseTime).tqarg(sunSetTime);
tip += "</tr></table>";
@ -182,14 +182,14 @@ void dockwidget::initDock()
TQBoxLayout *mainLayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom);
mainLayout->setSpacing(0);
mainLayout->setMargin(0);
mainLayout->addWidget(m_button, 0, Qt::AlignCenter);
mainLayout->addWidget(m_button, 0, TQt::AlignCenter);
TQBoxLayout *layout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom);
layout->setSpacing(0);
layout->setMargin(0);
layout->addWidget(m_lblTemp);
layout->addWidget(m_lblWind);
layout->addWidget(m_lblPres);
TQBoxLayout *tqlayout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom);
tqlayout->setSpacing(0);
tqlayout->setMargin(0);
tqlayout->addWidget(m_lblTemp);
tqlayout->addWidget(m_lblWind);
tqlayout->addWidget(m_lblPres);
mainLayout->addSpacing(8);
@ -204,27 +204,27 @@ void dockwidget::resizeView( const TQSize &size )
kdDebug(12004) << "Changing to size " << size << endl;
resize(size);
if ( m_orientation == Horizontal ) // Kicker in horizontal mode
if ( m_orientation ==Qt::Horizontal ) // Kicker in horizontal mode
{
int h = size.height();
if ( m_mode == ShowAll )
{
if ( h <= 128 ) // left to right layout
if ( h <= 128 ) // left to right tqlayout
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblWind->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblPres->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
}
else // top to bottom
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font);
h = 128 - (3 * fm.height()); // 3 lines of text below the button
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter);
m_lblTemp->tqsetAlignment(TQt::AlignCenter);
m_lblWind->tqsetAlignment(TQt::AlignCenter);
m_lblPres->tqsetAlignment(TQt::AlignCenter);
}
m_button->setFixedSize(h, h);
}
@ -232,21 +232,21 @@ void dockwidget::resizeView( const TQSize &size )
{
if ( h <= 32 ) // left to right
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
}
else // top to bottom
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
TQFontMetrics fm(m_font);
h = QMIN(128, h) - fm.height();
m_lblTemp->setAlignment(Qt::AlignCenter);
h = TQMIN(128, h) - fm.height();
m_lblTemp->tqsetAlignment(TQt::AlignCenter);
}
m_button->setFixedSize(h, h);
}
else
{
h = QMIN(h, 128);
h = TQMIN(h, 128);
m_button->setFixedSize(h, h);
}
}
@ -259,21 +259,21 @@ void dockwidget::resizeView( const TQSize &size )
{
if ( w <= 128 ) // top to bottom
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->tqsetAlignment(TQt::AlignCenter);
m_lblWind->tqsetAlignment(TQt::AlignCenter);
m_lblPres->tqsetAlignment(TQt::AlignCenter);
TQFontMetrics fm(m_font);
h = h - (3 * fm.height()); // 3 lines of text below the button
h = QMIN(w, h);
h = TQMIN(w, h);
}
else // left to right layout
else // left to right tqlayout
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblWind->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
m_lblPres->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
}
m_button->setFixedSize(h, h);
}
@ -281,15 +281,15 @@ void dockwidget::resizeView( const TQSize &size )
{
if ( w <= 128 ) // top to bottom
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->tqsetAlignment(TQt::AlignCenter);
h = w;
}
else // left to right layout
else // left to right tqlayout
{
static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
static_cast<TQBoxLayout*>(tqlayout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->tqsetAlignment(TQt::AlignAuto | TQt::AlignVCenter);
h = static_cast<int>(w * 0.33);
}
@ -297,7 +297,7 @@ void dockwidget::resizeView( const TQSize &size )
}
else
{
w = QMIN(w, 128);
w = TQMIN(w, 128);
m_button->setFixedSize(w, w);
}
}
@ -310,13 +310,13 @@ int dockwidget::widthForHeight(int h)
if ( m_mode == ShowAll )
{
if ( h <= 128 ) // left to right layout
if ( h <= 128 ) // left to right tqlayout
{
int pixelSize = h/3 - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
pixelSize = TQMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
TQFontMetrics fm(m_font);
w = h + QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
w = h + TQMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
}
else // top to bottom
{
@ -331,16 +331,16 @@ int dockwidget::widthForHeight(int h)
TQFontMetrics fm(m_font);
// size of icon
h = 128 - (3 * fm.height()); // 3 lines of text below the button
w = QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
w = QMAX(h, w); // at least width of square icon
w = TQMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
w = TQMAX(h, w); // at least width of square icon
}
}
else if ( m_mode == ShowTempOnly )
{
if ( h <= 32 ) // left to right layout
if ( h <= 32 ) // left to right tqlayout
{
int pixelSize = h - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
pixelSize = TQMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
TQFontMetrics fm(m_font);
w = h + fm.width(m_lblTemp->text()) + 1;
@ -357,14 +357,14 @@ int dockwidget::widthForHeight(int h)
}
TQFontMetrics fm(m_font);
// size of icon
h = QMIN(128, h) - fm.height();
h = TQMIN(128, h) - fm.height();
w = fm.width(m_lblTemp->text()) + 1;
w = QMAX(h, w); // at least width of square icon
w = TQMAX(h, w); // at least width of square icon
}
}
else
{
w = QMIN(128, h); // don't make it too large
w = TQMIN(128, h); // don't make it too large
}
updateFont();
@ -441,12 +441,12 @@ int dockwidget::heightForWidth( int w )
}
TQFontMetrics fm(m_font);
h = QMAX(fm.height(), static_cast<int>(w * 0.33));
h = TQMAX(fm.height(), static_cast<int>(w * 0.33));
}
}
else
{
h = QMIN(128, w); // don't make it too large
h = TQMIN(128, w); // don't make it too large
}
updateFont();

@ -28,19 +28,20 @@ class TQLabel;
class WeatherService_stub;
class WeatherButton;
class dockwidget : public QWidget
class dockwidget : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
dockwidget(const TQString &location, TQWidget *parent=0, const char *name=0);
dockwidget(const TQString &location, TQWidget *tqparent=0, const char *name=0);
~dockwidget();
enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 };
void setLocationCode(const TQString &locationCode);
void setViewMode(int);
void setOrientation(Orientation o) { m_orientation = o; }
void setOrientation(Qt::Orientation o) { m_orientation = o; }
/** resize the view **/
void resizeView(const TQSize &size);
int widthForHeight(int h);
@ -64,7 +65,7 @@ private:
TQLabel *m_lblTemp;
TQLabel *m_lblWind;
TQLabel *m_lblPres;
Orientation m_orientation;
Qt::Orientation m_orientation;
WeatherService_stub *m_weatherService;
};

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
with any edition of TQt, and distribute the resulting executable,
without including the source code for TQt in the source distribution.
*/
#include <tqbuttongroup.h>
@ -43,23 +43,23 @@
extern "C"
{
KDE_EXPORT KCModule *create_weather( TQWidget *parent, const char * )
KDE_EXPORT KCModule *create_weather( TQWidget *tqparent, const char * )
{
return new KCMWeather( parent, "kweather" );
return new KCMWeather( tqparent, "kweather" );
}
}
KCMWeather::KCMWeather( TQWidget *parent, const char *name )
: KCModule( parent, name )
KCMWeather::KCMWeather( TQWidget *tqparent, const char *name )
: KCModule( tqparent, name )
{
mWeatherService = new WeatherService_stub( "KWeatherService",
"WeatherService" );
TQVBoxLayout *layout = new TQVBoxLayout( this );
TQVBoxLayout *tqlayout = new TQVBoxLayout( this );
mWidget = new prefsDialogData( this );
mWidget->m_reportLocation->setFocus();
layout->addWidget( mWidget );
layout->addStretch();
tqlayout->addWidget( mWidget );
tqlayout->addStretch();
fillStationList();
load();
@ -169,7 +169,7 @@ void KCMWeather::load()
mWidget->m_enableLog->setChecked( enabled );
enableLogWidgets( enabled );
static TQColor black(Qt::black);
static TQColor black(TQt::black);
TQColor textColor = config.readColorEntry("textColor", &black);
mWidget->m_textColor->setColor(textColor);

@ -16,8 +16,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
with any edition of TQt, and distribute the resulting executable,
without including the source code for TQt in the source distribution.
*/
#ifndef KCMWEATHER_H
@ -30,9 +30,10 @@ class prefsDialogData;
class KCMWeather : public KCModule
{
Q_OBJECT
TQ_OBJECT
public:
KCMWeather( TQWidget *parent = 0, const char *name = 0 );
KCMWeather( TQWidget *tqparent = 0, const char *name = 0 );
~KCMWeather();
virtual void load();

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
with any edition of TQt, and distribute the resulting executable,
without including the source code for TQt in the source distribution.
*/
#include <tqlayout.h>
@ -33,21 +33,21 @@
extern "C"
{
KDE_EXPORT KCModule *create_weatherservice( TQWidget *parent, const char * ) {
return new KCMWeatherService( parent, "kweather" );
KDE_EXPORT KCModule *create_weatherservice( TQWidget *tqparent, const char * ) {
return new KCMWeatherService( tqparent, "kweather" );
}
}
KCMWeatherService::KCMWeatherService( TQWidget *parent, const char *name )
: KCModule( parent, name )
KCMWeatherService::KCMWeatherService( TQWidget *tqparent, const char *name )
: KCModule( tqparent, name )
{
TQVBoxLayout *layout = new TQVBoxLayout( this );
TQVBoxLayout *tqlayout = new TQVBoxLayout( this );
mWidget = new ServiceConfigWidget( this );
// not needed, as a change immediately changes the service
//connect(mWidget, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool)));
layout->addWidget( mWidget );
tqlayout->addWidget( mWidget );
KAboutData *about = new KAboutData( "kcmweatherservice",
I18N_NOOP( "KWeather Configure Dialog" ),
0, 0, KAboutData::License_GPL,

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
with any edition of TQt, and distribute the resulting executable,
without including the source code for TQt in the source distribution.
*/
#ifndef KCMWEATHERSERVICE_H
@ -31,9 +31,10 @@ class ServiceConfigWidget;
class KCMWeatherService : public KCModule
{
Q_OBJECT
TQ_OBJECT
public:
KCMWeatherService( TQWidget *parent = 0, const char *name = 0 );
KCMWeatherService( TQWidget *tqparent = 0, const char *name = 0 );
virtual void load();
virtual void save();

@ -40,20 +40,20 @@
extern "C"
{
KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kweather");
kweather *theApplet = new kweather(configFile, KPanelApplet::Normal,
0, parent, "kweather");
0, tqparent, "kweather");
return theApplet;
}
}
kweather::kweather(const TQString& configFile, Type t, int actions,
TQWidget *parent, const char *name):
KPanelApplet(configFile, t, actions, parent, name), weatherIface(),
TQWidget *tqparent, const char *name):
KPanelApplet(configFile, t, actions, tqparent, name), weatherIface(),
mFirstRun( false ), mReport( 0 ), mClient( 0 ),
mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(Qt::black)
mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(TQt::black)
{
kdDebug(12004) << "Constructor " << endl;
setObjId("weatherIface");
@ -86,7 +86,7 @@ kweather::~kweather()
void kweather::initContextMenu()
{
mContextMenu = new KPopupMenu(this);
mContextMenu->insertTitle(i18n("KWeather - %1").arg( reportLocation ), -1, 0);
mContextMenu->insertTitle(i18n("KWeather - %1").tqarg( reportLocation ), -1, 0);
mContextMenu->insertItem(SmallIcon("viewmag"), i18n("Show &Report"),
this, TQT_SLOT(doReport()), 0, -1, 1);
mContextMenu->insertItem(SmallIcon("reload"), i18n("&Update Now"),
@ -171,7 +171,7 @@ void kweather::preferences()
/** The help handler */
void kweather::help()
{
kapp->invokeHelp(TQString::null, TQString::fromLatin1("kweather"));
kapp->invokeHelp(TQString(), TQString::tqfromLatin1("kweather"));
}
/** Display the current weather report. */
@ -216,7 +216,7 @@ void kweather::loadPrefs(){
reportLocation = kcConfig->readEntry("report_location");
mViewMode = kcConfig->readNumEntry("smallview_mode", dockwidget::ShowAll);
static TQColor black(Qt::black);
static TQColor black(TQt::black);
mTextColor = kcConfig->readColorEntry("textColor", &black);
}
@ -299,7 +299,7 @@ void kweather::timeout()
int kweather::widthForHeight(int h) const
{
//kdDebug(12004) << "widthForHeight " << h << endl;
dockWidget->setOrientation(Horizontal);
dockWidget->setOrientation(Qt::Horizontal);
int w = dockWidget->widthForHeight(h);
return w;
}
@ -307,7 +307,7 @@ int kweather::widthForHeight(int h) const
int kweather::heightForWidth(int w) const
{
kdDebug(12004) << "heightForWidth " << w<< endl;
dockWidget->setOrientation(Vertical);
dockWidget->setOrientation(Qt::Vertical);
int h = dockWidget->heightForWidth( w );
return h;
}
@ -363,7 +363,7 @@ void kweather::slotPrefsAccepted()
void kweather::mousePressEvent(TQMouseEvent *e)
{
if ( e->button() != RightButton )
if ( e->button() != Qt::RightButton )
{
KPanelApplet::mousePressEvent( e );
return;

@ -33,9 +33,10 @@ class TQPalette;
class kweather : public KPanelApplet, public weatherIface
{
Q_OBJECT
TQ_OBJECT
public:
kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0);
kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *tqparent = 0, const char *name = 0);
~kweather();
void help();
void resizeEvent(TQResizeEvent*);

@ -29,7 +29,7 @@ int main (int argc, char *argv[])
// This app is started automatically, no need for session management
app.disableSessionManagement();
kdDebug() << "starting dcopservice " << endl;
new WeatherService(&app, "WeatherService");
new WeatherService(TQT_TQOBJECT(&app), "WeatherService");
return app.exec();
}

@ -54,7 +54,7 @@ MetarParser::MetarParser(StationDatabase *stationDB,
void MetarParser::reset()
{
// Initialize the WeatherInfo structure
weatherInfo.theWeather = TQString::null;
weatherInfo.theWeather = TQString();
weatherInfo.clouds = 0;
weatherInfo.windMPH = 0;
weatherInfo.tempC = 0;
@ -64,15 +64,15 @@ void MetarParser::reset()
weatherInfo.qsCurrentList.clear();
weatherInfo.qsDate = m_date;
weatherInfo.qsTime = m_time;
weatherInfo.qsPressure = TQString::null;
weatherInfo.qsTemperature = TQString::null;
weatherInfo.qsDewPoint = TQString::null;
weatherInfo.qsRelHumidity = TQString::null;
weatherInfo.qsVisibility = TQString::null;
weatherInfo.qsWindSpeed = TQString::null;
weatherInfo.qsWindChill = TQString::null;
weatherInfo.qsHeatIndex = TQString::null;
weatherInfo.qsWindDirection = TQString::null;
weatherInfo.qsPressure = TQString();
weatherInfo.qsTemperature = TQString();
weatherInfo.qsDewPoint = TQString();
weatherInfo.qsRelHumidity = TQString();
weatherInfo.qsVisibility = TQString();
weatherInfo.qsWindSpeed = TQString();
weatherInfo.qsWindChill = TQString();
weatherInfo.qsHeatIndex = TQString();
weatherInfo.qsWindDirection = TQString();
weatherInfo.stationNeedsMaintenance = false;
}
@ -147,7 +147,7 @@ bool MetarParser::parseCover(const TQString &s)
{
if (CoverRegExp.search(s) > -1)
{
kdDebug(12006) << "Cover: " << CoverRegExp.capturedTexts().join("-")
kdDebug(12006) << "Cover: " << TQString(CoverRegExp.tqcapturedTexts().join("-"))
<< endl;
TQString sCode = CoverRegExp.cap(1);
@ -170,22 +170,22 @@ bool MetarParser::parseCover(const TQString &s)
if (sCode == "FEW")
{
skycondition = i18n( "Few clouds at %1" ).arg(sClouds);
skycondition = i18n( "Few clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 2;
}
else if (sCode == "SCT")
{
skycondition = i18n( "Scattered clouds at %1" ).arg(sClouds);
skycondition = i18n( "Scattered clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 4;
}
else if (sCode == "BKN")
{
skycondition = i18n( "Broken clouds at %1" ).arg(sClouds);
skycondition = i18n( "Broken clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 8;
}
else if (sCode == "OVC")
{
skycondition = i18n( "Overcast clouds at %1" ).arg(sClouds);
skycondition = i18n( "Overcast clouds at %1" ).tqarg(sClouds);
weatherInfo.clouds += 64;
}
else if ((sCode == "CLR") || (sCode == "SKC") || (sCode == "CAVOK"))
@ -211,7 +211,7 @@ bool MetarParser::parseCurrent(const TQString &s)
TQString sCode = CurrentRegExp.cap(2);
TQString intensity, descriptor, phenomena, currentWeather;
kdDebug(12006) << "Current: " << CurrentRegExp.capturedTexts().join("-") << endl;
kdDebug(12006) << "Current: " << TQString(CurrentRegExp.tqcapturedTexts().join("-")) << endl;
// Decode the intensity
if (sIntensity == "+")
@ -226,78 +226,78 @@ bool MetarParser::parseCurrent(const TQString &s)
}
// Decode the descriptor
if (sCode.contains("MI"))
if (sCode.tqcontains("MI"))
descriptor = i18n("Shallow");
else if (sCode.contains("PR"))
else if (sCode.tqcontains("PR"))
descriptor = i18n("Partial");
else if (sCode.contains("BC"))
else if (sCode.tqcontains("BC"))
descriptor = i18n("Patches");
else if (sCode.contains("DR"))
else if (sCode.tqcontains("DR"))
descriptor = i18n("Low Drifting");
else if (sCode.contains("BL"))
else if (sCode.tqcontains("BL"))
descriptor = i18n("Blowing");
else if (sCode.contains("SH"))
else if (sCode.tqcontains("SH"))
{
descriptor = i18n("Showers");
weatherInfo.theWeather = "shower";
}
else if (sCode.contains("TS"))
else if (sCode.tqcontains("TS"))
{
descriptor = i18n("Thunder Storm");
weatherInfo.theWeather = "tstorm";
}
else if (sCode.contains("FZ"))
else if (sCode.tqcontains("FZ"))
{
descriptor = i18n("Freezing");
}
// Decode weather phenomena
if (sCode.contains("DZ"))
if (sCode.tqcontains("DZ"))
{
phenomena = i18n("Drizzle");
weatherInfo.theWeather = "light_rain";
}
else if (sCode.contains("RA"))
else if (sCode.tqcontains("RA"))
{
phenomena = i18n("Rain");
weatherInfo.theWeather = "shower";
}
else if (sCode.contains("SN"))
else if (sCode.tqcontains("SN"))
{
phenomena = i18n("Snow");
weatherInfo.theWeather = "snow";
}
else if (sCode.contains("SG"))
else if (sCode.tqcontains("SG"))
{
phenomena = i18n("Snow Grains");
weatherInfo.theWeather = "snow4";
}
else if (sCode.contains("IC"))
else if (sCode.tqcontains("IC"))
{
phenomena = i18n("Ice Crystals");
weatherInfo.theWeather = "hail";
}
else if (sCode.contains("PE"))
else if (sCode.tqcontains("PE"))
{
phenomena = i18n("Ice Pellets");
weatherInfo.theWeather = "hail";
}
else if (s.contains("GR"))
else if (s.tqcontains("GR"))
{
phenomena = i18n("Hail");
weatherInfo.theWeather = "hail";
}
else if (sCode.contains("GS"))
else if (sCode.tqcontains("GS"))
{
phenomena = i18n("Small Hail Pellets");
weatherInfo.theWeather = "hail";
}
else if (s.contains("UP"))
else if (s.tqcontains("UP"))
{
phenomena = i18n("Unknown Precipitation");
weatherInfo.theWeather = iconName("shower1");
}
else if (sCode.contains("BR"))
else if (sCode.tqcontains("BR"))
{
phenomena = i18n("Mist");
// Mist has lower priority than say rain or snow
@ -306,7 +306,7 @@ bool MetarParser::parseCurrent(const TQString &s)
weatherInfo.theWeather = "mist";
}
}
else if (sCode.contains("FG"))
else if (sCode.tqcontains("FG"))
{
phenomena = i18n("Fog");
// Fog has lower priority than say rain or snow
@ -315,35 +315,35 @@ bool MetarParser::parseCurrent(const TQString &s)
weatherInfo.theWeather = "fog";
}
}
else if (sCode.contains("FU"))
else if (sCode.tqcontains("FU"))
phenomena = i18n("Smoke");
else if (sCode.contains("VA"))
else if (sCode.tqcontains("VA"))
phenomena = i18n("Volcanic Ash");
else if (sCode.contains("DU"))
else if (sCode.tqcontains("DU"))
phenomena = i18n("Widespread Dust");
else if (sCode.contains("SA"))
else if (sCode.tqcontains("SA"))
phenomena = i18n("Sand");
else if (sCode.contains("HZ"))
else if (sCode.tqcontains("HZ"))
phenomena = i18n("Haze");
else if (sCode.contains("PY"))
else if (sCode.tqcontains("PY"))
phenomena = i18n("Spray");
else if (sCode.contains("PO"))
else if (sCode.tqcontains("PO"))
phenomena = i18n("Dust/Sand Swirls");
else if (sCode.contains("SQ"))
else if (sCode.tqcontains("SQ"))
phenomena = i18n("Sudden Winds");
else if (sCode.contains("FC"))
else if (sCode.tqcontains("FC"))
{
if (sIntensity == "+")
currentWeather = i18n("Tornado");
else
phenomena = i18n("Funnel Cloud");
}
else if (sCode.contains("SS"))
else if (sCode.tqcontains("SS"))
phenomena = i18n("Sand Storm");
else if (sCode.contains("DS"))
else if (sCode.tqcontains("DS"))
phenomena = i18n("Dust Storm");
if (currentWeather.isEmpty()) currentWeather = i18n("%1 is the intensity, %2 is the descriptor and %3 is the phenomena", "%1 %2 %3").arg(intensity).arg(descriptor).arg(phenomena);
if (currentWeather.isEmpty()) currentWeather = i18n("%1 is the intensity, %2 is the descriptor and %3 is the phenomena", "%1 %2 %3").tqarg(intensity).tqarg(descriptor).tqarg(phenomena);
if (!currentWeather.isEmpty())
weatherInfo.qsCurrentList << currentWeather;
@ -358,7 +358,7 @@ bool MetarParser::parseTemperature(const TQString &s)
{
if (TempRegExp.search(s) > -1)
{
kdDebug(12006) << "Temp: " << TempRegExp.capturedTexts().join("-")
kdDebug(12006) << "Temp: " << TQString(TempRegExp.tqcapturedTexts().join("-"))
<< endl;
float fTemp = TempRegExp.cap(2).toFloat();
@ -379,7 +379,7 @@ bool MetarParser::parseTemperatureTenths(const TQString &s)
{
if (TempTenRegExp.search(s) > -1)
{
kdDebug(12006) << "Temp Tenths: " << TempTenRegExp.capturedTexts().join("-")
kdDebug(12006) << "Temp Tenths: " << TQString(TempTenRegExp.tqcapturedTexts().join("-"))
<< endl;
float temperature = TempTenRegExp.cap( 1 ).toFloat() / 10;
@ -473,7 +473,7 @@ bool MetarParser::parseDate(const TQString &s)
{
if (DateRegExp.search(s) > -1)
{
kdDebug(12006) << "Date: " << DateRegExp.capturedTexts().join("-")
kdDebug(12006) << "Date: " << TQString(DateRegExp.tqcapturedTexts().join("-"))
<< endl;
TQString dateString = DateRegExp.cap(1);
TQString day, month, year;
@ -496,7 +496,7 @@ bool MetarParser::parseTime(const TQString &s)
{
if (TimeRegExp.search(s) > -1)
{
kdDebug(12006) << "Time: " << TimeRegExp.capturedTexts().join("-")
kdDebug(12006) << "Time: " << TQString(TimeRegExp.tqcapturedTexts().join("-"))
<< endl;
TQString hour, minute, dateString;
@ -521,7 +521,7 @@ bool MetarParser::parseVisibility(TQStringList::ConstIterator it)
{
fVisibility = VisRegExp.cap(1).toFloat();
kdDebug(12006) << "Visibility: " << VisRegExp.capturedTexts().join("-")
kdDebug(12006) << "Visibility: " << TQString(VisRegExp.tqcapturedTexts().join("-"))
<< endl;
}
@ -564,7 +564,7 @@ bool MetarParser::parsePressure( const TQString &s)
TQString type = PressRegExp.cap(1);
float fPressure = PressRegExp.cap(2).toFloat();
kdDebug(12006) << "Pressure: " << PressRegExp.capturedTexts().join("-")
kdDebug(12006) << "Pressure: " << TQString(PressRegExp.tqcapturedTexts().join("-"))
<< endl;
if (m_units == KLocale::Metric)
@ -643,7 +643,7 @@ bool MetarParser::parseWindSpeed(const TQString &s)
float gustSpeed = WindRegExp.cap(3).toFloat();
TQString sWindUnit = WindRegExp.cap(4);
kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-")
kdDebug(12006) << "Wind: " << WindRegExp.tqcapturedTexts().join("-")
<< endl;
if (m_units == KLocale::Metric)
@ -854,7 +854,7 @@ bool MetarParser::isNight(const TQString &stationID) const
// Midnight Sun & Polar Night - In summer, the Sun is always
// over the horizon line ... so use latitude & today date to
// set isNight() value.
return ((m_date.daysInYear() >= 80 || m_date.daysInYear() <= 264) && latitude.contains("S"));
return ((m_date.daysInYear() >= 80 || m_date.daysInYear() <= 264) && latitude.tqcontains("S"));
}
}
}

@ -60,7 +60,7 @@ class MetarParser
public:
MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units = KLocale::Imperial,
TQDate date = TQDate::currentDate(),
TQDate date = TQDate::tqcurrentDate(),
TQTime time = TQTime::currentTime(),
unsigned int localUTCOffset = KRFCDate::localUTCOffset());

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>prefsDialogData</class>
<author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>prefsDialogData</cstring>
</property>
@ -21,7 +21,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@ -37,7 +37,7 @@
<property name="margin">
<number>0</number>
</property>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>GroupBox2</cstring>
</property>
@ -62,7 +62,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>TextLabel1_4_2_2</cstring>
</property>
@ -85,7 +85,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@ -102,7 +102,7 @@
<property name="sizeType">
<enum>MinimumExpanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>40</width>
<height>20</height>
@ -111,7 +111,7 @@
</spacer>
</hbox>
</widget>
<widget class="QButtonGroup">
<widget class="TQButtonGroup">
<property name="name">
<cstring>m_viewMode</cstring>
</property>
@ -129,7 +129,7 @@
<property name="title">
<string>Panel Display Options</string>
</property>
<property name="alignment">
<property name="tqalignment">
<set>AlignVCenter|AlignLeft</set>
</property>
<property name="exclusive">
@ -139,7 +139,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>m_smallView</cstring>
</property>
@ -161,10 +161,10 @@
<string>&lt;qt&gt;Click here to show only the weather icon.&lt;/qt&gt;</string>
</property>
<property name="whatsThis" stdset="0">
<string>This feature will allow you to make KWeather take up only one slot on the kicker. Normally this application will take up two slots. The small view will only show the weather icon, while the normal view will display both the icon and the current weather statistics. For the small view the weather statistics will be put on the buttons tool tip.</string>
<string>This feature will allow you to make KWeather take up only one slot on the kicker. Normally this application will take up two Q_SLOTS. The small view will only show the weather icon, while the normal view will display both the icon and the current weather statistics. For the small view the weather statistics will be put on the buttons tool tip.</string>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>CheckBox9</cstring>
</property>
@ -175,7 +175,7 @@
<number>2</number>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>CheckBox10</cstring>
</property>
@ -191,7 +191,7 @@
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>GroupBox1</cstring>
</property>
@ -210,7 +210,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
<widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>m_enableLog</cstring>
</property>
@ -228,14 +228,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>294</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="1" column="0">
<widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>m_labelLogFile</cstring>
</property>
@ -256,7 +256,7 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<property name="tqminimumSize">
<size>
<width>252</width>
<height>0</height>
@ -271,7 +271,7 @@
</widget>
</grid>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@ -282,15 +282,15 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout1</cstring>
<cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -318,7 +318,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>170</width>
<height>20</height>
@ -348,8 +348,8 @@
<includes>
<include location="local" impldecl="in implementation">kdialog.h</include>
</includes>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<tqlayoutdefaults spacing="3" margin="6"/>
<tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<includehints>
<includehint>kcombobox.h</includehint>
<includehint>kurlrequester.h</includehint>

@ -31,7 +31,7 @@
#include "weatherservice_stub.h"
reportView::reportView(const TQString &reportLocation)
: KDialogBase( (TQWidget *)0, "report", false, TQString::null, Close ),
: KDialogBase( (TQWidget *)0, "report", false, TQString(), Close ),
m_locationCode(reportLocation)
{
TQVBox *vbox = makeVBoxMainWidget();
@ -55,7 +55,7 @@ reportView::reportView(const TQString &reportLocation)
reportView::~reportView(){
delete m_weatherService;
// we do not have to delete m_reportView because this class is
// the parent of the TQVBox, and that is the parent of the KHTMLPart.
// the tqparent of the TQVBox, and that is the tqparent of the KHTMLPart.
KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" );
@ -72,7 +72,7 @@ void reportView::render(){
TQString textColor = KGlobalSettings::textColor().name();
TQString baseColor = KGlobalSettings::baseColor().name();
TQColorGroup cg = palette().active();
TQColorGroup cg = tqpalette().active();
TQString bgColor = cg.background().name();
TQString hlColor = cg.highlight().name();
TQString hlTextColor = cg.highlightedText().name();
@ -93,7 +93,7 @@ void reportView::render(){
TQStringList cover = m_weatherService->cover(m_locationCode );
TQStringList weather = m_weatherService->weather(m_locationCode );
setCaption(i18n("Weather Report - %1").arg( locationName ) );
setCaption(i18n("Weather Report - %1").tqarg( locationName ) );
TQString weatherText = "<ul>\n";
@ -114,24 +114,24 @@ void reportView::render(){
TQString contents =
"<html><head><style type=\"text/css\">" +
TQString("body { font-family: \"%1\"; font-size: %2pt; color: %3; background-color: %4; }\n")
.arg(fntFamily).arg(fntSize).arg(textColor).arg(baseColor) +
.tqarg(fntFamily).tqarg(fntSize).tqarg(textColor).tqarg(baseColor) +
TQString("div.headerTitle { background-color: %1; color: %2; padding: 4px; font-size: 120%; border: solid %3 1px; }\n")
.arg(hlColor).arg(hlTextColor).arg(textColor) +
.tqarg(hlColor).tqarg(hlTextColor).tqarg(textColor) +
TQString("div.headerMsg { background-color: %1; color: %2; border-bottom: solid %3 1px; "
"border-left: solid %4 1px; border-right: solid %5 1px; margin-bottom: 1em; padding: 2px; }\n")
.arg(bgColor).arg(textColor).arg(textColor).arg(textColor).arg(textColor) +
TQString("</style><title></title></head><body dir=\"%1\">").arg( TQApplication::reverseLayout()?"rtl":"ltr") +
"<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).arg( locationName ).arg( countryName ) +
.tqarg(bgColor).tqarg(textColor).tqarg(textColor).tqarg(textColor).tqarg(textColor) +
TQString("</style><title></title></head><body dir=\"%1\">").tqarg( TQApplication::reverseLayout()?"rtl":"ltr") +
"<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).tqarg( locationName ).tqarg( countryName ) +
"</b></div>\n";
if ( ! date.isEmpty() )
contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).arg(date) + "</b></div>\n";
contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).tqarg(date) + "</b></div>\n";
contents += TQString(
"<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">"
"<img width=\"64\" height=\"64\" src=\"%2\" /></td>"
"<td style=\"vertical-align: top\">%3</td></tr>")
.arg(bgColor).arg(KURL(icon).url()).arg(weatherText) +
.tqarg(bgColor).tqarg(KURL(icon).url()).tqarg(weatherText) +
"</table><table>" +
TQString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
+ "</th><td>%1</td>"
@ -145,15 +145,15 @@ void reportView::render(){
+ "</th><td>%4</td></tr>"
"<tr><th style=\"text-align: right\">" + i18n( "Wind Speed:" )
+ "</th><td>%5</td>")
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity)
.arg(wind) + "<td width=\"50\">&nbsp;</td>";
.tqarg(temp).tqarg(dewPoint).tqarg(pressure).tqarg(relHumidity)
.tqarg(wind) + "<td width=\"50\">&nbsp;</td>";
if (!heatIndex.isEmpty())
contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Heat Index:" ) + "</th><td>%1</td>").arg(heatIndex);
+ i18n( "Heat Index:" ) + "</th><td>%1</td>").tqarg(heatIndex);
else if (!windChill.isEmpty())
contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Wind Chill:" ) + "</th><td>%1</td>").arg(windChill);
+ i18n( "Wind Chill:" ) + "</th><td>%1</td>").tqarg(windChill);
else
contents += "<td>&nbsp;</td><td>&nbsp;</td>";
contents += "</tr>";
@ -162,7 +162,7 @@ void reportView::render(){
+ i18n( "Sunrise:" ) + "</th><td>%1</td>" +
"<td width=\"50\">&nbsp;</td><th style=\"text-align: right\">"
+ i18n( "Sunset:" ) + "</th><td>%2</td>")
.arg(sunRiseTime).arg(sunSetTime);
.tqarg(sunRiseTime).tqarg(sunSetTime);
contents += "</tr></table></body></html>";

@ -31,6 +31,7 @@ class WeatherService_stub;
class reportView : public KDialogBase {
Q_OBJECT
TQ_OBJECT
public:
reportView(const TQString &reportLocation);

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>wsPrefs</class>
<author>Ian Reinhart Geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>wsPrefs</cstring>
</property>
@ -28,7 +28,7 @@
<string>A&amp;dd</string>
</property>
</widget>
<widget class="QLabel" row="0" column="2">
<widget class="TQLabel" row="0" column="2">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@ -39,7 +39,7 @@
<cstring>mSelectedStations</cstring>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -60,7 +60,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>86</height>
@ -121,7 +121,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>85</height>
@ -167,9 +167,9 @@
<bool>false</bool>
</property>
</widget>
<widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout1</cstring>
<cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
@ -224,9 +224,9 @@
</connection>
<connection>
<sender>mSelectedStations</sender>
<signal>selectionChanged(QListViewItem*)</signal>
<signal>selectionChanged(TQListViewItem*)</signal>
<receiver>wsPrefs</receiver>
<slot>selectionChanged(QListViewItem*)</slot>
<slot>selectionChanged(TQListViewItem*)</slot>
</connection>
</connections>
<tabstops>
@ -242,15 +242,15 @@
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="global" impldecl="in implementation">knuminput.h</include>
</includes>
<slots>
<Q_SLOTS>
<slot>exitWeatherService()</slot>
<slot>removeStation()</slot>
<slot>updateStations()</slot>
<slot>addStation()</slot>
<slot>selectionChanged( QListViewItem* )</slot>
</slots>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<slot>selectionChanged( TQListViewItem* )</slot>
</Q_SLOTS>
<tqlayoutdefaults spacing="3" margin="6"/>
<tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<includehints>
<includehint>klistview.h</includehint>
<includehint>klistview.h</includehint>

@ -34,7 +34,7 @@
#include "serviceconfigwidget.h"
#include "weatherservice_stub.h"
class StationItem : public QListViewItem
class StationItem : public TQListViewItem
{
public:
StationItem( TQListView *view, const TQString &name, const TQString &uid )
@ -55,8 +55,8 @@ class StationItem : public QListViewItem
static void parseStationEntry( const TQString &line, TQString &name, TQString &uid );
ServiceConfigWidget::ServiceConfigWidget( TQWidget *parent, const char *name )
: wsPrefs( parent, name ), mService(0)
ServiceConfigWidget::ServiceConfigWidget( TQWidget *tqparent, const char *name )
: wsPrefs( tqparent, name ), mService(0)
{
mService = new WeatherService_stub( "KWeatherService", "WeatherService" );
connect( mAllStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( addStation() ) );
@ -194,7 +194,7 @@ void ServiceConfigWidget::loadLocations()
parseStationEntry( entryIt.data(), station, uid );
new StationItem( stateItem, station, uid );
mStationMap.insert( uid, TQString( "%1, %2" )
.arg( station ).arg( *stateIt ) );
.tqarg( station ).tqarg( *stateIt ) );
}
}
}
@ -224,7 +224,7 @@ void parseStationEntry( const TQString &line, TQString &name, TQString &uid )
for ( uint i = 0; i < list.count(); ++i ) {
if ( inName ) {
if ( list[ i ].endsWith( "\\" ) ) {
name.append( list[ i ].replace( "\\", " " ) );
name.append( list[ i ].tqreplace( "\\", " " ) );
} else {
name.append( list[ i ] );
inName = false;

@ -28,9 +28,10 @@ class WeatherService_stub;
class ServiceConfigWidget : public wsPrefs
{
Q_OBJECT
TQ_OBJECT
public:
ServiceConfigWidget( TQWidget *parent, const char *name = 0 );
ServiceConfigWidget( TQWidget *tqparent, const char *name = 0 );
virtual ~ServiceConfigWidget();
signals:

@ -22,8 +22,8 @@
#include "sidebarwidget.h"
#include <tqscrollview.h>
sidebarwidget::sidebarwidget(TQWidget* parent, const char* name) :
sidebarwidgetbase(parent,name)
sidebarwidget::sidebarwidget(TQWidget* tqparent, const char* name) :
sidebarwidgetbase(tqparent,name)
{
view = new TQVBox(reportGrid->viewport());
reportGrid->addChild(view);

@ -29,8 +29,9 @@
class sidebarwidget : public sidebarwidgetbase
{
Q_OBJECT
TQ_OBJECT
public:
sidebarwidget(TQWidget* parent, const char* name = 0);
sidebarwidget(TQWidget* tqparent, const char* name = 0);
virtual ~sidebarwidget();
void addWidget(TQWidget *w, const TQString &s);
TQWidget *viewport();

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>sidebarwidgetbase</class>
<author>ian reinhart geiser &lt;geiseri@kde.org&gt;</author>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>Form1</cstring>
</property>
@ -17,7 +17,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QGroupBox" row="1" column="0">
<widget class="TQGroupBox" row="1" column="0">
<property name="name">
<cstring>GroupBox2</cstring>
</property>
@ -28,7 +28,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
<cstring>Layout1</cstring>
</property>
@ -61,7 +61,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
@ -70,7 +70,7 @@
</spacer>
</grid>
</widget>
<widget class="QGroupBox" row="0" column="0">
<widget class="TQGroupBox" row="0" column="0">
<property name="name">
<cstring>reportGroup</cstring>
</property>
@ -81,7 +81,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QScrollView" row="0" column="0">
<widget class="TQScrollView" row="0" column="0">
<property name="name">
<cstring>reportGrid</cstring>
</property>
@ -108,5 +108,5 @@
<pixmap>image0</pixmap>
</customwidget>
</customwidgets>
<layoutdefaults spacing="5" margin="5"/>
<tqlayoutdefaults spacing="5" margin="5"/>
</UI>

@ -76,7 +76,7 @@ TQString StationDatabase::stationNameFromID( const TQString & stationID )
{
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
if ( theDB.tqfind( stationID ) == theDB.end() )
{
if ( loadStation( stationID ) )
result = theDB[ stationID ].cityName;
@ -98,7 +98,7 @@ TQString StationDatabase::stationLongitudeFromID( const TQString & stationID )
{
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
if ( theDB.tqfind( stationID ) == theDB.end() )
{
if ( loadStation( stationID ) )
result = theDB[ stationID ].longitude;
@ -120,7 +120,7 @@ TQString StationDatabase::stationLatitudeFromID( const TQString & stationID )
{
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
if ( theDB.tqfind( stationID ) == theDB.end() )
{
if ( loadStation( stationID ) )
result = theDB[ stationID ].latitude;
@ -142,7 +142,7 @@ TQString StationDatabase::stationCountryFromID( const TQString &stationID )
{
TQString result;
if ( theDB.find( stationID ) == theDB.end() )
if ( theDB.tqfind( stationID ) == theDB.end() )
{
if ( loadStation( stationID ) )
result = theDB[ stationID ].country;

@ -176,7 +176,7 @@ static double latitudeToDouble( const TQString &latitude )
result = dd + (mm / 60);
if (latitude.contains("S"))
if (latitude.tqcontains("S"))
result *= -1;
return result;
@ -192,7 +192,7 @@ static double longitudeToDouble( const TQString &longitude )
result = ddd + (mm / 60);
if (longitude.contains("W"))
if (longitude.tqcontains("W"))
result *= -1;
return result;
@ -282,7 +282,7 @@ static int __sunriset__( int year, int month, int day, double lon, double lat,
double sr; /* Solar distance, astronomical units */
double sRA; /* Sun's Right Ascension */
double sdec; /* Sun's declination */
double sradius; /* Sun's apparent radius */
double sradius; /* Sun's aptqparent radius */
double t; /* Diurnal arc */
double tsouth; /* Time when Sun is at south */
double sidtime; /* Local sidereal time */
@ -303,7 +303,7 @@ static int __sunriset__( int year, int month, int day, double lon, double lat,
/* Compute time when Sun is at south - in hours UT */
tsouth = 12.0 - rev180(sidtime - sRA) / 15.0;
/* Compute the Sun's apparent radius, degrees */
/* Compute the Sun's aptqparent radius, degrees */
sradius = 0.2666 / sr;
/* Do correction to upper limb, if necessary */

@ -37,7 +37,7 @@ class Sun
*/
Sun( const TQString &latitude,
const TQString &longitude,
TQDate date = TQDate::currentDate(),
TQDate date = TQDate::tqcurrentDate(),
const int localUTCOffset = KRFCDate::localUTCOffset() );
TQTime computeRiseTime();

@ -36,11 +36,11 @@
#include <dcopref.h>
KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* parent,
KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* tqparent,
TQWidget* widgetParent,
TQString& desktopName, const char* name)
: KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name),
: KonqSidebarPlugin(inst, tqparent, widgetParent, desktopName, name),
DCOPObject(name)
{
@ -100,7 +100,7 @@ TQWidget* KonqSidebarWeather::getWidget()
void KonqSidebarWeather::refresh(TQString stationID)
{
kdDebug() << "refresh " << stationID << endl;
if(m_widgets.find(stationID))
if(m_widgets.tqfind(stationID))
{
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(TQString)", stationID ,true ));
@ -134,7 +134,7 @@ void KonqSidebarWeather::update()
TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++)
{
if(!m_widgets.find(replyList[i]))
if(!m_widgets.tqfind(replyList[i]))
{
dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
m_container->addWidget(d, replyList[i].latin1());

@ -19,8 +19,8 @@
* $Id$
*/
#ifndef __KONQSIDEBARWEATHER_H__
#define __KONQSIDEBARWEATHER_H__
#ifndef __KONTQSIDEBARWEATHER_H__
#define __KONTQSIDEBARWEATHER_H__
#include <konqsidebarplugin.h>
#include <kparts/part.h>
@ -37,9 +37,10 @@ class sidebarwidget;
class KonqSidebarWeather: public KonqSidebarPlugin, virtual public DCOPObject
{
Q_OBJECT
TQ_OBJECT
K_DCOP
public:
KonqSidebarWeather(KInstance* inst, TQObject* parent, TQWidget* widgetParent,
KonqSidebarWeather(KInstance* inst, TQObject* tqparent, TQWidget* widgetParent,
TQString& desktopName_, const char* name = 0);
~KonqSidebarWeather();

@ -29,8 +29,8 @@
#include <kipc.h>
#include <kstandarddirs.h>
WeatherButton::WeatherButton( TQWidget *parent, const char *name )
: TQButton( parent, name ), m_highlight( false )
WeatherButton::WeatherButton( TQWidget *tqparent, const char *name )
: TQButton( tqparent, name ), m_highlight( false )
{
setBackgroundOrigin( AncestorOrigin );
@ -98,7 +98,7 @@ void WeatherButton::generateIcons()
return;
TQImage image = pixmap()->convertToImage();
image = image.smoothScale( pixmapSize(), TQImage::ScaleMin );
image = image.smoothScale( pixmapSize(), TQ_ScaleMin );
KIconEffect effect;
@ -124,14 +124,14 @@ void WeatherButton::slotIconChanged( int group )
return;
generateIcons();
repaint( false );
tqrepaint( false );
}
void WeatherButton::enterEvent( TQEvent *e )
{
m_highlight = true;
repaint( false );
tqrepaint( false );
TQButton::enterEvent( e );
}
@ -139,7 +139,7 @@ void WeatherButton::leaveEvent( TQEvent *e )
{
m_highlight = false;
repaint( false );
tqrepaint( false );
TQButton::enterEvent( e );
}

@ -23,12 +23,13 @@
#include <tqbutton.h>
#include <tqpixmap.h>
class WeatherButton : public QButton
class WeatherButton : public TQButton
{
Q_OBJECT
TQ_OBJECT
public:
WeatherButton( TQWidget *parent, const char *name );
WeatherButton( TQWidget *tqparent, const char *name );
void setPixmap( const TQPixmap &pix );
protected:

@ -65,7 +65,7 @@ WeatherLib::Data::Data()
void WeatherLib::Data::clear()
{
age = TQDateTime::currentDateTime();
age = TQDateTime::tqcurrentDateTime();
downloading = false;
updated = false;
job = 0;
@ -77,8 +77,8 @@ void WeatherLib::Data::clear()
}
}
WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *parent, const char *name)
: TQObject (parent, name)
WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *tqparent, const char *name)
: TQObject (tqparent, name)
{
KGlobal::locale()->insertCatalogue("kweather");
@ -124,7 +124,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
//TQTextStream *t = d->target->textStream();
if( t )
{
TQString s = TQString::null;
TQString s = TQString();
while ( !t->eof() )
{
s += " " + t->readLine();
@ -135,7 +135,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
kdDebug( 12006 ) << "Parse: " << s << endl;
MetarParser parser(m_StationDb, KGlobal::locale()->measureSystem());
d->wi = parser.processData(d->wi.reportLocation, s);
d->age = TQDateTime::currentDateTime().addSecs(1800);
d->age = TQDateTime::tqcurrentDateTime().addSecs(1800);
emit fileUpdate(d->wi.reportLocation);
d->updated = true;
}
@ -144,7 +144,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
// File error
kdDebug( 12006 ) << "File empty error..." << endl;
KPassivePopup::message( i18n("KWeather Error!"),
i18n("The temp file %1 was empty.").arg(d->target->name()), 0L,"error" );
i18n("The temp file %1 was empty.").tqarg(d->target->name()), 0L,"error" );
d->updated = false;
}
}
@ -153,7 +153,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
// File error
kdDebug( 12006 ) << "File read error..." << endl;
KPassivePopup::message( i18n("KWeather Error!"),
i18n("Could not read the temp file %1.").arg(d->target->name()), 0L,"error" );
i18n("Could not read the temp file %1.").tqarg(d->target->name()), 0L,"error" );
d->updated = false;
}
delete d->target;
@ -197,7 +197,7 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
u += d->wi.reportLocation.upper().stripWhiteSpace();
u += ".TXT";
d->target = new KTempFile(TQString::null, "-weather");
d->target = new KTempFile(TQString(), "-weather");
d->target->setAutoDelete(true);
d->target->file();
@ -322,7 +322,7 @@ void WeatherLib::update(const TQString &stationID)
// Only grab new data if its more than 50 minutes old
Data *d = findData(stationID);
TQDateTime timeout = TQDateTime::currentDateTime();
TQDateTime timeout = TQDateTime::tqcurrentDateTime();
kdDebug (12006) << "Current Time: " << KGlobal::locale()->formatDateTime(timeout, false, false) <<
" Update at: " << KGlobal::locale()->formatDateTime(d->age, false, false) << endl;

@ -29,14 +29,15 @@ namespace KIO
class StationDatabase;
class WeatherLib : public QObject
class WeatherLib : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
class Data;
WeatherLib(StationDatabase *stationDB, TQObject *parent =0L, const char *name =0L);
WeatherLib(StationDatabase *stationDB, TQObject *tqparent =0L, const char *name =0L);
virtual ~WeatherLib();
TQString temperature(const TQString &stationID);

@ -31,7 +31,7 @@
#include "stationdatabase.h"
#include "sun.h"
WeatherService::WeatherService(TQObject *parent, const char *name) : TQObject (parent, name), DCOPObject("WeatherService")
WeatherService::WeatherService(TQObject *tqparent, const char *name) : TQObject (tqparent, name), DCOPObject("WeatherService")
{
kdDebug(12006) << "Starting new service... " << endl;

@ -32,6 +32,7 @@ class StationDatabase;
class WeatherService : public TQObject, public DCOPObject
{
Q_OBJECT
// TQ_OBJECT
K_DCOP
private:
@ -43,7 +44,7 @@ class WeatherService : public TQObject, public DCOPObject
void slotStationRemoved(const TQString &stationID);
public:
WeatherService(TQObject *parent, const char *name);
WeatherService(TQObject *tqparent, const char *name);
~WeatherService();
k_dcop_signals:

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AboutDialog</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>AboutDialog</cstring>
</property>
@ -28,7 +28,7 @@
<property name="spacing">
<number>6</number>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>Layout1</cstring>
</property>
@ -42,7 +42,7 @@
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>PixmapLabel3</cstring>
</property>
@ -61,7 +61,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>TextLabel3</cstring>
</property>
@ -79,7 +79,7 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>Layout4</cstring>
</property>
@ -103,14 +103,14 @@
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>41</width>
<height>31</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>TextLabel4</cstring>
</property>
@ -119,7 +119,7 @@
Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
</property>
<property name="alignment">
<property name="tqalignment">
<set>WordBreak|AlignVCenter|AlignLeft</set>
</property>
<property name="wordwrap" stdset="0">
@ -127,7 +127,7 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>Layout3</cstring>
</property>
@ -151,14 +151,14 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>PushButton2</cstring>
</property>
@ -179,7 +179,7 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
@ -209,9 +209,9 @@ Copyright: (c) 2000 Matthias Hoelzer-Kluepfel</string>
<includes>
<include location="global" impldecl="in declaration">kseparator.h</include>
</includes>
<slots>
<Q_SLOTS>
<slot>PushButton2_clicked()</slot>
<slot>accept()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
</Q_SLOTS>
<tqlayoutdefaults spacing="6" margin="11"/>
</UI>

@ -1,6 +1,6 @@
/*
**
** Copyright (C) 1998-2001 by Matthias Hölzer-Klüpfel <hoelzer@kde.org>
** Copyright (C) 1998-2001 by Matthias H<EFBFBD>lzer-Kl<EFBFBD>pfel <hoelzer@kde.org>
** Maintainence has ceased - send questions to kde-devel@kde.org.
**
*/
@ -42,20 +42,20 @@
extern "C"
{
KDE_EXPORT KPanelApplet *init(TQWidget *parent, const TQString& configFile)
KDE_EXPORT KPanelApplet *init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kworldclock");
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation
return new KWWApplet(configFile, KPanelApplet::Normal,
0,
parent, "kwwapplet");
tqparent, "kwwapplet");
}
}
KWWApplet::KWWApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
TQWidget *tqparent, const char *name)
: KPanelApplet(configFile, type, actions, tqparent, name)
{
// make use of the icons installed for ksaferppp
KGlobal::iconLoader()->addAppDir("kworldwatch");
@ -94,7 +94,7 @@ bool KWWApplet::eventFilter( TQObject *o, TQEvent *e )
{
if ((e->type() == TQEvent::MouseButtonPress) || (e->type() == TQEvent::MouseButtonDblClick))
{
mousePressEvent(static_cast<TQMouseEvent*>(e));
mousePressEvent(TQT_TQMOUSEEVENT(e));
return true;
}
@ -115,7 +115,7 @@ void KWWApplet::mousePressEvent(TQMouseEvent *e)
clicked = e->type() == TQMouseEvent::MouseButtonDblClick;
}
if (clicked && e->button() == TQMouseEvent::LeftButton)
if (clicked && e->button() == Qt::LeftButton)
{
KRun::run("kworldclock", KURL::List());
}

@ -42,11 +42,12 @@ class MapWidget;
class KWWApplet : public KPanelApplet
{
Q_OBJECT
TQ_OBJECT
public:
KWWApplet(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
TQWidget *tqparent = 0, const char *name = 0);
~KWWApplet();
int widthForHeight(int height) const;

@ -7,7 +7,7 @@
long jdate(struct tm *);
double jtime(struct tm *);
double kepler(double m, double ecc);
void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong);
void sunpos(double jd, int aptqparent, double *ra, double *dec, double *rv, double *slong);
double gmst(double jd);
/* JDATE -- Convert internal GMT date and time to Julian day
@ -65,19 +65,19 @@ double m, ecc;
/* SUNPOS -- Calculate position of the Sun. JD is the Julian date
of the instant for which the position is desired and
APPARENT should be nonzero if the apparent position
APPARENT should be nonzero if the aptqparent position
(corrected for nutation and aberration) is desired.
The Sun's co-ordinates are returned in RA and DEC,
both specified in degrees (divide RA by 15 to obtain
hours). The radius vector to the Sun in astronomical
units is returned in RV and the Sun's longitude (true
or apparent, as desired) is returned as degrees in
or aptqparent, as desired) is returned as degrees in
SLONG. */
void
sunpos(jd, apparent, ra, dec, rv, slong)
sunpos(jd, aptqparent, ra, dec, rv, slong)
double jd;
int apparent;
int aptqparent;
double *ra, *dec, *rv, *slong;
{
double t, t2, t3, l, m, e, ea, v, theta, omega,
@ -119,9 +119,9 @@ double *ra, *dec, *rv, *slong;
eps = 23.452294 - 0.0130125 * t - 0.00000164 * t2 + 0.000000503 * t3;
/* Corrections for Sun's apparent longitude, if desired. */
/* Corrections for Sun's aptqparent longitude, if desired. */
if (apparent) {
if (aptqparent) {
omega = fixangle(259.18 - 1934.142 * t);
theta = theta - 0.00569 - 0.00479 * sin(dtr(omega));
eps += 0.00256 * cos(dtr(omega));

@ -34,7 +34,7 @@
extern "C" {
double jtime(struct tm *t);
double kepler(double m, double ecc);
void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong);
void sunpos(double jd, int aptqparent, double *ra, double *dec, double *rv, double *slong);
void projillum(short *wtab, int xdots, int ydots, double dec);
}

@ -128,9 +128,9 @@ void CityList::readCityList(const TQString &fname)
if (!c.isEmpty() && !n.isEmpty())
{
double la, lo;
pos = c.find("+", 1);
pos = c.tqfind("+", 1);
if (pos < 0)
pos = c.find("-", 1);
pos = c.tqfind("-", 1);
if (pos > 0)
{
la = coordinate(c.left(pos));
@ -157,7 +157,7 @@ TQPoint CityList::getPosition(double la, double lo, int w, int h, int offset)
void CityList::paint(TQPainter *p, int width, int height, int offset)
{
p->setPen(Qt::black);
p->setPen(TQt::black);
TQPtrListIterator<City> it(_cities);
for ( ; it.current(); ++it)

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>ClockDialog</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>ClockDialog</cstring>
</property>
@ -28,7 +28,7 @@
<property name="spacing">
<number>6</number>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>Layout5</cstring>
</property>
@ -42,7 +42,7 @@
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel" row="0" column="0">
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>PixmapLabel1</cstring>
</property>
@ -71,7 +71,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
@ -88,14 +88,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
<widget class="TQLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
<property name="name">
<cstring>Layout2</cstring>
</property>
@ -109,12 +109,12 @@
<property name="spacing">
<number>6</number>
</property>
<widget class="QComboBox" row="2" column="1">
<widget class="TQComboBox" row="2" column="1">
<property name="name">
<cstring>ClockZone</cstring>
</property>
</widget>
<widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
<widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>TextLabel2</cstring>
</property>
@ -122,7 +122,7 @@
<string>Please enter the settings for the clock.</string>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
<widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>TextLabel3</cstring>
</property>
@ -133,12 +133,12 @@
<cstring>ClockCaption</cstring>
</property>
</widget>
<widget class="QLineEdit" row="1" column="1">
<widget class="TQLineEdit" row="1" column="1">
<property name="name">
<cstring>ClockCaption</cstring>
</property>
</widget>
<widget class="QLabel" row="2" column="0">
<widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>TextLabel4</cstring>
</property>
@ -153,7 +153,7 @@
</widget>
</grid>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>Layout1</cstring>
</property>
@ -177,14 +177,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>PushButton1</cstring>
</property>
@ -195,7 +195,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>PushButton2</cstring>
</property>
@ -213,7 +213,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
@ -255,5 +255,5 @@
<includes>
<include location="global" impldecl="in declaration">kseparator.h</include>
</includes>
<layoutdefaults spacing="6" margin="11"/>
<tqlayoutdefaults spacing="6" margin="11"/>
</UI>

@ -39,7 +39,7 @@ FlagList::FlagList()
_flags.setAutoDelete(true);
_flagPixmap = TQPixmap(locate("data", "kworldclock/pics/flag.png"));
_flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, TQPixmap::ThresholdDither);
_flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-tqmask.xpm"), 0, TQPixmap::ThresholdDither);
_flagMask.setMask(_flagMask.createHeuristicMask());
}
@ -62,7 +62,7 @@ TQPoint FlagList::getPosition(double la, double lo, int w, int h, int offset)
void FlagList::paint(TQPainter *p, int width, int height, int offset)
{
p->setPen(Qt::black);
p->setPen(TQt::black);
TQPtrListIterator<Flag> it(_flags);
for ( ; it.current(); ++it)
@ -121,9 +121,9 @@ void FlagList::save(KConfig *config)
int cnt=0;
for ( ; it.current(); ++it)
{
config->writeEntry(TQString("Flag_%1_Color").arg(cnt), it.current()->color());
config->writeEntry(TQString("Flag_%1_Latitude").arg(cnt), it.current()->latitude());
config->writeEntry(TQString("Flag_%1_Longitude").arg(cnt), it.current()->longitude());
config->writeEntry(TQString("Flag_%1_Color").tqarg(cnt), it.current()->color());
config->writeEntry(TQString("Flag_%1_Latitude").tqarg(cnt), it.current()->latitude());
config->writeEntry(TQString("Flag_%1_Longitude").tqarg(cnt), it.current()->longitude());
cnt++;
}
}
@ -136,9 +136,9 @@ void FlagList::load(KConfig *config)
for (int i=0; i<num; ++i)
{
addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").arg(i)),
config->readDoubleNumEntry(TQString("Flag_%1_Latitude").arg(i)),
config->readColorEntry(TQString("Flag_%1_Color").arg(i))));
addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").tqarg(i)),
config->readDoubleNumEntry(TQString("Flag_%1_Latitude").tqarg(i)),
config->readColorEntry(TQString("Flag_%1_Color").tqarg(i))));
}
}

@ -1,18 +1,18 @@
/****************************************************************************
** $Id$
**
** Implementing your own layout: flow example
** Implementing your own tqlayout: flow example
**
** Copyright (C) 1996 by Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include "flow.h"
class SimpleFlowIterator :public QGLayoutIterator
class SimpleFlowIterator :public TQGLayoutIterator
{
public:
SimpleFlowIterator( TQPtrList<TQLayoutItem> *l ) :idx(0), list(l) {}
@ -66,9 +66,9 @@ int SimpleFlow::heightForWidth( int w ) const
return cached_hfw;
}
void SimpleFlow::addItem( TQLayoutItem *item)
void SimpleFlow::addItem( QLayoutItem *item)
{
list.append( item );
list.append( TQT_TQLAYOUTITEM(item) );
}
bool SimpleFlow::hasHeightForWidth() const
@ -76,19 +76,29 @@ bool SimpleFlow::hasHeightForWidth() const
return TRUE;
}
TQSize SimpleFlow::sizeHint() const
TQSize SimpleFlow::tqsizeHint() const
{
return minimumSize();
return tqminimumSize();
}
TQSizePolicy::ExpandData SimpleFlow::expanding() const
{
#ifdef USE_QT4
return (Qt::Orientation)TQSizePolicy::NoDirection;
#else // USE_QT4
return TQSizePolicy::NoDirection;
#endif // USE_QT4
}
TQLayoutIterator SimpleFlow::iterator()
{
// [FIXME]
#ifdef USE_QT4
#warning [FIXME] ContainerAreaLayout iterators may not function correctly under Qt4
return TQLayoutIterator(this); // [FIXME]
#else // USE_QT4
return TQLayoutIterator( new SimpleFlowIterator( &list ) );
#endif // USE_QT4
}
void SimpleFlow::setGeometry( const TQRect &r )
@ -106,30 +116,60 @@ int SimpleFlow::doLayout( const TQRect &r, bool testonly )
TQLayoutItem *o;
while ( (o=it.current()) != 0 ) {
++it;
int nextX = x + o->sizeHint().width() + spacing();
int nextX = x + o->tqsizeHint().width() + spacing();
if ( nextX - spacing() > r.right() && h > 0 ) {
x = r.x();
y = y + h + spacing();
nextX = x + o->sizeHint().width() + spacing();
nextX = x + o->tqsizeHint().width() + spacing();
h = 0;
}
if ( !testonly )
o->setGeometry( TQRect( TQPoint( x, y ), o->sizeHint() ) );
o->setGeometry( TQRect( TQPoint( x, y ), o->tqsizeHint() ) );
x = nextX;
h = QMAX( h, o->sizeHint().height() );
h = TQMAX( h, o->tqsizeHint().height() );
}
return y + h - r.y();
}
TQSize SimpleFlow::minimumSize() const
TQSize SimpleFlow::tqminimumSize() const
{
TQSize s(0,0);
TQPtrListIterator<TQLayoutItem> it(list);
TQLayoutItem *o;
while ( (o=it.current()) != 0 ) {
++it;
s = s.expandedTo( o->minimumSize() );
s = s.expandedTo( o->tqminimumSize() );
}
return s;
}
#ifdef USE_QT4
/*!
\reimp
*/
int SimpleFlow::count() const {
return list.count();
}
/*!
\reimp
*/
TQLayoutItem* SimpleFlow::itemAt(int index) const {
return index >= 0 && index < list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(list).tqat(index)) : 0;
}
/*!
\reimp
*/
TQLayoutItem* SimpleFlow::takeAt(int index) {
if (index < 0 || index >= list.count())
return 0;
TQLayoutItem *item = list.tqat(index);
list.remove(list.tqat(index));
delete item;
invalidate();
return item;
}
#endif // USE_QT4

@ -1,13 +1,13 @@
/****************************************************************************
** $Id$
**
** Definition of simple flow layout for custom layout example
** Definition of simple flow tqlayout for custom tqlayout example
**
** Created : 979899
**
** Copyright (C) 1997 by Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
@ -18,15 +18,15 @@
#include <tqlayout.h>
#include <tqptrlist.h>
class SimpleFlow : public QLayout
class SimpleFlow : public TQLayout
{
public:
SimpleFlow( TQWidget *parent, int border=0, int space=-1,
SimpleFlow( TQWidget *tqparent, int border=0, int space=-1,
const char *name=0 )
: TQLayout( parent, border, space, name ),
: TQLayout( tqparent, border, space, name ),
cached_width(0), cached_hfw(0) {}
SimpleFlow( TQLayout* parent, int space=-1, const char *name=0 )
: TQLayout( parent, space, name ),
SimpleFlow( TQLayout* tqparent, int space=-1, const char *name=0 )
: TQLayout( tqparent, space, name ),
cached_width(0), cached_hfw(0) {}
SimpleFlow( int space=-1, const char *name=0 )
: TQLayout( space, name ),
@ -34,14 +34,18 @@ public:
~SimpleFlow();
void addItem( TQLayoutItem *item);
void addItem( QLayoutItem *item);
bool hasHeightForWidth() const;
int heightForWidth( int ) const;
TQSize sizeHint() const;
TQSize minimumSize() const;
TQSize tqsizeHint() const;
TQSize tqminimumSize() const;
TQLayoutIterator iterator();
TQSizePolicy::ExpandData expanding() const;
#ifdef USE_QT4
QLAYOUT_REQUIRED_METHOD_DECLARATIONS
#endif // USE_QT4
protected:
void setGeometry( const TQRect& );

@ -48,8 +48,8 @@
#include "zoneclock.h"
WorldWideWatch::WorldWideWatch(bool restore, TQWidget *parent, const char *name)
: KMainWindow(parent, name)
WorldWideWatch::WorldWideWatch(bool restore, TQWidget *tqparent, const char *name)
: KMainWindow(tqparent, name)
{
KGlobal::locale()->insertCatalogue("timezones"); // For time zone translation

@ -40,10 +40,11 @@ class ZoneClockPanel;
class WorldWideWatch : public KMainWindow
{
Q_OBJECT
TQ_OBJECT
public:
WorldWideWatch(bool restore=false, TQWidget *parent=0, const char *name=0);
WorldWideWatch(bool restore=false, TQWidget *tqparent=0, const char *name=0);
void save(KConfig *config);
void load(KConfig *load);
@ -71,6 +72,7 @@ private:
class WatchApplication : public KUniqueApplication
{
Q_OBJECT
TQ_OBJECT
public:

@ -63,7 +63,7 @@ TQPtrList<MapTheme> MapLoader::themes()
TQStringList MapLoader::maps(const TQString &theme)
{
return KGlobal::dirs()->findAllResources("data", TQString("kworldclock/maps/%1/*.jpg").arg(theme));
return KGlobal::dirs()->findAllResources("data", TQString("kworldclock/maps/%1/*.jpg").tqarg(theme));
}
@ -75,10 +75,10 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
for (uint i=0; i<files.count(); ++i)
{
TQString f = files[i];
int pos = f.findRev("/");
int pos = f.tqfindRev("/");
if (pos >= 0)
f = f.mid(pos+1);
pos = f.findRev(".");
pos = f.tqfindRev(".");
if (pos >= 0)
f = f.left(pos);
sizes.append(f.toInt());
@ -101,7 +101,7 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
size = 800;
}
else
image = TQImage(locate("data", TQString("kworldclock/maps/%1/%2.jpg").arg(theme).arg(size)));
image = TQImage(locate("data", TQString("kworldclock/maps/%1/%2.jpg").tqarg(theme).tqarg(size)));
if (height == 0)
height = width/2;
@ -113,7 +113,7 @@ void MapLoader::load(unsigned int width, const TQString &theme, unsigned int hei
_light.convertFromImage(image);
// calculate dark map
_dark.convertFromImage(KImageEffect::blend(Qt::black, image, opacity));
_dark.convertFromImage(KImageEffect::blend(TQt::black, image, opacity));
}
@ -140,7 +140,7 @@ TQBitmap MapLoader::darkMask(int width, int height)
projillum(wtab,width,height,sundec);
// draw illumination
illuMask.fill(Qt::black);
illuMask.fill(TQt::black);
TQPainter p;
p.begin(&illuMask);

@ -56,8 +56,8 @@
#include "mapwidget.moc"
MapWidget::MapWidget(bool applet, bool restore, TQWidget *parent, const char *name)
: TQWidget(parent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0),
MapWidget::MapWidget(bool applet, bool restore, TQWidget *tqparent, const char *name)
: TQWidget(tqparent, name), _loader(), _illumination(true), _cities(true), _flags(true), _cityList(0),
_applet(applet), _width(0), _height(0)
{
// this ugly construction is necessary so we don't load
@ -143,7 +143,7 @@ MapWidget::MapWidget(bool applet, bool restore, TQWidget *parent, const char *na
_cityIndicator->setIndent(0);
_cityIndicator->setAutoMask(false);
_cityIndicator->setLineWidth(1);
_cityIndicator->setAlignment(TQLabel::AlignAuto | TQLabel::AlignTop);
_cityIndicator->tqsetAlignment(TQLabel::AlignAuto | TQLabel::AlignTop);
_cityIndicator->setAutoResize(true);
_cityIndicator->setFrameStyle(TQFrame::Box | TQFrame::Plain);
_cityIndicator->setPalette(TQToolTip::palette());
@ -223,18 +223,18 @@ void MapWidget::addClock()
void MapWidget::addFlag(int index)
{
TQColor col = Qt::red;
TQColor col = TQt::red;
switch (index)
{
case 0:
col = Qt::red;
col = TQt::red;
break;
case 1:
col = Qt::green;
col = TQt::green;
break;
case 2:
col = Qt::blue;
col = TQt::blue;
break;
case 3:
if (KColorDialog::getColor(col, this) != KColorDialog::Accepted)
@ -262,7 +262,7 @@ void MapWidget::removeFlag()
void MapWidget::removeAllFlags()
{
if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), TQString::null, KStdGuiItem::del() ) == KMessageBox::Continue )
if ( KMessageBox::warningContinueCancel( this, i18n( "Do you really want to remove all flags?" ), TQString(), KStdGuiItem::del() ) == KMessageBox::Continue )
_flagList->removeAllFlags();
update();
@ -353,10 +353,10 @@ void MapWidget::timeout()
TQString MapWidget::cityTime(const TQString &city)
{
TQString result = i18n(city.latin1()); // Time zone translation
int pos = result.find("/");
int pos = result.tqfind("/");
if (pos >= 0)
result = result.mid(pos+1);
result.replace(TQRegExp("_"), " ");
result.tqreplace(TQRegExp("_"), " ");
result.append(": ");
char *initial_TZ = getenv("TZ");
@ -366,7 +366,7 @@ TQString MapWidget::cityTime(const TQString &city)
time_t t = time(NULL);
TQDateTime dt;
dt.setTime_t(t);
result.append(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
result.append(TQString("%1, %2").tqarg(KGlobal::locale()->formatTime(dt.time(), true)).tqarg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1);
@ -407,7 +407,7 @@ void MapWidget::themeSelected(int index)
void MapWidget::mousePressEvent(TQMouseEvent *ev)
{
if (ev->button() == TQMouseEvent::RightButton)
if (ev->button() == Qt::RightButton)
{
_flagPos = ev->pos();
_popup->exec(ev->globalPos());
@ -563,13 +563,13 @@ TQPixmap MapWidget::calculatePixmap()
if (gmt_position >= greenwich)
{
p.drawPixmap(gmt_position-greenwich, 0, map, 0, 0, map.width()-gmt_position+greenwich);
p.drawPixmap(0,0, map, map.width()-gmt_position+greenwich, 0, gmt_position-greenwich);
p.tqdrawPixmap(gmt_position-greenwich, 0, map, 0, 0, map.width()-gmt_position+greenwich);
p.tqdrawPixmap(0,0, map, map.width()-gmt_position+greenwich, 0, gmt_position-greenwich);
}
else
{
p.drawPixmap(0,0, map, greenwich-gmt_position, 0, map.width()+gmt_position-greenwich);
p.drawPixmap(map.width()+gmt_position-greenwich, 0, map, 0, 0, greenwich-gmt_position);
p.tqdrawPixmap(0,0, map, greenwich-gmt_position, 0, map.width()+gmt_position-greenwich);
p.tqdrawPixmap(map.width()+gmt_position-greenwich, 0, map, 0, 0, greenwich-gmt_position);
}
return pm;

@ -53,13 +53,14 @@ class FlagList;
#include "maploader.h"
class MapWidget : public QWidget
class MapWidget : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
MapWidget(bool applet=false, bool restore=false, TQWidget *parent=0, const char *name=0);
MapWidget(bool applet=false, bool restore=false, TQWidget *tqparent=0, const char *name=0);
~MapWidget();
void setTheme(const TQString &theme);

@ -1,6 +1,6 @@
/*
**
** Copyright (C) 1998-2001 by Matthias Hölzer-Klüpfel <hoelzer@kde.org>
** Copyright (C) 1998-2001 by Matthias H<EFBFBD>lzer-Kl<EFBFBD>pfel <hoelzer@kde.org>
** Maintainence has ceased - send questions to kde-devel@kde.org.
**
*/
@ -51,8 +51,8 @@
#include "zoneclock.moc"
#include <kdebug.h>
ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent, const char *n)
: TQFrame(parent, n), _zone(zone), _name(name)
ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *tqparent, const char *n)
: TQFrame(tqparent, n), _zone(zone), _name(name)
{
setFrameStyle(TQFrame::Panel | TQFrame::Raised);
TQHBoxLayout *hbox = new TQHBoxLayout(this, 2,2);
@ -63,7 +63,7 @@ ZoneClock::ZoneClock(const TQString &zone, const TQString &name, TQWidget *paren
hbox->addSpacing(4);
_timeLabel = new TQLabel(this);
hbox->addWidget(_timeLabel, 0, Qt::AlignRight);
hbox->addWidget(_timeLabel, 0, TQt::AlignRight);
_popup = new TQPopupMenu(this);
_popup->insertItem(i18n("&Edit..."), this, TQT_SLOT(editClock()));
@ -122,7 +122,7 @@ void ZoneClock::editClock()
_name = _dlg->ClockCaption->text().append(":");
_nameLabel->setText(_dlg->ClockCaption->text().append(":"));
updateTime();
layout()->invalidate();
tqlayout()->tqinvalidate();
emit changed();
}
@ -135,7 +135,7 @@ bool ZoneClock::eventFilter(TQObject *obj, TQEvent *ev)
if (ev->type() == TQEvent::MouseButtonPress)
{
TQMouseEvent *e = (TQMouseEvent*)ev;
if (e->button() == TQMouseEvent::RightButton)
if (e->button() == Qt::RightButton)
_popup->exec(e->globalPos());
}
@ -152,7 +152,7 @@ void ZoneClock::updateTime()
time_t t = time(NULL);
TQDateTime dt;
dt.setTime_t(t);
_timeLabel->setText(TQString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true)));
_timeLabel->setText(TQString("%1, %2").tqarg(KGlobal::locale()->formatTime(dt.time(), true)).tqarg(KGlobal::locale()->formatDate(dt.date(), true)));
if (initial_TZ != 0)
setenv("TZ", initial_TZ, 1);
@ -162,8 +162,8 @@ void ZoneClock::updateTime()
}
ZoneClockPanel::ZoneClockPanel(TQWidget *parent, const char *name)
: TQFrame(parent, name), _dlg(0)
ZoneClockPanel::ZoneClockPanel(TQWidget *tqparent, const char *name)
: TQFrame(tqparent, name), _dlg(0)
{
_flow = new SimpleFlow(this,1,1);
@ -218,8 +218,8 @@ void ZoneClockPanel::realign()
int w = 0;
TQPtrListIterator<ZoneClock> it(_clocks);
for ( ; it.current(); ++it)
if (it.current()->sizeHint().width() > w)
w = it.current()->sizeHint().width();
if (it.current()->tqsizeHint().width() > w)
w = it.current()->tqsizeHint().width();
it.toFirst();
for ( ; it.current(); ++it)
it.current()->setFixedWidth(w);
@ -266,8 +266,8 @@ void ZoneClockPanel::save(KConfig *config)
{
TQString n = it.current()->name();
n = n.left(n.length()-1);
config->writeEntry(TQString("Clock_%1_Name").arg(cnt), n);
config->writeEntry(TQString("Clock_%1_Zone").arg(cnt), it.current()->zone());
config->writeEntry(TQString("Clock_%1_Name").tqarg(cnt), n);
config->writeEntry(TQString("Clock_%1_Zone").tqarg(cnt), it.current()->zone());
cnt++;
}
}
@ -281,7 +281,7 @@ void ZoneClockPanel::load(KConfig *config)
for (int i=0; i<num; ++i)
{
addClock(config->readEntry(TQString("Clock_%1_Zone").arg(i)), config->readEntry(TQString("Clock_%1_Name").arg(i)));
addClock(config->readEntry(TQString("Clock_%1_Zone").tqarg(i)), config->readEntry(TQString("Clock_%1_Name").tqarg(i)));
}
}

@ -43,13 +43,14 @@ class KConfig;
class ClockDialog;
class ZoneClock : public QFrame
class ZoneClock : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
ZoneClock(const TQString &zone, const TQString &name, TQWidget *parent=0, const char *n=0);
ZoneClock(const TQString &zone, const TQString &name, TQWidget *tqparent=0, const char *n=0);
TQString zone() const { return _zone; };
@ -94,13 +95,14 @@ private:
};
class ZoneClockPanel : public QFrame
class ZoneClockPanel : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
ZoneClockPanel(TQWidget *parent=0, const char *name=0);
ZoneClockPanel(TQWidget *tqparent=0, const char *name=0);
void addClock(const TQString &zone, const TQString &name);

Loading…
Cancel
Save