summaryrefslogtreecommitdiffstats
path: root/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc')
-rw-r--r--kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
index 56388af8f..558f59cb4 100644
--- a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
+++ b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
@@ -39,8 +39,8 @@
#include <kofficeversion.h>
#include <kmessagebox.h>
-#include <qpoint.h>
-#include <qrect.h>
+#include <tqpoint.h>
+#include <tqrect.h>
namespace KSpread
{
@@ -50,15 +50,15 @@ typedef KGenericFactory<PluginInsertCalendar> InsertCalendarFactory;
K_EXPORT_COMPONENT_FACTORY( libkspreadinsertcalendar, InsertCalendarFactory("kspreadinsertcalendar"))
-PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, const QStringList& /*args*/ )
-: Plugin(parent,name)
+PluginInsertCalendar::PluginInsertCalendar( TQObject *tqparent, const char *name, const TQStringList& /*args*/ )
+: Plugin(tqparent,name)
{
this->m_kspreadView = NULL;
- if (parent)
+ if (tqparent)
{
- if (parent->inherits("KSpread::View"))
+ if (tqparent->inherits("KSpread::View"))
{
- this->m_kspreadView = (View*)parent;
+ this->m_kspreadView = (View*)tqparent;
}
else
{
@@ -67,14 +67,14 @@ PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, c
}
else
{
- kdWarning() << "Plugin created without a parent!!!" << endl;
+ kdWarning() << "Plugin created without a tqparent!!!" << endl;
}
this->m_dialog = NULL;
(void)new KAction( i18n("Insert Calendar..."), KShortcut::null(),
- this, SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar");
+ this, TQT_SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar");
}
PluginInsertCalendar::~PluginInsertCalendar()
@@ -107,8 +107,8 @@ void PluginInsertCalendar::slotShowDialog()
Q_ASSERT(m_dialog);
- connect(m_dialog,SIGNAL(insertCalendar(const QDate&, const QDate&)),
- this,SLOT(slotInsertCalendar(const QDate&, const QDate&)));
+ connect(m_dialog,TQT_SIGNAL(insertCalendar(const TQDate&, const TQDate&)),
+ this,TQT_SLOT(slotInsertCalendar(const TQDate&, const TQDate&)));
}
//@todo if anyone knows a better way to get a background window to foreground, please change this...
@@ -117,7 +117,7 @@ void PluginInsertCalendar::slotShowDialog()
}
-void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &end)
+void PluginInsertCalendar::slotInsertCalendar(const TQDate &start, const TQDate &end)
{
//@todo implement
kdDebug() << "slotInsert... still to be implemented" << endl;
@@ -158,7 +158,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
Q_ASSERT(selection_info);
- QPoint selection = selection_info->selection().topLeft();
+ TQPoint selection = selection_info->selection().topLeft();
Sheet* sheet = m_kspreadView->activeSheet();
@@ -175,12 +175,12 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
//@todo improve calendar size prediction!
int sizeY = 4 + (int)(0.5*(float)(start.daysTo(end)));
- if (!sheet->areaIsEmpty(QRect(selection,QSize(sizeX,sizeY))))
+ if (!sheet->areaIsEmpty(TQRect(selection,TQSize(sizeX,sizeY))))
{
if (KMessageBox::No == KMessageBox::warningYesNo(NULL,i18n("The area where the calendar is inserted is NOT empty, are you sure you want to continue, overwriting existing data? If you choose No the area that would be required for the desired calendar will be selected so you can see what data would be overwritten."),i18n("Warning")))
{
//select the area so the user knows what's in the way
- selection_info->initialize(QRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet);
+ selection_info->initialize(TQRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet);
return;
}
}
@@ -194,16 +194,16 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
int row = selection.y();
int col = selection.x();
int colstart = col; //this is where we get back after each week
- sheet->setText(row,colstart,i18n("Calendar from %1 to %2").arg(start.toString()).arg(end.toString()));
+ sheet->setText(row,colstart,i18n("Calendar from %1 to %2").tqarg(start.toString()).tqarg(end.toString()));
- QDate current(start);
-// QDate previous(current);
+ TQDate current(start);
+// TQDate previous(current);
bool yearheader = true;
bool monthheader = true;
bool weekheader = true;
//this loop creates the actual calendar
- //@todo formatting of cells - each day occupies QRect(row,col,row,col+1)
+ //@todo formatting of cells - each day occupies TQRect(row,col,row,col+1)
while (current <= end)
{
@@ -229,7 +229,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
if (yearheader)
{
- kdDebug() << "inserting year " + QString::number(current.year()) << endl;
+ kdDebug() << "inserting year " + TQString::number(current.year()) << endl;
sheet->setText(row,colstart+6,cs->yearString(current,false));
row+=2;
@@ -237,7 +237,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
if (monthheader)
{
- kdDebug() << "inserting month " + QString::number(current.month()) << endl;
+ kdDebug() << "inserting month " + TQString::number(current.month()) << endl;
sheet->setText(row,colstart+6,cs->monthName(current,false));
row+=2;
//we always have the week number in the first column
@@ -251,7 +251,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
if (weekheader)
{
- sheet->setText(row,colstart,QString::number(cs->weekNumber(current)));
+ sheet->setText(row,colstart,TQString::number(cs->weekNumber(current)));
col++;
weekheader=false;
@@ -262,10 +262,10 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
}
- sheet->setText(row,col,QString::number(cs->day(current)));
+ sheet->setText(row,col,TQString::number(cs->day(current)));
//go to the next date
//@todo isn't there a better way, like current++ or something??
- QDate next = current.addDays(1);
+ TQDate next = current.addDays(1);
current.setYMD(next.year(),next.month(),next.day());
col+=2;