diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /akregator/src/trayicon.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'akregator/src/trayicon.cpp')
-rw-r--r-- | akregator/src/trayicon.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/akregator/src/trayicon.cpp b/akregator/src/trayicon.cpp index 4b4f3153b..680f88ca4 100644 --- a/akregator/src/trayicon.cpp +++ b/akregator/src/trayicon.cpp @@ -36,10 +36,10 @@ #include <kpopupmenu.h> #include <kiconloader.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qfont.h> -#include <qtooltip.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqfont.h> +#include <tqtooltip.h> namespace Akregator { @@ -57,15 +57,15 @@ void TrayIcon::setInstance(TrayIcon* trayIcon) } -TrayIcon::TrayIcon(QWidget *parent, const char *name) +TrayIcon::TrayIcon(TQWidget *parent, const char *name) : KSystemTray(parent, name), m_unread(0) { m_defaultIcon=KSystemTray::loadIcon("akregator"); - QPixmap m_unreadIcon=KSystemTray::loadIcon("akregator_empty"); + TQPixmap m_unreadIcon=KSystemTray::loadIcon("akregator_empty"); m_lightIconImage=m_unreadIcon.convertToImage(); KIconEffect::deSaturate(m_lightIconImage, 0.60); setPixmap(m_defaultIcon); - QToolTip::add(this, i18n("Akregator - RSS Feed Reader")); + TQToolTip::add(this, i18n("Akregator - RSS Feed Reader")); } @@ -73,7 +73,7 @@ TrayIcon::~TrayIcon() {} -void TrayIcon::mousePressEvent(QMouseEvent *e) { +void TrayIcon::mousePressEvent(TQMouseEvent *e) { if (e->button() == LeftButton) { emit showPart(); } @@ -82,9 +82,9 @@ void TrayIcon::mousePressEvent(QMouseEvent *e) { } -QPixmap TrayIcon::takeScreenshot() const +TQPixmap TrayIcon::takeScreenshot() const { - QPoint g = mapToGlobal(pos()); + TQPoint g = mapToGlobal(pos()); int desktopWidth = kapp->desktop()->width(); int desktopHeight = kapp->desktop()->height(); int tw = width(); @@ -103,19 +103,19 @@ QPixmap TrayIcon::takeScreenshot() const y = desktopHeight - h; // Grab the desktop and draw a circle arround the icon: - QPixmap shot = QPixmap::grabWindow(qt_xrootwin(), x, y, w, h); - QPainter painter(&shot); + TQPixmap shot = TQPixmap::grabWindow(qt_xrootwin(), x, y, w, h); + TQPainter painter(&shot); const int MARGINS = 6; const int WIDTH = 3; int ax = g.x() - x - MARGINS -1; int ay = g.y() - y - MARGINS -1; - painter.setPen( QPen(Qt::red/*KApplication::palette().active().highlight()*/, WIDTH) ); + painter.setPen( TQPen(Qt::red/*KApplication::palette().active().highlight()*/, WIDTH) ); painter.drawArc(ax, ay, tw + 2*MARGINS, th + 2*MARGINS, 0, 16*360); painter.end(); // Paint the border const int BORDER = 1; - QPixmap finalShot(w + 2*BORDER, h + 2*BORDER); + TQPixmap finalShot(w + 2*BORDER, h + 2*BORDER); finalShot.fill(KApplication::palette().active().foreground()); painter.begin(&finalShot); painter.drawPixmap(BORDER, BORDER, shot); @@ -130,8 +130,8 @@ void TrayIcon::slotSetUnread(int unread) m_unread=unread; - QToolTip::remove(this); - QToolTip::add(this, i18n("Akregator - 1 unread article", "Akregator - %n unread articles", unread > 0 ? unread : 0)); + TQToolTip::remove(this); + TQToolTip::add(this, i18n("Akregator - 1 unread article", "Akregator - %n unread articles", unread > 0 ? unread : 0)); if (unread <= 0) { @@ -143,11 +143,11 @@ void TrayIcon::slotSetUnread(int unread) int oldW = pixmap()->size().width(); int oldH = pixmap()->size().height(); - QString uStr=QString::number( unread ); - QFont f=KGlobalSettings::generalFont(); + TQString uStr=TQString::number( unread ); + TQFont f=KGlobalSettings::generalFont(); f.setBold(true); float pointSize=f.pointSizeFloat(); - QFontMetrics fm(f); + TQFontMetrics fm(f); int w=fm.width(uStr); if( w > (oldW) ) { @@ -155,21 +155,21 @@ void TrayIcon::slotSetUnread(int unread) f.setPointSizeFloat(pointSize); } - QPixmap pix(oldW, oldH); + TQPixmap pix(oldW, oldH); pix.fill(Qt::white); - QPainter p(&pix); + TQPainter p(&pix); p.setFont(f); p.setPen(Qt::blue); p.drawText(pix.rect(), Qt::AlignCenter, uStr); pix.setMask(pix.createHeuristicMask()); - QImage img=pix.convertToImage(); + TQImage img=pix.convertToImage(); // overlay - QImage overlayImg=m_lightIconImage.copy(); + TQImage overlayImg=m_lightIconImage.copy(); KIconEffect::overlay(overlayImg, img); - QPixmap icon; + TQPixmap icon; icon.convertFromImage(overlayImg); setPixmap(icon); } @@ -177,7 +177,7 @@ void TrayIcon::slotSetUnread(int unread) void TrayIcon::viewButtonClicked() { - QWidget *p=static_cast<QWidget*>(parent()); + TQWidget *p=static_cast<TQWidget*>(parent()); KWin::forceActiveWindow(p->winId()); } |