From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- korganizer/timelabels.cpp | 66 +++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'korganizer/timelabels.cpp') diff --git a/korganizer/timelabels.cpp b/korganizer/timelabels.cpp index ab5967055..0c4956bd4 100644 --- a/korganizer/timelabels.cpp +++ b/korganizer/timelabels.cpp @@ -24,16 +24,16 @@ #include "timelabels.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -42,8 +42,8 @@ #include "koprefs.h" #include "koagenda.h" -TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +TimeLabels::TimeLabels(int rows,TQWidget *parent,const char *name,WFlags f) : + TQScrollView(parent,name,f) { mRows = rows; mMiniWidth = 0; @@ -59,7 +59,7 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : viewport()->setBackgroundMode( PaletteBackground ); - mMousePos = new QFrame(this); + mMousePos = new TQFrame(this); mMousePos->setLineWidth(0); mMousePos->setMargin(0); mMousePos->setBackgroundColor(Qt::red); @@ -67,7 +67,7 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : addChild(mMousePos, 0, 0); } -void TimeLabels::mousePosChanged(const QPoint &pos) +void TimeLabels::mousePosChanged(const TQPoint &pos) { moveChild(mMousePos, 0, pos.y()); } @@ -91,7 +91,7 @@ void TimeLabels::setCellHeight(double height) Optimization so that only the "dirty" portion of the scroll view is redrawn. Unfortunately, this is not called by default paintEvent() method. */ -void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) +void TimeLabels::drawContents(TQPainter *p,int cx, int cy, int cw, int ch) { // bug: the parameters cx and cw are the areas that need to be // redrawn, not the area of the widget. unfortunately, this @@ -104,11 +104,11 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) int cell = ((int)(cy/mCellHeight)); double y = cell * mCellHeight; - QFontMetrics fm = fontMetrics(); - QString hour; - QString suffix = "am"; + TQFontMetrics fm = fontMetrics(); + TQString hour; + TQString suffix = "am"; int timeHeight = fm.ascent(); - QFont nFont = font(); + TQFont nFont = font(); p->setFont( font() ); if (!KGlobal::locale()->use12Clock()) { @@ -121,18 +121,18 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) int pointS = nFont.pointSize(); while ( pointS > 4 ) { nFont.setPointSize( pointS ); - fm = QFontMetrics( nFont ); + fm = TQFontMetrics( nFont ); if ( fm.ascent() < mCellHeight ) break; -- pointS; } - fm = QFontMetrics( nFont ); + fm = TQFontMetrics( nFont ); timeHeight = fm.ascent(); } //timeHeight -= (timeHeight/4-2); - QFont sFont = nFont; + TQFont sFont = nFont; sFont.setPointSize( sFont.pointSize()/2 ); - QFontMetrics fmS( sFont ); + TQFontMetrics fmS( sFont ); int startW = mMiniWidth - frameWidth()-2 ; int tw2 = fmS.width(suffix); int divTimeHeight = (timeHeight-1) /2 - 1; @@ -183,7 +183,7 @@ void TimeLabels::updateConfig() setFont(KOPrefs::instance()->mTimeBarFont); - QString test = "20"; + TQString test = "20"; if ( KGlobal::locale()->use12Clock() ) test = "12"; mMiniWidth = fontMetrics().width( test ); @@ -192,9 +192,9 @@ void TimeLabels::updateConfig() else { test = "00"; } - QFont sFont = font(); + TQFont sFont = font(); sFont.setPointSize( sFont.pointSize()/2 ); - QFontMetrics fmS( sFont ); + TQFontMetrics fmS( sFont ); mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; // update geometry restrictions based on new settings setFixedWidth( mMiniWidth ); @@ -226,20 +226,20 @@ void TimeLabels::setAgenda(KOAgenda* agenda) { mAgenda = agenda; - connect(mAgenda, SIGNAL(mousePosSignal(const QPoint &)), this, SLOT(mousePosChanged(const QPoint &))); - connect(mAgenda, SIGNAL(enterAgenda()), this, SLOT(showMousePos())); - connect(mAgenda, SIGNAL(leaveAgenda()), this, SLOT(hideMousePos())); - connect(mAgenda, SIGNAL(gridSpacingYChanged( double ) ), this, SLOT( setCellHeight( double ) ) ); + connect(mAgenda, TQT_SIGNAL(mousePosSignal(const TQPoint &)), this, TQT_SLOT(mousePosChanged(const TQPoint &))); + connect(mAgenda, TQT_SIGNAL(enterAgenda()), this, TQT_SLOT(showMousePos())); + connect(mAgenda, TQT_SIGNAL(leaveAgenda()), this, TQT_SLOT(hideMousePos())); + connect(mAgenda, TQT_SIGNAL(gridSpacingYChanged( double ) ), this, TQT_SLOT( setCellHeight( double ) ) ); } /** This is called in response to repaint() */ -void TimeLabels::paintEvent(QPaintEvent*) +void TimeLabels::paintEvent(TQPaintEvent*) { // kdDebug(5850) << "paintevent..." << endl; // this is another hack! -// QPainter painter(this); - //QString c +// TQPainter painter(this); + //TQString c repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); } -- cgit v1.2.1