diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/kopete/kopeteballoon.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/kopete/kopeteballoon.cpp')
-rw-r--r-- | kopete/kopete/kopeteballoon.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kopete/kopete/kopeteballoon.cpp b/kopete/kopete/kopeteballoon.cpp index cee42240..13696da1 100644 --- a/kopete/kopete/kopeteballoon.cpp +++ b/kopete/kopete/kopeteballoon.cpp @@ -18,11 +18,11 @@ ************************************************************************* */ -#include <qpointarray.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqpointarray.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kdeversion.h> #include <kglobalsettings.h> @@ -39,20 +39,20 @@ #include "systemtray.h" #include "kopeteprefs.h" -KopeteActiveLabel::KopeteActiveLabel( QWidget *parent, const char *name ) +KopeteActiveLabel::KopeteActiveLabel( TQWidget *parent, const char *name ) : KActiveLabel( parent, name ) { } -KopeteActiveLabel::KopeteActiveLabel( const QString& text, QWidget *parent, +KopeteActiveLabel::KopeteActiveLabel( const TQString& text, TQWidget *parent, const char *name ) : KActiveLabel( text, parent, name ) { } -void KopeteActiveLabel::openLink( const QString& link ) +void KopeteActiveLabel::openLink( const TQString& link ) { KURL url( link ); - QString protocol = url.protocol(); + TQString protocol = url.protocol(); if ( protocol == "mailto" ) kapp->invokeMailer(url); @@ -63,26 +63,26 @@ void KopeteActiveLabel::openLink( const QString& link ) } } -KopeteBalloon::KopeteBalloon(const QString &text, const QString &pix) -: QWidget(0L, "KopeteBalloon", WStyle_StaysOnTop | WStyle_Customize | +KopeteBalloon::KopeteBalloon(const TQString &text, const TQString &pix) +: TQWidget(0L, "KopeteBalloon", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM) { setCaption(""); - QVBoxLayout *BalloonLayout = new QVBoxLayout(this, 22, + TQVBoxLayout *BalloonLayout = new TQVBoxLayout(this, 22, KDialog::spacingHint(), "BalloonLayout"); // BEGIN Layout1 - QHBoxLayout *Layout1 = new QHBoxLayout(BalloonLayout, + TQHBoxLayout *Layout1 = new TQHBoxLayout(BalloonLayout, KDialog::spacingHint(), "Layout1"); - //QLabel *mCaption = new QLabel(text, this, "mCaption"); + //TQLabel *mCaption = new TQLabel(text, this, "mCaption"); KopeteActiveLabel *mCaption = new KopeteActiveLabel(text, this, "mCaption"); - mCaption->setPalette(QToolTip::palette()); - mCaption->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + mCaption->setPalette(TQToolTip::palette()); + mCaption->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); if (!pix.isEmpty()) { - QLabel *mImage = new QLabel(this, "mImage"); + TQLabel *mImage = new TQLabel(this, "mImage"); mImage->setScaledContents(FALSE); mImage->setPixmap(locate("data", pix)); @@ -93,11 +93,11 @@ KopeteBalloon::KopeteBalloon(const QString &text, const QString &pix) // BEGIN Layout2 - QHBoxLayout *Layout2 = new QHBoxLayout(BalloonLayout, + TQHBoxLayout *Layout2 = new TQHBoxLayout(BalloonLayout, KDialog::spacingHint(), "Layout2"); - QPushButton *mViewButton = new QPushButton(i18n("to view", "View"), this, + TQPushButton *mViewButton = new TQPushButton(i18n("to view", "View"), this, "mViewButton"); - QPushButton *mIgnoreButton = new QPushButton(i18n("Ignore"), this, + TQPushButton *mIgnoreButton = new TQPushButton(i18n("Ignore"), this, "mIgnoreButton"); Layout2->addStretch(); @@ -106,29 +106,29 @@ KopeteBalloon::KopeteBalloon(const QString &text, const QString &pix) Layout2->addStretch(); // END Layout2 - setPalette(QToolTip::palette()); + setPalette(TQToolTip::palette()); setAutoMask(TRUE); - connect(mViewButton, SIGNAL(clicked()), - this, SIGNAL(signalButtonClicked())); - connect(mViewButton, SIGNAL(clicked()), - this, SLOT(deleteLater())); - connect(mIgnoreButton, SIGNAL(clicked()), - this, SIGNAL(signalIgnoreButtonClicked())); - connect(mIgnoreButton, SIGNAL(clicked()), - this, SLOT(deleteLater())); - connect(mCaption, SIGNAL(linkClicked(const QString &)), - this, SIGNAL(signalIgnoreButtonClicked())); - connect(mCaption, SIGNAL(linkClicked(const QString &)), - this, SLOT(deleteLater())); + connect(mViewButton, TQT_SIGNAL(clicked()), + this, TQT_SIGNAL(signalButtonClicked())); + connect(mViewButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(deleteLater())); + connect(mIgnoreButton, TQT_SIGNAL(clicked()), + this, TQT_SIGNAL(signalIgnoreButtonClicked())); + connect(mIgnoreButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(deleteLater())); + connect(mCaption, TQT_SIGNAL(linkClicked(const TQString &)), + this, TQT_SIGNAL(signalIgnoreButtonClicked())); + connect(mCaption, TQT_SIGNAL(linkClicked(const TQString &)), + this, TQT_SLOT(deleteLater())); KopetePrefs *p = KopetePrefs::prefs(); // Autoclose balloon if (p->balloonClose()) - QTimer::singleShot( p->balloonCloseDelay() * 1000, this, SIGNAL( signalTimeout( ) ) ); + TQTimer::singleShot( p->balloonCloseDelay() * 1000, this, TQT_SIGNAL( signalTimeout( ) ) ); } -void KopeteBalloon::setAnchor(const QPoint &anchor) +void KopeteBalloon::setAnchor(const TQPoint &anchor) { mAnchor = anchor; updateMask(); @@ -136,22 +136,22 @@ void KopeteBalloon::setAnchor(const QPoint &anchor) void KopeteBalloon::updateMask() { - QRegion mask(10, 10, width() - 20, height() - 20); - - QPoint corners[8] = { - QPoint(width() - 50, 10), - QPoint(10, 10), - QPoint(10, height() - 50), - QPoint(width() - 50, height() - 50), - QPoint(width() - 10, 10), - QPoint(10, 10), - QPoint(10, height() - 10), - QPoint(width() - 10, height() - 10) + TQRegion mask(10, 10, width() - 20, height() - 20); + + TQPoint corners[8] = { + TQPoint(width() - 50, 10), + TQPoint(10, 10), + TQPoint(10, height() - 50), + TQPoint(width() - 50, height() - 50), + TQPoint(width() - 10, 10), + TQPoint(10, 10), + TQPoint(10, height() - 10), + TQPoint(width() - 10, height() - 10) }; for (int i = 0; i < 4; ++i) { - QPointArray corner; + TQPointArray corner; corner.makeArc(corners[i].x(), corners[i].y(), 40, 40, i * 16 * 90, 16 * 90); corner.resize(corner.size() + 1); @@ -161,16 +161,16 @@ void KopeteBalloon::updateMask() // get screen-geometry for screen our anchor is on // (geometry can differ from screen to screen! - QRect deskRect = KGlobalSettings::desktopGeometry(mAnchor); + TQRect deskRect = KGlobalSettings::desktopGeometry(mAnchor); bool bottom = (mAnchor.y() + height()) > ((deskRect.y() + deskRect.height()-48)); bool right = (mAnchor.x() + width()) > ((deskRect.x() + deskRect.width()-48)); - QPointArray arrow(4); - arrow.setPoint(0, QPoint(right ? width() : 0, bottom ? height() : 0)); - arrow.setPoint(1, QPoint(right ? width() - 10 : 10, + TQPointArray arrow(4); + arrow.setPoint(0, TQPoint(right ? width() : 0, bottom ? height() : 0)); + arrow.setPoint(1, TQPoint(right ? width() - 10 : 10, bottom ? height() - 30 : 30)); - arrow.setPoint(2, QPoint(right ? width() - 30 : 30, + arrow.setPoint(2, TQPoint(right ? width() - 30 : 30, bottom ? height() - 10 : 10)); arrow.setPoint(3, arrow[0]); mask += arrow; |