diff options
Diffstat (limited to 'kipi-plugins/calendar')
22 files changed, 494 insertions, 486 deletions
diff --git a/kipi-plugins/calendar/calevents.cpp b/kipi-plugins/calendar/calevents.cpp index b34dfb4..7792acb 100644 --- a/kipi-plugins/calendar/calevents.cpp +++ b/kipi-plugins/calendar/calevents.cpp @@ -20,7 +20,7 @@ * * ============================================================ */ -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kiconloader.h> #include <kfiledialog.h> @@ -32,12 +32,12 @@ namespace KIPICalendarPlugin { -CalEvents::CalEvents(QWidget *parent, const char *name) - : CalEventsBase(parent, name) +CalEvents::CalEvents(TQWidget *tqparent, const char *name) + : CalEventsBase(tqparent, name) { - KIconLoader * icons = new KIconLoader( QString( "MenuDlg" ) ); - ohBtn->setPixmap( icons->loadIcon( QString( "fileopen" ), KIcon::Toolbar ) ); - fhBtn->setPixmap( icons->loadIcon( QString( "fileopen" ), KIcon::Toolbar ) ); + KIconLoader * icons = new KIconLoader( TQString( "MenuDlg" ) ); + ohBtn->setPixmap( icons->loadIcon( TQString( "fileopen" ), KIcon::Toolbar ) ); + fhBtn->setPixmap( icons->loadIcon( TQString( "fileopen" ), KIcon::Toolbar ) ); } @@ -48,10 +48,10 @@ CalEvents::~CalEvents() void CalEvents::ohChooseSlot() { - QString temp; + TQString temp; temp = KFileDialog::getOpenFileName(ohFileEdit->text(), - QString( "*.ics" ), + TQString( "*.ics" ), this, i18n("Select 'Official Holidays' calendar file") ); if( temp.isEmpty() ) @@ -62,10 +62,10 @@ void CalEvents::ohChooseSlot() void CalEvents::fhChooseSlot() { - QString temp; + TQString temp; temp = KFileDialog::getOpenFileName(fhFileEdit->text(), - QString( "*.ics" ), + TQString( "*.ics" ), this, i18n("Select 'Family Holidays' calendar file") ); if( temp.isEmpty() ) diff --git a/kipi-plugins/calendar/calevents.h b/kipi-plugins/calendar/calevents.h index 621574a..92230d3 100644 --- a/kipi-plugins/calendar/calevents.h +++ b/kipi-plugins/calendar/calevents.h @@ -23,7 +23,7 @@ #ifndef KIPICALENDARPLUGINCALEVENTS_H #define KIPICALENDARPLUGINCALEVENTS_H -#include <qwidget.h> +#include <tqwidget.h> #include "caleventsbase.h" @@ -35,8 +35,9 @@ namespace KIPICalendarPlugin { class CalEvents : public CalEventsBase { Q_OBJECT + TQ_OBJECT public: - CalEvents(QWidget *parent = 0, const char *name = 0); + CalEvents(TQWidget *tqparent = 0, const char *name = 0); ~CalEvents(); diff --git a/kipi-plugins/calendar/caleventsbase.ui b/kipi-plugins/calendar/caleventsbase.ui index 99267b0..2c9066d 100644 --- a/kipi-plugins/calendar/caleventsbase.ui +++ b/kipi-plugins/calendar/caleventsbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>CalEventsBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>Form1</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -32,9 +32,9 @@ <string>Select an optional calendar file with the official holidays</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> @@ -44,14 +44,14 @@ <property name="name"> <cstring>ohFileEdit</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>300</width> <height>0</height> </size> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>ohBtn</cstring> </property> @@ -64,7 +64,7 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -77,7 +77,7 @@ <string>You can download a calendar for your country from http://www.icalshare.com/ or other sites. This is fully optional. All the events from this calendar will be printed red.</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> @@ -95,7 +95,7 @@ This is fully optional. All the events from this calendar will be printed red.</ <enum>Horizontal</enum> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -108,9 +108,9 @@ This is fully optional. All the events from this calendar will be printed red.</ <string>Select an optional calendar file with your "family holidays"</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> @@ -120,14 +120,14 @@ This is fully optional. All the events from this calendar will be printed red.</ <property name="name"> <cstring>fhFileEdit</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>300</width> <height>0</height> </size> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>fhBtn</cstring> </property> @@ -148,7 +148,7 @@ This is fully optional. All the events from this calendar will be printed red.</ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -161,7 +161,7 @@ This is fully optional. All the events from this calendar will be printed red.</ <string>You can create such a calendar using KOrganizer or any other calendar program. This is fully optional. All the events from this calendar will be printed green.</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> @@ -175,7 +175,7 @@ This is fully optional. All the events from this calendar will be printed green. <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>41</width> <height>140</height> @@ -198,11 +198,11 @@ This is fully optional. All the events from this calendar will be printed green. <slot>ohChooseSlot()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>fhChooseSlot()</slot> <slot>ohChooseSlot()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kipi-plugins/calendar/calformatter.cpp b/kipi-plugins/calendar/calformatter.cpp index fa02c2c..b51d6fd 100644 --- a/kipi-plugins/calendar/calformatter.cpp +++ b/kipi-plugins/calendar/calformatter.cpp @@ -21,9 +21,9 @@ * * ============================================================ */ -#include <qdatetime.h> -#include <qcolor.h> -#include <qmap.h> +#include <tqdatetime.h> +#include <tqcolor.h> +#include <tqmap.h> #include <kdebug.h> #include <kglobal.h> @@ -43,29 +43,29 @@ public: class Day { public: Day(){}; - Day(QColor c, QString d): color(c), description(d) {}; + Day(TQColor c, TQString d): color(c), description(d) {}; - QColor color; - QString description; + TQColor color; + TQString description; }; - QString ohFile; - QString fhFile; + TQString ohFile; + TQString fhFile; - QMap<QDate, Day> oh;//official holidays - QMap<QDate, Day> fh;//family holidays + TQMap<TQDate, Day> oh;//official holidays + TQMap<TQDate, Day> fh;//family holidays Data() { //you define a holiday that way: -oh[QDate(2005, 1, 1)] = Day(Qt::red, "New year!"); -//oh[QDate(2005, 1, 4)] = Day(Qt::red, "Fete Nat"); +oh[TQDate(2005, 1, 1)] = Day(TQt::red, "New year!"); +//oh[TQDate(2005, 1, 4)] = Day(TQt::red, "Fete Nat"); -fh[QDate(2005,1,3)] = Day(Qt::green, "Adam"); -//fh[QDate(2005, 1, 14)] = Day(Qt::green, "Maciek"); +fh[TQDate(2005,1,3)] = Day(TQt::green, "Adam"); +//fh[TQDate(2005, 1, 14)] = Day(TQt::green, "Maciek"); }; @@ -82,7 +82,7 @@ CalFormatter::~CalFormatter() { } -void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile) +void CalFormatter::init(int year, const TQString & ohFile, const TQString & fhFile) { if (initialized) return; @@ -98,7 +98,7 @@ void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile if (not(ohFile.isEmpty())) { calendar = new KCal::CalendarLocal("UTC"); if (calendar->load(ohFile)) { - QDate dtFirst, dtLast; + TQDate dtFirst, dtLast; KGlobal::locale()->calendar()->setYMD(dtFirst, year_, 1, 1); KGlobal::locale()->calendar()->setYMD(dtLast, year_ + 1, 1, 1); dtLast = dtLast.addDays(-1); @@ -107,7 +107,7 @@ void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile KCal::Event::List::iterator it; KCal::Recurrence *recur; - QDateTime dtCurrent; + TQDateTime dtCurrent; int counter = 0; for ( it = list.begin(); it != list.end(); ++it ) { @@ -116,15 +116,15 @@ void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile if ((*it)->doesRecur()) { recur = (*it)->recurrence(); - for (dtCurrent = recur->getNextDateTime(dtFirst.addDays(-1)); (dtCurrent <= dtLast) && dtCurrent.isValid(); dtCurrent = recur->getNextDateTime(dtCurrent)) + for (dtCurrent = recur->getNextDateTime(dtFirst.addDays(-1)); (dtCurrent <= TQDateTime(dtLast)) && dtCurrent.isValid(); dtCurrent = recur->getNextDateTime(dtCurrent)) { kdDebug(51000) << dtCurrent.toString() << endl; - d->oh[dtCurrent.date()] = CalFormatter::Data::Day(Qt::red, (*it)->summary()); + d->oh[dtCurrent.date()] = CalFormatter::Data::Day(TQt::red, (*it)->summary()); } } else - d->oh[(*it)->dtStart().date()] = CalFormatter::Data::Day(Qt::red, (*it)->summary()); + d->oh[(*it)->dtStart().date()] = CalFormatter::Data::Day(TQt::red, (*it)->summary()); } kdDebug(51000) << "Loaded " << counter << " events for year " << year_ << endl; } @@ -135,15 +135,15 @@ void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile calendar = new KCal::CalendarLocal("UTC"); if (calendar->load(fhFile)) { - KCal::Event::List list = calendar->rawEvents(QDate(year_,1,1), QDate(year_,12,31)); + KCal::Event::List list = calendar->rawEvents(TQDate(year_,1,1), TQDate(year_,12,31)); KCal::Event::List::iterator it; - QString eventDate; + TQString eventDate; int counter = 0; for ( it = list.begin(); it != list.end(); ++it ) { counter++; - d->fh[(*it)->dtStart().date()] = CalFormatter::Data::Day(Qt::red, (*it)->summary()); + d->fh[(*it)->dtStart().date()] = CalFormatter::Data::Day(TQt::red, (*it)->summary()); //kdDebug(51000) << eventDate << "----" << (*it)->summary() << endl; } kdDebug(51000) << "Loaded " << counter << " events for year " << year_ << endl; @@ -154,7 +154,7 @@ void CalFormatter::init(int year, const QString & ohFile, const QString & fhFile bool CalFormatter::isPrayDay(int month, int day) { - QDate dt; + TQDate dt; KGlobal::locale()->calendar()->setYMD(dt, year_, month, day); return (dt.dayOfWeek() == KGlobal::locale()->calendar()->weekDayOfPray()); } @@ -164,49 +164,49 @@ bool CalFormatter::isPrayDay(int month, int day) */ bool KIPICalendarPlugin::CalFormatter::isSpecial(int month, int day) { - QDate dt; + TQDate dt; KGlobal::locale()->calendar()->setYMD(dt, year_, month, day); - return (isPrayDay(month,day) || d->oh.contains(dt) || d->fh.contains(dt)); + return (isPrayDay(month,day) || d->oh.tqcontains(dt) || d->fh.tqcontains(dt)); } /*! Returns the color to be used for painting of the day info */ -QColor KIPICalendarPlugin::CalFormatter::getDayColor(int month, int day) +TQColor KIPICalendarPlugin::CalFormatter::getDayColor(int month, int day) { - QDate dt; + TQDate dt; KGlobal::locale()->calendar()->setYMD(dt, year_, month, day); if (isPrayDay(month, day)) - return Qt::red; + return TQt::red; - if (d->oh.contains(dt)) - return Qt::red; + if (d->oh.tqcontains(dt)) + return TQt::red; - if (d->fh.contains(dt)) - return Qt::green; + if (d->fh.tqcontains(dt)) + return TQt::green; //default - return Qt::black; + return TQt::black; } /*! Returns the description of the day to be painted on the calendar. */ -QString KIPICalendarPlugin::CalFormatter::getDayDescr(int month, int day) +TQString KIPICalendarPlugin::CalFormatter::getDayDescr(int month, int day) { - QDate dt; + TQDate dt; KGlobal::locale()->calendar()->setYMD(dt, year_, month, day); - QString ret; + TQString ret; - if (d->oh.contains(dt)) + if (d->oh.tqcontains(dt)) ret = d->oh[dt].description; - if (d->fh.contains(dt)) { + if (d->fh.tqcontains(dt)) { if (ret.isNull()) return d->fh[dt].description; else diff --git a/kipi-plugins/calendar/calformatter.h b/kipi-plugins/calendar/calformatter.h index d66e652..250a70a 100644 --- a/kipi-plugins/calendar/calformatter.h +++ b/kipi-plugins/calendar/calformatter.h @@ -24,16 +24,17 @@ #ifndef KIPICALENDARPLUGINCALFORMATTER_H #define KIPICALENDARPLUGINCALFORMATTER_H -#include <qobject.h> +#include <tqobject.h> namespace KIPICalendarPlugin { /** @author Maciek Borowka */ -class CalFormatter : public QObject +class CalFormatter : public TQObject { Q_OBJECT + TQ_OBJECT public: CalFormatter(); @@ -41,10 +42,10 @@ public: bool isSpecial(int month, int day); - QColor getDayColor(int month, int day); - QString getDayDescr(int month, int day); + TQColor getDayColor(int month, int day); + TQString getDayDescr(int month, int day); - void init(int year, const QString & ohFile, const QString & fhFile); + void init(int year, const TQString & ohFile, const TQString & fhFile); protected: int year_; diff --git a/kipi-plugins/calendar/calpainter.cpp b/kipi-plugins/calendar/calpainter.cpp index 998cb85..d481b96 100644 --- a/kipi-plugins/calendar/calpainter.cpp +++ b/kipi-plugins/calendar/calpainter.cpp @@ -19,17 +19,17 @@ * * ============================================================ */ -// Qt includes. - -#include <qpainter.h> -#include <qrect.h> -#include <qpaintdevice.h> -#include <qdatetime.h> -#include <qpaintdevicemetrics.h> -#include <qstring.h> -#include <qimage.h> -#include <qtimer.h> -#include <qwmatrix.h> +// TQt includes. + +#include <tqpainter.h> +#include <tqrect.h> +#include <tqpaintdevice.h> +#include <tqdatetime.h> +#include <tqpaintdevicemetrics.h> +#include <tqstring.h> +#include <tqimage.h> +#include <tqtimer.h> +#include <tqwmatrix.h> // KDE includes. @@ -48,7 +48,7 @@ namespace KIPICalendarPlugin { -CalPainter::CalPainter(QPaintDevice *pd) +CalPainter::CalPainter(TQPaintDevice *pd) { pd_ = pd; } @@ -68,7 +68,7 @@ void CalPainter::paint(bool useDeviceMetrics) { if (!pd_) return; - QPainter *painter = new QPainter(); + TQPainter *painter = new TQPainter(); painter->begin(pd_); int width = 0; @@ -80,7 +80,7 @@ void CalPainter::paint(bool useDeviceMetrics) height = params.height; } else { - QPaintDeviceMetrics metrics( painter->device()); + TQPaintDeviceMetrics metrics( painter->device()); width = metrics.width(); height = metrics.height(); } @@ -93,7 +93,7 @@ void CalPainter::paint(bool useDeviceMetrics) for (int i=0; i<42; i++) days[i] = -1; - QDate d; + TQDate d; KGlobal::locale()->calendar()->setYMD(d, year_, month_, 1); int s = d.dayOfWeek(); @@ -106,7 +106,7 @@ void CalPainter::paint(bool useDeviceMetrics) // ----------------------------------------------- - QRect rCal, rImage, rCalHeader; + TQRect rCal, rImage, rCalHeader; int cellSizeX; int cellSizeY; @@ -114,7 +114,7 @@ void CalPainter::paint(bool useDeviceMetrics) case(CalParams::Top): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setWidth(width); rImage.setHeight((int)(height * (params.ratio)/(params.ratio + 100))); @@ -123,11 +123,11 @@ void CalPainter::paint(bool useDeviceMetrics) cellSizeX = (width - 20)/7; cellSizeY = remainingHeight/8; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight((int)(cellSizeY*7)); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight((int)(cellSizeY)); rCalHeader.moveTop(rImage.bottom()); @@ -141,7 +141,7 @@ void CalPainter::paint(bool useDeviceMetrics) case(CalParams::Left): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setHeight(height); rImage.setWidth((int)(width * (params.ratio)/(params.ratio + 100))); @@ -150,11 +150,11 @@ void CalPainter::paint(bool useDeviceMetrics) cellSizeX = remainingWidth/8; cellSizeY = (height - 20)/7; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight(cellSizeY*7); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight(cellSizeY); rCalHeader.moveLeft(rImage.right() + cellSizeX); @@ -168,7 +168,7 @@ void CalPainter::paint(bool useDeviceMetrics) case(CalParams::Right): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setHeight(height); rImage.setWidth((int)(width * (params.ratio)/(params.ratio + 100))); @@ -177,11 +177,11 @@ void CalPainter::paint(bool useDeviceMetrics) cellSizeX = remainingWidth/8; cellSizeY = (height - 20)/7; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight(cellSizeY*7); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight(cellSizeY); rCalHeader.moveTop(height/2 - @@ -202,24 +202,24 @@ void CalPainter::paint(bool useDeviceMetrics) // --------------------------------------------------------------- - painter->fillRect(0,0,width, height, Qt::white); - painter->fillRect(rImage, Qt::black); + painter->fillRect(0,0,width, height, TQt::white); + painter->fillRect(rImage, TQt::black); painter->setFont(params.baseFont); // --------------------------------------------------------------- painter->save(); - QFont f(params.baseFont); + TQFont f(params.baseFont); f.setBold(true); f.setPixelSize(f.pixelSize() + 5); painter->setFont(f); - painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter, - QString::number(year_)); + painter->drawText(rCalHeader, TQt::AlignLeft|TQt::AlignVCenter, + TQString::number(year_)); #if KDE_IS_VERSION(3,2,0) - painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter, + painter->drawText(rCalHeader, TQt::AlignRight|TQt::AlignVCenter, KGlobal::locale()->calendar()->monthName(month_, year_)); #else - painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter, + painter->drawText(rCalHeader, TQt::AlignRight|TQt::AlignVCenter, KGlobal::locale()->monthName(month_)); #endif painter->restore(); @@ -227,7 +227,7 @@ void CalPainter::paint(bool useDeviceMetrics) // --------------------------------------------------------------- int sx, sy; - QRect r, rsmall; + TQRect r, rsmall; r.setWidth(cellSizeX); r.setHeight(cellSizeY); @@ -236,7 +236,7 @@ void CalPainter::paint(bool useDeviceMetrics) painter->save(); - painter->setPen(Qt::red); + painter->setPen(TQt::red); sy = rCal.top(); for (int i=0; i<7; i++) { @@ -245,15 +245,15 @@ void CalPainter::paint(bool useDeviceMetrics) dayname = dayname-7; sx = cellSizeX * i + rCal.left(); - r.moveTopLeft(QPoint(sx,sy)); + r.moveTopLeft(TQPoint(sx,sy)); rsmall = r; rsmall.setWidth(r.width() - 2); rsmall.setHeight(r.height() - 2); #if KDE_IS_VERSION(3,2,0) - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, KGlobal::locale()->calendar()->weekDayName(dayname, true)); #else - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, KGlobal::locale()->weekDayName(dayname, true)); #endif @@ -265,13 +265,13 @@ void CalPainter::paint(bool useDeviceMetrics) sy = cellSizeY * (j + 1) + rCal.top(); for (int i=0; i<7; i++) { sx = cellSizeX * i + rCal.left(); - r.moveTopLeft(QPoint(sx,sy)); + r.moveTopLeft(TQPoint(sx,sy)); rsmall = r; rsmall.setWidth(r.width() - 2); rsmall.setHeight(r.height() - 2); if (days[index] != -1) - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, - QString::number(days[index])); + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, + TQString::number(days[index])); index++; } } @@ -299,16 +299,16 @@ void CalPainter::paint(bool useDeviceMetrics) delete painter; } -CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, - const KURL& imagePath, int angle, CalFormatter *formatter, QPainter *painter) - : QObject(parent), painter_(painter) +CalBlockPainter::CalBlockPainter(TQObject *tqparent, int year, int month, + const KURL& imagePath, int angle, CalFormatter *formatter, TQPainter *painter) + : TQObject(tqparent), painter_(painter) { int width = 0; int height = 0; CalParams& params = CalSettings::instance()->calParams; - QPaintDeviceMetrics metrics( painter->device()); + TQPaintDeviceMetrics metrics( painter->device()); width = metrics.width(); height = metrics.height(); @@ -320,7 +320,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, for (int i=0; i<42; i++) days[i] = -1; - QDate d; + TQDate d; KGlobal::locale()->calendar()->setYMD(d, year, month, 1); int s = d.dayOfWeek(); @@ -333,7 +333,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, // ----------------------------------------------- - QRect rCal, rImage, rCalHeader; + TQRect rCal, rImage, rCalHeader; int cellSizeX; int cellSizeY; @@ -341,7 +341,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, case(CalParams::Top): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setWidth(width); rImage.setHeight((int)(height * (params.ratio)/(params.ratio + 100))); @@ -350,11 +350,11 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, cellSizeX = (width - 20)/7; cellSizeY = remainingHeight/8; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight((int)(cellSizeY*7)); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight((int)(cellSizeY)); rCalHeader.moveTop(rImage.bottom()); @@ -368,7 +368,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, case(CalParams::Left): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setHeight(height); rImage.setWidth((int)(width * (params.ratio)/(params.ratio + 100))); @@ -377,11 +377,11 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, cellSizeX = remainingWidth/8; cellSizeY = (height - 20)/7; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight(cellSizeY*7); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight(cellSizeY); rCalHeader.moveLeft(rImage.right() + cellSizeX); @@ -395,7 +395,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, case(CalParams::Right): { - rImage = QRect(0,0,0,0); + rImage = TQRect(0,0,0,0); rImage.setHeight(height); rImage.setWidth((int)(width * (params.ratio)/(params.ratio + 100))); @@ -404,11 +404,11 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, cellSizeX = remainingWidth/8; cellSizeY = (height - 20)/7; - rCal = QRect(0,0,0,0); + rCal = TQRect(0,0,0,0); rCal.setWidth(cellSizeX*7); rCal.setHeight(cellSizeY*7); - rCalHeader = QRect(0,0,0,0); + rCalHeader = TQRect(0,0,0,0); rCalHeader.setWidth(rCal.width()); rCalHeader.setHeight(cellSizeY); rCalHeader.moveTop(height/2 - @@ -429,23 +429,23 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, // --------------------------------------------------------------- - painter->fillRect(0,0,width, height, Qt::white); + painter->fillRect(0,0,width, height, TQt::white); painter->setFont(params.baseFont); // --------------------------------------------------------------- painter->save(); - QFont f(params.baseFont); + TQFont f(params.baseFont); f.setBold(true); f.setPixelSize(f.pixelSize() + 5); painter->setFont(f); - painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter, - QString::number(year)); + painter->drawText(rCalHeader, TQt::AlignLeft|TQt::AlignVCenter, + TQString::number(year)); #if KDE_IS_VERSION(3,2,0) - painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter, + painter->drawText(rCalHeader, TQt::AlignRight|TQt::AlignVCenter, KGlobal::locale()->calendar()->monthName(month, year)); #else - painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter, + painter->drawText(rCalHeader, TQt::AlignRight|TQt::AlignVCenter, KGlobal::locale()->monthName(month)); #endif painter->restore(); @@ -453,7 +453,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, // --------------------------------------------------------------- int sx, sy; - QRect r, rsmall, rSpecial; + TQRect r, rsmall, rSpecial; r.setWidth(cellSizeX); r.setHeight(cellSizeY); @@ -462,7 +462,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, painter->save(); - painter->setPen(Qt::red); + painter->setPen(TQt::red); sy = rCal.top(); for (int i=0; i<7; i++) { @@ -471,15 +471,15 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, dayname = dayname-7; sx = cellSizeX * i + rCal.left(); - r.moveTopLeft(QPoint(sx,sy)); + r.moveTopLeft(TQPoint(sx,sy)); rsmall = r; rsmall.setWidth(r.width() - 2); rsmall.setHeight(r.height() - 2); #if KDE_IS_VERSION(3,2,0) - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, KGlobal::locale()->calendar()->weekDayName(dayname, true)); #else - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, KGlobal::locale()->weekDayName(dayname, true)); #endif } @@ -490,7 +490,7 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, sy = cellSizeY * (j + 1) + rCal.top(); for (int i=0; i<7; i++) { sx = cellSizeX * i + rCal.left(); - r.moveTopLeft(QPoint(sx,sy)); + r.moveTopLeft(TQPoint(sx,sy)); rsmall = r; rsmall.setWidth(r.width() - 2); rsmall.setHeight(r.height() - 2); @@ -499,25 +499,25 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, painter->save(); painter->setPen( formatter->getDayColor(month, days[index]) ); - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, - QString::number(days[index])); + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, + TQString::number(days[index])); - QString descr = formatter->getDayDescr(month, days[index]); + TQString descr = formatter->getDayDescr(month, days[index]); kdDebug(51000) << "Painting special info: '" << descr << "' for date " << days[index] << "/" << month << endl; rSpecial = rsmall; rSpecial.moveBy(2,0); - QFont f(params.baseFont); + TQFont f(params.baseFont); f.setPixelSize(f.pixelSize() / 3); painter->setFont(f); - painter->drawText(rSpecial, Qt::AlignLeft|Qt::AlignTop, descr); + painter->drawText(rSpecial, TQt::AlignLeft|TQt::AlignTop, descr); painter->restore(); } else { - painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom, - QString::number(days[index])); + painter->drawText(rsmall, TQt::AlignRight|TQt::AlignBottom, + TQString::number(days[index])); } } index++; @@ -544,16 +544,16 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, // --------------------------------------------------------------- - QImage img = QImage(imagePath.path()); // PENDING(blackie) handle general URLS. + TQImage img = TQImage(imagePath.path()); // PENDING(blackie) handle general URLS. if (!img.isNull()) { if ( angle != 0 ) { - QWMatrix matrix; + TQWMatrix matrix; matrix.rotate( angle ); img = img.xForm( matrix ); } - image_ = new QImage(img.smoothScale(rImage.width(), rImage.height(), - QImage::ScaleMin)); + image_ = new TQImage(img.smoothScale(rImage.width(), rImage.height(), + TQ_ScaleMin)); // Center the image int x = rImage.x() + rImage.width()/2 - image_->width()/2; int y = rImage.y() + rImage.height()/2 - image_->height()/2; @@ -587,13 +587,13 @@ CalBlockPainter::CalBlockPainter(QObject *parent, int year, int month, pb->h = image_->height() - pb->y; currBlock_ = 0; - QTimer::singleShot(10, this, SLOT(slotPaintNextBlock())); + TQTimer::singleShot(10, this, TQT_SLOT(slotPaintNextBlock())); } else { image_ = 0; blocks_ = 0; - painter->fillRect(rImage, Qt::blue); + painter->fillRect(rImage, TQt::blue); } } @@ -610,7 +610,7 @@ void CalBlockPainter::slotPaintNextBlock() b.w, b.h); currBlock_++; if (currBlock_ < numBlocks_) { - QTimer::singleShot(10, this, SLOT(slotPaintNextBlock())); + TQTimer::singleShot(10, this, TQT_SLOT(slotPaintNextBlock())); emit signalProgress(currBlock_+1, numBlocks_); } else { diff --git a/kipi-plugins/calendar/calpainter.h b/kipi-plugins/calendar/calpainter.h index 3d0a89a..7a4a4e4 100644 --- a/kipi-plugins/calendar/calpainter.h +++ b/kipi-plugins/calendar/calpainter.h @@ -22,10 +22,10 @@ #ifndef CALPAINTER_H #define CALPAINTER_H -// Qt includes. +// TQt includes. -#include <qobject.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqvaluelist.h> // KDE includes. @@ -36,11 +36,11 @@ #include "calformatter.h" -class QPaintDevice; -class QPainter; -class QString; -class QTimer; -class QImage; +class TQPaintDevice; +class TQPainter; +class TQString; +class TQTimer; +class TQImage; namespace KIPICalendarPlugin { @@ -49,7 +49,7 @@ class CalPainter { public: - CalPainter(QPaintDevice *pd); + CalPainter(TQPaintDevice *pd); ~CalPainter(); void setYearMonth(int year, int month); @@ -57,19 +57,20 @@ public: private: - QPaintDevice *pd_; + TQPaintDevice *pd_; int year_; int month_; }; -class CalBlockPainter : public QObject +class CalBlockPainter : public TQObject { Q_OBJECT + TQ_OBJECT public: - CalBlockPainter(QObject *parent, int year, int month, - const KURL& imagePath, int angle, CalFormatter* formatter, QPainter *painter); + CalBlockPainter(TQObject *tqparent, int year, int month, + const KURL& imagePath, int angle, CalFormatter* formatter, TQPainter *painter); ~CalBlockPainter(); signals: @@ -88,9 +89,9 @@ private: struct Block *blocks_; int numBlocks_; int currBlock_; - QTimer *timer_; - QPainter *painter_; - QImage *image_; + TQTimer *timer_; + TQPainter *painter_; + TQImage *image_; private slots: diff --git a/kipi-plugins/calendar/calprint.h b/kipi-plugins/calendar/calprint.h index 19349dc..cdc33c5 100644 --- a/kipi-plugins/calendar/calprint.h +++ b/kipi-plugins/calendar/calprint.h @@ -22,7 +22,7 @@ #ifndef CALPRINT_H #define CALPRINT_H -#include <qwidget.h> +#include <tqwidget.h> #endif /* CALPRINT_H */ diff --git a/kipi-plugins/calendar/calselect.cpp b/kipi-plugins/calendar/calselect.cpp index ea0d17c..20058d4 100644 --- a/kipi-plugins/calendar/calselect.cpp +++ b/kipi-plugins/calendar/calselect.cpp @@ -19,15 +19,15 @@ * * ============================================================ */ -// Qt includes. +// TQt includes. -#include <qhgroupbox.h> -#include <qlayout.h> -#include <qspinbox.h> -#include <qdatetime.h> -#include <qlabel.h> -#include <qframe.h> -#include <qpixmap.h> +#include <tqhgroupbox.h> +#include <tqlayout.h> +#include <tqspinbox.h> +#include <tqdatetime.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqpixmap.h> // KDE includes. @@ -47,10 +47,10 @@ namespace KIPICalendarPlugin { -CalSelect::CalSelect(KIPI::Interface* interface, QWidget *parent, const char* name) - : QWidget(parent, name) +CalSelect::CalSelect(KIPI::Interface* interface, TQWidget *tqparent, const char* name) + : TQWidget(tqparent, name) { - mwVector_ = new QPtrVector<MonthWidget>(MAX_MONTHS); + mwVector_ = new TQPtrVector<MonthWidget>(MAX_MONTHS); monthBoxLayout_ = NULL; setupView( interface ); } @@ -62,42 +62,42 @@ CalSelect::~CalSelect() void CalSelect::setupView( KIPI::Interface* interface ) { - QVBoxLayout *mainLayout = new QVBoxLayout(this, 6, 11); + TQVBoxLayout *mainLayout = new TQVBoxLayout(this, 6, 11); // ---------------------------------------------------------------- setCaption(i18n("Create Calendar")); - QHGroupBox *yearBox = new QHGroupBox(i18n("Select Year"), this); - yearBox->layout()->addItem(new QSpacerItem(5,5, - QSizePolicy::Expanding, - QSizePolicy::Minimum)); - yearSpin_ = new QSpinBox(KGlobal::locale()->calendar()->minValidYear(), + TQHGroupBox *yearBox = new TQHGroupBox(i18n("Select Year"), this); + yearBox->tqlayout()->addItem(new TQSpacerItem(5,5, + TQSizePolicy::Expanding, + TQSizePolicy::Minimum)); + yearSpin_ = new TQSpinBox(KGlobal::locale()->calendar()->minValidYear(), KGlobal::locale()->calendar()->maxValidYear(), 1,yearBox); - yearSpin_->setValue(KGlobal::locale()->calendar()->year(QDate::currentDate())); + yearSpin_->setValue(KGlobal::locale()->calendar()->year(TQDate::tqcurrentDate())); slotYearChanged(yearSpin_->value()); - connect(yearSpin_, SIGNAL(valueChanged(int)), - SLOT(slotYearChanged(int))); + connect(yearSpin_, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotYearChanged(int))); mainLayout->addWidget(yearBox); // ---------------------------------------------------------------- - QGroupBox *monthBox = new QGroupBox(i18n("Select Images"), this); + TQGroupBox *monthBox = new TQGroupBox(i18n("Select Images"), this); monthBox->setColumnLayout(0, Qt::Vertical ); - monthBox->layout()->setSpacing( 6 ); - monthBox->layout()->setMargin( 11 ); + monthBox->tqlayout()->setSpacing( 6 ); + monthBox->tqlayout()->setMargin( 11 ); - monthBoxLayout_ = new QGridLayout(monthBox->layout()); - monthBoxLayout_->setAlignment( Qt::AlignCenter ); + monthBoxLayout_ = new TQGridLayout(monthBox->tqlayout()); + monthBoxLayout_->tqsetAlignment( TQt::AlignCenter ); KURL::List urlList; KIPI::ImageCollection images = interface->currentSelection(); if ( images.isValid() && !images.images().isEmpty()) urlList = images.images(); - QDate d; + TQDate d; KGlobal::locale()->calendar()->setYMD(d, yearSpin_->value(), 1, 1); unsigned int months = KGlobal::locale()->calendar()->monthsInYear(d); // span the monthWidgets over 2 rows. inRow should usually be 6 or 7 (for 12 or 13 months) @@ -115,8 +115,8 @@ void CalSelect::setupView( KIPI::Interface* interface ) mwVector_->insert(i, w); } - QLabel* tLabel = - new QLabel(i18n("Left click on Months to Select Images. " + TQLabel* tLabel = + new TQLabel(i18n("Left click on Months to Select Images. " "Right click to Clear Month.\n" "You can also drag and drop images onto the Months"), monthBox); @@ -127,14 +127,14 @@ void CalSelect::setupView( KIPI::Interface* interface ) // ---------------------------------------------------------------- - mainLayout->addItem(new QSpacerItem(5,5,QSizePolicy::Minimum, - QSizePolicy::Expanding)); + mainLayout->addItem(new TQSpacerItem(5,5,TQSizePolicy::Minimum, + TQSizePolicy::Expanding)); } void CalSelect::slotYearChanged(int year) { int i, months; - QDate d, oldD; + TQDate d, oldD; KGlobal::locale()->calendar()->setYMD(d, year, 1, 1); KGlobal::locale()->calendar()->setYMD(oldD, CalSettings::instance()->getYear(), 1, 1); months = KGlobal::locale()->calendar()->monthsInYear(d); diff --git a/kipi-plugins/calendar/calselect.h b/kipi-plugins/calendar/calselect.h index 2038392..d0636b9 100644 --- a/kipi-plugins/calendar/calselect.h +++ b/kipi-plugins/calendar/calselect.h @@ -22,38 +22,39 @@ #ifndef CALSELECT_H #define CALSELECT_H -// Qt includes. +// TQt includes. -#include <qwidget.h> -#include <qptrvector.h> +#include <tqwidget.h> +#include <tqptrvector.h> // LibKIPi includes. #include <libkipi/interface.h> -class QSpinBox; +class TQSpinBox; namespace KIPICalendarPlugin { class MonthWidget; -class CalSelect : public QWidget +class CalSelect : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CalSelect( KIPI::Interface* interface, QWidget *parent, const char* name=0); + CalSelect( KIPI::Interface* interface, TQWidget *tqparent, const char* name=0); ~CalSelect(); private: void setupView( KIPI::Interface* interface ); - QPtrVector<MonthWidget> *mwVector_; - QSpinBox *yearSpin_; - QGridLayout *monthBoxLayout_; + TQPtrVector<MonthWidget> *mwVector_; + TQSpinBox *yearSpin_; + TQGridLayout *monthBoxLayout_; private slots: diff --git a/kipi-plugins/calendar/calsettings.cpp b/kipi-plugins/calendar/calsettings.cpp index 2c5f112..bf008c0 100644 --- a/kipi-plugins/calendar/calsettings.cpp +++ b/kipi-plugins/calendar/calsettings.cpp @@ -67,7 +67,7 @@ void CalSettings::setImage(int month, const KURL& path) KURL CalSettings::getImage(int month) const { - return monthMap_.contains(month) ? monthMap_[month] : KURL(); + return monthMap_.tqcontains(month) ? monthMap_[month] : KURL(); } } // NameSpace KIPICalendarPlugin diff --git a/kipi-plugins/calendar/calsettings.h b/kipi-plugins/calendar/calsettings.h index 6b6dd70..e2e2b92 100644 --- a/kipi-plugins/calendar/calsettings.h +++ b/kipi-plugins/calendar/calsettings.h @@ -22,11 +22,11 @@ #ifndef CALSETTINGS_H #define CALSETTINGS_H -// Qt includes. +// TQt includes. -#include <qmap.h> -#include <qstring.h> -#include <qfont.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqfont.h> // KDE includes. @@ -55,7 +55,7 @@ public: bool drawLines; float ratio; ImagePosition imgPos; - QFont baseFont; + TQFont baseFont; }; class CalSettings @@ -78,7 +78,7 @@ private: static CalSettings* instance_; - QMap<int,KURL> monthMap_; + TQMap<int,KURL> monthMap_; int year_; }; diff --git a/kipi-plugins/calendar/caltemplate.cpp b/kipi-plugins/calendar/caltemplate.cpp index 238e2a5..6f54541 100644 --- a/kipi-plugins/calendar/caltemplate.cpp +++ b/kipi-plugins/calendar/caltemplate.cpp @@ -19,25 +19,25 @@ * * ============================================================ */ -// Qt includes. - -#include <qvariant.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qbuttongroup.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qfontdatabase.h> -#include <qpaintdevicemetrics.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qprinter.h> +// TQt includes. + +#include <tqvariant.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqbuttongroup.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqfontdatabase.h> +#include <tqpaintdevicemetrics.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqprinter.h> // KDE includes. @@ -54,108 +54,108 @@ namespace KIPICalendarPlugin { -CalTemplate::CalTemplate(QWidget* parent, const char* name) - : QWidget(parent, name) +CalTemplate::CalTemplate(TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { - QGridLayout *mainLayout = new QGridLayout(this, 1, 1, 5, 5); + TQGridLayout *mainLayout = new TQGridLayout(this, 1, 1, 5, 5); // ---------------------------------------------------------------- previewSize_ = 300; - QGroupBox *boxPreview_ = new QGroupBox( i18n("Preview"), this ); + TQGroupBox *boxPreview_ = new TQGroupBox( i18n("Preview"), this ); boxPreview_->setColumnLayout(0, Qt::Vertical); - boxPreview_->layout()->setMargin( 5 ); + boxPreview_->tqlayout()->setMargin( 5 ); - QVBoxLayout *previewLayout = new QVBoxLayout(boxPreview_->layout()); + TQVBoxLayout *previewLayout = new TQVBoxLayout(boxPreview_->tqlayout()); calWidget_ = new CalWidget(boxPreview_); - previewLayout->addWidget(calWidget_, 0, Qt::AlignCenter); + previewLayout->addWidget(calWidget_, 0, TQt::AlignCenter); mainLayout->addWidget( boxPreview_, 0, 0 ); // --------------------------------------------------------------- - QGroupBox *gbox = new QGroupBox( i18n("Settings"), this ); + TQGroupBox *gbox = new TQGroupBox( i18n("Settings"), this ); gbox->setColumnLayout(0, Qt::Vertical ); - gbox->layout()->setSpacing( 11 ); - gbox->layout()->setMargin( 6 ); - QVBoxLayout* gboxLayout = new QVBoxLayout( gbox->layout() ); + gbox->tqlayout()->setSpacing( 11 ); + gbox->tqlayout()->setMargin( 6 ); + TQVBoxLayout* gboxLayout = new TQVBoxLayout( gbox->tqlayout() ); // --------------------------------------------------------------- - QHBoxLayout *hlayout = new QHBoxLayout( 0, 0, 5 ); - hlayout->addWidget( new QLabel(i18n("Paper size:"), gbox) ); + TQHBoxLayout *htqlayout = new TQHBoxLayout( 0, 0, 5 ); + htqlayout->addWidget( new TQLabel(i18n("Paper size:"), gbox) ); - comboPaperSize_ = new QComboBox(false, gbox); - hlayout->addWidget(comboPaperSize_); - gboxLayout->addLayout( hlayout ); + comboPaperSize_ = new TQComboBox(false, gbox); + htqlayout->addWidget(comboPaperSize_); + gboxLayout->addLayout( htqlayout ); - QStringList paperSizes; + TQStringList paperSizes; paperSizes << "A4"; paperSizes << "US Letter"; comboPaperSize_->insertStringList(paperSizes); - connect(comboPaperSize_, SIGNAL(activated(int)), - SLOT(slotParamsChanged())); + connect(comboPaperSize_, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotParamsChanged())); // --------------------------------------------------------------- - btnGroupImagePos_ = new QVButtonGroup(i18n("Image Position"), gbox); + btnGroupImagePos_ = new TQVButtonGroup(i18n("Image Position"), gbox); btnGroupImagePos_->setRadioButtonExclusive(true); // Insert the buttons in the order Top, Left, Right so that they // get the corresponding ids - QRadioButton* radioBtn = new QRadioButton(i18n("Top"), btnGroupImagePos_); + TQRadioButton* radioBtn = new TQRadioButton(i18n("Top"), btnGroupImagePos_); radioBtn->setChecked(true); Q_ASSERT(btnGroupImagePos_->id( radioBtn ) == CalParams::Top); - radioBtn = new QRadioButton(i18n("Left"), btnGroupImagePos_); + radioBtn = new TQRadioButton(i18n("Left"), btnGroupImagePos_); Q_ASSERT(btnGroupImagePos_->id( radioBtn ) == CalParams::Left); - radioBtn = new QRadioButton(i18n("Right"), btnGroupImagePos_); + radioBtn = new TQRadioButton(i18n("Right"), btnGroupImagePos_); Q_ASSERT(btnGroupImagePos_->id( radioBtn ) == CalParams::Right); gboxLayout->addWidget( btnGroupImagePos_ ); - connect(btnGroupImagePos_, SIGNAL(clicked(int)), - SLOT(slotParamsChanged())); + connect(btnGroupImagePos_, TQT_SIGNAL(clicked(int)), + TQT_SLOT(slotParamsChanged())); // --------------------------------------------------------------- - checkBoxDrawLines_ = new QCheckBox(i18n("Draw lines in calendar"), gbox); + checkBoxDrawLines_ = new TQCheckBox(i18n("Draw lines in calendar"), gbox); gboxLayout->addWidget( checkBoxDrawLines_ ); checkBoxDrawLines_->setChecked(true); - connect(checkBoxDrawLines_, SIGNAL(toggled(bool)), - SLOT(slotParamsChanged())); + connect(checkBoxDrawLines_, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotParamsChanged())); // --------------------------------------------------------------- - hlayout = new QHBoxLayout( 0, 0, 5 ); + htqlayout = new TQHBoxLayout( 0, 0, 5 ); - hlayout->addWidget(new QLabel(i18n("Image to text ratio:"), gbox)); + htqlayout->addWidget(new TQLabel(i18n("Image to text ratio:"), gbox)); - sliderRatio_ = new QSlider(50,300,5,100,Qt::Horizontal,gbox); - hlayout->addWidget( sliderRatio_ ); + sliderRatio_ = new TQSlider(50,300,5,100,Qt::Horizontal,gbox); + htqlayout->addWidget( sliderRatio_ ); - gboxLayout->addLayout( hlayout ); + gboxLayout->addLayout( htqlayout ); - connect(sliderRatio_, SIGNAL(valueChanged(int)), - SLOT(slotParamsChanged())); + connect(sliderRatio_, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotParamsChanged())); // --------------------------------------------------------------- - hlayout = new QHBoxLayout( 0, 0, 5 ); + htqlayout = new TQHBoxLayout( 0, 0, 5 ); - hlayout->addWidget(new QLabel(i18n("Font:"), gbox)); + htqlayout->addWidget(new TQLabel(i18n("Font:"), gbox)); - comboFont_ = new QComboBox(false, gbox); - hlayout->addWidget( comboFont_ ); + comboFont_ = new TQComboBox(false, gbox); + htqlayout->addWidget( comboFont_ ); - QFontDatabase fontDB; - QStringList families(fontDB.families()); - QStringList smoothScalableFamilies; - for (QStringList::iterator it=families.begin(); it != families.end(); + TQFontDatabase fontDB; + TQStringList families(fontDB.tqfamilies()); + TQStringList smoothScalableFamilies; + for (TQStringList::iterator it=families.begin(); it != families.end(); ++it) { smoothScalableFamilies.append(*it); @@ -163,29 +163,29 @@ CalTemplate::CalTemplate(QWidget* parent, const char* name) comboFont_->insertStringList(smoothScalableFamilies); // fetch and set the default font selected in the combo. - QFont f; + TQFont f; comboFont_->setCurrentText( f.family() ); - gboxLayout->addLayout( hlayout ); + gboxLayout->addLayout( htqlayout ); - connect(comboFont_, SIGNAL(activated(int)), - SLOT(slotParamsChanged())); + connect(comboFont_, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotParamsChanged())); // --------------------------------------------------------------- - gboxLayout->addItem(new QSpacerItem(5,10,QSizePolicy::Minimum, - QSizePolicy::Expanding)); + gboxLayout->addItem(new TQSpacerItem(5,10,TQSizePolicy::Minimum, + TQSizePolicy::Expanding)); mainLayout->addWidget( gbox, 0, 1 ); // --------------------------------------------------------------- - timer_ = new QTimer(this); + timer_ = new TQTimer(this); - connect(timer_, SIGNAL(timeout()), - SLOT(slotUpdatePreview())); + connect(timer_, TQT_SIGNAL(timeout()), + TQT_SLOT(slotUpdatePreview())); timer_->start(0,true); } @@ -207,7 +207,7 @@ void CalTemplate::slotUpdatePreview() CalParams& params = CalSettings::instance()->calParams; - QString paperSize = comboPaperSize_->currentText(); + TQString paperSize = comboPaperSize_->currentText(); if (paperSize == "A4") { params.paperWidth = 210; params.paperHeight = 297; @@ -224,7 +224,7 @@ void CalTemplate::slotUpdatePreview() if (imgPos == CalParams::Top) { params.imgPos = CalParams::Top; - float zoom = QMIN((float)previewSize_/params.paperWidth, + float zoom = TQMIN((float)previewSize_/params.paperWidth, (float)previewSize_/params.paperHeight); params.width = (int)(params.paperWidth * zoom); params.height = (int)(params.paperHeight * zoom); @@ -233,7 +233,7 @@ void CalTemplate::slotUpdatePreview() else if (imgPos == CalParams::Left) { params.imgPos = CalParams::Left; - float zoom = QMIN((float)previewSize_/params.paperWidth, + float zoom = TQMIN((float)previewSize_/params.paperWidth, (float)previewSize_/params.paperHeight); params.width = (int)(params.paperHeight * zoom); params.height = (int)(params.paperWidth * zoom); @@ -242,7 +242,7 @@ void CalTemplate::slotUpdatePreview() else { params.imgPos = CalParams::Right; - float zoom = QMIN((float)previewSize_/params.paperWidth, + float zoom = TQMIN((float)previewSize_/params.paperWidth, (float)previewSize_/params.paperHeight); params.width = (int)(params.paperHeight * zoom); params.height = (int)(params.paperWidth * zoom); @@ -250,7 +250,7 @@ void CalTemplate::slotUpdatePreview() params.drawLines = checkBoxDrawLines_->isChecked(); params.ratio = sliderRatio_->value(); - params.baseFont = QFont(comboFont_->currentText()); + params.baseFont = TQFont(comboFont_->currentText()); calWidget_->recreate(); } diff --git a/kipi-plugins/calendar/caltemplate.h b/kipi-plugins/calendar/caltemplate.h index 36b56ec..8208580 100644 --- a/kipi-plugins/calendar/caltemplate.h +++ b/kipi-plugins/calendar/caltemplate.h @@ -22,45 +22,46 @@ #ifndef CALTEMPLATE_H #define CALTEMPLATE_H -// Qt includes. +// TQt includes. -#include <qwidget.h> +#include <tqwidget.h> -class QFrame; -class QComboBox; -class QVButtonGroup; -class QRadioButton; -class QCheckBox; -class QSlider; -class QSpinBox; -class QLabel; -class QTimer; +class TQFrame; +class TQComboBox; +class TQVButtonGroup; +class TQRadioButton; +class TQCheckBox; +class TQSlider; +class TQSpinBox; +class TQLabel; +class TQTimer; namespace KIPICalendarPlugin { class CalWidget; -class CalTemplate : public QWidget +class CalTemplate : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CalTemplate(QWidget* parent, const char* name=0); + CalTemplate(TQWidget* tqparent, const char* name=0); ~CalTemplate(); private: - QComboBox* comboPaperSize_; - QVButtonGroup* btnGroupImagePos_; - QCheckBox* checkBoxDrawLines_; - QSlider* sliderSpacing_; - QSlider* sliderRatio_; - QComboBox* comboFont_; + TQComboBox* comboPaperSize_; + TQVButtonGroup* btnGroupImagePos_; + TQCheckBox* checkBoxDrawLines_; + TQSlider* sliderSpacing_; + TQSlider* sliderRatio_; + TQComboBox* comboFont_; CalWidget* calWidget_; - QTimer* timer_; + TQTimer* timer_; int previewSize_; private slots: diff --git a/kipi-plugins/calendar/calwidget.cpp b/kipi-plugins/calendar/calwidget.cpp index ff9017c..10bf19c 100644 --- a/kipi-plugins/calendar/calwidget.cpp +++ b/kipi-plugins/calendar/calwidget.cpp @@ -23,12 +23,12 @@ #include <iostream> -// Qt includes. +// TQt includes. -#include <qdatetime.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqdatetime.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqpainter.h> // KDE includes. @@ -45,12 +45,12 @@ namespace KIPICalendarPlugin { -CalWidget::CalWidget(QWidget *parent) - : QWidget(parent,0,Qt::WRepaintNoErase|Qt::WResizeNoErase) +CalWidget::CalWidget(TQWidget *tqparent) + : TQWidget(tqparent,0,TQt::WRepaintNoErase|TQt::WResizeNoErase) { - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); calPainter_ = 0; - pix_ = new QPixmap(); + pix_ = new TQPixmap(); } CalWidget::~CalWidget() @@ -60,26 +60,26 @@ CalWidget::~CalWidget() delete calPainter_; } -void CalWidget::paintEvent(QPaintEvent *e) +void CalWidget::paintEvent(TQPaintEvent *e) { if (!e || pix_->isNull()) return; - bitBlt(this, 0, 0, pix_, 0, 0, width(), height(), Qt::CopyROP); + bitBlt(this, 0, 0, pix_, 0, 0, width(), height(), TQt::CopyROP); } void CalWidget::recreate() { CalParams& params = CalSettings::instance()->calParams; - setFixedSize(QSize(params.width,params.height)); - resize(QSize(params.width,params.height)); + setFixedSize(TQSize(params.width,params.height)); + resize(TQSize(params.width,params.height)); pix_->resize(params.width,params.height); if (!calPainter_) - calPainter_ = new CalPainter(pix_); + calPainter_ = new CalPainter(TQT_TQPAINTDEVICE(pix_)); - calPainter_->setYearMonth(KGlobal::locale()->calendar()->year(QDate::currentDate()), - KGlobal::locale()->calendar()->month(QDate::currentDate())); + calPainter_->setYearMonth(KGlobal::locale()->calendar()->year(TQDate::tqcurrentDate()), + KGlobal::locale()->calendar()->month(TQDate::tqcurrentDate())); calPainter_->paint(); update(); } diff --git a/kipi-plugins/calendar/calwidget.h b/kipi-plugins/calendar/calwidget.h index 1448090..54cb0fe 100644 --- a/kipi-plugins/calendar/calwidget.h +++ b/kipi-plugins/calendar/calwidget.h @@ -22,35 +22,35 @@ #ifndef CALWIDGET_H #define CALWIDGET_H -// Qt includes. +// TQt includes. -#include <qwidget.h> +#include <tqwidget.h> -class QPaintEvent; -class QPixmap; +class TQPaintEvent; +class TQPixmap; namespace KIPICalendarPlugin { class CalPainter; -class CalWidget : public QWidget +class CalWidget : public TQWidget { public: - CalWidget(QWidget *parent); + CalWidget(TQWidget *tqparent); ~CalWidget(); void recreate(); protected: - void paintEvent(QPaintEvent *e); + void paintEvent(TQPaintEvent *e); private: CalPainter *calPainter_; - QPixmap *pix_; + TQPixmap *pix_; }; diff --git a/kipi-plugins/calendar/calwizard.cpp b/kipi-plugins/calendar/calwizard.cpp index 1f02b6f..d0b20c7 100644 --- a/kipi-plugins/calendar/calwizard.cpp +++ b/kipi-plugins/calendar/calwizard.cpp @@ -21,19 +21,19 @@ * * ============================================================ */ -// Qt includes. - -#include <qlabel.h> -#include <qdatetime.h> -#include <qstringlist.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qprogressbar.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qframe.h> -#include <qpixmap.h> -#include <qvbox.h> +// TQt includes. + +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqstringlist.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqprogressbar.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqframe.h> +#include <tqpixmap.h> +#include <tqvbox.h> // KDE includes. @@ -68,8 +68,8 @@ namespace KIPICalendarPlugin { -CalWizard::CalWizard( KIPI::Interface* interface, QWidget *parent ) - : KWizard(parent, 0, false, Qt::WDestructiveClose), +CalWizard::CalWizard( KIPI::Interface* interface, TQWidget *tqparent ) + : KWizard(tqparent, 0, false, TQt::WDestructiveClose), interface_( interface ) { cSettings_ = new CalSettings(); @@ -94,9 +94,9 @@ CalWizard::CalWizard( KIPI::Interface* interface, QWidget *parent ) // --------------------------------------------------------------- - wPrint_ = new QVBox(this, "wPrint"); + wPrint_ = new TQVBox(this, "wPrint"); - wPrintLabel_ = new QLabel(wPrint_, "wPrint"); + wPrintLabel_ = new TQLabel(wPrint_, "wPrint"); wPrintLabel_->setIndent(20); wPrint_->setStretchFactor(wPrintLabel_, 2); @@ -106,24 +106,24 @@ CalWizard::CalWizard( KIPI::Interface* interface, QWidget *parent ) // --------------------------------------------------------------- - wFinish_ = new QWidget(this, "wFinish"); + wFinish_ = new TQWidget(this, "wFinish"); - QVBoxLayout *wFinishLayout = new QVBoxLayout(wFinish_, 6, 11); + TQVBoxLayout *wFinishLayout = new TQVBoxLayout(wFinish_, 6, 11); - wFinishLabel_ = new QLabel(wFinish_); + wFinishLabel_ = new TQLabel(wFinish_); wFinishLayout->addWidget(wFinishLabel_); - QHBoxLayout *hboxlayout = new QHBoxLayout(0, 5, 5); - hboxlayout->addWidget(new QLabel(i18n("Current Page"), wFinish_)); - wFinishProgressCurrent_ = new QProgressBar(wFinish_); - hboxlayout->addWidget(wFinishProgressCurrent_); - wFinishLayout->addLayout(hboxlayout); + TQHBoxLayout *hboxtqlayout = new TQHBoxLayout(0, 5, 5); + hboxtqlayout->addWidget(new TQLabel(i18n("Current Page"), wFinish_)); + wFinishProgressCurrent_ = new TQProgressBar(wFinish_); + hboxtqlayout->addWidget(wFinishProgressCurrent_); + wFinishLayout->addLayout(hboxtqlayout); - hboxlayout = new QHBoxLayout(0, 5, 5); - hboxlayout->addWidget(new QLabel(i18n("Total Pages"), wFinish_)); - wFinishProgressTotal_ = new QProgressBar(wFinish_); - hboxlayout->addWidget(wFinishProgressTotal_); - wFinishLayout->addLayout(hboxlayout); + hboxtqlayout = new TQHBoxLayout(0, 5, 5); + hboxtqlayout->addWidget(new TQLabel(i18n("Total Pages"), wFinish_)); + wFinishProgressTotal_ = new TQProgressBar(wFinish_); + hboxtqlayout->addWidget(wFinishProgressTotal_); + wFinishLayout->addLayout(hboxtqlayout); wFinishLayout->addStretch(); @@ -149,7 +149,7 @@ CalWizard::CalWizard( KIPI::Interface* interface, QWidget *parent ) m_helpButton = helpButton(); KHelpMenu* helpMenu = new KHelpMenu(this, m_about, false); helpMenu->menu()->removeItemAt(0); - helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, SLOT(slotHelp()), 0, -1, 0); + helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, TQT_SLOT(slotHelp()), 0, -1, 0); m_helpButton->setPopup( helpMenu->menu() ); // ------------------------------------------ @@ -159,8 +159,8 @@ CalWizard::CalWizard( KIPI::Interface* interface, QWidget *parent ) formatter_ = new CalFormatter(); - connect(this, SIGNAL(selected(const QString&)), - SLOT(slotPageSelected(const QString&))); + connect(this, TQT_SIGNAL(selected(const TQString&)), + TQT_SLOT(slotPageSelected(const TQString&))); setCaption(i18n("Create Calendar")); } @@ -183,7 +183,7 @@ void CalWizard::slotHelp() KApplication::kApplication()->invokeHelp("calendar", "kipi-plugins"); } -void CalWizard::slotPageSelected(const QString&) +void CalWizard::slotPageSelected(const TQString&) { if (currentPage() == wPrint_) { @@ -193,9 +193,9 @@ void CalWizard::slotPageSelected(const QString&) monthNumbers_.clear(); monthImages_.clear(); KURL image; - QString month; - QStringList printList; - QDate d; + TQString month; + TQStringList printList; + TQDate d; KGlobal::locale()->calendar()->setYMD(d, cSettings_->getYear(), 1, 1); for (int i=1; i<=KGlobal::locale()->calendar()->monthsInYear(d); i++) { #if KDE_IS_VERSION(3,2,0) @@ -212,27 +212,27 @@ void CalWizard::slotPageSelected(const QString&) } if (!monthNumbers_.empty()) { - QString year = QString::number(cSettings_->getYear()); + TQString year = TQString::number(cSettings_->getYear()); - QString extra; - if ((KGlobal::locale()->calendar()->month(QDate::currentDate()) >= 6 && - KGlobal::locale()->calendar()->year(QDate::currentDate()) == cSettings_->getYear()) || - KGlobal::locale()->calendar()->year(QDate::currentDate()) > cSettings_->getYear()) + TQString extra; + if ((KGlobal::locale()->calendar()->month(TQDate::tqcurrentDate()) >= 6 && + KGlobal::locale()->calendar()->year(TQDate::tqcurrentDate()) == cSettings_->getYear()) || + KGlobal::locale()->calendar()->year(TQDate::tqcurrentDate()) > cSettings_->getYear()) extra = "<br><br><b>"+i18n("Please note that you are making a " "calendar for<br>the current year or a year in the " "past.")+"</b>"; KApplication::startServiceByName("KJobViewer"); - QString extra2 = i18n("<br><br>You can see KJobViewer is already started. " + TQString extra2 = i18n("<br><br>You can see KJobViewer is already started. " "After the plugin has prepared the calendar, it is passed to " "the PDF printer. In the KJobViewer you can see the progress " "of that part of the generation of the calendar."); wPrintLabel_->setText(i18n("Click Next to start Printing<br><br>" - "Following months will be printed for year %1:").arg(year) - + QString("<br>") + "Following months will be printed for year %1:").tqarg(year) + + TQString("<br>") + printList.join(" - ") + extra + extra2); - wPrintLabel_->setTextFormat(Qt::RichText); + wPrintLabel_->setTextFormat(TQt::RichText); setNextEnabled(wPrint_, true); } @@ -261,11 +261,11 @@ void CalWizard::slotPageSelected(const QString&) #endif // TODO: Let user choose resolutions - //, QPrinter::HighResolution); + //, TQPrinter::HighResolution); CalParams& params = cSettings_->calParams; - // Orientation + // Qt::Orientation switch (params.imgPos) { case(CalParams::Top): { printer_->setOrientation(KPrinter::Portrait); @@ -282,7 +282,7 @@ void CalWizard::slotPageSelected(const QString&) // Start printing -------------------------------------------- - painter_ = new QPainter(printer_); + painter_ = new TQPainter(printer_); totPages_ = monthImages_.count(); currPage_ = -1; formatter_->init(cSettings_->getYear(), wEvents_->ohFileEdit->text(), wEvents_->fhFileEdit->text()); @@ -316,16 +316,16 @@ void CalWizard::slotPrintOnePage() monthNumbers_.pop_front(); monthImages_.pop_front(); - QString yearName = QString::number(cSettings_->getYear()); + TQString yearName = TQString::number(cSettings_->getYear()); #if KDE_IS_VERSION(3,2,0) wFinishLabel_->setText(i18n("Printing Calendar Page for %1 of %2") - .arg(KGlobal::locale()->calendar()->monthName(month, cSettings_->getYear(), false)) - .arg(yearName)); + .tqarg(KGlobal::locale()->calendar()->monthName(month, cSettings_->getYear(), false)) + .tqarg(yearName)); #else wFinishLabel_->setText(i18n("Printing Calendar Page for %1 of %2") - .arg(KGlobal::locale()->monthName(month)). - .arg(yearName)); + .tqarg(KGlobal::locale()->monthName(month)). + .tqarg(yearName)); #endif currPage_++; @@ -335,13 +335,13 @@ void CalWizard::slotPrintOnePage() int angle = interface_->info( image ).angle(); - cb_ = new CalBlockPainter(this, cSettings_->getYear(), month, + cb_ = new CalBlockPainter(TQT_TQOBJECT(this), cSettings_->getYear(), month, image, angle, formatter_, painter_); - connect(cb_, SIGNAL(signalCompleted()), - SLOT(slotPrintOnePage())); - connect(cb_, SIGNAL(signalProgress(int,int)), - wFinishProgressCurrent_, SLOT(setProgress(int,int))); + connect(cb_, TQT_SIGNAL(signalCompleted()), + TQT_SLOT(slotPrintOnePage())); + connect(cb_, TQT_SIGNAL(signalProgress(int,int)), + wFinishProgressCurrent_, TQT_SLOT(setProgress(int,int))); } } // NameSpace KIPICalendarPlugin diff --git a/kipi-plugins/calendar/calwizard.h b/kipi-plugins/calendar/calwizard.h index 439292a..5de9bca 100644 --- a/kipi-plugins/calendar/calwizard.h +++ b/kipi-plugins/calendar/calwizard.h @@ -22,10 +22,10 @@ #ifndef CALWIZARD_H #define CALWIZARD_H -// Qt includes. +// TQt includes. -#include <qstringlist.h> -#include <qguardedptr.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> // KDE includes. @@ -39,11 +39,11 @@ #include "kpaboutdata.h" -class QLabel; -class QVBox; -class QPainter; -class QProgressBar; -class QPushButton; +class TQLabel; +class TQVBox; +class TQPainter; +class TQProgressBar; +class TQPushButton; class KPrinter; @@ -60,10 +60,11 @@ class CalBlockPainter; class CalWizard : public KWizard { Q_OBJECT + TQ_OBJECT public: - CalWizard( KIPI::Interface* interface, QWidget *parent=0L ); + CalWizard( KIPI::Interface* interface, TQWidget *tqparent=0L ); ~CalWizard(); private: @@ -72,32 +73,32 @@ private: CalTemplate *wTemplate_; CalSelect *wSelect_; CalEvents *wEvents_; - QVBox *wPrint_; - QLabel *wPrintLabel_; - QWidget *wFinish_; - QLabel *wFinishLabel_; - QProgressBar *wFinishProgressTotal_; - QProgressBar *wFinishProgressCurrent_; - - QPushButton *m_helpButton; + TQVBox *wPrint_; + TQLabel *wPrintLabel_; + TQWidget *wFinish_; + TQLabel *wFinishLabel_; + TQProgressBar *wFinishProgressTotal_; + TQProgressBar *wFinishProgressCurrent_; + + TQPushButton *m_helpButton; KPrinter *printer_; - QPainter *painter_; + TQPainter *painter_; CalFormatter *formatter_; - QValueList<int> monthNumbers_; + TQValueList<int> monthNumbers_; KURL::List monthImages_; int totPages_; int currPage_; - QGuardedPtr<CalBlockPainter> cb_; + TQGuardedPtr<CalBlockPainter> cb_; KIPI::Interface* interface_; KIPIPlugins::KPAboutData *m_about; private slots: - void slotPageSelected(const QString& name); + void slotPageSelected(const TQString& name); void slotPrintOnePage(); void slotHelp(); }; diff --git a/kipi-plugins/calendar/monthwidget.cpp b/kipi-plugins/calendar/monthwidget.cpp index abe2c87..411affe 100644 --- a/kipi-plugins/calendar/monthwidget.cpp +++ b/kipi-plugins/calendar/monthwidget.cpp @@ -21,15 +21,15 @@ * * ============================================================ */ -// Qt includes. +// TQt includes. -#include <qdatetime.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qevent.h> -#include <qdragobject.h> -#include <qstrlist.h> -#include <qimage.h> +#include <tqdatetime.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqstrlist.h> +#include <tqimage.h> // KDE includes. @@ -59,17 +59,17 @@ namespace KIPICalendarPlugin { -MonthWidget::MonthWidget( KIPI::Interface* interface, QWidget *parent, int month) - : QFrame(parent), interface_( interface ) +MonthWidget::MonthWidget( KIPI::Interface* interface, TQWidget *tqparent, int month) + : TQFrame(tqparent), interface_( interface ) { setAcceptDrops(true); month_ = month; - imagePath_ = QString(""); - pixmap_ = new QPixmap(SmallIcon("file_broken", + imagePath_ = TQString(""); + pixmap_ = new TQPixmap(SmallIcon("file_broken", KIcon::SizeMedium, KIcon::DisabledState)); - setFixedSize(QSize(70,90)); - setFrameStyle(QFrame::Panel|QFrame::Raised); + setFixedSize(TQSize(70,90)); + setFrameStyle(TQFrame::Panel|TQFrame::Raised); } MonthWidget::~MonthWidget() @@ -82,16 +82,16 @@ KURL MonthWidget::imagePath() return imagePath_; } -void MonthWidget::drawContents(QPainter *p) +void MonthWidget::drawContents(TQPainter *p) { #if KDE_IS_VERSION(3,2,0) - QString name = KGlobal::locale()->calendar()->monthName(month_, CalSettings::instance()->getYear(), true); + TQString name = KGlobal::locale()->calendar()->monthName(month_, CalSettings::instance()->getYear(), true); #else - QString name = KGlobal::locale()->monthName(month_, true); + TQString name = KGlobal::locale()->monthName(month_, true); #endif - QRect cr; + TQRect cr; cr = contentsRect(); cr.setBottom(70); @@ -101,12 +101,12 @@ void MonthWidget::drawContents(QPainter *p) cr = contentsRect(); cr.setTop(70); - p->drawText(cr,Qt::AlignHCenter,name); + p->drawText(cr,TQt::AlignHCenter,name); } -void MonthWidget::dragEnterEvent(QDragEnterEvent* event) +void MonthWidget::dragEnterEvent(TQDragEnterEvent* event) { - event->accept(QUriDrag::canDecode(event)); + event->accept(TQUriDrag::canDecode(event)); } void MonthWidget::setImage( const KURL &url ) @@ -115,7 +115,7 @@ void MonthWidget::setImage( const KURL &url ) return; // check if the file is an image - if ( ! QImageIO::imageFormat( url.path() ) ) + if ( ! TQImageIO::imageFormat( url.path() ) ) { kdWarning( 51001 ) << "Unknown image format for: " << url.prettyURL() << endl; @@ -126,10 +126,10 @@ void MonthWidget::setImage( const KURL &url ) CalSettings::instance()->setImage(month_, imagePath_); KIconLoader* iconLoader = KApplication::kApplication()->iconLoader(); - QPixmap pix = iconLoader->loadIcon("image", KIcon::NoGroup, 64 ); + TQPixmap pix = iconLoader->loadIcon("image", KIcon::NoGroup, 64 ); if ( pixmap_ ) delete pixmap_; - pixmap_ = new QPixmap( pix ); + pixmap_ = new TQPixmap( pix ); update(); KURL::List urls; @@ -137,11 +137,11 @@ void MonthWidget::setImage( const KURL &url ) KIO::PreviewJob* thumbJob_ = KIO::filePreview( urls,64); - connect(thumbJob_, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), - SLOT(slotGotThumbnaiL(const KFileItem*, const QPixmap&))); + connect(thumbJob_, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), + TQT_SLOT(slotGotThumbnaiL(const KFileItem*, const TQPixmap&))); } -void MonthWidget::dropEvent(QDropEvent* event) +void MonthWidget::dropEvent(TQDropEvent* event) { KURL::List srcURLs; if ( !KURLDrag::decode(event, srcURLs) ) @@ -154,25 +154,25 @@ void MonthWidget::dropEvent(QDropEvent* event) setImage( url ); } -void MonthWidget::slotGotThumbnaiL(const KFileItem* , const QPixmap& pix) +void MonthWidget::slotGotThumbnaiL(const KFileItem* , const TQPixmap& pix) { if ( pixmap_ ) delete pixmap_; - QPixmap image = pix; + TQPixmap image = pix; int angle = interface_->info( imagePath_ ).angle(); if ( angle != 0 ) { - QWMatrix matrix; + TQWMatrix matrix; matrix.rotate( angle ); image = image.xForm( matrix ); } - pixmap_ = new QPixmap(image); + pixmap_ = new TQPixmap(image); update(); } -void MonthWidget::mouseReleaseEvent(QMouseEvent* e) +void MonthWidget::mouseReleaseEvent(TQMouseEvent* e) { - if (!contentsRect().contains(e->pos())) return; + if (!contentsRect().tqcontains(e->pos())) return; if (e->button() == Qt::LeftButton) { @@ -180,10 +180,10 @@ void MonthWidget::mouseReleaseEvent(QMouseEvent* e) setImage(url); } else if (e->button() == Qt::RightButton) { - imagePath_ = QString(""); + imagePath_ = TQString(""); CalSettings::instance()->setImage(month_,imagePath_); delete pixmap_; - pixmap_ = new QPixmap(SmallIcon("file_broken", + pixmap_ = new TQPixmap(SmallIcon("file_broken", KIcon::SizeMedium, KIcon::DisabledState)); update(); diff --git a/kipi-plugins/calendar/monthwidget.h b/kipi-plugins/calendar/monthwidget.h index 1a79d24..5a6d475 100644 --- a/kipi-plugins/calendar/monthwidget.h +++ b/kipi-plugins/calendar/monthwidget.h @@ -22,19 +22,19 @@ #ifndef MONTHWIDGET_H #define MONTHWIDGET_H -// Qt includes. +// TQt includes. -#include <qframe.h> +#include <tqframe.h> // LibKipi includes #include <libkipi/interface.h> -class QPainter; -class QPixmap; -class QDragEnterEvent; -class QDropEvent; -class QMouseEvent; +class TQPainter; +class TQPixmap; +class TQDragEnterEvent; +class TQDropEvent; +class TQMouseEvent; class KURL; class KFileItem; @@ -42,13 +42,14 @@ class KFileItem; namespace KIPICalendarPlugin { -class MonthWidget : public QFrame +class MonthWidget : public TQFrame { Q_OBJECT + TQ_OBJECT public: - MonthWidget( KIPI::Interface* interface, QWidget *parent, int month); + MonthWidget( KIPI::Interface* interface, TQWidget *tqparent, int month); ~MonthWidget(); KURL imagePath(); @@ -56,20 +57,20 @@ public: protected: - void drawContents(QPainter *p); - void dragEnterEvent(QDragEnterEvent* event); - void dropEvent(QDropEvent* event); - void mouseReleaseEvent(QMouseEvent* e); + void drawContents(TQPainter *p); + void dragEnterEvent(TQDragEnterEvent* event); + void dropEvent(TQDropEvent* event); + void mouseReleaseEvent(TQMouseEvent* e); private: int month_; KURL imagePath_; - QPixmap *pixmap_; + TQPixmap *pixmap_; KIPI::Interface* interface_; private slots: - void slotGotThumbnaiL(const KFileItem* url, const QPixmap& pix); + void slotGotThumbnaiL(const KFileItem* url, const TQPixmap& pix); }; } // NameSpace KIPICalendarPlugin diff --git a/kipi-plugins/calendar/plugin_calendar.cpp b/kipi-plugins/calendar/plugin_calendar.cpp index 8ca7113..30311c7 100644 --- a/kipi-plugins/calendar/plugin_calendar.cpp +++ b/kipi-plugins/calendar/plugin_calendar.cpp @@ -19,10 +19,10 @@ * * ============================================================ */ -// Qt includes. +// TQt includes. -#include <qprogressdialog.h> -#include <qtimer.h> +#include <tqprogressdialog.h> +#include <tqtimer.h> // KDE includes. @@ -45,15 +45,15 @@ typedef KGenericFactory<Plugin_Calendar> Factory; K_EXPORT_COMPONENT_FACTORY( kipiplugin_calendar, Factory("kipiplugin_calendar")) -Plugin_Calendar::Plugin_Calendar(QObject *parent, +Plugin_Calendar::Plugin_Calendar(TQObject *tqparent, const char*, - const QStringList &) - : KIPI::Plugin(Factory::instance(), parent, "Calendar") + const TQStringList &) + : KIPI::Plugin(Factory::instance(), tqparent, "Calendar") { kdDebug( 51001 ) << "Loaded Plugin_Calendar" << endl; } -void Plugin_Calendar::setup( QWidget* widget ) +void Plugin_Calendar::setup( TQWidget* widget ) { KIPI::Plugin::setup( widget ); @@ -61,7 +61,7 @@ void Plugin_Calendar::setup( QWidget* widget ) "date", 0, this, - SLOT(slotActivate()), + TQT_SLOT(slotActivate()), actionCollection(), "calendar"); @@ -74,7 +74,7 @@ Plugin_Calendar::~Plugin_Calendar() void Plugin_Calendar::slotActivate() { - KIPI::Interface* interface = dynamic_cast< KIPI::Interface* >( parent() ); + KIPI::Interface* interface = dynamic_cast< KIPI::Interface* >( tqparent() ); if ( !interface ) { @@ -82,7 +82,7 @@ void Plugin_Calendar::slotActivate() return; } - KIPICalendarPlugin::CalWizard* w = new KIPICalendarPlugin::CalWizard( interface, kapp->activeWindow() ); + KIPICalendarPlugin::CalWizard* w = new KIPICalendarPlugin::CalWizard( interface, TQT_TQWIDGET(kapp->activeWindow()) ); w->show(); } diff --git a/kipi-plugins/calendar/plugin_calendar.h b/kipi-plugins/calendar/plugin_calendar.h index e11abae..d70f7aa 100644 --- a/kipi-plugins/calendar/plugin_calendar.h +++ b/kipi-plugins/calendar/plugin_calendar.h @@ -26,23 +26,24 @@ #include <libkipi/plugin.h> -class QProgressDialog; -class QTimer; +class TQProgressDialog; +class TQTimer; class KAction; class Plugin_Calendar : public KIPI::Plugin { Q_OBJECT + TQ_OBJECT public: - Plugin_Calendar(QObject *parent, + Plugin_Calendar(TQObject *tqparent, const char* name, - const QStringList &args); + const TQStringList &args); ~Plugin_Calendar(); virtual KIPI::Category category( KAction* action ) const; - virtual void setup( QWidget* widget ); + virtual void setup( TQWidget* widget ); private: |