diff options
Diffstat (limited to 'kplato/kptganttview.cc')
-rw-r--r-- | kplato/kptganttview.cc | 270 |
1 files changed, 135 insertions, 135 deletions
diff --git a/kplato/kptganttview.cc b/kplato/kptganttview.cc index ec960fe2..1e32a092 100644 --- a/kplato/kptganttview.cc +++ b/kplato/kptganttview.cc @@ -43,22 +43,22 @@ #include <kdebug.h> -#include <qsplitter.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qlistview.h> -#include <qheader.h> -#include <qpopupmenu.h> -#include <qtabwidget.h> -#include <qptrlist.h> -#include <qlineedit.h> -#include <qwidget.h> -#include <qlabel.h> -#include <qspinbox.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <tqsplitter.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlistview.h> +#include <tqheader.h> +#include <tqpopupmenu.h> +#include <tqtabwidget.h> +#include <tqptrlist.h> +#include <tqlineedit.h> +#include <tqwidget.h> +#include <tqlabel.h> +#include <tqspinbox.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> #include <klocale.h> #include <kglobal.h> @@ -70,16 +70,16 @@ namespace KPlato class MyKDGanttView : public KDGanttView { public: - MyKDGanttView(QWidget *parent, const char *name) - : KDGanttView(parent, name) { + MyKDGanttView(TQWidget *tqparent, const char *name) + : KDGanttView(tqparent, name) { } - virtual QSize sizeHint() const { - return minimumSizeHint(); //HACK: koshell splitter minimumSize problem + virtual TQSize tqsizeHint() const { + return tqminimumSizeHint(); //HACK: koshell splitter tqminimumSize problem } }; -GanttView::GanttView(QWidget *parent, bool readWrite, const char* name) - : QSplitter(parent, name), +GanttView::GanttView(TQWidget *tqparent, bool readWrite, const char* name) + : TQSplitter(tqparent, name), m_readWrite(readWrite), m_currentItem(0), m_taskView(0), @@ -87,7 +87,7 @@ GanttView::GanttView(QWidget *parent, bool readWrite, const char* name) m_project(0) { kdDebug() << " ---------------- KPlato: Creating GanttView ----------------" << endl; - setOrientation(QSplitter::Vertical); + setOrientation(Qt::Vertical); m_gantt = new MyKDGanttView(this, "Gantt view"); @@ -108,7 +108,7 @@ GanttView::GanttView(QWidget *parent, bool readWrite, const char* name) m_gantt->addColumn(i18n("Work Breakdown Structure", "WBS")); // HACK: need changes to kdgantt KDGanttViewTaskItem *item = new KDGanttViewTaskItem(m_gantt); - QListView *lv = item->listView(); + TQListView *lv = item->listView(); lv->header()->moveSection(1, 0); m_gantt->setScale(KDGanttView::Day); @@ -116,7 +116,7 @@ GanttView::GanttView(QWidget *parent, bool readWrite, const char* name) m_gantt->setShowHeaderPopupMenu(); m_taskView = new TaskAppointmentsView(this); // hide TaskAppointmentsView - QValueList<int> list = sizes(); + TQValueList<int> list = sizes(); list[0] += list[1]; list[1] = 0; setSizes(list); @@ -124,13 +124,13 @@ GanttView::GanttView(QWidget *parent, bool readWrite, const char* name) setReadWriteMode(readWrite); - connect(m_gantt, SIGNAL(lvContextMenuRequested ( KDGanttViewItem *, const QPoint &, int )), - this, SLOT (popupMenuRequested(KDGanttViewItem *, const QPoint &, int))); + connect(m_gantt, TQT_SIGNAL(lvContextMenuRequested ( KDGanttViewItem *, const TQPoint &, int )), + this, TQT_SLOT (popupMenuRequested(KDGanttViewItem *, const TQPoint &, int))); - connect(m_gantt, SIGNAL(lvCurrentChanged(KDGanttViewItem*)), this, SLOT (currentItemChanged(KDGanttViewItem*))); + connect(m_gantt, TQT_SIGNAL(lvCurrentChanged(KDGanttViewItem*)), this, TQT_SLOT (currentItemChanged(KDGanttViewItem*))); // HACK: kdgantt emits 2 signals for each *double* click, so we go direct to listview - connect(lv, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), this, SLOT (slotItemDoubleClicked(QListViewItem*))); + connect(lv, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT (slotItemDoubleClicked(TQListViewItem*))); m_taskLinks.setAutoDelete(true); @@ -213,12 +213,12 @@ void GanttView::drawChanges(Project &project) currentItemChanged(m_currentItem); } -void GanttView::drawOnPainter(QPainter* painter, const QRect rect) +void GanttView::drawOnPainter(TQPainter* painter, const TQRect rect) { // Assume clipping is allready set // Fill out the rect by adding ticks to right side of the timeline - QSize s = m_gantt->drawContents(0, false, true); + TQSize s = m_gantt->drawContents(0, false, true); while (s.width() < rect.width()) { m_gantt->addTicksRight(); m_gantt->setTimelineToEnd(); @@ -227,7 +227,7 @@ void GanttView::drawOnPainter(QPainter* painter, const QRect rect) kdDebug()<<k_funcinfo<<rect<<" : "<<s<<endl; painter->save(); -// QValueList<int> sizes = m_taskView->sizes(); +// TQValueList<int> sizes = m_taskView->sizes(); // if (sizes.count() >= 2) // { // int first = sizes[0]; @@ -239,7 +239,7 @@ void GanttView::drawOnPainter(QPainter* painter, const QRect rect) // m_taskView->setSizes(sizes); // } // else -// kdWarning() << "Apparently the task view splitter contains less than 2 parts!" << endl; +// kdWarning() << "Aptqparently the task view splitter contains less than 2 parts!" << endl; // bool showlistview = m_gantt->showListView(); // int listviewwidth = m_gantt->listViewWidth(); @@ -322,7 +322,7 @@ void GanttView::resetDrawn(KDGanttViewItem *_item) for (; item; item = nextItem) { nextItem = item->nextSibling(); setDrawn(item, false); - resetDrawn(item->firstChild()); // then my children + resetDrawn(item->firstChild()); // then my tqchildren } } @@ -336,7 +336,7 @@ void GanttView::removeNotDrawn(KDGanttViewItem *_item) m_currentItem = 0; deleteItem(item); } else { - removeNotDrawn(item->firstChild()); // then my children + removeNotDrawn(item->firstChild()); // then my tqchildren } } } @@ -344,8 +344,8 @@ void GanttView::removeNotDrawn(KDGanttViewItem *_item) void GanttView::deleteItem(KDGanttViewItem *item) { //kdDebug()<<k_funcinfo<<item->listViewText()<<endl; - if (item->parent()) - item->parent()->takeItem(item); + if (item->tqparent()) + item->tqparent()->takeItem(item); else item->listView()->takeItem(item); delete item; @@ -375,7 +375,7 @@ KDGanttViewItem *GanttView::correctType(KDGanttViewItem *item, Node *node) return item; break; } - KDGanttViewItem *newItem = addNode(item->parent(), node, item); + KDGanttViewItem *newItem = addNode(item->tqparent(), node, item); newItem->setOpen(item->isOpen()); deleteItem(item); return newItem; @@ -392,7 +392,7 @@ void GanttView::correctPosition(KDGanttViewItem *item, Node *node) KDGanttViewItem *GanttView::correctParent(KDGanttViewItem *item, Node *node) { KDGanttViewItem *p = findItem(node->getParent()); - if (p == item->parent()) { + if (p == item->tqparent()) { return item; } KDGanttViewItem *newItem = addNode(p, node); @@ -401,10 +401,10 @@ KDGanttViewItem *GanttView::correctParent(KDGanttViewItem *item, Node *node) return newItem; } -void GanttView::updateChildren(Node *parentNode) +void GanttView::updateChildren(Node *tqparentNode) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Node> nit(parentNode->childNodeIterator()); + TQPtrListIterator<Node> nit(tqparentNode->childNodeIterator()); for (; nit.current(); ++nit ) { updateNode(nit.current()); @@ -434,7 +434,7 @@ void GanttView::updateNode(Node *node) void GanttView::modifyChildren(Node *node) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Node> nit(node->childNodeIterator()); + TQPtrListIterator<Node> nit(node->childNodeIterator()); for ( nit.toLast(); nit.current(); --nit ) { modifyNode(nit.current()); modifyChildren(nit.current()); @@ -500,12 +500,12 @@ void GanttView::modifySummaryTask(KDGanttViewItem *item, Task *task) if (m_showTaskName) { item->setText(task->name()); } else { - item->setText(QString()); + item->setText(TQString()); } - QString w = i18n("Name: %1").arg(task->name()); + TQString w = i18n("Name: %1").tqarg(task->name()); if (!task->notScheduled()) { - w += "\n" + i18n("Start: %1").arg(locale->formatDateTime(task->startTime())); - w += "\n" + i18n("End: %1").arg(locale->formatDateTime(task->endTime())); + w += "\n" + i18n("Start: %1").tqarg(locale->formatDateTime(task->startTime())); + w += "\n" + i18n("End: %1").tqarg(locale->formatDateTime(task->endTime())); } bool ok = true; if (task->notScheduled()) { @@ -517,10 +517,10 @@ void GanttView::modifySummaryTask(KDGanttViewItem *item, Task *task) } } if (ok) { - QColor c(cyan); + TQColor c(cyan); item->setColors(c,c,c); } else { - QColor c(yellow); + TQColor c(yellow); item->setColors(c,c,c); } item->setTooltipText(w); @@ -545,17 +545,17 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task) item->setEndTime(task->endTime()); } //item->setOpen(true); - QString text; + TQString text; if (m_showTaskName) { text = task->name(); } if (m_showResources && !task->notScheduled()) { - QPtrList<Appointment> lst = task->appointments(); + TQPtrList<Appointment> lst = task->appointments(); if (lst.count() > 0) { if (!text.isEmpty()) text += ' '; text += '('; - QPtrListIterator<Appointment> it = lst; + TQPtrListIterator<Appointment> it = lst; for (bool first=true; it.current(); ++it) { if (!first) text += ", "; @@ -572,25 +572,25 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task) item->setProgress(0); } if (m_showPositiveFloat) { - QDateTime t = task->endTime() + task->positiveFloat(); + TQDateTime t = task->endTime() + task->positiveFloat(); if (t.isValid() && t > task->endTime()) { item->setFloatEndTime(t); } else { - item->setFloatEndTime(QDateTime()); + item->setFloatEndTime(TQDateTime()); } } else { - item->setFloatStartTime(QDateTime()); - item->setFloatEndTime(QDateTime()); + item->setFloatStartTime(TQDateTime()); + item->setFloatEndTime(TQDateTime()); } - QString w = i18n("Name: %1").arg(task->name()); + TQString w = i18n("Name: %1").tqarg(task->name()); if (!task->notScheduled()) { - w += "\n"; w += i18n("Start: %1").arg(locale->formatDateTime(task->startTime())); - w += "\n"; w += i18n("End: %1").arg(locale->formatDateTime(task->endTime())); + w += "\n"; w += i18n("Start: %1").tqarg(locale->formatDateTime(task->startTime())); + w += "\n"; w += i18n("End: %1").tqarg(locale->formatDateTime(task->endTime())); if (m_showProgress) { - w += "\n"; w += i18n("Completion: %1%").arg(task->progress().percentFinished); + w += "\n"; w += i18n("Completion: %1%").tqarg(task->progress().percentFinished); } if (task->positiveFloat() > Duration::zeroDuration) { - w += "\n" + i18n("Float: %1").arg(task->positiveFloat().toString(Duration::Format_i18nDayTime)); + w += "\n" + i18n("Float: %1").tqarg(task->positiveFloat().toString(Duration::Format_i18nDayTime)); } if (task->inCriticalPath()) { w += "\n" + i18n("Critical path"); @@ -598,7 +598,7 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task) w += "\n" + i18n("Critical"); } } - QString sts; + TQString sts; bool ok = true; if (task->notScheduled()) { sts += "\n" + i18n("Not scheduled"); @@ -622,8 +622,8 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task) } if (task->resourceOverbooked()) { ok = false; - QStringList rl = task->overbookedResources(); - sts += "\n" + i18n("arg: list of resources", "Resource overbooked: %1").arg(rl.join(",")); + TQStringList rl = task->overbookedResources(); + sts += "\n" + i18n("arg: list of resources", "Resource overbooked: %1").tqarg(rl.join(",")); } if (!m_showNoInformation && m_project && m_project->notScheduled()) { @@ -631,11 +631,11 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task) } } if (ok) { - QColor c(green); + TQColor c(green); item->setColors(c,c,c); } else { w += sts; - QColor c(yellow); + TQColor c(yellow); item->setColors(c,c,c); } item->setHighlight(false); @@ -668,7 +668,7 @@ void GanttView::modifyMilestone(KDGanttViewItem *item, Task *task) if (m_showTaskName) { item->setText(task->name()); } else { - item->setText(QString()); + item->setText(TQString()); } if (m_showPositiveFloat) { DateTime t = task->startTime() + task->positiveFloat(); @@ -676,20 +676,20 @@ void GanttView::modifyMilestone(KDGanttViewItem *item, Task *task) if (t.isValid() && t > task->startTime()) { item->setFloatEndTime(t); } else { - item->setFloatEndTime(QDateTime()); + item->setFloatEndTime(TQDateTime()); } } else { - item->setFloatStartTime(QDateTime()); - item->setFloatEndTime(QDateTime()); + item->setFloatStartTime(TQDateTime()); + item->setFloatEndTime(TQDateTime()); } //TODO: Show progress - QString w = i18n("Name: %1").arg(task->name()); + TQString w = i18n("Name: %1").tqarg(task->name()); if (!task->notScheduled()) { - w += "\n" + i18n("Time: %1").arg(locale->formatDateTime(task->startTime())); + w += "\n" + i18n("Time: %1").tqarg(locale->formatDateTime(task->startTime())); if (task->positiveFloat() > Duration::zeroDuration) { - w += "\n" + i18n("Float: %1").arg(task->positiveFloat().toString(Duration::Format_i18nDayTime)); + w += "\n" + i18n("Float: %1").tqarg(task->positiveFloat().toString(Duration::Format_i18nDayTime)); } if (task->inCriticalPath()) { w += "\n" + i18n("Critical path"); @@ -711,10 +711,10 @@ void GanttView::modifyMilestone(KDGanttViewItem *item, Task *task) } } if (ok) { - QColor c(blue); + TQColor c(blue); item->setColors(c,c,c); } else { - QColor c(yellow); + TQColor c(yellow); item->setColors(c,c,c); } item->setHighlight(false); @@ -728,33 +728,33 @@ void GanttView::modifyMilestone(KDGanttViewItem *item, Task *task) setDrawn(item, true); } -KDGanttViewItem *GanttView::addNode( KDGanttViewItem *parentItem, Node *node, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addNode( KDGanttViewItem *tqparentItem, Node *node, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; if (node->type() == Node::Type_Project) { - return addProject(parentItem, node, after); + return addProject(tqparentItem, node, after); } if (node->type() == Node::Type_Subproject) { - return addSubProject(parentItem, node, after); + return addSubProject(tqparentItem, node, after); } if (node->type() == Node::Type_Summarytask) { - return addSummaryTask(parentItem, static_cast<Task *>(node), after); + return addSummaryTask(tqparentItem, static_cast<Task *>(node), after); } if (node->type() == Node::Type_Task) { - return addTask(parentItem, static_cast<Task *>(node), after); + return addTask(tqparentItem, static_cast<Task *>(node), after); } if (node->type() == Node::Type_Milestone) { - return addMilestone(parentItem, static_cast<Task *>(node), after); + return addMilestone(tqparentItem, static_cast<Task *>(node), after); } return 0; } -KDGanttViewItem *GanttView::addProject(KDGanttViewItem *parentItem, Node *node, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addProject(KDGanttViewItem *tqparentItem, Node *node, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; GanttViewSummaryItem *item; - if ( parentItem) { - item = new GanttViewSummaryItem(parentItem, node); + if ( tqparentItem) { + item = new GanttViewSummaryItem(tqparentItem, node); } else { // we are on the top level item = new GanttViewSummaryItem(m_gantt, node); @@ -765,19 +765,19 @@ KDGanttViewItem *GanttView::addProject(KDGanttViewItem *parentItem, Node *node, return item; } -KDGanttViewItem *GanttView::addSubProject(KDGanttViewItem *parentItem, Node *node, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addSubProject(KDGanttViewItem *tqparentItem, Node *node, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; - return addProject(parentItem, node, after); + return addProject(tqparentItem, node, after); } -KDGanttViewItem *GanttView::addSummaryTask(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addSummaryTask(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; // display summary item GanttViewSummaryItem *item; - if ( parentItem) { - item = new GanttViewSummaryItem(parentItem, task); + if ( tqparentItem) { + item = new GanttViewSummaryItem(tqparentItem, task); } else { // we are on the top level item = new GanttViewSummaryItem(m_gantt, task); @@ -788,13 +788,13 @@ KDGanttViewItem *GanttView::addSummaryTask(KDGanttViewItem *parentItem, Task *ta return item; } -KDGanttViewItem *GanttView::addTask(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addTask(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; // display task item GanttViewTaskItem *item; - if ( parentItem ) { - item = new GanttViewTaskItem(parentItem, task); + if ( tqparentItem ) { + item = new GanttViewTaskItem(tqparentItem, task); } else { // we are on the top level @@ -806,12 +806,12 @@ KDGanttViewItem *GanttView::addTask(KDGanttViewItem *parentItem, Task *task, KDG return item; } -KDGanttViewItem *GanttView::addMilestone(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after) +KDGanttViewItem *GanttView::addMilestone(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after) { //kdDebug()<<k_funcinfo<<endl; GanttViewEventItem *item; - if ( parentItem ) { - item = new GanttViewEventItem(parentItem, task); + if ( tqparentItem ) { + item = new GanttViewEventItem(tqparentItem, task); } else { // we are on the top level item = new GanttViewEventItem(m_gantt, task); @@ -822,26 +822,26 @@ KDGanttViewItem *GanttView::addMilestone(KDGanttViewItem *parentItem, Task *task return item; } -void GanttView::drawChildren(KDGanttViewItem *parentItem, Node &parentNode) +void GanttView::drawChildren(KDGanttViewItem *tqparentItem, Node &tqparentNode) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Node> nit(parentNode.childNodeIterator()); + TQPtrListIterator<Node> nit(tqparentNode.childNodeIterator()); for ( nit.toLast(); nit.current(); --nit ) { Node *n = nit.current(); if (n->type() == Node::Type_Project) - drawProject(parentItem, n); + drawProject(tqparentItem, n); else if (n->type() == Node::Type_Subproject) - drawSubProject(parentItem, n); + drawSubProject(tqparentItem, n); else if (n->type() == Node::Type_Summarytask) { Task *t = dynamic_cast<Task *>(n); - drawSummaryTask(parentItem, t); + drawSummaryTask(tqparentItem, t); } else if (n->type() == Node::Type_Task) { Task *t = dynamic_cast<Task *>(n); - drawTask(parentItem, t); + drawTask(tqparentItem, t); } else if (n->type() == Node::Type_Milestone) { Task *t = dynamic_cast<Task *>(n); - drawMilestone(parentItem, t); + drawMilestone(tqparentItem, t); } else kdDebug()<<k_funcinfo<<"Node type "<<n->type()<<" not implemented yet"<<endl; @@ -850,37 +850,37 @@ void GanttView::drawChildren(KDGanttViewItem *parentItem, Node &parentNode) } -void GanttView::drawProject(KDGanttViewItem *parentItem, Node *node) +void GanttView::drawProject(KDGanttViewItem *tqparentItem, Node *node) { //kdDebug()<<k_funcinfo<<endl; - GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addProject(parentItem, node)); + GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addProject(tqparentItem, node)); drawChildren(item, *node); } -void GanttView::drawSubProject(KDGanttViewItem *parentItem, Node *node) +void GanttView::drawSubProject(KDGanttViewItem *tqparentItem, Node *node) { //kdDebug()<<k_funcinfo<<endl; - GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addSubProject(parentItem, node)); + GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addSubProject(tqparentItem, node)); drawChildren(item, *node); } -void GanttView::drawSummaryTask(KDGanttViewItem *parentItem, Task *task) +void GanttView::drawSummaryTask(KDGanttViewItem *tqparentItem, Task *task) { //kdDebug()<<k_funcinfo<<endl; - GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addSummaryTask(parentItem, task)); + GanttViewSummaryItem *item = dynamic_cast<GanttViewSummaryItem*>(addSummaryTask(tqparentItem, task)); drawChildren(item, *task); } -void GanttView::drawTask(KDGanttViewItem *parentItem, Task *task) +void GanttView::drawTask(KDGanttViewItem *tqparentItem, Task *task) { //kdDebug()<<k_funcinfo<<endl; - addTask(parentItem, task); + addTask(tqparentItem, task); } -void GanttView::drawMilestone(KDGanttViewItem *parentItem, Task *task) +void GanttView::drawMilestone(KDGanttViewItem *tqparentItem, Task *task) { //kdDebug()<<k_funcinfo<<endl; - addMilestone(parentItem, task); + addMilestone(tqparentItem, task); } void GanttView::addTaskLink(KDGanttViewTaskLink *link) { @@ -970,7 +970,7 @@ Node *GanttView::currentNode() const return getNode(m_currentItem); } -void GanttView::popupMenuRequested(KDGanttViewItem * item, const QPoint & pos, int) +void GanttView::popupMenuRequested(KDGanttViewItem * item, const TQPoint & pos, int) { //kdDebug()<<k_funcinfo<<(item?item->listViewText(0):"0")<<endl; if (item == 0) { @@ -985,7 +985,7 @@ void GanttView::popupMenuRequested(KDGanttViewItem * item, const QPoint & pos, i Task *t = dynamic_cast<Task*>(n); if (t && (t->type() == Node::Type_Task || t->type() == Node::Type_Milestone)) { emit requestPopupMenu("task_popup",pos); -// QPopupMenu *menu = m_mainview->popupMenu("task_popup"); +// TQPopupMenu *menu = m_mainview->popupMenu("task_popup"); // if (menu) // { // /*int id =*/ menu->exec(pos); @@ -995,7 +995,7 @@ void GanttView::popupMenuRequested(KDGanttViewItem * item, const QPoint & pos, i } if (t && t->type() == Node::Type_Summarytask) { emit requestPopupMenu("summarytask_popup",pos); -// QPopupMenu *menu = m_mainview->popupMenu("summarytask_popup"); +// TQPopupMenu *menu = m_mainview->popupMenu("summarytask_popup"); // if (menu) // { // /*int id =*/ menu->exec(pos); @@ -1006,7 +1006,7 @@ void GanttView::popupMenuRequested(KDGanttViewItem * item, const QPoint & pos, i //TODO: Other nodetypes } -void GanttView::slotItemDoubleClicked(QListViewItem* item) { +void GanttView::slotItemDoubleClicked(TQListViewItem* item) { //kdDebug()<<k_funcinfo<<endl; if (item == 0 || item->childCount() > 0) { // FIXME: How else to avoid interference wirh expanding/collapsing summary items? @@ -1029,7 +1029,7 @@ void GanttView::print(KPrinter &prt) { // anyway (it's the PS driver that takes care of the printer resolution). //But KSpread uses fixed 300 dpis, so we can use it. - QPaintDeviceMetrics metrics( &prt ); + TQPaintDeviceMetrics metrics( &prt ); uint top, left, bottom, right; prt.margins(&top, &left, &bottom, &right); //kdDebug()<<m.width()<<"x"<<m.height()<<" : "<<top<<", "<<left<<", "<<bottom<<", "<<right<<" : "<<size()<<endl; @@ -1037,30 +1037,30 @@ void GanttView::print(KPrinter &prt) { // get the size of the desired output for scaling. // here we want to print: ListView and TimeLine (default) // for this purpose, we call drawContents() with a 0 pointer as painter - QSize size = m_gantt->drawContents(0); + TQSize size = m_gantt->drawContents(0); - QPainter p; + TQPainter p; p.begin( &prt ); p.setViewport(left, top, metrics.width()-left-right, metrics.height()-top-bottom); p.setClipRect(left, top, metrics.width()-left-right, metrics.height()-top-bottom); // Make a simple header p.drawRect(0,0,metrics.width(),metrics.height()); - QString text; + TQString text; int hei = 0; - text = KGlobal::locale()->formatDateTime(QDateTime::currentDateTime()); - QRect r = p.boundingRect(metrics.width()-1,0,0,0, Qt::AlignRight, text ); - p.drawText( r, Qt::AlignRight, text ); + text = KGlobal::locale()->formatDateTime(TQDateTime::tqcurrentDateTime()); + TQRect r = p.boundingRect(metrics.width()-1,0,0,0, TQt::AlignRight, text ); + p.drawText( r, TQt::AlignRight, text ); hei = r.height(); //kdDebug()<<"Date r="<<r.left()<<","<<r.top()<<" "<<r.width()<<"x"<<r.height()<<endl; if (m_project) { - QRect re = p.boundingRect(1,0,0,0, Qt::AlignLeft, text ); + TQRect re = p.boundingRect(1,0,0,0, TQt::AlignLeft, text ); re.setWidth(metrics.width()-r.width()-5); // don't print on top of date - p.drawText( re, Qt::AlignLeft, m_project->name() ); + p.drawText( re, TQt::AlignLeft, m_project->name() ); hei = r.height(); //kdDebug()<<"Project r="<<re.left()<<","<<re.top()<<" "<<re.width()<<"x"<<re.height()<<": "<<endl; - hei = QMAX(hei, re.height()); + hei = TQMAX(hei, re.height()); } hei++; @@ -1090,7 +1090,7 @@ void GanttView::print(KPrinter &prt) { selItem->setSelected(true); } -void GanttView::slotItemRenamed(KDGanttViewItem* item, int col, const QString& str) { +void GanttView::slotItemRenamed(KDGanttViewItem* item, int col, const TQString& str) { //kdDebug()<<k_funcinfo<<(item ? item->listViewText(col) : "null")<<": "<<str<<endl; if (col == 0) { emit itemRenamed(getNode(item), str); @@ -1101,7 +1101,7 @@ void GanttView::slotItemRenamed(KDGanttViewItem* item, int col, const QString& s } // testing -bool GanttView::exportGantt(QIODevice* device) { +bool GanttView::exportGantt(TQIODevice* device) { kdDebug()<<k_funcinfo<<endl; return m_gantt->saveProject(device); } @@ -1153,7 +1153,7 @@ void GanttView::slotModifyLink(KDGanttViewTaskLink* link) { bool GanttView::setContext(Context::Ganttview &context, Project& /*project*/) { //kdDebug()<<k_funcinfo<<endl; - QValueList<int> list = sizes(); + TQValueList<int> list = sizes(); list[0] = context.ganttviewsize; list[1] = context.taskviewsize; setSizes(list); @@ -1172,7 +1172,7 @@ bool GanttView::setContext(Context::Ganttview &context, Project& /*project*/) { //TODO this does not work yet! // getContextClosedNodes(context, m_gantt->firstChild()); -// for (QStringList::ConstIterator it = context.closedNodes.begin(); it != context.closedNodes.end(); ++it) { +// for (TQStringList::ConstIterator it = context.closedNodes.begin(); it != context.closedNodes.end(); ++it) { // KDGanttViewItem *item = findItem(project.findNode(*it)); // if (item) { // item->setOpen(false); @@ -1214,22 +1214,22 @@ void GanttView::getContextClosedNodes(Context::Ganttview &context, KDGanttViewIt void GanttView::setReadWriteMode(bool on) { m_readWrite = on; - disconnect(m_gantt, SIGNAL(linkItems(KDGanttViewItem*, KDGanttViewItem*, int)), this, SLOT(slotLinkItems(KDGanttViewItem*, KDGanttViewItem*, int))); - disconnect(m_gantt, SIGNAL(taskLinkDoubleClicked(KDGanttViewTaskLink*)), this, SLOT(slotModifyLink(KDGanttViewTaskLink*))); + disconnect(m_gantt, TQT_SIGNAL(linkItems(KDGanttViewItem*, KDGanttViewItem*, int)), this, TQT_SLOT(slotLinkItems(KDGanttViewItem*, KDGanttViewItem*, int))); + disconnect(m_gantt, TQT_SIGNAL(taskLinkDoubleClicked(KDGanttViewTaskLink*)), this, TQT_SLOT(slotModifyLink(KDGanttViewTaskLink*))); m_gantt->setLinkItemsEnabled(on); if (on) { - connect(m_gantt, SIGNAL(linkItems(KDGanttViewItem*, KDGanttViewItem*, int)), SLOT(slotLinkItems(KDGanttViewItem*, KDGanttViewItem*, int))); + connect(m_gantt, TQT_SIGNAL(linkItems(KDGanttViewItem*, KDGanttViewItem*, int)), TQT_SLOT(slotLinkItems(KDGanttViewItem*, KDGanttViewItem*, int))); - connect(m_gantt, SIGNAL(taskLinkDoubleClicked(KDGanttViewTaskLink*)), SLOT(slotModifyLink(KDGanttViewTaskLink*))); + connect(m_gantt, TQT_SIGNAL(taskLinkDoubleClicked(KDGanttViewTaskLink*)), TQT_SLOT(slotModifyLink(KDGanttViewTaskLink*))); } setRenameEnabled(m_gantt->firstChild(), on); } -void GanttView::setRenameEnabled(QListViewItem *item, bool on) { +void GanttView::setRenameEnabled(TQListViewItem *item, bool on) { if (item == 0) return; - for (QListViewItem *i = item; i; i = i->nextSibling()) { + for (TQListViewItem *i = item; i; i = i->nextSibling()) { i->setRenameEnabled(0, on); setRenameEnabled(i->firstChild(), on); } |