diff options
Diffstat (limited to 'kplato')
155 files changed, 5002 insertions, 4940 deletions
diff --git a/kplato/KPtViewIface.h b/kplato/KPtViewIface.h index bb134b74..60e653c8 100644 --- a/kplato/KPtViewIface.h +++ b/kplato/KPtViewIface.h @@ -4,9 +4,9 @@ #include <KoViewIface.h> -#include <qstring.h> -#include <qrect.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqrect.h> +#include <tqcolor.h> namespace KPlato { diff --git a/kplato/intervalitem.h b/kplato/intervalitem.h index 9bc8992b..2ee6b4c6 100644 --- a/kplato/intervalitem.h +++ b/kplato/intervalitem.h @@ -20,26 +20,26 @@ #ifndef INTERVALITEM_H #define INTERVALITEM_H -#include <qlistview.h> -#include <qdatetime.h> -#include <qpair.h> +#include <tqlistview.h> +#include <tqdatetime.h> +#include <tqpair.h> namespace KPlato { -class IntervalItem : public QListViewItem +class IntervalItem : public TQListViewItem { public: - IntervalItem(QListView * parent, QTime start, QTime end) - : QListViewItem(parent, QString("%1 - %2").arg(start.toString(), end.toString())), + IntervalItem(TQListView * tqparent, TQTime start, TQTime end) + : TQListViewItem(tqparent, TQString("%1 - %2").tqarg(start.toString(), end.toString())), m_start(start), m_end(end) {} - QPair<QTime, QTime> interval() { return QPair<QTime, QTime>(m_start, m_end); } + TQPair<TQTime, TQTime> interval() { return TQPair<TQTime, TQTime>(m_start, m_end); } private: - QTime m_start; - QTime m_end; + TQTime m_start; + TQTime m_end; }; } //KPlato namespace diff --git a/kplato/kptaccount.cc b/kplato/kptaccount.cc index 42dff604..f166111c 100644 --- a/kplato/kptaccount.cc +++ b/kplato/kptaccount.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqstring.h> #include <klocale.h> @@ -43,7 +43,7 @@ Account::Account() m_costPlaces.setAutoDelete(true); } -Account::Account(QString name, QString description) +Account::Account(TQString name, TQString description) : m_name(name), m_description(description), m_list(0), @@ -65,7 +65,7 @@ Account::~Account() { } -void Account::setName(QString name) { +void Account::setName(TQString name) { if (findAccount() == this) { removeId(); } @@ -95,23 +95,23 @@ void Account::take(Account *account) { if (account == 0) { return; } - if (account->parent() == this) { - m_accountList.take(m_accountList.findRef(account)); - } else if (account->parent()) { - account->parent()->take(account); + if (account->tqparent() == this) { + m_accountList.take(m_accountList.tqfindRef(account)); + } else if (account->tqparent()) { + account->tqparent()->take(account); } else { m_list->take(account); } //kdDebug()<<k_funcinfo<<account->name()<<endl; } -bool Account::load(QDomElement &element, const Project &project) { +bool Account::load(TQDomElement &element, const Project &project) { m_name = element.attribute("name"); m_description = element.attribute("description"); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "costplace") { Account::CostPlace *child = new Account::CostPlace(this); if (child->load(e, project)) { @@ -134,12 +134,12 @@ bool Account::load(QDomElement &element, const Project &project) { return true; } -void Account::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("account"); +void Account::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("account"); element.appendChild(me); me.setAttribute("name", m_name); me.setAttribute("description", m_description); - QPtrListIterator<Account::CostPlace> cit = m_costPlaces; + TQPtrListIterator<Account::CostPlace> cit = m_costPlaces; for (; cit.current(); ++cit) { cit.current()->save(me); } @@ -150,7 +150,7 @@ void Account::save(QDomElement &element) const { } Account::CostPlace *Account::findCostPlace(const Node &node) const { - QPtrListIterator<CostPlace> it = m_costPlaces; + TQPtrListIterator<CostPlace> it = m_costPlaces; for (; it.current(); ++it) { if (&node == it.current()->node()) { return it.current(); @@ -232,13 +232,13 @@ void Account::addShutdown(Node &node) { append(new CostPlace(this, &node, false, false, true)); } -Account *Account::findAccount(const QString &id) const { +Account *Account::findAccount(const TQString &id) const { if (m_list) return m_list->findAccount(id); return 0; } -bool Account::removeId(const QString &id) { +bool Account::removeId(const TQString &id) { return (m_list ? m_list->removeId(id) : false); } @@ -280,7 +280,7 @@ void Account::CostPlace::setShutdown(bool on ) { m_node->setShutdownAccount(on ? m_account : 0); } -bool Account::CostPlace::load(QDomElement &element, const Project &project) { +bool Account::CostPlace::load(TQDomElement &element, const Project &project) { //kdDebug()<<k_funcinfo<<endl; m_nodeId = element.attribute("node-id"); if (m_nodeId.isEmpty()) { @@ -298,9 +298,9 @@ bool Account::CostPlace::load(QDomElement &element, const Project &project) { return true; } -void Account::CostPlace::save(QDomElement &element) const { +void Account::CostPlace::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("costplace"); + TQDomElement me = element.ownerDocument().createElement("costplace"); element.appendChild(me); me.setAttribute("node-id", m_nodeId); me.setAttribute("running-cost", m_running); @@ -323,9 +323,9 @@ Accounts::~Accounts() { m_accountList.clear(); } -EffortCostMap Accounts::plannedCost(const Account &account, const QDate &start, const QDate &end) { +EffortCostMap Accounts::plannedCost(const Account &account, const TQDate &start, const TQDate &end) { EffortCostMap ec; - QPtrListIterator<Account::CostPlace> it = account.costPlaces(); + TQPtrListIterator<Account::CostPlace> it = account.costPlaces(); for (; it.current(); ++it) { Node *n = it.current()->node(); if (n == 0) { @@ -347,7 +347,7 @@ EffortCostMap Accounts::plannedCost(const Account &account, const QDate &start, } } if (&account == m_defaultAccount) { - QDictIterator<Node> nit = m_project.nodeDict(); + TQDictIterator<Node> nit = m_project.nodeDict(); for (; nit.current(); ++nit) { Node *n = nit.current(); if (n->runningAccount() == 0) { @@ -383,19 +383,19 @@ void Accounts::take(Account *account){ return; } removeId(account->name()); - if (account->parent()) { - account->parent()->take(account); + if (account->tqparent()) { + account->tqparent()->take(account); return; } - m_accountList.take(m_accountList.findRef(account)); + m_accountList.take(m_accountList.tqfindRef(account)); //kdDebug()<<k_funcinfo<<account->name()<<endl; } -bool Accounts::load(QDomElement &element, const Project &project) { - QDomNodeList list = element.childNodes(); +bool Accounts::load(TQDomElement &element, const Project &project) { + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "account") { Account *child = new Account(); if (child->load(e, project)) { @@ -417,8 +417,8 @@ bool Accounts::load(QDomElement &element, const Project &project) { return true; } -void Accounts::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("accounts"); +void Accounts::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("accounts"); element.appendChild(me); if (m_defaultAccount) { me.setAttribute("default-account", m_defaultAccount->name()); @@ -429,9 +429,9 @@ void Accounts::save(QDomElement &element) const { } } -QStringList Accounts::costElements() const { - QDictIterator<Account> it(m_idDict); - QStringList l; +TQStringList Accounts::costElements() const { + TQDictIterator<Account> it(m_idDict); + TQStringList l; for(; it.current(); ++it) { if (it.current()->isElement()) l << it.currentKey(); @@ -440,9 +440,9 @@ QStringList Accounts::costElements() const { } -QStringList Accounts::nameList() const { - QDictIterator<Account> it(m_idDict); - QStringList l; +TQStringList Accounts::nameList() const { + TQDictIterator<Account> it(m_idDict); + TQStringList l; for(; it.current(); ++it) { l << it.currentKey(); } @@ -450,7 +450,7 @@ QStringList Accounts::nameList() const { } Account *Accounts::findRunningAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findRunning(node)) return it.current(); @@ -459,7 +459,7 @@ Account *Accounts::findRunningAccount(const Node &node) const { } Account *Accounts::findStartupAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findStartup(node)) return it.current(); @@ -468,7 +468,7 @@ Account *Accounts::findStartupAccount(const Node &node) const { } Account *Accounts::findShutdownAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findShutdown(node)) return it.current(); @@ -476,13 +476,13 @@ Account *Accounts::findShutdownAccount(const Node &node) const { return 0; } -Account *Accounts::findAccount(const QString &id) const { - return m_idDict.find(id); +Account *Accounts::findAccount(const TQString &id) const { + return m_idDict.tqfind(id); } bool Accounts::insertId(const Account *account) { Q_ASSERT(account); - Account *a = m_idDict.find(account->name()); + Account *a = m_idDict.tqfind(account->name()); if (a == 0) { //kdDebug()<<k_funcinfo<<"'"<<account->name()<<"' inserted"<<endl; m_idDict.insert(account->name(), account); @@ -497,16 +497,16 @@ bool Accounts::insertId(const Account *account) { return false; } -bool Accounts::removeId(const QString &id) { +bool Accounts::removeId(const TQString &id) { bool res = m_idDict.remove(id); //kdDebug()<<k_funcinfo<<id<<": removed="<<res<<endl; return res; } #ifndef NDEBUG -void Accounts::printDebug(QString /*indent*/) { +void Accounts::printDebug(TQString /*indent*/) { } -void Account::printDebug(QString /*indent*/) { +void Account::printDebug(TQString /*indent*/) { } #endif } //namespace KPlato diff --git a/kplato/kptaccount.h b/kplato/kptaccount.h index 845f70d6..9e23b8e7 100644 --- a/kplato/kptaccount.h +++ b/kplato/kptaccount.h @@ -20,18 +20,18 @@ #ifndef KPTACCOUNT_H #define KPTACCOUNT_H -#include <qdatetime.h> -#include <qdict.h> -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqdatetime.h> +#include <tqdict.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include "kpteffortcostmap.h" #include "kptnode.h" #include <kdebug.h> -class QDomElement; -class QString; +class TQDomElement; +class TQString; namespace KPlato { @@ -57,7 +57,7 @@ public: /** * */ - Account(QString name, QString description=QString::null); + Account(TQString name, TQString description=TQString()); /** * Destructor. @@ -65,32 +65,32 @@ public: ~Account(); - QString name() const { return m_name; } - void setName(QString name); + TQString name() const { return m_name; } + void setName(TQString name); - QString description() const { return m_description; } - void setDescription(QString desc) { m_description = desc; } + TQString description() const { return m_description; } + void setDescription(TQString desc) { m_description = desc; } bool isElement() const { return m_accountList.isEmpty(); } Accounts *list() const { return m_list; } void setList(Accounts *list) { m_list = list; } - Account *parent() const { return m_parent; } - void setParent(Account *parent) { m_parent = parent; } + Account *tqparent() const { return m_parent; } + void setParent(Account *tqparent) { m_parent = tqparent; } void clear() { m_accountList.clear(); } void append(Account *account); void take(Account *account); void insertChildren(); - bool load(QDomElement &element, const Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, const Project &project); + void save(TQDomElement &element) const; - const QPtrList<Account> &accountList() const { return m_accountList; } + const TQPtrList<Account> &accountList() const { return m_accountList; } Account *findAccount() const { return findAccount(m_name); } - Account *findAccount(const QString &id) const; + Account *findAccount(const TQString &id) const; bool removeId() { return removeId(m_name); } - bool removeId(const QString &id); + bool removeId(const TQString &id); bool insertId(); bool insertId(const Account *account); @@ -130,12 +130,12 @@ public: bool shutdown() const { return m_shutdown; } void setShutdown(bool on); - bool load(QDomElement &element, const Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, const Project &project); + void save(TQDomElement &element) const; private: Account *m_account; - QString m_nodeId; + TQString m_nodeId; Node *m_node; bool m_running; bool m_startup; @@ -143,7 +143,7 @@ public: }; void append(const CostPlace *cp) { m_costPlaces.append(cp); } - const QPtrList<CostPlace> &costPlaces() const {return m_costPlaces; } + const TQPtrList<CostPlace> &costPlaces() const {return m_costPlaces; } Account::CostPlace *findCostPlace(const Node &node) const; CostPlace *findRunning(const Node &node) const; void removeRunning(const Node &node); @@ -156,21 +156,21 @@ public: void addShutdown(Node &node); private: - QString m_name; - QString m_description; + TQString m_name; + TQString m_description; Accounts *m_list; Account *m_parent; - QPtrList<Account> m_accountList; - QPtrList<CostPlace> m_costPlaces; + TQPtrList<Account> m_accountList; + TQPtrList<CostPlace> m_costPlaces; #ifndef NDEBUG public: - void printDebug(QString indent); + void printDebug(TQString indent); #endif }; -typedef QPtrList<Account> AccountList; -typedef QPtrListIterator<Account> AccountListIterator; +typedef TQPtrList<Account> AccountList; +typedef TQPtrListIterator<Account> AccountListIterator; /** * Accounts administrates all accounts. @@ -185,39 +185,39 @@ public: Account *defaultAccount() const { return m_defaultAccount; } void setDefaultAccount(Account *account) { m_defaultAccount = account; } - EffortCostMap plannedCost(const Account &account, const QDate &start, const QDate &end); + EffortCostMap plannedCost(const Account &account, const TQDate &start, const TQDate &end); void clear() { m_accountList.clear(); m_idDict.clear(); } void append(Account *account); void take(Account *account); - bool load(QDomElement &element, const Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, const Project &project); + void save(TQDomElement &element) const; - QStringList costElements() const; - QStringList nameList() const; + TQStringList costElements() const; + TQStringList nameList() const; const AccountList &accountList() const { return m_accountList; } Account *findRunningAccount(const Node &node) const; Account *findStartupAccount(const Node &node) const; Account *findShutdownAccount(const Node &node) const; - Account *findAccount(const QString &id) const; + Account *findAccount(const TQString &id) const; bool insertId(const Account *account); - bool removeId(const QString &id); + bool removeId(const TQString &id); void accountDeleted(Account *account) { if (account == m_defaultAccount) m_defaultAccount = 0; } private: Project &m_project; AccountList m_accountList; - QDict<Account> m_idDict; + TQDict<Account> m_idDict; Account *m_defaultAccount; #ifndef NDEBUG public: - void printDebug(QString indent); + void printDebug(TQString indent); #endif }; diff --git a/kplato/kptaccountsdialog.cc b/kplato/kptaccountsdialog.cc index 5f03b126..9247aad7 100644 --- a/kplato/kptaccountsdialog.cc +++ b/kplato/kptaccountsdialog.cc @@ -26,14 +26,14 @@ namespace KPlato { -AccountsDialog::AccountsDialog(Accounts &acc, QWidget *p, const char *n) +AccountsDialog::AccountsDialog(Accounts &acc, TQWidget *p, const char *n) : KDialogBase(Swallow, i18n("Edit Accounts"), Ok|Cancel, Ok, p, n, true, true) { m_panel = new AccountsPanel(acc, this); setMainWidget(m_panel); enableButtonOK(false); - connect(m_panel, SIGNAL(changed(bool)), SLOT(enableButtonOK(bool))); + connect(m_panel, TQT_SIGNAL(changed(bool)), TQT_SLOT(enableButtonOK(bool))); } KCommand *AccountsDialog::buildCommand(Part *part) { diff --git a/kplato/kptaccountsdialog.h b/kplato/kptaccountsdialog.h index eb7cd1b7..e9bb8d4e 100644 --- a/kplato/kptaccountsdialog.h +++ b/kplato/kptaccountsdialog.h @@ -22,7 +22,7 @@ #include <kdialogbase.h> -class QWidget; +class TQWidget; class KCommand; @@ -35,8 +35,9 @@ class Part; class AccountsDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AccountsDialog(Accounts &acc, QWidget *parent=0, const char *name=0); + AccountsDialog(Accounts &acc, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptaccountspanel.cc b/kplato/kptaccountspanel.cc index 70fba38e..1d38ac79 100644 --- a/kplato/kptaccountspanel.cc +++ b/kplato/kptaccountspanel.cc @@ -22,12 +22,12 @@ #include "kptcommand.h" #include "kptproject.h" -#include <qcombobox.h> -#include <qheader.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <klistview.h> #include <klocale.h> @@ -39,29 +39,29 @@ namespace KPlato class AccountItem : public KListViewItem { public: - AccountItem(AccountsPanel &pan, QListView *parent) - : KListViewItem(parent), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent) + : KListViewItem(tqparent), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent) - : KListViewItem(parent), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent) + : KListViewItem(tqparent), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListView *parent, QString label1, QString label2 = QString::null) - : KListViewItem(parent, label1, label2), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent, TQString label1, TQString label2 = TQString()) + : KListViewItem(tqparent, label1, label2), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent, QString label1, QString label2 = QString::null) - : KListViewItem(parent, label1, label2), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent, TQString label1, TQString label2 = TQString()) + : KListViewItem(tqparent, label1, label2), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListView *parent, QListViewItem *after) - : KListViewItem(parent, after), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent, QListViewItem *after) - : KListViewItem(parent, after), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), account(0), panel(pan) { init(); } Account *account; bool isDefault; - QString oldText; + TQString oldText; AccountsPanel &panel; protected: virtual void cancelRename(int col) { @@ -71,7 +71,7 @@ protected: return; } panel.renameStopped(this); - QListViewItem::cancelRename(col); + TQListViewItem::cancelRename(col); setRenameEnabled(col, false); } private: @@ -84,7 +84,7 @@ private: } }; -AccountsPanel::AccountsPanel(Accounts &acc, QWidget *p, const char *n) +AccountsPanel::AccountsPanel(Accounts &acc, TQWidget *p, const char *n) : AccountsPanelBase(p, n), m_accounts(acc), m_currentIndex(0), @@ -94,34 +94,34 @@ AccountsPanel::AccountsPanel(Accounts &acc, QWidget *p, const char *n) accountList->setRootIsDecorated(true); accountList->header()->setStretchEnabled(true, 1); accountList->setItemMargin(2); - accountList->setDefaultRenameAction(QListView::Accept); + accountList->setDefaultRenameAction(TQListView::Accept); addItems(accountList, acc); slotSelectionChanged(); - connect(accountList, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); - connect(accountList, SIGNAL(itemRenamed(QListViewItem*, int)), SLOT(slotItemRenamed(QListViewItem*, int))); - connect(accountList, SIGNAL(doubleClicked(QListViewItem*, const QPoint &, int)), SLOT(slotListDoubleClicked(QListViewItem*, const QPoint &, int))); + connect(accountList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); + connect(accountList, TQT_SIGNAL(itemRenamed(TQListViewItem*, int)), TQT_SLOT(slotItemRenamed(TQListViewItem*, int))); + connect(accountList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint &, int)), TQT_SLOT(slotListDoubleClicked(TQListViewItem*, const TQPoint &, int))); - connect(removeBtn, SIGNAL(clicked()), SLOT(slotRemoveBtn())); - connect(newBtn, SIGNAL(clicked()), SLOT(slotNewBtn())); - connect(subBtn, SIGNAL(clicked()), SLOT(slotSubBtn())); + connect(removeBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveBtn())); + connect(newBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewBtn())); + connect(subBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSubBtn())); - connect(accountsComboBox, SIGNAL(activated(int)), SLOT(slotActivated(int))); + connect(accountsComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); // Internal hacks, to get renaming to behave along with unique names - // Uses signals to not get in the way of QListView - connect(this, SIGNAL(renameStarted(QListViewItem*, int)), SLOT(slotRenameStarted(QListViewItem*, int))); - connect(this, SIGNAL(startRename(QListViewItem*, int)), SLOT(slotStartRename(QListViewItem*, int))); - connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); + // Uses signals to not get in the way of TQListView + connect(this, TQT_SIGNAL(renameStarted(TQListViewItem*, int)), TQT_SLOT(slotRenameStarted(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(startRename(TQListViewItem*, int)), TQT_SLOT(slotStartRename(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); } -void AccountsPanel::addItems(QListView *lv, Accounts &acc) { +void AccountsPanel::addItems(TQListView *lv, Accounts &acc) { //kdDebug()<<k_funcinfo<<"No of accs: "<<acc.accountList().count()<<endl; AccountListIterator it = acc.accountList(); for (; it.current(); ++it) { - QString n = it.current()->name(); - QString d = it.current()->description(); + TQString n = it.current()->name(); + TQString d = it.current()->description(); AccountItem *item = new AccountItem(*this, lv, n, d); item->account = it.current(); item->isDefault = (it.current() == acc.defaultAccount()); @@ -132,11 +132,11 @@ void AccountsPanel::addItems(QListView *lv, Accounts &acc) { } } -void AccountsPanel::addItems(QListViewItem *item, Account *acc) { +void AccountsPanel::addItems(TQListViewItem *item, Account *acc) { AccountListIterator it = acc->accountList(); for (; it.current(); ++it) { - QString n = it.current()->name(); - QString d = it.current()->description(); + TQString n = it.current()->name(); + TQString d = it.current()->description(); AccountItem *ai = new AccountItem(*this, item, n, d); ai->account = it.current(); ai->isDefault = (it.current() == acc->list()->defaultAccount()); @@ -147,16 +147,16 @@ void AccountsPanel::addItems(QListViewItem *item, Account *acc) { } } -void AccountsPanel::addElement(const QListViewItem *item) { - if (item->parent()) { - removeElement(item->parent()); +void AccountsPanel::addElement(const TQListViewItem *item) { + if (item->tqparent()) { + removeElement(item->tqparent()); } - m_elements.replace(item->text(0), item); + m_elements.tqreplace(item->text(0), item); //kdDebug()<<k_funcinfo<<item->text(0)<<endl; refreshDefaultAccount(); } -void AccountsPanel::removeElement(QListViewItem *item) { +void AccountsPanel::removeElement(TQListViewItem *item) { static_cast<AccountItem*>(item)->isDefault = false; m_elements.remove(item->text(0)); refreshDefaultAccount(); @@ -166,7 +166,7 @@ void AccountsPanel::refreshDefaultAccount() { accountsComboBox->clear(); m_currentIndex = 0; accountsComboBox->insertItem(i18n("None")); - QDictIterator<QListViewItem> it(m_elements); + TQDictIterator<TQListViewItem> it(m_elements); for(int i=1; it.current(); ++it, ++i) { accountsComboBox->insertItem(it.currentKey()); if (static_cast<AccountItem*>(it.current())->isDefault) { @@ -217,13 +217,13 @@ void AccountsPanel::slotSelectionChanged() { subBtn->setEnabled(false); return; } - QListViewItem *i = accountList->selectedItem(); + TQListViewItem *i = accountList->selectedItem(); removeBtn->setEnabled((bool)i); newBtn->setEnabled(true); subBtn->setEnabled((bool)i); } -void AccountsPanel::slotItemRenamed(QListViewItem *item, int col) { +void AccountsPanel::slotItemRenamed(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<item->text(0)<<endl; item->setRenameEnabled(col, false); m_renameItem = 0; @@ -254,8 +254,8 @@ void AccountsPanel::slotItemRenamed(QListViewItem *item, int col) { slotChanged(); } -bool AccountsPanel::isUnique(QListViewItem *item) { - QListViewItemIterator it(accountList); +bool AccountsPanel::isUnique(TQListViewItem *item) { + TQListViewItemIterator it(accountList); for (; it.current(); ++it) { if (it.current() != item && it.current()->text(0) == item->text(0)) { return false; @@ -271,42 +271,42 @@ void AccountsPanel::slotRemoveBtn() { void AccountsPanel::slotNewBtn() { //kdDebug()<<k_funcinfo<<endl; - QListViewItem *item = accountList->selectedItem(); + TQListViewItem *item = accountList->selectedItem(); if (item && item->text(0).isEmpty()) { return; } - QListViewItem *n; + TQListViewItem *n; if (item) { - if (item->parent()) { - n = new AccountItem(*this, item->parent(), item); + if (item->tqparent()) { + n = new AccountItem(*this, item->tqparent(), item); } else { n = new AccountItem(*this, accountList, item); } } else { n = new AccountItem(*this, accountList); } - slotListDoubleClicked(n, QPoint(), 0); + slotListDoubleClicked(n, TQPoint(), 0); } void AccountsPanel::slotSubBtn() { //kdDebug()<<k_funcinfo<<endl; - QListViewItem *item = accountList->selectedItem(); + TQListViewItem *item = accountList->selectedItem(); if (item && item->text(0).isEmpty()) { return; } - QListViewItem *n; + TQListViewItem *n; if (item) { n = new AccountItem(*this, item); } else { n = new AccountItem(*this, accountList); } - slotListDoubleClicked(n, QPoint(), 0); + slotListDoubleClicked(n, TQPoint(), 0); } KCommand *AccountsPanel::buildCommand(Part *part) { KMacroCommand *cmd = 0; // First remove - QPtrListIterator<QListViewItem> rit = m_removedItems; + TQPtrListIterator<TQListViewItem> rit = m_removedItems; for (;rit.current(); ++rit) { AccountItem *item = static_cast<AccountItem*>(rit.current()); //kdDebug()<<k_funcinfo<<"Removed item"<<endl; @@ -325,7 +325,7 @@ KCommand *AccountsPanel::buildCommand(Part *part) { KCommand *AccountsPanel::save(Part *part, Project &project) { KMacroCommand *cmd=0; - QListViewItem *myChild = accountList->firstChild(); + TQListViewItem *myChild = accountList->firstChild(); for (; myChild; myChild = myChild->nextSibling()) { KCommand *c = save(part, project, myChild); if (c) { @@ -336,7 +336,7 @@ KCommand *AccountsPanel::save(Part *part, Project &project) { return cmd; } -KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { +KCommand *AccountsPanel::save(Part *part, Project &project, TQListViewItem *i) { KMacroCommand *cmd=0; AccountItem *item = static_cast<AccountItem*>(i); if (item->account == 0) { @@ -344,9 +344,9 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { //kdDebug()<<k_funcinfo<<"New account: "<<item->text(0)<<endl; if (!cmd) cmd = new KMacroCommand(""); item->account = new Account(item->text(0), item->text(1)); - if (item->parent()) { + if (item->tqparent()) { //kdDebug()<<k_funcinfo<<"New account: "<<item->text(0)<<endl; - cmd->addCommand(new AddAccountCmd(part, project, item->account, item->parent()->text(0))); + cmd->addCommand(new AddAccountCmd(part, project, item->account, item->tqparent()->text(0))); } else { cmd->addCommand(new AddAccountCmd(part, project, item->account)); } @@ -363,7 +363,7 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { cmd->addCommand(new ModifyAccountDescriptionCmd(part, item->account, item->text(1))); } } - QListViewItem *myChild = item->firstChild(); + TQListViewItem *myChild = item->firstChild(); for (; myChild; myChild = myChild->nextSibling()) { KCommand *c = save(part, project, myChild); if (c) { @@ -383,14 +383,14 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { return cmd; } -void AccountsPanel::slotListDoubleClicked(QListViewItem* item, const QPoint&, int col) { +void AccountsPanel::slotListDoubleClicked(TQListViewItem* item, const TQPoint&, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (m_renameItem) return; slotStartRename(item, col); } -void AccountsPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { +void AccountsPanel::slotRenameStarted(TQListViewItem */*item*/, int /*col*/) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (accountList->isRenaming()) { removeBtn->setEnabled(false); @@ -399,7 +399,7 @@ void AccountsPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { } } -void AccountsPanel::slotStartRename(QListViewItem *item, int col) { +void AccountsPanel::slotStartRename(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; static_cast<AccountItem*>(item)->oldText = item->text(col); item->setRenameEnabled(col, true); @@ -409,13 +409,13 @@ void AccountsPanel::slotStartRename(QListViewItem *item, int col) { emit renameStarted(item, col); } -void AccountsPanel::slotRemoveItem(QListViewItem *i) { +void AccountsPanel::slotRemoveItem(TQListViewItem *i) { AccountItem *item = static_cast<AccountItem*>(i); if (item == 0) return; //kdDebug()<<k_funcinfo<<item->text(0)<<endl; removeElement(item); - QListViewItem *p = item->parent(); + TQListViewItem *p = item->tqparent(); if (p) { p->takeItem(item); if (item->account) { @@ -437,7 +437,7 @@ void AccountsPanel::slotRemoveItem(QListViewItem *i) { } // We don't get notified when rename is cancelled, this is called from the item -void AccountsPanel::renameStopped(QListViewItem */*item*/) { +void AccountsPanel::renameStopped(TQListViewItem */*item*/) { //kdDebug()<<k_funcinfo<<endl; m_renameItem = 0; emit selectionChanged(); diff --git a/kplato/kptaccountspanel.h b/kplato/kptaccountspanel.h index d067d6d3..6e1646f7 100644 --- a/kplato/kptaccountspanel.h +++ b/kplato/kptaccountspanel.h @@ -22,12 +22,12 @@ #include "kptaccountspanelbase.h" -#include <qptrlist.h> -#include <qdict.h> +#include <tqptrlist.h> +#include <tqdict.h> -class QListView; -class QListViewItem; -class QWidget; +class TQListView; +class TQListViewItem; +class TQWidget; class KCommand; class KMacroCommand; @@ -43,20 +43,21 @@ class Project; class AccountsPanel : public AccountsPanelBase { Q_OBJECT + TQ_OBJECT public: - AccountsPanel(Accounts &acc, QWidget *parent=0, const char *name=0); + AccountsPanel(Accounts &acc, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); - bool isUnique(QListViewItem *item); - void renameStopped(QListViewItem *item); + bool isUnique(TQListViewItem *item); + void renameStopped(TQListViewItem *item); signals: void changed(bool); // Internal - void renameStarted(QListViewItem *, int); - void startRename(QListViewItem *item, int col); + void renameStarted(TQListViewItem *, int); + void startRename(TQListViewItem *item, int col); void selectionChanged(); public slots: @@ -65,33 +66,33 @@ public slots: protected slots: void slotChanged(); void slotSelectionChanged(); - void slotItemRenamed(QListViewItem *item, int col); + void slotItemRenamed(TQListViewItem *item, int col); void slotRemoveBtn(); void slotNewBtn(); void slotSubBtn(); void slotActivated(int); - void slotListDoubleClicked(QListViewItem* item, const QPoint&, int col); - void slotRenameStarted(QListViewItem *item, int col); - void slotStartRename(QListViewItem *item, int col); - void slotRemoveItem(QListViewItem *i); + void slotListDoubleClicked(TQListViewItem* item, const TQPoint&, int col); + void slotRenameStarted(TQListViewItem *item, int col); + void slotStartRename(TQListViewItem *item, int col); + void slotRemoveItem(TQListViewItem *i); protected: - void addItems(QListView *lv, Accounts &acc); - void addItems(QListViewItem *item, Account *acc); - void addElement(const QListViewItem *item); - void removeElement(QListViewItem *item); + void addItems(TQListView *lv, Accounts &acc); + void addItems(TQListViewItem *item, Account *acc); + void addElement(const TQListViewItem *item); + void removeElement(TQListViewItem *item); void refreshDefaultAccount(); KCommand *save(Part *part, Project &project); - KCommand *save(Part *part, Project &project, QListViewItem *item); + KCommand *save(Part *part, Project &project, TQListViewItem *item); private: Accounts &m_accounts; - QPtrList<QListViewItem> m_removedItems; + TQPtrList<TQListViewItem> m_removedItems; Account *m_oldDefaultAccount; - QDict<QListViewItem> m_elements; + TQDict<TQListViewItem> m_elements; int m_currentIndex; - QString m_renameText; - QListViewItem *m_renameItem; + TQString m_renameText; + TQListViewItem *m_renameItem; }; } //namespace KPlato diff --git a/kplato/kptaccountspanelbase.ui b/kplato/kptaccountspanelbase.ui index dde73216..71e08516 100644 --- a/kplato/kptaccountspanelbase.ui +++ b/kplato/kptaccountspanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::AccountsPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AccountsPanelBase</cstring> </property> @@ -13,7 +13,7 @@ <height>234</height> </rect> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>350</width> <height>220</height> @@ -35,15 +35,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -51,7 +51,7 @@ <string>Default account:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>accountsComboBox</cstring> </property> @@ -85,15 +85,15 @@ <cstring>accountList</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>newBtn</cstring> </property> @@ -101,7 +101,7 @@ <string>&New</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>subBtn</cstring> </property> @@ -109,7 +109,7 @@ <string>New &Sub-Account</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>removeBtn</cstring> </property> @@ -123,7 +123,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> </includehints> diff --git a/kplato/kptaccountsview.cc b/kplato/kptaccountsview.cc index 3fc5d8dd..d9e0c33d 100644 --- a/kplato/kptaccountsview.cc +++ b/kplato/kptaccountsview.cc @@ -26,21 +26,21 @@ #include "kptview.h" #include "kpteffortcostmap.h" -#include <qapplication.h> -#include <qcombobox.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qpushbutton.h> -#include <qvaluelist.h> -#include <qpopupmenu.h> -#include <qsizepolicy.h> -#include <qhbox.h> -#include <qpaintdevicemetrics.h> +#include <tqapplication.h> +#include <tqcombobox.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqpushbutton.h> +#include <tqvaluelist.h> +#include <tqpopupmenu.h> +#include <tqsizepolicy.h> +#include <tqhbox.h> +#include <tqpaintdevicemetrics.h> #include <kcalendarsystem.h> #include <kglobal.h> @@ -53,26 +53,26 @@ namespace KPlato { -class Label : public QLabel +class Label : public TQLabel { public: - Label(QWidget *w) - : QLabel(w) + Label(TQWidget *w) + : TQLabel(w) {} - void paintContents(QPainter *p) { + void paintContents(TQPainter *p) { drawContents(p); } }; -AccountsView::AccountItem::AccountItem(Account *a, QListView *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, a->name(), highlight), +AccountsView::AccountItem::AccountItem(Account *a, TQListView *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, a->name(), highlight), account(a) { - if (parent->columns() >= 3) { + if (tqparent->columns() >= 3) { setText(2, a->description()); } //kdDebug()<<k_funcinfo<<endl; } -AccountsView::AccountItem::AccountItem(Account *a, QListViewItem *p, bool highlight) +AccountsView::AccountItem::AccountItem(Account *a, TQListViewItem *p, bool highlight) : DoubleListViewBase::MasterListItem(p, a->name(), highlight), account(a) { if (listView() && listView()->columns() >= 3) { @@ -81,39 +81,39 @@ AccountsView::AccountItem::AccountItem(Account *a, QListViewItem *p, bool highli //kdDebug()<<k_funcinfo<<endl; } -AccountsView::AccountItem::AccountItem(QString text, Account *a, QListViewItem *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, text, highlight), +AccountsView::AccountItem::AccountItem(TQString text, Account *a, TQListViewItem *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, text, highlight), account(a) { //kdDebug()<<k_funcinfo<<endl; } -void AccountsView::AccountItem::add(int col, const QDate &date, const EffortCost &ec) { +void AccountsView::AccountItem::add(int col, const TQDate &date, const EffortCost &ec) { EffortCost &cm = costMap.add(date, ec); if (m_slaveItem) m_slaveItem->setText(col, KGlobal::locale()->formatMoney(cm.cost(), "", 0)); } -AccountsView::AccountsView(Project &project, View *view, QWidget *parent) - : QWidget(parent, "Accounts view"), +AccountsView::AccountsView(Project &project, View *view, TQWidget *tqparent) + : TQWidget(tqparent, "Accounts view"), m_mainview(view), m_project(project), m_accounts(project.accounts()) { - m_date = QDate::currentDate(); + m_date = TQDate::tqcurrentDate(); m_period = 0; m_periodTexts<<i18n("Day")<<i18n("Week")<<i18n("Month"); m_cumulative = false; - QVBoxLayout *lay1 = new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout *lay1 = new TQVBoxLayout(this, 0, KDialog::spacingHint()); - QHBoxLayout *lay2 = new QHBoxLayout(0, 0, KDialog::spacingHint()); + TQHBoxLayout *lay2 = new TQHBoxLayout(0, 0, KDialog::spacingHint()); m_label = new Label(this); - m_label->setFrameShape(QLabel::StyledPanel); - m_label->setFrameShadow(QLabel::Sunken); - m_label->setAlignment(int(QLabel::WordBreak | QLabel::AlignVCenter)); + m_label->setFrameShape(TQLabel::StyledPanel); + m_label->setFrameShadow(TQLabel::Sunken); + m_label->tqsetAlignment(int(TQLabel::WordBreak | TQLabel::AlignVCenter)); lay2->addWidget(m_label); - m_changeBtn = new QPushButton(i18n("Configure..."), this); - m_changeBtn->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, m_changeBtn->sizePolicy().hasHeightForWidth())); + m_changeBtn = new TQPushButton(i18n("Configure..."), this); + m_changeBtn->tqsetSizePolicy(TQSizePolicy((TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, m_changeBtn->sizePolicy().hasHeightForWidth())); lay2->addWidget(m_changeBtn); lay1->addLayout(lay2); @@ -124,12 +124,12 @@ AccountsView::AccountsView(Project &project, View *view, QWidget *parent) lay1->addWidget(m_dlv); - connect(this, SIGNAL(update()), SLOT(slotUpdate())); - connect(m_changeBtn, SIGNAL(clicked()), SLOT(slotConfigure())); + connect(this, TQT_SIGNAL(update()), TQT_SLOT(slotUpdate())); + connect(m_changeBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotConfigure())); - QValueList<int> list = m_dlv->sizes(); + TQValueList<int> list = m_dlv->sizes(); int tot = list[0] + list[1]; - list[0] = QMIN(35, tot); + list[0] = TQMIN(35, tot); list[1] = tot-list[0]; m_dlv->setSizes(list); } @@ -139,7 +139,7 @@ void AccountsView::zoom(double zoom) { } void AccountsView::init() { - m_date = QDate::currentDate(); + m_date = TQDate::tqcurrentDate(); m_period = 0; initAccList(m_accounts.accountList()); } @@ -165,32 +165,32 @@ void AccountsView::initAccList(const AccountList &list) { createPeriods(); } -void AccountsView::initAccSubItems(Account *acc, AccountsView::AccountItem *parent) { +void AccountsView::initAccSubItems(Account *acc, AccountsView::AccountItem *tqparent) { if (!acc->accountList().isEmpty()) { -/* AccountsView::AccountItem *a = new AccountsView::AccountItem(i18n("Subaccounts"), acc, parent); - DoubleListViewBase::SlaveListItem *i = new DoubleListViewBase::SlaveListItem(a, parent->period); +/* AccountsView::AccountItem *a = new AccountsView::AccountItem(i18n("Subaccounts"), acc, tqparent); + DoubleListViewBase::SlaveListItem *i = new DoubleListViewBase::SlaveListItem(a, tqparent->period); a->period = i;*/ - initAccList(acc->accountList(), parent); + initAccList(acc->accountList(), tqparent); } -// AccountsView::AccountItem *a = new AccountsView::AccountItem(i18n("Variance"), acc, parent, true); -// DoubleListViewBase::SlaveListItem *i = new DoubleListViewBase::SlaveListItem(a, parent->period, true); +// AccountsView::AccountItem *a = new AccountsView::AccountItem(i18n("Variance"), acc, tqparent, true); +// DoubleListViewBase::SlaveListItem *i = new DoubleListViewBase::SlaveListItem(a, tqparent->period, true); // a->period = i; // -// a = new AccountsView::AccountItem(i18n("Actual"), acc, parent); -// i = new DoubleListViewBase::SlaveListItem(a, parent->period); +// a = new AccountsView::AccountItem(i18n("Actual"), acc, tqparent); +// i = new DoubleListViewBase::SlaveListItem(a, tqparent->period); // a->period = i; // -// a = new AccountsView::AccountItem(i18n("Planned"), acc, parent); -// i = new DoubleListViewBase::SlaveListItem(a, parent->period); +// a = new AccountsView::AccountItem(i18n("Planned"), acc, tqparent); +// i = new DoubleListViewBase::SlaveListItem(a, tqparent->period); // a->period = i; } -void AccountsView::initAccList(const AccountList &list, AccountsView::AccountItem *parent) { +void AccountsView::initAccList(const AccountList &list, AccountsView::AccountItem *tqparent) { AccountListIterator it = list; for (it.toLast(); it.current(); --it) { - AccountsView::AccountItem *a = new AccountsView::AccountItem(it.current(), parent); + AccountsView::AccountItem *a = new AccountsView::AccountItem(it.current(), tqparent); a->setOpen(true); a->setExpandable(!it.current()->isElement()); initAccSubItems(it.current(), a); @@ -207,30 +207,30 @@ void AccountsView::createPeriods() { void AccountsView::slotUpdate() { //kdDebug()<<k_funcinfo<<endl; - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); createPeriods(); KLocale *locale = KGlobal::locale(); const KCalendarSystem *cal = locale->calendar(); - QString t; + TQString t; if (m_cumulative) { t += " <b>" + i18n("Cumulative") + "</b> "; } - t += i18n("Cut-off date:%1").arg("<b>" + locale->formatDate(m_date, true) + "</b>"); - t += " " + i18n("Periodicity:%1").arg("<b>" + periodText(m_period) + "</b>"); + t += i18n("Cut-off date:%1").tqarg("<b>" + locale->formatDate(m_date, true) + "</b>"); + t += " " + i18n("Periodicity:%1").tqarg("<b>" + periodText(m_period) + "</b>"); m_label->setText(t); // Add columns for selected period/periods - QDate start = m_project.startTime().date(); - QDate end = m_date; + TQDate start = m_project.startTime().date(); + TQDate end = m_date; //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; int c=0; if (m_period == 0) { //Daily - for (QDate dt = start; dt <= end; dt = cal->addDays(dt, 1), ++c) { - QString df = locale->formatDate(dt, true); + for (TQDate dt = start; dt <= end; dt = cal->addDays(dt, 1), ++c) { + TQString df = locale->formatDate(dt, true); m_dlv->addSlaveColumn(df); } - QListViewItemIterator it(m_dlv->masterListView()); + TQListViewItemIterator it(m_dlv->masterListView()); for (;it.current(); ++it) { AccountsView::AccountItem *item = dynamic_cast<AccountsView::AccountItem*>(it.current()); if (!item || !item->account || !item->account->isElement()) { @@ -239,7 +239,7 @@ void AccountsView::slotUpdate() { item->costMap = m_accounts.plannedCost(*(item->account), start, end); double cost = 0.0; int col=0; - for (QDate d=start; d <= end; d = cal->addDays(d, 1), ++col) { + for (TQDate d=start; d <= end; d = cal->addDays(d, 1), ++col) { EffortCost &ec = item->costMap.effortCostOnDate(d); cost = (m_cumulative ? cost + ec.cost() : ec.cost()); item->setSlaveItem(col, cost); @@ -247,20 +247,20 @@ void AccountsView::slotUpdate() { } } m_dlv->calculate(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } if (m_period == 1) { //Weekly //TODO make this user controlled int weekStartDay = locale->weekStartDay(); - QDate dt = start; - QDate pend = cal->addDays(dt, 7 + weekStartDay - 1 - cal->dayOfWeek(dt)); + TQDate dt = start; + TQDate pend = cal->addDays(dt, 7 + weekStartDay - 1 - cal->dayOfWeek(dt)); for (; pend <= end; ++c) { //kdDebug()<<k_funcinfo<<c<<": "<<dt<<"-"<<pend<<" : "<<end<<endl; int y; int w = cal->weekNumber(dt, &y); - QString t = i18n("<week>-<year>", "%1-%2").arg(w).arg(y); + TQString t = i18n("<week>-<year>", "%1-%2").tqarg(w).tqarg(y); m_dlv->addSlaveColumn(t); dt = pend.addDays(1); pend = cal->addDays(pend, 7); @@ -269,10 +269,10 @@ void AccountsView::slotUpdate() { } } if (c == 0) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } - QListViewItemIterator it(m_dlv->masterListView()); + TQListViewItemIterator it(m_dlv->masterListView()); for (;it.current(); ++it) { AccountsView::AccountItem *item = dynamic_cast<AccountsView::AccountItem*>(it.current()); if (!item || !item->account || !item->account->isElement()) { @@ -280,8 +280,8 @@ void AccountsView::slotUpdate() { } item->costMap = m_accounts.plannedCost(*(item->account), start, end); double cost = 0.0; - QDate d = start; - QDate pend = cal->addDays(d, 7 + weekStartDay - 1 - cal->dayOfWeek(d)); + TQDate d = start; + TQDate pend = cal->addDays(d, 7 + weekStartDay - 1 - cal->dayOfWeek(d)); for (int col=0; pend <= end; ++col) { double cst = item->costMap.cost(d, d.daysTo(pend)+1); cost = (m_cumulative ? cost + cst : cst); @@ -295,17 +295,17 @@ void AccountsView::slotUpdate() { } } m_dlv->calculate(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } if (m_period == 2) { //Monthly //TODO make this user controlled - QDate dt = start; - QDate pend; + TQDate dt = start; + TQDate pend; cal->setYMD(pend, dt.year(), dt.month(), dt.daysInMonth()); for (; pend <= end; ++c) { //kdDebug()<<k_funcinfo<<c<<": "<<dt<<"-"<<pend<<" : "<<end<<endl; - QString m = cal->monthName(dt, true) + QString(" %1").arg( dt.year()); + TQString m = cal->monthName(dt, true) + TQString(" %1").tqarg( dt.year()); m_dlv->addSlaveColumn(m); dt = pend.addDays(1); // 1. next month @@ -315,10 +315,10 @@ void AccountsView::slotUpdate() { } } if (c == 0) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } - QListViewItemIterator it(m_dlv->masterListView()); + TQListViewItemIterator it(m_dlv->masterListView()); for (;it.current(); ++it) { AccountsView::AccountItem *item = dynamic_cast<AccountsView::AccountItem*>(it.current()); if (!item || !item->account || !item->account->isElement()) { @@ -326,7 +326,7 @@ void AccountsView::slotUpdate() { } item->costMap = m_accounts.plannedCost(*(item->account), start, end); double cost = 0.0; - QDate d = start; + TQDate d = start; cal->setYMD(pend, d.year(), d.month(), d.daysInMonth()); for (int col=0; pend <= end; ++col) { double cst = item->costMap.cost(d, d.daysTo(pend)+1); @@ -341,26 +341,26 @@ void AccountsView::slotUpdate() { } } m_dlv->calculate(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void AccountsView::print(KPrinter &printer) { //kdDebug()<<k_funcinfo<<endl; - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + TQPaintDeviceMetrics m = TQPaintDeviceMetrics ( &printer ); uint top, left, bottom, right; printer.margins(&top, &left, &bottom, &right); //kdDebug()<<m.width()<<"x"<<m.height()<<" : "<<top<<", "<<left<<", "<<bottom<<", "<<right<<" : "<<size()<<endl; - QPainter p; + TQPainter p; p.begin(&printer); p.setViewport(left, top, m.width()-left-right, m.height()-top-bottom); p.setClipRect(left, top, m.width()-left-right, m.height()-top-bottom); - QRect preg = p.clipRegion(QPainter::CoordPainter).boundingRect(); + TQRect preg = p.clipRegion(TQPainter::CoordPainter).boundingRect(); //kdDebug()<<"p="<<preg<<endl; //p.drawRect(preg.x(), preg.y(), preg.width()-1, preg.height()-1); - double scale = QMIN((double)preg.width()/(double)size().width(), (double)preg.height()/(double)(size().height())); + double scale = TQMIN((double)preg.width()/(double)size().width(), (double)preg.height()/(double)(size().height())); //kdDebug()<<"scale="<<scale<<endl; if (scale < 1.0) { p.scale(scale, scale); @@ -373,12 +373,12 @@ void AccountsView::print(KPrinter &printer) { bool AccountsView::setContext(Context::Accountsview &context) { //kdDebug()<<k_funcinfo<<"---->"<<endl; - QValueList<int> list; + TQValueList<int> list; list << context.accountsviewsize << context.periodviewsize; //m_dlv->setSizes(list); //NOTE: This doesn't always work! m_date = context.date; if (!m_date.isValid()) - m_date = QDate::currentDate(); + m_date = TQDate::tqcurrentDate(); m_period = context.period; m_cumulative = context.cumulative; setContextClosedItems(context); @@ -387,9 +387,9 @@ bool AccountsView::setContext(Context::Accountsview &context) { } void AccountsView::setContextClosedItems(Context::Accountsview &context) { - for (QStringList::ConstIterator it = context.closedItems.begin(); it != context.closedItems.end(); ++it) { + for (TQStringList::ConstIterator it = context.closedItems.begin(); it != context.closedItems.end(); ++it) { if (m_accounts.findAccount(*it)) { - QListViewItemIterator lit(m_dlv->masterListView()); + TQListViewItemIterator lit(m_dlv->masterListView()); for (; lit.current(); ++lit) { if (lit.current()->text(0) == (*it)) { m_dlv->setOpen(lit.current(), false); @@ -413,10 +413,10 @@ void AccountsView::getContext(Context::Accountsview &context) const { } -void AccountsView::getContextClosedItems(Context::Accountsview &context, QListViewItem *item) const { +void AccountsView::getContextClosedItems(Context::Accountsview &context, TQListViewItem *item) const { if (item == 0) return; - for (QListViewItem *i = item; i; i = i->nextSibling()) { + for (TQListViewItem *i = item; i; i = i->nextSibling()) { if (!i->isOpen()) { context.closedItems.append(i->text(0)); //kdDebug()<<k_funcinfo<<"add closed "<<i->text(0)<<endl; @@ -437,9 +437,9 @@ void AccountsView::slotConfigure() { delete dia; } -QString AccountsView::periodText(int offset) { - QString s; - QStringList::const_iterator it = m_periodTexts.at(offset); +TQString AccountsView::periodText(int offset) { + TQString s; + TQStringList::const_iterator it = m_periodTexts.at(offset); if (it != m_periodTexts.constEnd()) { s = (*it); } diff --git a/kplato/kptaccountsview.h b/kplato/kptaccountsview.h index cc73514a..973d7484 100644 --- a/kplato/kptaccountsview.h +++ b/kplato/kptaccountsview.h @@ -20,7 +20,7 @@ #ifndef KPTACCOUNTSVIEW_H #define KPTACCOUNTSVIEW_H -#include <qdatetime.h> +#include <tqdatetime.h> #include <klistview.h> @@ -29,13 +29,13 @@ #include "kpteffortcostmap.h" #include "kptdoublelistviewbase.h" -class QComboBox; -class QDateEdit; -class QPushButton; -class QSplitter; -class QListViewItem; -class QLabel; -class QPushButton; +class TQComboBox; +class TQDateEdit; +class TQPushButton; +class TQSplitter; +class TQListViewItem; +class TQLabel; +class TQPushButton; class KListView; class KListViewItem; @@ -55,12 +55,13 @@ class ResourceGroup; class Resource; class ResourceItemPrivate; -class AccountsView : public QWidget +class AccountsView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - AccountsView(Project &project, View *view, QWidget *parent); + AccountsView(Project &project, View *view, TQWidget *tqparent); //~AccountsView(); @@ -83,17 +84,17 @@ protected slots: void slotUpdate(); protected: - void getContextClosedItems(Context::Accountsview &context, QListViewItem *item) const; + void getContextClosedItems(Context::Accountsview &context, TQListViewItem *item) const; void setContextClosedItems(Context::Accountsview &context); private: class AccountItem : public DoubleListViewBase::MasterListItem { public: - AccountItem(Account *a, QListView *parent, bool highlight=false); - AccountItem(Account *a, QListViewItem *parent, bool highlight=false); - AccountItem(QString text, Account *a, QListViewItem *parent, bool _highlight=false); + AccountItem(Account *a, TQListView *tqparent, bool highlight=false); + AccountItem(Account *a, TQListViewItem *tqparent, bool highlight=false); + AccountItem(TQString text, Account *a, TQListViewItem *tqparent, bool _highlight=false); - void add(int col, const QDate &date, const EffortCost &ec); + void add(int col, const TQDate &date, const EffortCost &ec); Account *account; EffortCostMap costMap; @@ -101,11 +102,11 @@ private: void init(); void initAccList(const AccountList &list); - void initAccSubItems(Account *acc, AccountItem *parent); - void initAccList(const AccountList &list, AccountItem *parent); + void initAccSubItems(Account *acc, AccountItem *tqparent); + void initAccList(const AccountList &list, AccountItem *tqparent); void createPeriods(); void clearPeriods(); - QString periodText(int offset); + TQString periodText(int offset); private: View *m_mainview; @@ -114,14 +115,14 @@ private: int m_defaultFontSize; - QDate m_date; + TQDate m_date; int m_period; bool m_cumulative; DoubleListViewBase *m_dlv; - QStringList m_periodTexts; - QPushButton *m_changeBtn; + TQStringList m_periodTexts; + TQPushButton *m_changeBtn; Label *m_label; }; diff --git a/kplato/kptaccountsviewconfigdialog.cc b/kplato/kptaccountsviewconfigdialog.cc index bf5e1b65..595061d2 100644 --- a/kplato/kptaccountsviewconfigdialog.cc +++ b/kplato/kptaccountsviewconfigdialog.cc @@ -19,11 +19,11 @@ #include "kptaccountsviewconfigdialog.h" -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qstring.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqstring.h> #include <kdatewidget.h> #include <klocale.h> @@ -33,7 +33,7 @@ namespace KPlato { -AccountsviewConfigDialog::AccountsviewConfigDialog(const QDate &date, int period, const QStringList &periodTexts, bool cumulative, QWidget *p) +AccountsviewConfigDialog::AccountsviewConfigDialog(const TQDate &date, int period, const TQStringList &periodTexts, bool cumulative, TQWidget *p) : KDialogBase(Swallow, i18n("Settings"), Ok|Cancel, Ok, p, "Accountsview Settings Dialog", true, true) { m_panel = new AccountsviewConfigPanel(this); @@ -45,11 +45,11 @@ AccountsviewConfigDialog::AccountsviewConfigDialog(const QDate &date, int period enableButtonOK(false); - connect(m_panel, SIGNAL(changed(bool)), SLOT( enableButtonOK(bool))); + connect(m_panel, TQT_SIGNAL(changed(bool)), TQT_SLOT( enableButtonOK(bool))); } -QDate AccountsviewConfigDialog::date() { +TQDate AccountsviewConfigDialog::date() { return m_panel->dateEdit->date(); } @@ -57,7 +57,7 @@ int AccountsviewConfigDialog::period() { return m_panel->periodBox->currentItem(); } -QString AccountsviewConfigDialog::periodText() { +TQString AccountsviewConfigDialog::periodText() { return m_panel->periodBox->currentText(); } @@ -67,12 +67,12 @@ bool AccountsviewConfigDialog::isCumulative() { //---------------------------- -AccountsviewConfigPanel::AccountsviewConfigPanel(QWidget *parent) - : AccountsviewConfigurePanelBase(parent) { +AccountsviewConfigPanel::AccountsviewConfigPanel(TQWidget *tqparent) + : AccountsviewConfigurePanelBase(tqparent) { - connect(dateEdit, SIGNAL(changed(QDate)), SLOT(slotChanged())); - connect(periodBox, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(cumulative, SIGNAL(clicked()), SLOT(slotChanged())); + connect(dateEdit, TQT_SIGNAL(changed(TQDate)), TQT_SLOT(slotChanged())); + connect(periodBox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(cumulative, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); } void AccountsviewConfigPanel::slotChanged() { diff --git a/kplato/kptaccountsviewconfigdialog.h b/kplato/kptaccountsviewconfigdialog.h index 696dbb87..946481fd 100644 --- a/kplato/kptaccountsviewconfigdialog.h +++ b/kplato/kptaccountsviewconfigdialog.h @@ -24,9 +24,9 @@ #include <kdialogbase.h> #include "kptaccountsviewconfigurepanelbase.h" -class QDate; -class QString; -class QWidget; +class TQDate; +class TQString; +class TQWidget; namespace KPlato { @@ -35,12 +35,13 @@ class AccountsviewConfigPanel; class AccountsviewConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AccountsviewConfigDialog(const QDate &date, int period, const QStringList &periodTexts, bool cumulative, QWidget *parent); + AccountsviewConfigDialog(const TQDate &date, int period, const TQStringList &periodTexts, bool cumulative, TQWidget *tqparent); - QDate date(); + TQDate date(); int period(); - QString periodText(); + TQString periodText(); bool isCumulative(); private: @@ -49,8 +50,9 @@ private: class AccountsviewConfigPanel : public AccountsviewConfigurePanelBase { Q_OBJECT + TQ_OBJECT public: - AccountsviewConfigPanel(QWidget *parent); + AccountsviewConfigPanel(TQWidget *tqparent); public slots: void slotChanged(); diff --git a/kplato/kptaccountsviewconfigurepanelbase.ui b/kplato/kptaccountsviewconfigurepanelbase.ui index 568adfd7..97c097b3 100644 --- a/kplato/kptaccountsviewconfigurepanelbase.ui +++ b/kplato/kptaccountsviewconfigurepanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::AccountsviewConfigurePanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AccountsviewConfigurePanelBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -31,7 +31,7 @@ <string>Cut-off date:</string> </property> </widget> - <widget class="QComboBox" row="1" column="1"> + <widget class="TQComboBox" row="1" column="1"> <property name="name"> <cstring>periodBox</cstring> </property> @@ -41,7 +41,7 @@ <cstring>dateEdit</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -49,7 +49,7 @@ <string>Periodicity:</string> </property> </widget> - <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>cumulative</cstring> </property> @@ -61,7 +61,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatewidget.h</includehint> </includehints> diff --git a/kplato/kptappointment.cc b/kplato/kptappointment.cc index 897ab390..f09b4bcc 100644 --- a/kplato/kptappointment.cc +++ b/kplato/kptappointment.cc @@ -77,10 +77,10 @@ Duration AppointmentInterval::effort(const DateTime &time, bool upto) const { return (m_end - s) * m_load / 100; } -bool AppointmentInterval::loadXML(QDomElement &element) { +bool AppointmentInterval::loadXML(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; bool ok; - QString s = element.attribute("start"); + TQString s = element.attribute("start"); if (s != "") m_start = DateTime::fromString(s); s = element.attribute("end"); @@ -91,8 +91,8 @@ bool AppointmentInterval::loadXML(QDomElement &element) { return m_start.isValid() && m_end.isValid(); } -void AppointmentInterval::saveXML(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("interval"); +void AppointmentInterval::saveXML(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("interval"); element.appendChild(me); me.setAttribute("start", m_start.toString(Qt::ISODate)); @@ -155,12 +155,12 @@ AppointmentInterval AppointmentInterval::firstInterval(const AppointmentInterval ////// -Appointment::UsedEffortItem::UsedEffortItem(QDate date, Duration effort, bool overtime) { +Appointment::UsedEffortItem::UsedEffortItem(TQDate date, Duration effort, bool overtime) { m_date = date; m_effort = effort; m_overtime = overtime; } -QDate Appointment::UsedEffortItem::date() { +TQDate Appointment::UsedEffortItem::date() { return m_date; } Duration Appointment::UsedEffortItem::effort() { @@ -174,14 +174,14 @@ Appointment::UsedEffort::UsedEffort() { setAutoDelete(true); } -void Appointment::UsedEffort::inSort(QDate date, Duration effort, bool overtime) { +void Appointment::UsedEffort::inSort(TQDate date, Duration effort, bool overtime) { UsedEffortItem *item = new UsedEffortItem(date, effort, overtime); - QPtrList<UsedEffortItem>::inSort(item); + TQPtrList<UsedEffortItem>::inSort(item); } Duration Appointment::UsedEffort::usedEffort(bool includeOvertime) const { Duration eff; - QPtrListIterator<UsedEffortItem> it(*this); + TQPtrListIterator<UsedEffortItem> it(*this); for (; it.current(); ++it) { if (includeOvertime || !it.current()->isOvertime()) { eff += it.current()->effort(); @@ -190,9 +190,9 @@ Duration Appointment::UsedEffort::usedEffort(bool includeOvertime) const { return eff; } -Duration Appointment::UsedEffort::usedEffort(const QDate &date, bool includeOvertime) const { +Duration Appointment::UsedEffort::usedEffort(const TQDate &date, bool includeOvertime) const { Duration eff; - QPtrListIterator<UsedEffortItem> it(*this); + TQPtrListIterator<UsedEffortItem> it(*this); for (; it.current(); ++it) { if ((includeOvertime || !it.current()->isOvertime()) && it.current()->date() == date) { @@ -202,9 +202,9 @@ Duration Appointment::UsedEffort::usedEffort(const QDate &date, bool includeOver return eff; } -Duration Appointment::UsedEffort::usedEffortTo(const QDate &date, bool includeOvertime) const { +Duration Appointment::UsedEffort::usedEffortTo(const TQDate &date, bool includeOvertime) const { Duration eff; - QPtrListIterator<UsedEffortItem> it(*this); + TQPtrListIterator<UsedEffortItem> it(*this); for (; it.current(); ++it) { if ((includeOvertime || !it.current()->isOvertime()) && it.current()->date() <= date) { @@ -219,9 +219,9 @@ Duration Appointment::UsedEffort::usedOvertime() const { return item==0 ? Duration::zeroDuration : usedOvertime(item->date()); } -Duration Appointment::UsedEffort::usedOvertime(const QDate &date) const { +Duration Appointment::UsedEffort::usedOvertime(const TQDate &date) const { Duration eff; - QPtrListIterator<UsedEffortItem> it(*this); + TQPtrListIterator<UsedEffortItem> it(*this); for (; it.current(); ++it) { if (it.current()->isOvertime() && it.current()->date() == date) { eff += it.current()->effort(); @@ -230,9 +230,9 @@ Duration Appointment::UsedEffort::usedOvertime(const QDate &date) const { return eff; } -Duration Appointment::UsedEffort::usedOvertimeTo(const QDate &date) const { +Duration Appointment::UsedEffort::usedOvertimeTo(const TQDate &date) const { Duration eff; - QPtrListIterator<UsedEffortItem> it(*this); + TQPtrListIterator<UsedEffortItem> it(*this); for (; it.current(); ++it) { if (it.current()->isOvertime() && it.current()->date() <= date) { eff += it.current()->effort(); @@ -241,17 +241,17 @@ Duration Appointment::UsedEffort::usedOvertimeTo(const QDate &date) const { return eff; } -bool Appointment::UsedEffort::load(QDomElement &element) { - QString s; - QDomNodeList list = element.childNodes(); +bool Appointment::UsedEffort::load(TQDomElement &element) { + TQString s; + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "actual-effort") { - QDate date; + TQDate date; s = e.attribute("date"); if (s != "") - date = QDate::fromString(s, Qt::ISODate); + date = TQDate::fromString(s, Qt::ISODate); Duration eff = Duration::fromString(e.attribute("effort")); bool ot = e.attribute("overtime", "0").toInt(); if (date.isValid()) { @@ -265,11 +265,11 @@ bool Appointment::UsedEffort::load(QDomElement &element) { return true; } -void Appointment::UsedEffort::save(QDomElement &element) const { +void Appointment::UsedEffort::save(TQDomElement &element) const { if (isEmpty()) return; - QPtrListIterator<UsedEffortItem> it = *this; + TQPtrListIterator<UsedEffortItem> it = *this; for (; it.current(); ++it) { - QDomElement me = element.ownerDocument().createElement("actual-effort"); + TQDomElement me = element.ownerDocument().createElement("actual-effort"); element.appendChild(me); me.setAttribute("date",it.current()->date().toString(Qt::ISODate)); me.setAttribute("effort",it.current()->effort().toString()); @@ -277,9 +277,9 @@ void Appointment::UsedEffort::save(QDomElement &element) const { } } -int Appointment::UsedEffort::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) { - QDate d1 = static_cast<UsedEffortItem*>(item1)->date(); - QDate d2 = static_cast<UsedEffortItem*>(item2)->date(); +int Appointment::UsedEffort::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { + TQDate d1 = static_cast<UsedEffortItem*>(item1)->date(); + TQDate d2 = static_cast<UsedEffortItem*>(item2)->date(); if (d1 > d2) return 1; if (d1 < d2) return -1; return 0; @@ -344,7 +344,7 @@ void Appointment::addInterval(const DateTime &start, const Duration &duration, d double Appointment::maxLoad() const { double v = 0.0; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { if (v < it.current()->load()) v = it.current()->load(); @@ -354,7 +354,7 @@ double Appointment::maxLoad() const { DateTime Appointment::startTime() const { DateTime t; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { if (!t.isValid() || t > it.current()->startTime()) t = it.current()->startTime(); @@ -364,7 +364,7 @@ DateTime Appointment::startTime() const { DateTime Appointment::endTime() const { DateTime t; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { if (!t.isValid() || t < it.current()->endTime()) t = it.current()->endTime(); @@ -382,9 +382,9 @@ bool Appointment::isBusy(const DateTime &/*start*/, const DateTime &/*end*/) { return false; } -bool Appointment::loadXML(QDomElement &element, Project &project, Schedule &sch) { +bool Appointment::loadXML(TQDomElement &element, Project &project, Schedule &sch) { //kdDebug()<<k_funcinfo<<endl; - QDictIterator<Node> it = project.nodeDict(); + TQDictIterator<Node> it = project.nodeDict(); /* for (; it.current(); ++it) { kdDebug()<<" Node="<<it.current()->name()<<" id="<<it.currentKey()<<endl; }*/ @@ -408,10 +408,10 @@ bool Appointment::loadXML(QDomElement &element, Project &project, Schedule &sch) return false; } //kdDebug()<<k_funcinfo<<"res="<<m_resource<<" node="<<m_node<<endl; - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "interval") { AppointmentInterval *a = new AppointmentInterval(); if (a->loadXML(e)) { @@ -430,7 +430,7 @@ bool Appointment::loadXML(QDomElement &element, Project &project, Schedule &sch) return true; } -void Appointment::saveXML(QDomElement &element) const { +void Appointment::saveXML(TQDomElement &element) const { if (m_intervals.isEmpty()) { kdError()<<k_funcinfo<<"Incomplete appointment data: No intervals"<<endl; } @@ -443,12 +443,12 @@ void Appointment::saveXML(QDomElement &element) const { return; // shouldn't happen } //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("appointment"); + TQDomElement me = element.ownerDocument().createElement("appointment"); element.appendChild(me); me.setAttribute("resource-id", m_resource->resource()->id()); me.setAttribute("task-id", m_node->node()->id()); - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { it.current()->saveXML(me); } @@ -458,7 +458,7 @@ void Appointment::saveXML(QDomElement &element) const { // Returns the total actual effort for this appointment Duration Appointment::plannedEffort() const { Duration d; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(); } @@ -466,11 +466,11 @@ Duration Appointment::plannedEffort() const { } // Returns the planned effort on the date -Duration Appointment::plannedEffort(const QDate &date) const { +Duration Appointment::plannedEffort(const TQDate &date) const { Duration d; DateTime s(date); DateTime e(date.addDays(1)); - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(s, e); } @@ -478,10 +478,10 @@ Duration Appointment::plannedEffort(const QDate &date) const { } // Returns the planned effort upto and including the date -Duration Appointment::plannedEffortTo(const QDate& date) const { +Duration Appointment::plannedEffortTo(const TQDate& date) const { Duration d; DateTime e(date.addDays(1)); - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(e, true); } @@ -490,7 +490,7 @@ Duration Appointment::plannedEffortTo(const QDate& date) const { // Returns a list of efforts pr day for interval start, end inclusive // The list only includes days with any planned effort -EffortCostMap Appointment::plannedPrDay(const QDate& start, const QDate& end) const { +EffortCostMap Appointment::plannedPrDay(const TQDate& start, const TQDate& end) const { //kdDebug()<<k_funcinfo<<m_node->id()<<", "<<m_resource->id()<<endl; EffortCostMap ec; Duration eff; @@ -506,14 +506,14 @@ EffortCostMap Appointment::plannedPrDay(const QDate& start, const QDate& end) co if (dt.date() < st.date()) { dt.setDate(st.date()); } - ndt = dt.addDays(1); + ndt = TQDateTime(dt.addDays(1)); while (dt.date() <= e.date()) { eff = it.current()->effort(dt, ndt); ec.add(dt.date(), eff, eff.toDouble(Duration::Unit_h) * rate); if (dt.date() < e.date() ) { // loop trough the interval (it spans dates) dt = ndt; - ndt = ndt.addDays(1); + ndt = TQDateTime(ndt.addDays(1)); } else { break; } @@ -529,12 +529,12 @@ Duration Appointment::actualEffort() const { } // Returns the actual effort on the date -Duration Appointment::actualEffort(const QDate &date) const { +Duration Appointment::actualEffort(const TQDate &date) const { return m_actualEffort.usedEffort(date); } // Returns the actual effort upto and including date -Duration Appointment::actualEffortTo(const QDate &date) const { +Duration Appointment::actualEffortTo(const TQDate &date) const { return m_actualEffort.usedEffortTo(date); } @@ -546,7 +546,7 @@ double Appointment::plannedCost() { } //Calculates the planned cost on date -double Appointment::plannedCost(const QDate &date) { +double Appointment::plannedCost(const TQDate &date) { if (m_resource && m_resource->resource()) { return plannedEffort(date).toDouble(Duration::Unit_h) * m_resource->resource()->normalRate(); //FIXME overtime } @@ -554,7 +554,7 @@ double Appointment::plannedCost(const QDate &date) { } //Calculates the planned cost upto and including date -double Appointment::plannedCostTo(const QDate &date) { +double Appointment::plannedCostTo(const TQDate &date) { if (m_resource && m_resource->resource()) { return plannedEffortTo(date).toDouble(Duration::Unit_h) * m_resource->resource()->normalRate(); //FIXME overtime } @@ -571,7 +571,7 @@ double Appointment::actualCost() { } // Calculates the actual cost on date -double Appointment::actualCost(const QDate &date) { +double Appointment::actualCost(const TQDate &date) { if (m_resource && m_resource->resource()) { return (m_actualEffort.usedEffort(date, false /*ex. overtime*/).toDouble(Duration::Unit_h)*m_resource->resource()->normalRate()) + (m_actualEffort.usedOvertime(date).toDouble(Duration::Unit_h)*m_resource->resource()->overtimeRate()); } @@ -579,14 +579,14 @@ double Appointment::actualCost(const QDate &date) { } // Calculates the actual cost upto and including date -double Appointment::actualCostTo(const QDate &date) { +double Appointment::actualCostTo(const TQDate &date) { if (m_resource && m_resource->resource()) { return (m_actualEffort.usedEffortTo(date, false /*ex. overtime*/).toDouble(Duration::Unit_h)*m_resource->resource()->normalRate()) + (m_actualEffort.usedOvertimeTo(date).toDouble(Duration::Unit_h)*m_resource->resource()->overtimeRate()); } return 0.0; } -void Appointment::addActualEffort(QDate date, Duration effort, bool overtime) { +void Appointment::addActualEffort(TQDate date, Duration effort, bool overtime) { m_actualEffort.inSort(date, effort, overtime); } @@ -615,7 +615,7 @@ void Appointment::detach() { // Returns the effort from start to end Duration Appointment::effort(const DateTime &start, const DateTime &end) const { Duration d; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(start, end); } @@ -624,7 +624,7 @@ Duration Appointment::effort(const DateTime &start, const DateTime &end) const { // Returns the effort from start for the duration Duration Appointment::effort(const DateTime &start, const Duration &duration) const { Duration d; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(start, start+duration); } @@ -633,7 +633,7 @@ Duration Appointment::effort(const DateTime &start, const Duration &duration) co // Returns the effort upto time / from time Duration Appointment::effortFrom(const DateTime &time) const { Duration d; - QPtrListIterator<AppointmentInterval> it = m_intervals; + TQPtrListIterator<AppointmentInterval> it = m_intervals; for (; it.current(); ++it) { d += it.current()->effort(time, false); } @@ -647,7 +647,7 @@ Appointment &Appointment::operator=(const Appointment &app) { m_repeatCount = app.repeatCount(); m_intervals.clear(); - QPtrListIterator<AppointmentInterval> it = app.intervals(); + TQPtrListIterator<AppointmentInterval> it = app.intervals(); for (; it.current(); ++it) { addInterval(new AppointmentInterval(*(it.current()))); } @@ -703,7 +703,7 @@ Appointment Appointment::operator+(const Appointment &app) { } #ifndef NDEBUG -void Appointment::printDebug(QString indent) +void Appointment::printDebug(TQString indent) { bool err = false; if (m_node == 0) { @@ -724,7 +724,7 @@ void Appointment::printDebug(QString indent) return; kdDebug()<<indent<<" + Appointment to schedule: "<<m_node->name()<<" ("<<m_node->type()<<")"<<" resource: "<<m_resource->resource()->name()<<endl; indent += " ! "; - QPtrListIterator<AppointmentInterval> it = intervals(); + TQPtrListIterator<AppointmentInterval> it = intervals(); for (; it.current(); ++it) { kdDebug()<<indent<<it.current()->startTime().toString()<<" - "<<it.current()->endTime().toString()<<" load="<<it.current()->load()<<endl; } diff --git a/kplato/kptappointment.h b/kplato/kptappointment.h index 820905a1..547ee537 100644 --- a/kplato/kptappointment.h +++ b/kplato/kptappointment.h @@ -23,14 +23,14 @@ #include "kptduration.h" #include "kptdatetime.h" -#include <qdom.h> -#include <qintdict.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqintdict.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kdebug.h> -class QTime; +class TQTime; namespace KPlato { @@ -65,8 +65,8 @@ public: Duration effort(const DateTime &start, const DateTime end) const; Duration effort(const DateTime &time, bool upto) const; - bool loadXML(QDomElement &element); - void saveXML(QDomElement &element) const; + bool loadXML(TQDomElement &element); + void saveXML(TQDomElement &element) const; const DateTime &startTime() const { return m_start; } void setStartTime(const DateTime &time) { m_start = time; } @@ -90,9 +90,9 @@ private: * The intervals do not overlap, an interval does not start before the * previous interval ends. */ -class AppointmentIntervalList : public QPtrList<AppointmentInterval> { +class AppointmentIntervalList : public TQPtrList<AppointmentInterval> { protected: - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) { + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { AppointmentInterval *i1 = static_cast<AppointmentInterval*>(item1); AppointmentInterval *i2 = static_cast<AppointmentInterval*>(item2); if (i1->startTime() < i2->startTime()) { @@ -110,7 +110,7 @@ protected: return 0; } }; -typedef QPtrListIterator<AppointmentInterval> AppointmentIntervalListIterator; +typedef TQPtrListIterator<AppointmentInterval> AppointmentIntervalListIterator; /** * A resource (@ref Resource) can be scheduled to be used at any time, @@ -165,14 +165,14 @@ public: const AppointmentIntervalList &intervals() const { return m_intervals; } - bool loadXML(QDomElement &element, Project &project, Schedule &sch); - void saveXML(QDomElement &element) const; + bool loadXML(TQDomElement &element, Project &project, Schedule &sch); + void saveXML(TQDomElement &element) const; /** * Returns the planned effort and cost for the interval start to end (inclusive). * Only dates with any planned effort is returned. */ - EffortCostMap plannedPrDay(const QDate& start, const QDate& end) const; + EffortCostMap plannedPrDay(const TQDate& start, const TQDate& end) const; /// Returns the planned effort from start to end Duration effort(const DateTime &start, const DateTime &end) const; @@ -184,36 +184,36 @@ public: /// Returns the total planned effort for this appointment Duration plannedEffort() const; /// Returns the planned effort on the date - Duration plannedEffort(const QDate &date) const; + Duration plannedEffort(const TQDate &date) const; /// Returns the planned effort upto and including date - Duration plannedEffortTo(const QDate &date) const; + Duration plannedEffortTo(const TQDate &date) const; /// Returns the total actual effort for this appointment Duration actualEffort() const; /// Returns the actual effort on the date - Duration actualEffort(const QDate &date) const; + Duration actualEffort(const TQDate &date) const; /// Returns the actual effort on the date - Duration actualEffortTo(const QDate &date) const; + Duration actualEffortTo(const TQDate &date) const; /// Calculates the total planned cost for this appointment double plannedCost(); /// Calculates the planned cost on date - double plannedCost(const QDate &date); + double plannedCost(const TQDate &date); /// Calculates the planned cost upto and including date - double plannedCostTo(const QDate &date); + double plannedCostTo(const TQDate &date); /// Calculates the total actual cost for this appointment double actualCost(); /// Calculates the actual cost on date - double actualCost(const QDate &date); + double actualCost(const TQDate &date); /// Calculates the actual cost upto and including date - double actualCostTo(const QDate &date); + double actualCostTo(const TQDate &date); Appointment &operator=(const Appointment &app); Appointment &operator+=(const Appointment &app); Appointment operator+(const Appointment &app); - void addActualEffort(QDate date, Duration effort, bool overtime=false); + void addActualEffort(TQDate date, Duration effort, bool overtime=false); private: Schedule *m_node; @@ -221,45 +221,45 @@ private: Duration m_repeatInterval; int m_repeatCount; - QPtrList<Duration> m_extraRepeats; - QPtrList<Duration> m_skipRepeats; + TQPtrList<Duration> m_extraRepeats; + TQPtrList<Duration> m_skipRepeats; AppointmentIntervalList m_intervals; class UsedEffortItem { public: - UsedEffortItem(QDate date, Duration effort, bool overtime=false); - QDate date(); + UsedEffortItem(TQDate date, Duration effort, bool overtime=false); + TQDate date(); Duration effort(); bool isOvertime(); private: - QDate m_date; + TQDate m_date; Duration m_effort; bool m_overtime; }; - class UsedEffort : QPtrList<UsedEffortItem> { + class UsedEffort : TQPtrList<UsedEffortItem> { public: UsedEffort(); ~UsedEffort() {} - void inSort(QDate date, Duration effort, bool overtime=false); + void inSort(TQDate date, Duration effort, bool overtime=false); Duration usedEffort(bool includeOvertime=true) const; - Duration usedEffort(const QDate &date, bool includeOvertime=true) const; - Duration usedEffortTo(const QDate &date, bool includeOvertime=true) const; + Duration usedEffort(const TQDate &date, bool includeOvertime=true) const; + Duration usedEffortTo(const TQDate &date, bool includeOvertime=true) const; Duration usedOvertime() const; - Duration usedOvertime(const QDate &date) const; - Duration usedOvertimeTo(const QDate &date) const; - bool load(QDomElement &element); - void save(QDomElement &element) const; + Duration usedOvertime(const TQDate &date) const; + Duration usedOvertimeTo(const TQDate &date) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; protected: - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); }; UsedEffort m_actualEffort; #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; diff --git a/kplato/kptcalendar.cc b/kplato/kptcalendar.cc index 38c2a286..9412f30e 100644 --- a/kplato/kptcalendar.cc +++ b/kplato/kptcalendar.cc @@ -22,8 +22,8 @@ #include "kptdatetime.h" #include "kptproject.h" -#include <qdom.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqptrlist.h> #include <klocale.h> #include <kdebug.h> @@ -50,7 +50,7 @@ CalendarDay::CalendarDay(int state) m_workingIntervals.setAutoDelete(true); } -CalendarDay::CalendarDay(QDate date, int state) +CalendarDay::CalendarDay(TQDate date, int state) : m_date(date), m_state(state), m_workingIntervals() { @@ -76,39 +76,39 @@ const CalendarDay &CalendarDay::copy(const CalendarDay &day) { m_date = day.date(); m_state = day.state(); m_workingIntervals.clear(); - QPtrListIterator<QPair<QTime, QTime> > it = day.workingIntervals(); + TQPtrListIterator<TQPair<TQTime, TQTime> > it = day.workingIntervals(); for(; it.current(); ++it) { - m_workingIntervals.append(new QPair<QTime, QTime>(it.current()->first, it.current()->second)); + m_workingIntervals.append(new TQPair<TQTime, TQTime>(it.current()->first, it.current()->second)); } return *this; } -bool CalendarDay::load(QDomElement &element) { +bool CalendarDay::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; bool ok=false; - m_state = QString(element.attribute("state", "-1")).toInt(&ok); + m_state = TQString(element.attribute("state", "-1")).toInt(&ok); if (m_state < 0) return false; //kdDebug()<<k_funcinfo<<" state="<<m_state<<endl; - QString s = element.attribute("date"); + TQString s = element.attribute("date"); if (s != "") { - m_date = QDate::fromString(s, Qt::ISODate); + m_date = TQDate::fromString(s, Qt::ISODate); if (!m_date.isValid()) - m_date = QDate::fromString(s); + m_date = TQDate::fromString(s); } clearIntervals(); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "interval") { //kdDebug()<<k_funcinfo<<"Interval start="<<e.attribute("start")<<" end="<<e.attribute("end")<<endl; - QString st = e.attribute("start"); - QString en = e.attribute("end"); + TQString st = e.attribute("start"); + TQString en = e.attribute("end"); if (st != "" && en != "") { - QTime start = QTime::fromString(st); - QTime end = QTime::fromString(en); - addInterval(new QPair<QTime, QTime>(start,end)); + TQTime start = TQTime::fromString(st); + TQTime end = TQTime::fromString(en); + addInterval(new TQPair<TQTime, TQTime>(start,end)); } } } @@ -116,7 +116,7 @@ bool CalendarDay::load(QDomElement &element) { return true; } -void CalendarDay::save(QDomElement &element) const { +void CalendarDay::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<m_date.toString()<<endl; if (m_state == Map::None) return; @@ -127,23 +127,23 @@ void CalendarDay::save(QDomElement &element) const { if (m_workingIntervals.count() == 0) return; - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { - QDomElement me = element.ownerDocument().createElement("interval"); + TQDomElement me = element.ownerDocument().createElement("interval"); element.appendChild(me); me.setAttribute("end", it.current()->second.toString()); me.setAttribute("start", it.current()->first.toString()); } } -void CalendarDay::addInterval(QPair<QTime, QTime> *interval) { +void CalendarDay::addInterval(TQPair<TQTime, TQTime> *interval) { m_workingIntervals.append(interval); } -QTime CalendarDay::startOfDay() const { - QTime t; +TQTime CalendarDay::startOfDay() const { + TQTime t; if (!m_workingIntervals.isEmpty()) { - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; t = it.current()->first; for (++it; it.current(); ++it) { if (t > it.current()->first) @@ -153,10 +153,10 @@ QTime CalendarDay::startOfDay() const { return t; } -QTime CalendarDay::endOfDay() const { - QTime t; +TQTime CalendarDay::endOfDay() const { + TQTime t; if (!m_workingIntervals.isEmpty()) { - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; t = it.current()->second; for (++it; it.current(); ++it) { if (t > it.current()->second) @@ -188,13 +188,13 @@ bool CalendarDay::operator==(const CalendarDay &day) const { //kdDebug()<<k_funcinfo<<m_workingIntervals.count()<<" != "<<day.workingIntervals().count()<<endl; return false; } - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; - QPtrListIterator<QPair<QTime, QTime> > dit = day.workingIntervals(); + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > dit = day.workingIntervals(); for (; it.current(); ++it) { bool res = false; - QPair<QTime, QTime> *a = it.current(); + TQPair<TQTime, TQTime> *a = it.current(); for (dit.toFirst(); dit.current(); ++dit) { - QPair<QTime, QTime> *b = dit.current(); + TQPair<TQTime, TQTime> *b = dit.current(); if (a->first == b->first && a->second == b->second) { res = true; break; @@ -214,22 +214,22 @@ bool CalendarDay::operator!=(const CalendarDay &day) const { return !operator==(day); } -Duration CalendarDay::effort(const QTime &start, const QTime &end) { +Duration CalendarDay::effort(const TQTime &start, const TQTime &end) { //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; Duration eff; if (m_state != Map::Working) { //kdDebug()<<k_funcinfo<<"Non working day"<<endl; return eff; } - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { //kdDebug()<<k_funcinfo<<"Interval: "<<it.current()->first.toString()<<" - "<<it.current()->second.toString()<<endl; if (end > it.current()->first && start < it.current()->second) { - DateTime dtStart(QDate::currentDate(), start); + DateTime dtStart(TQDate::tqcurrentDate(), start); if (start < it.current()->first) { dtStart.setTime(it.current()->first); } - DateTime dtEnd(QDate::currentDate(), end); + DateTime dtEnd(TQDate::tqcurrentDate(), end); if (end > it.current()->second) { dtEnd.setTime(it.current()->second); } @@ -241,34 +241,34 @@ Duration CalendarDay::effort(const QTime &start, const QTime &end) { return eff; } -QPair<QTime, QTime> CalendarDay::interval(const QTime &start, const QTime &end) const { +TQPair<TQTime, TQTime> CalendarDay::interval(const TQTime &start, const TQTime &end) const { //kdDebug()<<k_funcinfo<<endl; - QTime t1, t2; + TQTime t1, t2; if (m_state == Map::Working) { - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { if (start < it.current()->second && end > it.current()->first) { t1 = start > it.current()->first ? start : it.current()->first; t2 = end < it.current()->second ? end : it.current()->second; //kdDebug()<<k_funcinfo<<t1.toString()<<" to "<<t2.toString()<<endl; - return QPair<QTime, QTime>(t1, t2); + return TQPair<TQTime, TQTime>(t1, t2); } } } //kdError()<<k_funcinfo<<"No interval "<<m_date<<": "<<start<<","<<end<<endl; - return QPair<QTime, QTime>(t1, t2); + return TQPair<TQTime, TQTime>(t1, t2); } bool CalendarDay::hasInterval() const { return m_state == Map::Working && m_workingIntervals.count() > 0; } -bool CalendarDay::hasInterval(const QTime &start, const QTime &end) const { +bool CalendarDay::hasInterval(const TQTime &start, const TQTime &end) const { //kdDebug()<<k_funcinfo<<(m_date.isValid()?m_date.toString(Qt::ISODate):"Weekday")<<" "<<start.toString()<<" - "<<end.toString()<<endl; if (m_state != Map::Working) { return false; } - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { if (start < it.current()->second && end > it.current()->first) { //kdDebug()<<k_funcinfo<<"true:"<<(m_date.isValid()?m_date.toString(Qt::ISODate):"Weekday")<<" "<<it.current()->first.toString()<<" - "<<it.current()->second.toString()<<endl; @@ -280,10 +280,10 @@ bool CalendarDay::hasInterval(const QTime &start, const QTime &end) const { Duration CalendarDay::duration() const { Duration dur; - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { - DateTime start(QDate::currentDate(), it.current()->first); - DateTime end(QDate::currentDate(), it.current()->second); + DateTime start(TQDate::tqcurrentDate(), it.current()->first); + DateTime end(TQDate::tqcurrentDate(), it.current()->second); dur += end - start; } return dur; @@ -319,17 +319,17 @@ const CalendarWeekdays &CalendarWeekdays::copy(const CalendarWeekdays &weekdays) m_weekdays.setAutoDelete(true); m_weekdays.clear(); m_weekdays.setAutoDelete(false); - QPtrListIterator<CalendarDay> it = weekdays.weekdays(); + TQPtrListIterator<CalendarDay> it = weekdays.weekdays(); for (; it.current(); ++it) { m_weekdays.append(new CalendarDay(it.current())); } return *this; } -bool CalendarWeekdays::load(QDomElement &element) { +bool CalendarWeekdays::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; bool ok; - int dayNo = QString(element.attribute("day","-1")).toInt(&ok); + int dayNo = TQString(element.attribute("day","-1")).toInt(&ok); if (dayNo < 0 || dayNo > 6) { kdError()<<k_funcinfo<<"Illegal weekday: "<<dayNo<<endl; return true; // we continue anyway @@ -342,11 +342,11 @@ bool CalendarWeekdays::load(QDomElement &element) { return true; } -void CalendarWeekdays::save(QDomElement &element) const { +void CalendarWeekdays::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<CalendarDay> it = m_weekdays; + TQPtrListIterator<CalendarDay> it = m_weekdays; for (int i=0; it.current(); ++it) { - QDomElement me = element.ownerDocument().createElement("weekday"); + TQDomElement me = element.ownerDocument().createElement("weekday"); element.appendChild(me); me.setAttribute("day", i++); it.current()->save(me); @@ -362,7 +362,7 @@ IntMap CalendarWeekdays::map() { return days; } -int CalendarWeekdays::state(const QDate &date) const { +int CalendarWeekdays::state(const TQDate &date) const { return state(date.dayOfWeek()-1); } @@ -378,13 +378,13 @@ void CalendarWeekdays::setState(int weekday, int state) { day->setState(state); } -const QPtrList<QPair<QTime, QTime> > &CalendarWeekdays::intervals(int weekday) const { +const TQPtrList<TQPair<TQTime, TQTime> > &CalendarWeekdays::intervals(int weekday) const { CalendarDay *day = const_cast<CalendarWeekdays*>(this)->m_weekdays.at(weekday); Q_ASSERT(day); return day->workingIntervals(); } -void CalendarWeekdays::setIntervals(int weekday, QPtrList<QPair<QTime, QTime> >intervals) { +void CalendarWeekdays::setIntervals(int weekday, TQPtrList<TQPair<TQTime, TQTime> >intervals) { CalendarDay *day = m_weekdays.at(weekday); if (day) day->setIntervals(intervals); @@ -402,7 +402,7 @@ bool CalendarWeekdays::operator==(const CalendarWeekdays *wd) const { for (unsigned int i=0; i < m_weekdays.count(); ++i) { // is there a better way to get around this const stuff? CalendarDay *day1 = const_cast<CalendarWeekdays*>(this)->m_weekdays.at(i); - CalendarDay *day2 = const_cast<QPtrList<CalendarDay>&>(wd->weekdays()).at(i); + CalendarDay *day2 = const_cast<TQPtrList<CalendarDay>&>(wd->weekdays()).at(i); if (day1 != day2) return false; } @@ -414,14 +414,14 @@ bool CalendarWeekdays::operator!=(const CalendarWeekdays *wd) const { for (unsigned int i=0; i < m_weekdays.count(); ++i) { // is there a better way to get around this const stuff? CalendarDay *day1 = const_cast<CalendarWeekdays*>(this)->m_weekdays.at(i); - CalendarDay *day2 = const_cast<QPtrList<CalendarDay>&>(wd->weekdays()).at(i); + CalendarDay *day2 = const_cast<TQPtrList<CalendarDay>&>(wd->weekdays()).at(i); if (day1 != day2) return true; } return false; } -Duration CalendarWeekdays::effort(const QDate &date, const QTime &start, const QTime &end) { +Duration CalendarWeekdays::effort(const TQDate &date, const TQTime &start, const TQTime &end) { //kdDebug()<<k_funcinfo<<"Day of week="<<date.dayOfWeek()-1<<endl; CalendarDay *day = weekday(date.dayOfWeek()-1); if (day && day->state() == Map::Working) { @@ -430,7 +430,7 @@ Duration CalendarWeekdays::effort(const QDate &date, const QTime &start, const Q return Duration::zeroDuration; } -QPair<QTime, QTime> CalendarWeekdays::interval(const QDate date, const QTime &start, const QTime &end) const { +TQPair<TQTime, TQTime> CalendarWeekdays::interval(const TQDate date, const TQTime &start, const TQTime &end) const { //kdDebug()<<k_funcinfo<<endl; CalendarDay *day = weekday(date.dayOfWeek()-1); if (day && day->state() == Map::Working) { @@ -438,10 +438,10 @@ QPair<QTime, QTime> CalendarWeekdays::interval(const QDate date, const QTime &st return day->interval(start, end); } } - return QPair<QTime, QTime>(QTime(), QTime()); + return TQPair<TQTime, TQTime>(TQTime(), TQTime()); } -bool CalendarWeekdays::hasInterval(const QDate date, const QTime &start, const QTime &end) const { +bool CalendarWeekdays::hasInterval(const TQDate date, const TQTime &start, const TQTime &end) const { //kdDebug()<<k_funcinfo<<date.toString()<<": "<<start.toString()<<" - "<<end.toString()<<endl; CalendarDay *day = weekday(date.dayOfWeek()-1); return day && day->hasInterval(start, end); @@ -449,7 +449,7 @@ bool CalendarWeekdays::hasInterval(const QDate date, const QTime &start, const Q bool CalendarWeekdays::hasInterval() const { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<CalendarDay> it = m_weekdays; + TQPtrListIterator<CalendarDay> it = m_weekdays; for (; it.current(); ++it) { if (it.current()->hasInterval()) return true; @@ -458,7 +458,7 @@ bool CalendarWeekdays::hasInterval() const { } CalendarDay *CalendarWeekdays::weekday(int day) const { - QPtrListIterator<CalendarDay> it = m_weekdays; + TQPtrListIterator<CalendarDay> it = m_weekdays; for (int i=0; it.current(); ++it, ++i) { if (i == day) return it.current(); @@ -468,7 +468,7 @@ CalendarDay *CalendarWeekdays::weekday(int day) const { Duration CalendarWeekdays::duration() const { Duration dur; - QPtrListIterator<CalendarDay> it = m_weekdays; + TQPtrListIterator<CalendarDay> it = m_weekdays; for (; it.current(); ++it) { dur += it.current()->duration(); } @@ -482,18 +482,18 @@ Duration CalendarWeekdays::duration(int _weekday) const { return Duration(); } -QTime CalendarWeekdays::startOfDay(int _weekday) const { +TQTime CalendarWeekdays::startOfDay(int _weekday) const { CalendarDay *day = weekday(_weekday); if (day) return day->startOfDay(); - return QTime(); + return TQTime(); } -QTime CalendarWeekdays::endOfDay(int _weekday) const { +TQTime CalendarWeekdays::endOfDay(int _weekday) const { CalendarDay *day = weekday(_weekday); if (day) return day->endOfDay(); - return QTime(); + return TQTime(); } @@ -507,9 +507,9 @@ Calendar::Calendar() init(); } -Calendar::Calendar(QString name, Calendar *parent) +Calendar::Calendar(TQString name, Calendar *tqparent) : m_name(name), - m_parent(parent), + m_parent(tqparent), m_project(0), m_deleted(false), m_days() { @@ -531,11 +531,11 @@ Calendar::Calendar(Calendar *calendar) const Calendar &Calendar::copy(Calendar &calendar) { m_name = calendar.name(); - m_parent = calendar.parent(); + m_parent = calendar.tqparent(); m_deleted = calendar.isDeleted(); m_id = calendar.id(); - QPtrListIterator<CalendarDay> it = calendar.days(); + TQPtrListIterator<CalendarDay> it = calendar.days(); for (; it.current(); ++it) { m_days.append(new CalendarDay(it.current())); } @@ -561,7 +561,7 @@ void Calendar::setDeleted(bool yes) { } m_deleted = yes; } -bool Calendar::setId(QString id) { +bool Calendar::setId(TQString id) { //kdDebug()<<k_funcinfo<<id<<endl; if (id.isEmpty()) { kdError()<<k_funcinfo<<"id is empty"<<endl; @@ -578,7 +578,7 @@ bool Calendar::setId(QString id) { } if (findCalendar(id)) { kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different node: "<<findCalendar(id)->name()<<endl; - m_id = QString(); // hmmm + m_id = TQString(); // hmmm return false; } m_id = id; @@ -598,21 +598,21 @@ void Calendar::generateId() { return; } } - m_id = QString(); + m_id = TQString(); } -bool Calendar::load(QDomElement &element) { +bool Calendar::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<element.text()<<endl; //bool ok; setId(element.attribute("id")); - m_parentId = element.attribute("parent"); + m_parentId = element.attribute("tqparent"); m_name = element.attribute("name",""); - //TODO parent + //TODO tqparent - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "weekday") { if (!m_weekdays->load(e)) return false; @@ -643,30 +643,30 @@ bool Calendar::load(QDomElement &element) { return true; } -void Calendar::save(QDomElement &element) const { +void Calendar::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<m_name<<endl; if (m_deleted) return; - QDomElement me = element.ownerDocument().createElement("calendar"); + TQDomElement me = element.ownerDocument().createElement("calendar"); element.appendChild(me); if (m_parent && !m_parent->isDeleted()) - me.setAttribute("parent", m_parent->id()); + me.setAttribute("tqparent", m_parent->id()); me.setAttribute("name", m_name); me.setAttribute("id", m_id); m_weekdays->save(me); - QPtrListIterator<CalendarDay> it = m_days; + TQPtrListIterator<CalendarDay> it = m_days; for (; it.current(); ++it) { - QDomElement e = me.ownerDocument().createElement("day"); + TQDomElement e = me.ownerDocument().createElement("day"); me.appendChild(e); it.current()->save(e); } } -CalendarDay *Calendar::findDay(const QDate &date, bool skipNone) const { +CalendarDay *Calendar::findDay(const TQDate &date, bool skipNone) const { //kdDebug()<<k_funcinfo<<date.toString()<<endl; - QPtrListIterator<CalendarDay> it = m_days; + TQPtrListIterator<CalendarDay> it = m_days; for (; it.current(); ++it) { if (it.current()->date() == date) { if (skipNone && it.current()->state() == Map::None) { @@ -688,13 +688,13 @@ bool Calendar::hasParent(Calendar *cal) { return m_parent->hasParent(cal); } -Duration Calendar::effort(const QDate &date, const QTime &start, const QTime &end) const { +Duration Calendar::effort(const TQDate &date, const TQTime &start, const TQTime &end) const { //kdDebug()<<k_funcinfo<<m_name<<": "<<date.toString(Qt::ISODate)<<" "<<start.toString()<<" - "<<end.toString()<<endl; if (start == end) { return Duration::zeroDuration; } - QTime _start = start; - QTime _end = end; + TQTime _start = start; + TQTime _end = end; if (start > end) { _start = end; _end = start; @@ -733,9 +733,9 @@ Duration Calendar::effort(const DateTime &start, const DateTime &end) const { if (!start.isValid() || !end.isValid() || end <= start) { return eff; } - QDate date = start.date(); - QTime startTime = start.time(); - QTime endTime = end.time(); + TQDate date = start.date(); + TQTime startTime = start.time(); + TQTime endTime = end.time(); if (end.date() > date) { endTime.setHMS(23, 59, 59, 999); } @@ -743,9 +743,9 @@ Duration Calendar::effort(const DateTime &start, const DateTime &end) const { // Now get all the rest of the days for (date = date.addDays(1); date <= end.date(); date = date.addDays(1)) { if (date < end.date()) - eff += effort(date, QTime(), endTime); // whole days + eff += effort(date, TQTime(), endTime); // whole days else - eff += effort(date, QTime(), end.time()); // last day + eff += effort(date, TQTime(), end.time()); // last day //kdDebug()<<k_funcinfo<<": eff now="<<eff.toString(Duration::Format_Day)<<endl; } //kdDebug()<<k_funcinfo<<start.date().toString()<<"- "<<end.date().toString()<<": total="<<eff.toString(Duration::Format_Day)<<endl; @@ -753,7 +753,7 @@ Duration Calendar::effort(const DateTime &start, const DateTime &end) const { } -QPair<QTime, QTime> Calendar::firstInterval(const QDate &date, const QTime &startTime, const QTime &endTime) const { +TQPair<TQTime, TQTime> Calendar::firstInterval(const TQDate &date, const TQTime &startTime, const TQTime &endTime) const { CalendarDay *day = findDay(date, true); if (day) { return day->interval(startTime, endTime); @@ -763,7 +763,7 @@ QPair<QTime, QTime> Calendar::firstInterval(const QDate &date, const QTime &star return m_weekdays->interval(date, startTime, endTime); } if (m_weekdays->state(date) == Map::NonWorking) { - return QPair<QTime, QTime>(QTime(), QTime()); + return TQPair<TQTime, TQTime>(TQTime(), TQTime()); } } if (m_parent && !m_parent->isDeleted()) { @@ -772,41 +772,41 @@ QPair<QTime, QTime> Calendar::firstInterval(const QDate &date, const QTime &star return project()->defaultCalendar()->firstInterval(date, startTime, endTime); } -QPair<DateTime, DateTime> Calendar::firstInterval(const DateTime &start, const DateTime &end) const { +TQPair<DateTime, DateTime> Calendar::firstInterval(const DateTime &start, const DateTime &end) const { //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; if (!start.isValid()) { kdWarning()<<k_funcinfo<<"Invalid start time"<<endl; - return QPair<DateTime, DateTime>(DateTime(), DateTime()); + return TQPair<DateTime, DateTime>(DateTime(), DateTime()); } if (!end.isValid()) { kdWarning()<<k_funcinfo<<"Invalid end time"<<endl; - return QPair<DateTime, DateTime>(DateTime(), DateTime()); + return TQPair<DateTime, DateTime>(DateTime(), DateTime()); } - QTime startTime; - QTime endTime; - QDate date = start.date(); + TQTime startTime; + TQTime endTime; + TQDate date = start.date(); int i=0; for (; date <= end.date(); date = date.addDays(1)) { if (date < end.date()) - endTime = QTime(23, 59, 59, 999); + endTime = TQTime(23, 59, 59, 999); else endTime = end.time(); if (date > start.date()) - startTime = QTime(); + startTime = TQTime(); else startTime = start.time(); - QPair<QTime, QTime> res = firstInterval(date, startTime, endTime); + TQPair<TQTime, TQTime> res = firstInterval(date, startTime, endTime); if (res.first < res.second) { - return QPair<DateTime, DateTime>(DateTime(date,res.first),DateTime(date, res.second)); + return TQPair<DateTime, DateTime>(DateTime(date,res.first),DateTime(date, res.second)); } } //kdError()<<k_funcinfo<<"Didn't find an interval ("<<start<<", "<<end<<")"<<endl; - return QPair<DateTime, DateTime>(DateTime(), DateTime()); + return TQPair<DateTime, DateTime>(DateTime(), DateTime()); } -bool Calendar::hasInterval(const QDate &date, const QTime &startTime, const QTime &endTime) const { +bool Calendar::hasInterval(const TQDate &date, const TQTime &startTime, const TQTime &endTime) const { CalendarDay *day = findDay(date, true); if (day) { //kdDebug()<<k_funcinfo<<m_name<<" "<<date<<": "<<startTime<<" to "<<endTime<<endl; @@ -832,16 +832,16 @@ bool Calendar::hasInterval(const DateTime &start, const DateTime &end) const { //kdDebug()<<kdBacktrace(8)<<endl; return false; } - QTime startTime; - QTime endTime; - QDate date = start.date(); + TQTime startTime; + TQTime endTime; + TQDate date = start.date(); for (; date <= end.date(); date = date.addDays(1)) { if (date < end.date()) - endTime = QTime(23, 59, 59, 999); + endTime = TQTime(23, 59, 59, 999); else endTime = end.time(); if (date > start.date()) - startTime = QTime(); + startTime = TQTime(); else startTime = start.time(); @@ -874,7 +874,7 @@ DateTime Calendar::firstAvailableBefore(const DateTime &time, const DateTime &li DateTime lmt = time; DateTime t = DateTime(time.date()); // start of first day if (t == lmt) - t = t.addDays(-1); // in case time == start of day + t = TQDateTime(t.addDays(-1)); // in case time == start of day if (t < limit) t = limit; // always stop at limit (lower boundary) DateTime res; @@ -895,7 +895,7 @@ DateTime Calendar::firstAvailableBefore(const DateTime &time, const DateTime &li break; } lmt = t; - t = t.addDays(-1); + t = TQDateTime(t.addDays(-1)); if (t < limit) { t = limit; } @@ -907,15 +907,15 @@ DateTime Calendar::firstAvailableBefore(const DateTime &time, const DateTime &li return res; } -Calendar *Calendar::findCalendar(const QString &id) const { +Calendar *Calendar::findCalendar(const TQString &id) const { return (m_project ? m_project->findCalendar(id) : 0); } -bool Calendar::removeId(const QString &id) { +bool Calendar::removeId(const TQString &id) { return (m_project ? m_project->removeCalendarId(id) : false); } -void Calendar::insertId(const QString &id){ +void Calendar::insertId(const TQString &id){ if (m_project) m_project->insertCalendarId(id, this); } @@ -949,7 +949,7 @@ void StandardWorktime::init() { m_day = Duration(0, 8, 0); m_calendar = new Calendar; m_calendar->setName(i18n("Base")); - QPair<QTime, QTime> t = QPair<QTime, QTime>(QTime(8,0,0), QTime(16,0,0)); + TQPair<TQTime, TQTime> t = TQPair<TQTime, TQTime>(TQTime(8,0,0), TQTime(16,0,0)); for (int i=0; i < 5; ++i) { m_calendar->weekday(i)->addInterval(t); m_calendar->weekday(i)->setState(Map::Working); @@ -958,17 +958,17 @@ void StandardWorktime::init() { m_calendar->weekday(6)->setState(Map::NonWorking); } -bool StandardWorktime::load(QDomElement &element) { +bool StandardWorktime::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; m_year = Duration::fromString(element.attribute("year"), Duration::Format_Hour); m_month = Duration::fromString(element.attribute("month"), Duration::Format_Hour); m_week = Duration::fromString(element.attribute("week"), Duration::Format_Hour); m_day = Duration::fromString(element.attribute("day"), Duration::Format_Hour); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "calendar") { delete m_calendar; m_calendar = new Calendar; @@ -979,9 +979,9 @@ bool StandardWorktime::load(QDomElement &element) { return true; } -void StandardWorktime::save(QDomElement &element) const { +void StandardWorktime::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("standard-worktime"); + TQDomElement me = element.ownerDocument().createElement("standard-worktime"); element.appendChild(me); me.setAttribute("year", m_year.toString(Duration::Format_Hour)); me.setAttribute("month", m_month.toString(Duration::Format_Hour)); @@ -992,38 +992,38 @@ void StandardWorktime::save(QDomElement &element) const { } #ifndef NDEBUG -void CalendarDay::printDebug(QCString indent) { - QString s[] = {"None", "Non-working", "Working"}; +void CalendarDay::printDebug(TQCString indent) { + TQString s[] = {"None", "Non-working", "Working"}; kdDebug()<<indent<<" "<<m_date.toString()<<" = "<<s[m_state]<<endl; if (m_state == Map::Working) { indent += " "; - QPtrListIterator<QPair<QTime, QTime> > it = m_workingIntervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it = m_workingIntervals; for (; it.current(); ++it) { kdDebug()<<indent<<" Interval: "<<it.current()->first<<" to "<<it.current()->second<<endl; } } } -void CalendarWeekdays::printDebug(QCString indent) { +void CalendarWeekdays::printDebug(TQCString indent) { kdDebug()<<indent<<"Weekdays ------"<<endl; - QPtrListIterator<CalendarDay> it = m_weekdays; + TQPtrListIterator<CalendarDay> it = m_weekdays; for (char c='0'; it.current(); ++it) { it.current()->printDebug(indent + " Day " + c++ + ": "); } } -void Calendar::printDebug(QCString indent) { +void Calendar::printDebug(TQCString indent) { kdDebug()<<indent<<"Calendar "<<m_id<<": '"<<m_name<<"' Deleted="<<m_deleted<<endl; - kdDebug()<<indent<<" Parent: "<<(m_parent ? m_parent->name() : "No parent")<<endl; + kdDebug()<<indent<<" Parent: "<<(m_parent ? m_parent->name() : "No tqparent")<<endl; m_weekdays->printDebug(indent + " "); kdDebug()<<indent<<" Days --------"<<endl; - QPtrListIterator<CalendarDay> it = m_days; + TQPtrListIterator<CalendarDay> it = m_days; for (; it.current(); ++it) { it.current()->printDebug(indent + " "); } } -void StandardWorktime::printDebug(QCString indent) { +void StandardWorktime::printDebug(TQCString indent) { kdDebug()<<indent<<"StandardWorktime "<<endl; kdDebug()<<indent<<"Year: "<<m_year.toString()<<endl; kdDebug()<<indent<<"Month: "<<m_month.toString()<<endl; diff --git a/kplato/kptcalendar.h b/kplato/kptcalendar.h index 807e9a5f..b5a7c1cc 100644 --- a/kplato/kptcalendar.h +++ b/kplato/kptcalendar.h @@ -23,15 +23,15 @@ #include "kptmap.h" #include "kptduration.h" -#include <qdatetime.h> -#include <qpair.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqpair.h> +#include <tqptrlist.h> -class QDomElement; -class QDateTime; -class QTime; -class QDate; -class QString; +class TQDomElement; +class TQDateTime; +class TQTime; +class TQDate; +class TQString; namespace KPlato { @@ -44,27 +44,27 @@ class CalendarDay { public: CalendarDay(); CalendarDay(int state); - CalendarDay(QDate date, int state=0); + CalendarDay(TQDate date, int state=0); CalendarDay(CalendarDay *day); ~CalendarDay(); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; - const QPtrList<QPair<QTime, QTime> > &workingIntervals() const { return m_workingIntervals; } - void addInterval(QPair<QTime, QTime> *interval); - void addInterval(QPair<QTime, QTime> interval) { addInterval(new QPair<QTime, QTime>(interval)); } + const TQPtrList<TQPair<TQTime, TQTime> > &workingIntervals() const { return m_workingIntervals; } + void addInterval(TQPair<TQTime, TQTime> *interval); + void addInterval(TQPair<TQTime, TQTime> interval) { addInterval(new TQPair<TQTime, TQTime>(interval)); } void clearIntervals() { m_workingIntervals.clear(); } - void setIntervals(QPtrList<QPair<QTime, QTime> > intervals) { + void setIntervals(TQPtrList<TQPair<TQTime, TQTime> > intervals) { m_workingIntervals.clear(); m_workingIntervals = intervals; } - QTime startOfDay() const; - QTime endOfDay() const; + TQTime startOfDay() const; + TQTime endOfDay() const; - QDate date() const { return m_date; } - void setDate(QDate date) { m_date = date; } + TQDate date() const { return m_date; } + void setDate(TQDate date) { m_date = date; } int state() const { return m_state; } void setState(int state) { m_state = state; } @@ -77,14 +77,14 @@ public: * Returns the amount of 'worktime' that can be done on * this day between the times start and end. */ - Duration effort(const QTime &start, const QTime &end); + Duration effort(const TQTime &start, const TQTime &end); /** * Returns the actual 'work interval' for the interval start to end. * If no 'work interval' exists, returns the interval start, end. * Use @ref hasInterval() to check if a 'work interval' exists. */ - QPair<QTime, QTime> interval(const QTime &start, const QTime &end) const; + TQPair<TQTime, TQTime> interval(const TQTime &start, const TQTime &end) const; bool hasInterval() const; @@ -92,20 +92,20 @@ public: * Returns true if at least a part of a 'work interval' exists * for the interval start to end. */ - bool hasInterval(const QTime &start, const QTime &end) const; + bool hasInterval(const TQTime &start, const TQTime &end) const; Duration duration() const; const CalendarDay ©(const CalendarDay &day); private: - QDate m_date; //NOTE: inValid if used for weekdays + TQDate m_date; //NOTE: inValid if used for weekdays int m_state; - QPtrList<QPair<QTime, QTime> > m_workingIntervals; + TQPtrList<TQPair<TQTime, TQTime> > m_workingIntervals; #ifndef NDEBUG public: - void printDebug(QCString indent=""); + void printDebug(TQCString indent=""); #endif }; @@ -116,39 +116,39 @@ public: CalendarWeekdays(CalendarWeekdays *weekdays); ~CalendarWeekdays(); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; void addWeekday(CalendarDay *day) { m_weekdays.append(day); } - const QPtrList<CalendarDay> &weekdays() const { return m_weekdays; } + const TQPtrList<CalendarDay> &weekdays() const { return m_weekdays; } /** * Returns the pointer to CalendarDay for day or 0 if not defined. * day is 0..6. * @param day todo : add a comment */ CalendarDay *weekday(int day) const; - CalendarDay *weekday(const QDate &date) const { return weekday(date.dayOfWeek()-1); } - CalendarDay *replace(int weekday, CalendarDay *day) { + CalendarDay *weekday(const TQDate &date) const { return weekday(date.dayOfWeek()-1); } + CalendarDay *tqreplace(int weekday, CalendarDay *day) { CalendarDay *d = m_weekdays.at(weekday); - m_weekdays.replace(weekday, day); + m_weekdays.tqreplace(weekday, day); return d; } IntMap map(); void setWeekday(IntMap::iterator it, int state) { m_weekdays.at(it.key())->setState(state); } - int state(const QDate &date) const; + int state(const TQDate &date) const; int state(int weekday) const; void setState(int weekday, int state); - const QPtrList<QPair<QTime, QTime> > &intervals(int weekday) const; - void setIntervals(int weekday, QPtrList<QPair<QTime, QTime> >intervals); + const TQPtrList<TQPair<TQTime, TQTime> > &intervals(int weekday) const; + void setIntervals(int weekday, TQPtrList<TQPair<TQTime, TQTime> >intervals); void clearIntervals(int weekday); bool operator==(const CalendarWeekdays *weekdays) const; bool operator!=(const CalendarWeekdays *weekdays) const; - Duration effort(const QDate &date, const QTime &start, const QTime &end); + Duration effort(const TQDate &date, const TQTime &start, const TQTime &end); /** * Returns the actual 'work interval' on the weekday defined by date @@ -156,38 +156,38 @@ public: * If no 'work interval' exists, returns the interval start, end. * Use @ref hasInterval() to check if a 'work interval' exists. */ - QPair<QTime, QTime> interval(const QDate date, const QTime &start, const QTime &end) const; + TQPair<TQTime, TQTime> interval(const TQDate date, const TQTime &start, const TQTime &end) const; /** * Returns true if at least a part of a 'work interval' exists * on the weekday defined by date for the interval start to end. */ - bool hasInterval(const QDate date, const QTime &start, const QTime &end) const; + bool hasInterval(const TQDate date, const TQTime &start, const TQTime &end) const; bool hasInterval() const; Duration duration() const; Duration duration(int weekday) const; /// Returns the time when the weekday starts - QTime startOfDay(int weekday) const; + TQTime startOfDay(int weekday) const; /// Returns the time when the weekday ends - QTime endOfDay(int weekday) const; + TQTime endOfDay(int weekday) const; const CalendarWeekdays ©(const CalendarWeekdays &weekdays); private: - QPtrList<CalendarDay> m_weekdays; + TQPtrList<CalendarDay> m_weekdays; double m_workHours; #ifndef NDEBUG public: - void printDebug(QCString indent=""); + void printDebug(TQCString indent=""); #endif }; /** * Calendar defines the working and nonworking days and hours. * A day can have the three states None (Undefined), NonWorking, or Working. - * A calendar can have a parent calendar that defines the days that are + * A calendar can have a tqparent calendar that defines the days that are * undefined in this calendar. If a day is still undefined, it defaults * to Nonworking. * A Working day has one or more work intervals to define the work hours. @@ -205,15 +205,15 @@ class Calendar { public: Calendar(); - Calendar(QString name, Calendar *parent=0); + Calendar(TQString name, Calendar *tqparent=0); Calendar(Calendar *calendar); ~Calendar(); - QString name() const { return m_name; } - void setName(QString name) { m_name = name; } + TQString name() const { return m_name; } + void setName(TQString name) { m_name = name; } - Calendar *parent() const { return m_parent; } - void setParent(Calendar *parent) { m_parent = parent; } + Calendar *tqparent() const { return m_parent; } + void setParent(Calendar *tqparent) { m_parent = tqparent; } Project *project() const { return m_project; } void setProject(Project *project); @@ -221,36 +221,36 @@ public: bool isDeleted() const { return m_deleted; } void setDeleted(bool yes); - QString id() const { return m_id; } - bool setId(QString id); + TQString id() const { return m_id; } + bool setId(TQString id); void generateId(); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; /** * Find the definition for the day date. * If skipUndefined=true the day is NOT returned if it has state None (Undefined). */ - CalendarDay *findDay(const QDate &date, bool skipUndefined=false) const; + CalendarDay *findDay(const TQDate &date, bool skipUndefined=false) const; bool addDay(CalendarDay *day) { return m_days.insert(0, day); } bool removeDay(CalendarDay *day) { return m_days.removeRef(day); } - CalendarDay *takeDay(CalendarDay *day) { return m_days.take(m_days.find(day)); } - const QPtrList<CalendarDay> &days() const { return m_days; } + CalendarDay *takeDay(CalendarDay *day) { return m_days.take(m_days.tqfind(day)); } + const TQPtrList<CalendarDay> &days() const { return m_days; } /** - * Returns the state of definition for parents day date in it. - * Also checks the parents recursively. + * Returns the state of definition for tqparents day date in it. + * Also checks the tqparents recursively. */ - int parentDayState(const QDate &date) const; + int tqparentDayState(const TQDate &date) const; IntMap weekdaysMap() { return m_weekdays->map(); } void setWeekday(IntMap::iterator it, int state) { m_weekdays->setWeekday(it, state); } CalendarWeekdays *weekdays() { return m_weekdays; } CalendarDay *weekday(int day) const { return m_weekdays->weekday(day); } - QString parentId() const { return m_parentId; } - void setParentId(QString id) { m_parentId = id; } + TQString tqparentId() const { return m_parentId; } + void setParentId(TQString id) { m_parentId = id; } bool hasParent(Calendar *cal); @@ -258,7 +258,7 @@ public: * Returns the amount of 'worktime' that can be done on * the date date between the times start and end. */ - Duration effort(const QDate &date, const QTime &start, const QTime &end) const; + Duration effort(const TQDate &date, const TQTime &start, const TQTime &end) const; /** * Returns the amount of 'worktime' that can be done in the * interval from start to end @@ -271,7 +271,7 @@ public: * If no 'work interval' exists, returns an interval with invalid DateTime. * You can also use @ref hasInterval() to check if a 'work interval' exists. */ - QPair<DateTime, DateTime> firstInterval(const DateTime &start, const DateTime &end) const; + TQPair<DateTime, DateTime> firstInterval(const DateTime &start, const DateTime &end) const; /** * Returns the first 'work interval' on date for the interval @@ -279,7 +279,7 @@ public: * If no 'work interval' exists, returns an interval with first==second. * You can also use @ref hasInterval() to check if a 'work interval' exists. */ - QPair<QTime, QTime> firstInterval(const QDate &date, const QTime &start, const QTime &end) const; + TQPair<TQTime, TQTime> firstInterval(const TQDate &date, const TQTime &start, const TQTime &end) const; /** * Returns true if at least a part of a 'work interval' exists @@ -291,7 +291,7 @@ public: * Returns true if at least a part of a 'work interval' exists * for the interval on date, starting at start and ending at end. */ - bool hasInterval(const QDate &date, const QTime &start, const QTime &end) const; + bool hasInterval(const TQDate &date, const TQTime &start, const TQTime &end) const; /** * Find the first available time after time before limit. @@ -305,29 +305,29 @@ public: DateTime firstAvailableBefore(const DateTime &time, const DateTime &limit); Calendar *findCalendar() const { return findCalendar(m_id); } - Calendar *findCalendar(const QString &id) const; + Calendar *findCalendar(const TQString &id) const; bool removeId() { return removeId(m_id); } - bool removeId(const QString &id); - void insertId(const QString &id); + bool removeId(const TQString &id); + void insertId(const TQString &id); protected: const Calendar ©(Calendar &calendar); void init(); private: - QString m_name; + TQString m_name; Calendar *m_parent; Project *m_project; bool m_deleted; - QString m_id; - QString m_parentId; + TQString m_id; + TQString m_parentId; - QPtrList<CalendarDay> m_days; + TQPtrList<CalendarDay> m_days; CalendarWeekdays *m_weekdays; #ifndef NDEBUG public: - void printDebug(QCString indent=""); + void printDebug(TQCString indent=""); #endif }; @@ -345,7 +345,7 @@ public: /// Set the work time of a normal year. void setYear(const Duration year) { m_year = year; } /// Set the work time of a normal year. - void setYear(double hours) { m_year = Duration((Q_INT64)(hours*60.0*60.0)); } + void setYear(double hours) { m_year = Duration((TQ_INT64)(hours*60.0*60.0)); } /// The work time of a normal month Duration durationMonth() const { return m_month; } @@ -354,7 +354,7 @@ public: /// Set the work time of a normal month void setMonth(const Duration month) { m_month = month; } /// Set the work time of a normal month - void setMonth(double hours) { m_month = Duration((Q_INT64)(hours*60.0*60.0)); } + void setMonth(double hours) { m_month = Duration((TQ_INT64)(hours*60.0*60.0)); } /// The work time of a normal week Duration durationWeek() const { return m_week; } @@ -363,7 +363,7 @@ public: /// Set the work time of a normal week void setWeek(const Duration week) { m_week = week; } /// Set the work time of a normal week - void setWeek(double hours) { m_week = Duration((Q_INT64)(hours*60.0*60.0)); } + void setWeek(double hours) { m_week = Duration((TQ_INT64)(hours*60.0*60.0)); } /// The work time of a normal day Duration durationDay() const { return m_day; } @@ -372,10 +372,10 @@ public: /// Set the work time of a normal day void setDay(const Duration day) { m_day = day; } /// Set the work time of a normal day - void setDay(double hours) { m_day = Duration((Q_INT64)(hours*60.0*60.0)); } + void setDay(double hours) { m_day = Duration((TQ_INT64)(hours*60.0*60.0)); } - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; Calendar *calendar() const { return m_calendar; } @@ -392,7 +392,7 @@ private: #ifndef NDEBUG public: - void printDebug(QCString indent=""); + void printDebug(TQCString indent=""); #endif }; diff --git a/kplato/kptcalendaredit.cc b/kplato/kptcalendaredit.cc index f9d76316..297fc64d 100644 --- a/kplato/kptcalendaredit.cc +++ b/kplato/kptcalendaredit.cc @@ -24,33 +24,33 @@ #include "kptmap.h" #include "intervalitem.h" -#include <qbuttongroup.h> -#include <qheader.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <qtextedit.h> -#include <qlineedit.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qtabwidget.h> -#include <qtextbrowser.h> +#include <tqbuttongroup.h> +#include <tqheader.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqtextedit.h> +#include <tqlineedit.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqtabwidget.h> +#include <tqtextbrowser.h> #include <klocale.h> #include <kabc/addressee.h> #include <kabc/addresseedialog.h> -#include <qmap.h> +#include <tqmap.h> #include <kdebug.h> namespace KPlato { -CalendarEdit::CalendarEdit (QWidget *parent, const char */*name*/) - : CalendarEditBase(parent), +CalendarEdit::CalendarEdit (TQWidget *tqparent, const char */*name*/) + : CalendarEditBase(tqparent), m_calendar(0) { @@ -59,15 +59,15 @@ CalendarEdit::CalendarEdit (QWidget *parent, const char */*name*/) intervalList->setShowSortIndicator(true); intervalList->setSorting(0); - connect (calendarPanel, SIGNAL(dateChanged(QDate)), SLOT(slotDateSelected(QDate))); - connect (calendarPanel, SIGNAL(weekdaySelected(int)), SLOT(slotWeekdaySelected(int))); - connect(calendarPanel, SIGNAL(selectionCleared()), SLOT(slotSelectionCleared())); + connect (calendarPanel, TQT_SIGNAL(dateChanged(TQDate)), TQT_SLOT(slotDateSelected(TQDate))); + connect (calendarPanel, TQT_SIGNAL(weekdaySelected(int)), TQT_SLOT(slotWeekdaySelected(int))); + connect(calendarPanel, TQT_SIGNAL(selectionCleared()), TQT_SLOT(slotSelectionCleared())); - connect (state, SIGNAL(activated(int)), SLOT(slotStateActivated(int))); - connect (bClear, SIGNAL(clicked()), SLOT(slotClearClicked())); - connect (bAddInterval, SIGNAL(clicked()), SLOT(slotAddIntervalClicked())); + connect (state, TQT_SIGNAL(activated(int)), TQT_SLOT(slotStateActivated(int))); + connect (bClear, TQT_SIGNAL(clicked()), TQT_SLOT(slotClearClicked())); + connect (bAddInterval, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddIntervalClicked())); - connect (bApply, SIGNAL(clicked()), SLOT(slotApplyClicked())); + connect (bApply, TQT_SIGNAL(clicked()), TQT_SLOT(slotApplyClicked())); } void CalendarEdit::slotStateActivated(int id) { @@ -112,7 +112,7 @@ void CalendarEdit::slotApplyClicked() { //kdDebug()<<k_funcinfo<<"("<<m_calendar<<")"<<endl; DateMap dates = calendarPanel->selectedDates(); for(DateMap::iterator it = dates.begin(); it != dates.end(); ++it) { - QDate date = QDate::fromString(it.key(), Qt::ISODate); + TQDate date = TQDate::fromString(it.key(), Qt::ISODate); //kdDebug()<<k_funcinfo<<"Date: "<<date<<endl; CalendarDay *calDay = m_calendar->findDay(date); if (!calDay) { @@ -122,7 +122,7 @@ void CalendarEdit::slotApplyClicked() { calDay->setState(state->currentItem()); //NOTE!! calDay->clearIntervals(); if (calDay->state() == Map::Working) { - for (QListViewItem *item = intervalList->firstChild(); item; item = item->nextSibling()) { + for (TQListViewItem *item = intervalList->firstChild(); item; item = item->nextSibling()) { //kdDebug()<<k_funcinfo<<"Adding interval: "<<static_cast<IntervalItem *>(item)->interval().first.toString()<<"-"<<static_cast<IntervalItem *>(item)->interval().second.toString()<<endl; calDay->addInterval(static_cast<IntervalItem *>(item)->interval()); } @@ -136,7 +136,7 @@ void CalendarEdit::slotApplyClicked() { weekday->setState(state->currentItem());//NOTE!! weekday->clearIntervals(); if (weekday->state() == Map::Working) { - for (QListViewItem *item = intervalList->firstChild(); item; item = item->nextSibling()) { + for (TQListViewItem *item = intervalList->firstChild(); item; item = item->nextSibling()) { //kdDebug()<<k_funcinfo<<"Adding interval: "<<static_cast<IntervalItem *>(item)->interval().first.toString()<<"-"<<static_cast<IntervalItem *>(item)->interval().second.toString()<<endl; weekday->addInterval(static_cast<IntervalItem *>(item)->interval()); } @@ -182,9 +182,9 @@ void CalendarEdit::clearEditPart() { intervalList->clear(); intervalList->setEnabled(false); startTime->setEnabled(false); - startTime->setTime(QTime(8, 0, 0)); //FIXME + startTime->setTime(TQTime(8, 0, 0)); //FIXME endTime->setEnabled(false); - endTime->setTime(QTime(16, 0, 0)); //FIXME + endTime->setTime(TQTime(16, 0, 0)); //FIXME bAddInterval->setEnabled(false); bClear->setEnabled(false); @@ -192,7 +192,7 @@ void CalendarEdit::clearEditPart() { state->setEnabled(false); } -void CalendarEdit::slotDateSelected(QDate date) { +void CalendarEdit::slotDateSelected(TQDate date) { if (m_calendar == 0) return; //kdDebug()<<k_funcinfo<<"("<<date.toString()<<")"<<endl; @@ -205,7 +205,7 @@ void CalendarEdit::slotDateSelected(QDate date) { CalendarDay *calDay = m_calendar->findDay(date); state->setEnabled(true); if (calDay) { - QPtrListIterator<QPair<QTime, QTime> > it = calDay->workingIntervals(); + TQPtrListIterator<TQPair<TQTime, TQTime> > it = calDay->workingIntervals(); for (; it.current(); ++it) { IntervalItem *item = new IntervalItem(intervalList, it.current()->first, it.current()->second); intervalList->insertItem(item); @@ -250,7 +250,7 @@ void CalendarEdit::slotWeekdaySelected(int day_/* 1..7 */) { state->insertItem(i18n("Undefined")); state->insertItem(i18n("Non-working")); state->insertItem(i18n("Working")); - QPtrListIterator<QPair<QTime, QTime> > it = calDay->workingIntervals(); + TQPtrListIterator<TQPair<TQTime, TQTime> > it = calDay->workingIntervals(); for (; it.current(); ++it) { IntervalItem *item = new IntervalItem(intervalList, it.current()->first, it.current()->second); intervalList->insertItem(item); diff --git a/kplato/kptcalendaredit.h b/kplato/kptcalendaredit.h index 9089bf0f..d2a8f853 100644 --- a/kplato/kptcalendaredit.h +++ b/kplato/kptcalendaredit.h @@ -22,9 +22,9 @@ #include "kptcalendareditbase.h" -#include <qptrlist.h> +#include <tqptrlist.h> -class QDate; +class TQDate; namespace KPlato { @@ -33,8 +33,9 @@ class Calendar; class CalendarEdit : public CalendarEditBase { Q_OBJECT + TQ_OBJECT public: - CalendarEdit (QWidget *parent=0, const char *name=0); + CalendarEdit (TQWidget *tqparent=0, const char *name=0); Calendar *getCalendar() { return m_calendar; } void setCalendar(Calendar *cal); @@ -45,7 +46,7 @@ public: private slots: void slotCheckAllFieldsFilled(); - void slotDateSelected(QDate date); + void slotDateSelected(TQDate date); void slotWeekdaySelected(int day); void slotStateActivated(int id); void slotClearClicked(); diff --git a/kplato/kptcalendareditbase.cc b/kplato/kptcalendareditbase.cc index ebdb75ad..e9bbd00a 100644 --- a/kplato/kptcalendareditbase.cc +++ b/kplato/kptcalendareditbase.cc @@ -21,95 +21,95 @@ #include "kptcalendareditbase.h" -#include <qvariant.h> -#include <qpushbutton.h> -#include <qgroupbox.h> +#include <tqvariant.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> #include <kptcalendarpanel.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qbuttongroup.h> -#include <qheader.h> -#include <qlistview.h> -#include <qdatetimeedit.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqbuttongroup.h> +#include <tqheader.h> +#include <tqlistview.h> +#include <tqdatetimeedit.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> namespace KPlato { /* - * Constructs a CalendarEditBase as a child of 'parent', with the + * Constructs a CalendarEditBase as a child of 'tqparent', with the * name 'name' and widget flags set to 'f'. */ -CalendarEditBase::CalendarEditBase( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) +CalendarEditBase::CalendarEditBase( TQWidget* tqparent, const char* name, WFlags fl ) + : TQWidget( tqparent, name, fl ) { if ( !name ) setName( "CalendarEditBase" ); - CalendarEditBaseLayout = new QHBoxLayout( this, 0, 0, "CalendarEditBaseLayout"); + CalendarEditBaseLayout = new TQHBoxLayout( this, 0, 0, "CalendarEditBaseLayout"); - groupBox2 = new QGroupBox( this, "groupBox2" ); + groupBox2 = new TQGroupBox( this, "groupBox2" ); groupBox2->setColumnLayout(0, Qt::Vertical ); - groupBox2->layout()->setSpacing( 6 ); - groupBox2->layout()->setMargin( 6 ); - groupBox2Layout = new QGridLayout( groupBox2->layout() ); - groupBox2Layout->setAlignment( Qt::AlignTop ); + groupBox2->tqlayout()->setSpacing( 6 ); + groupBox2->tqlayout()->setMargin( 6 ); + groupBox2Layout = new TQGridLayout( groupBox2->tqlayout() ); + groupBox2Layout->tqsetAlignment( TQt::AlignTop ); calendarPanel = new CalendarPanel( groupBox2, "calendarPanel" ); groupBox2Layout->addWidget( calendarPanel, 1, 0 ); - day = new QButtonGroup( groupBox2, "day" ); + day = new TQButtonGroup( groupBox2, "day" ); day->setColumnLayout(0, Qt::Vertical ); - day->layout()->setSpacing( 6 ); - day->layout()->setMargin( 6 ); - dayLayout = new QVBoxLayout( day->layout() ); - dayLayout->setAlignment( Qt::AlignTop ); + day->tqlayout()->setSpacing( 6 ); + day->tqlayout()->setMargin( 6 ); + dayLayout = new TQVBoxLayout( day->tqlayout() ); + dayLayout->tqsetAlignment( TQt::AlignTop ); - layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); + tqlayout8 = new TQHBoxLayout( 0, 0, 6, "tqlayout8"); - state = new QComboBox( FALSE, day, "state" ); - layout8->addWidget( state ); + state = new TQComboBox( FALSE, day, "state" ); + tqlayout8->addWidget( state ); - bApply = new QPushButton( day, "bApply" ); - layout8->addWidget( bApply ); - dayLayout->addLayout( layout8 ); + bApply = new TQPushButton( day, "bApply" ); + tqlayout8->addWidget( bApply ); + dayLayout->addLayout( tqlayout8 ); - groupBox4 = new QGroupBox( day, "groupBox4" ); + groupBox4 = new TQGroupBox( day, "groupBox4" ); groupBox4->setColumnLayout(0, Qt::Vertical ); - groupBox4->layout()->setSpacing( 6 ); - groupBox4->layout()->setMargin( 6 ); - groupBox4Layout = new QVBoxLayout( groupBox4->layout() ); - groupBox4Layout->setAlignment( Qt::AlignTop ); + groupBox4->tqlayout()->setSpacing( 6 ); + groupBox4->tqlayout()->setMargin( 6 ); + groupBox4Layout = new TQVBoxLayout( groupBox4->tqlayout() ); + groupBox4Layout->tqsetAlignment( TQt::AlignTop ); - intervalList = new QListView( groupBox4, "intervalList" ); + intervalList = new TQListView( groupBox4, "intervalList" ); intervalList->addColumn( tr2i18n( "Work Interval" ) ); groupBox4Layout->addWidget( intervalList ); - layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); + tqlayout6 = new TQHBoxLayout( 0, 0, 6, "tqlayout6"); - startTime = new QTimeEdit( groupBox4, "startTime" ); - layout6->addWidget( startTime ); + startTime = new TQTimeEdit( groupBox4, "startTime" ); + tqlayout6->addWidget( startTime ); - endTime = new QTimeEdit( groupBox4, "endTime" ); - layout6->addWidget( endTime ); - groupBox4Layout->addLayout( layout6 ); + endTime = new TQTimeEdit( groupBox4, "endTime" ); + tqlayout6->addWidget( endTime ); + groupBox4Layout->addLayout( tqlayout6 ); - layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); + tqlayout5 = new TQHBoxLayout( 0, 0, 6, "tqlayout5"); - bClear = new QPushButton( groupBox4, "bClear" ); - layout5->addWidget( bClear ); + bClear = new TQPushButton( groupBox4, "bClear" ); + tqlayout5->addWidget( bClear ); - bAddInterval = new QPushButton( groupBox4, "bAddInterval" ); - layout5->addWidget( bAddInterval ); - groupBox4Layout->addLayout( layout5 ); + bAddInterval = new TQPushButton( groupBox4, "bAddInterval" ); + tqlayout5->addWidget( bAddInterval ); + groupBox4Layout->addLayout( tqlayout5 ); dayLayout->addWidget( groupBox4 ); groupBox2Layout->addWidget( day, 1, 1 ); CalendarEditBaseLayout->addWidget( groupBox2 ); languageChange(); - resize( QSize(540, 340).expandedTo(minimumSizeHint()) ); + resize( TQSize(540, 340).expandedTo(tqminimumSizeHint()) ); clearWState( WState_Polished ); } @@ -118,7 +118,7 @@ CalendarEditBase::CalendarEditBase( QWidget* parent, const char* name, WFlags fl */ CalendarEditBase::~CalendarEditBase() { - // no need to delete child widgets, Qt does it all for us + // no need to delete child widgets, TQt does it all for us } /* @@ -128,10 +128,10 @@ CalendarEditBase::~CalendarEditBase() void CalendarEditBase::languageChange() { setCaption( tr2i18n( "CalendarEditBase" ) ); - groupBox2->setTitle( QString::null ); - day->setTitle( QString::null ); + groupBox2->setTitle( TQString() ); + day->setTitle( TQString() ); bApply->setText( tr2i18n( "Apply" ) ); - groupBox4->setTitle( QString::null ); + groupBox4->setTitle( TQString() ); intervalList->header()->setLabel( 0, tr2i18n( "Work Interval" ) ); bClear->setText( tr2i18n( "Clear" ) ); bAddInterval->setText( tr2i18n( "Add Interval" ) ); diff --git a/kplato/kptcalendareditbase.h b/kplato/kptcalendareditbase.h index 284c0ecd..cdf4d621 100644 --- a/kplato/kptcalendareditbase.h +++ b/kplato/kptcalendareditbase.h @@ -20,55 +20,56 @@ #ifndef KPTCALENDAREDITBASE_H #define KPTCALENDAREDITBASE_H -#include <qvariant.h> -#include <qwidget.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QGroupBox; -class QLabel; -class QComboBox; -class QButtonGroup; -class QPushButton; -class QListView; -class QListViewItem; -class QTimeEdit; +#include <tqvariant.h> +#include <tqwidget.h> + +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQGroupBox; +class TQLabel; +class TQComboBox; +class TQButtonGroup; +class TQPushButton; +class TQListView; +class TQListViewItem; +class TQTimeEdit; namespace KPlato { class CalendarPanel; -class CalendarEditBase : public QWidget +class CalendarEditBase : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CalendarEditBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + CalendarEditBase( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~CalendarEditBase(); - QGroupBox* groupBox2; + TQGroupBox* groupBox2; CalendarPanel* calendarPanel; - QButtonGroup* day; - QComboBox* state; - QPushButton* bApply; - QGroupBox* groupBox4; - QListView* intervalList; - QTimeEdit* startTime; - QTimeEdit* endTime; - QPushButton* bClear; - QPushButton* bAddInterval; + TQButtonGroup* day; + TQComboBox* state; + TQPushButton* bApply; + TQGroupBox* groupBox4; + TQListView* intervalList; + TQTimeEdit* startTime; + TQTimeEdit* endTime; + TQPushButton* bClear; + TQPushButton* bAddInterval; protected: - QHBoxLayout* CalendarEditBaseLayout; - QGridLayout* groupBox2Layout; - QHBoxLayout* layout10; - QVBoxLayout* dayLayout; - QHBoxLayout* layout8; - QVBoxLayout* groupBox4Layout; - QHBoxLayout* layout6; - QHBoxLayout* layout5; + TQHBoxLayout* CalendarEditBaseLayout; + TQGridLayout* groupBox2Layout; + TQHBoxLayout* tqlayout10; + TQVBoxLayout* dayLayout; + TQHBoxLayout* tqlayout8; + TQVBoxLayout* groupBox4Layout; + TQHBoxLayout* tqlayout6; + TQHBoxLayout* tqlayout5; protected slots: virtual void languageChange(); diff --git a/kplato/kptcalendarlistdialog.cc b/kplato/kptcalendarlistdialog.cc index a319c616..5fe590ec 100644 --- a/kplato/kptcalendarlistdialog.cc +++ b/kplato/kptcalendarlistdialog.cc @@ -23,16 +23,16 @@ #include "kptcommand.h" #include "kptpart.h" -#include <qpushbutton.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qtextedit.h> -#include <qlineedit.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qtabwidget.h> -#include <qtextbrowser.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqtextedit.h> +#include <tqlineedit.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqtabwidget.h> +#include <tqtextbrowser.h> #include <klocale.h> @@ -47,7 +47,7 @@ namespace KPlato class CalendarListViewItem : public KListViewItem { public: - CalendarListViewItem(CalendarListDialogImpl &pan, QListView *lv, Calendar *cal, Calendar *orig=0) + CalendarListViewItem(CalendarListDialogImpl &pan, TQListView *lv, Calendar *cal, Calendar *orig=0) : KListViewItem(lv, cal->name()), panel(pan) { calendar = cal; @@ -87,14 +87,14 @@ public: macro->addCommand(new CalendarModifyNameCmd(part, original, calendar->name())); } Calendar *c = base ? base->baseCalendar() : 0; - if (c != original->parent()) { + if (c != original->tqparent()) { if (macro == 0) macro = new KMacroCommand(""); macro->addCommand(new CalendarModifyParentCmd(part, original, c)); //kdDebug()<<k_funcinfo<<"Base modified: "<<c->name()<<endl; } //kdDebug()<<k_funcinfo<<"Check for days deleted: "<<calendar->name()<<endl; - QPtrListIterator<CalendarDay> oit = original->days(); + TQPtrListIterator<CalendarDay> oit = original->days(); for (; oit.current(); ++oit) { if (calendar->findDay(oit.current()->date()) == 0) { if (macro == 0) macro = new KMacroCommand(""); @@ -104,7 +104,7 @@ public: } //kdDebug()<<k_funcinfo<<"Check for days added or modified: "<<calendar->name()<<endl; - QPtrListIterator<CalendarDay> cit = calendar->days(); + TQPtrListIterator<CalendarDay> cit = calendar->days(); for (; cit.current(); ++cit) { CalendarDay *day = original->findDay(cit.current()->date()); if (day == 0) { @@ -146,7 +146,7 @@ public: Calendar *original; CalendarListViewItem* base; CalendarListDialogImpl &panel; - QString oldText; + TQString oldText; protected: virtual void cancelRename(int col) { @@ -163,14 +163,14 @@ private: }; //---------------------------------------------------- -CalendarListDialog::CalendarListDialog(Project &p, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Calendar's Settings"), Ok|Cancel, Ok, parent, name, true, true), +CalendarListDialog::CalendarListDialog(Project &p, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Calendar's Settings"), Ok|Cancel, Ok, tqparent, name, true, true), project(p) { //kdDebug()<<k_funcinfo<<&p<<endl; dia = new CalendarListDialogImpl(p, this); - QPtrList<Calendar> list = p.calendars(); - QPtrListIterator<Calendar> it = list; + TQPtrList<Calendar> list = p.calendars(); + TQPtrListIterator<Calendar> it = list; for (; it.current(); ++it) { Calendar *c = new Calendar(it.current()); //c->setProject(&p); @@ -178,23 +178,23 @@ CalendarListDialog::CalendarListDialog(Project &p, QWidget *parent, const char * } dia->setBaseCalendars(); - QListViewItem *f = dia->calendarList->firstChild(); + TQListViewItem *f = dia->calendarList->firstChild(); if (f) { dia->calendarList->setSelected(f, true); } - //kdDebug()<<"size="<<size().width()<<"x"<<size().height()<<" hint="<<sizeHint().width()<<"x"<<sizeHint().height()<<endl; - resize(QSize(725, 388).expandedTo(minimumSizeHint())); + //kdDebug()<<"size="<<size().width()<<"x"<<size().height()<<" hint="<<tqsizeHint().width()<<"x"<<tqsizeHint().height()<<endl; + resize(TQSize(725, 388).expandedTo(tqminimumSizeHint())); setMainWidget(dia); enableButtonOK(false); - connect(dia, SIGNAL(enableButtonOk(bool)), SLOT(enableButtonOK(bool))); + connect(dia, TQT_SIGNAL(enableButtonOk(bool)), TQT_SLOT(enableButtonOK(bool))); } KCommand *CalendarListDialog::buildCommand(Part *part) { //kdDebug()<<k_funcinfo<<endl; KMacroCommand *cmd = 0; - QListViewItemIterator cit(dia->calendarList); + TQListViewItemIterator cit(dia->calendarList); for (;cit.current(); ++cit) { CalendarListViewItem *item = dynamic_cast<CalendarListViewItem *>(cit.current()); if (item) { @@ -205,7 +205,7 @@ KCommand *CalendarListDialog::buildCommand(Part *part) { } } } - QPtrListIterator<CalendarListViewItem> it = dia->deletedItems(); + TQPtrListIterator<CalendarListViewItem> it = dia->deletedItems(); for (; it.current(); ++it) { //kdDebug()<<k_funcinfo<<"deleted: "<<it.current()->calendar->name()<<endl; if (it.current()->original) { @@ -224,46 +224,46 @@ void CalendarListDialog::slotOk() { } //-------------------------------------------------- -CalendarListDialogImpl::CalendarListDialogImpl (Project &p, QWidget *parent) - : CalendarListDialogBase(parent), +CalendarListDialogImpl::CalendarListDialogImpl (Project &p, TQWidget *tqparent) + : CalendarListDialogBase(tqparent), project(p), m_renameItem(0) { calendarList->header()->setStretchEnabled(true, 0); calendarList->setShowSortIndicator(true); calendarList->setSorting(0); - calendarList->setDefaultRenameAction(QListView::Accept); + calendarList->setDefaultRenameAction(TQListView::Accept); m_deletedItems.setAutoDelete(true); calendar->setEnabled(false); slotSelectionChanged(); - connect(calendar, SIGNAL(obligatedFieldsFilled(bool)), SLOT(slotEnableButtonOk(bool))); - connect(calendar, SIGNAL(applyClicked()), SLOT(slotCalendarModified())); + connect(calendar, TQT_SIGNAL(obligatedFieldsFilled(bool)), TQT_SLOT(slotEnableButtonOk(bool))); + connect(calendar, TQT_SIGNAL(applyClicked()), TQT_SLOT(slotCalendarModified())); - connect(bDelete, SIGNAL(clicked()), SLOT(slotDeleteClicked())); - connect(bAdd, SIGNAL(clicked()), SLOT(slotAddClicked())); - //connect(editName, SIGNAL(returnPressed()), SLOT(slotAddClicked())); + connect(bDelete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteClicked())); + connect(bAdd, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddClicked())); + //connect(editName, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotAddClicked())); - connect(calendarList, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); - connect(calendarList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(slotListDoubleClicked(QListViewItem*, const QPoint&, int))); - connect(calendarList, SIGNAL(itemRenamed(QListViewItem*, int)), SLOT(slotItemRenamed(QListViewItem*, int))); + connect(calendarList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); + connect(calendarList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), TQT_SLOT(slotListDoubleClicked(TQListViewItem*, const TQPoint&, int))); + connect(calendarList, TQT_SIGNAL(itemRenamed(TQListViewItem*, int)), TQT_SLOT(slotItemRenamed(TQListViewItem*, int))); - connect (baseCalendar, SIGNAL(activated(int)), SLOT(slotBaseCalendarActivated(int))); + connect (baseCalendar, TQT_SIGNAL(activated(int)), TQT_SLOT(slotBaseCalendarActivated(int))); // Internal rename stuff - connect(this, SIGNAL(renameStarted(QListViewItem*, int)), SLOT(slotRenameStarted(QListViewItem*, int))); - connect(this, SIGNAL(startRename(QListViewItem*, int)), SLOT(slotStartRename(QListViewItem*, int))); - connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); + connect(this, TQT_SIGNAL(renameStarted(TQListViewItem*, int)), TQT_SLOT(slotRenameStarted(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(startRename(TQListViewItem*, int)), TQT_SLOT(slotStartRename(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); } void CalendarListDialogImpl::setBaseCalendars() { - QListViewItemIterator it(calendarList); + TQListViewItemIterator it(calendarList); for (;it.current(); ++it) { CalendarListViewItem *item = dynamic_cast<CalendarListViewItem *>(it.current()); if (item) { - item->base = findItem(item->calendar->parent()); + item->base = findItem(item->calendar->tqparent()); } } } @@ -285,13 +285,13 @@ void CalendarListDialogImpl::slotBaseCalendarActivated(int id) { void CalendarListDialogImpl::slotSelectionChanged() { //kdDebug()<<k_funcinfo<<endl; - QListViewItem *item = calendarList->selectedItem(); + TQListViewItem *item = calendarList->selectedItem(); bDelete->setEnabled((bool)item); bAdd->setEnabled(true); slotSelectionChanged(item); } -void CalendarListDialogImpl::slotSelectionChanged(QListViewItem *listItem) { +void CalendarListDialogImpl::slotSelectionChanged(TQListViewItem *listItem) { //kdDebug()<<k_funcinfo<<endl; baseCalendarList.clear(); baseCalendar->clear(); @@ -302,7 +302,7 @@ void CalendarListDialogImpl::slotSelectionChanged(QListViewItem *listItem) { baseCalendar->insertItem(i18n("None")); baseCalendarList.append(0); int me = 0, i = 0; - QListViewItemIterator it(calendarList); + TQListViewItemIterator it(calendarList); for (; it.current(); ++it) { CalendarListViewItem *item = dynamic_cast<CalendarListViewItem*>(it.current()); if (item && cal != item && !item->hasBaseCalendar(cal)) { @@ -311,7 +311,7 @@ void CalendarListDialogImpl::slotSelectionChanged(QListViewItem *listItem) { i++; if (item == cal->base) { me = i; - //kdDebug()<<k_funcinfo<<"item="<<item<<": cal="<<cal->calendar->name()<<" has parent "<<cal->base->calendar->name()<<endl; + //kdDebug()<<k_funcinfo<<"item="<<item<<": cal="<<cal->calendar->name()<<" has tqparent "<<cal->base->calendar->name()<<endl; } } } @@ -352,18 +352,18 @@ void CalendarListDialogImpl::slotAddClicked() { CalendarListViewItem *item = new CalendarListViewItem(*this, calendarList, cal); item->setState(CalendarListViewItem::New); - slotListDoubleClicked(item, QPoint(), 0); + slotListDoubleClicked(item, TQPoint(), 0); } -QPtrList<CalendarListViewItem> &CalendarListDialogImpl::deletedItems() { +TQPtrList<CalendarListViewItem> &CalendarListDialogImpl::deletedItems() { return m_deletedItems; } CalendarListViewItem *CalendarListDialogImpl::findItem(Calendar *cal) { if (!cal) return 0; - QListViewItemIterator it(calendarList); + TQListViewItemIterator it(calendarList); for (;it.current(); ++it) { CalendarListViewItem *item = dynamic_cast<CalendarListViewItem *>(it.current()); if (item && (cal == item->original || cal == item->calendar)) { @@ -374,7 +374,7 @@ CalendarListViewItem *CalendarListDialogImpl::findItem(Calendar *cal) { return 0; } -void CalendarListDialogImpl::slotItemRenamed(QListViewItem *itm, int col) { +void CalendarListDialogImpl::slotItemRenamed(TQListViewItem *itm, int col) { //kdDebug()<<k_funcinfo<<itm->text(0)<<endl; itm->setRenameEnabled(col, false); m_renameItem = 0; @@ -397,20 +397,20 @@ void CalendarListDialogImpl::slotItemRenamed(QListViewItem *itm, int col) { } // We don't get notified when rename is cancelled, this is called from the item -void CalendarListDialogImpl::renameStopped(QListViewItem */*item*/) { +void CalendarListDialogImpl::renameStopped(TQListViewItem */*item*/) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; m_renameItem = 0; emit selectionChanged(); } -void CalendarListDialogImpl::slotListDoubleClicked(QListViewItem *item, const QPoint&, int col) { +void CalendarListDialogImpl::slotListDoubleClicked(TQListViewItem *item, const TQPoint&, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (m_renameItem) return; slotStartRename(item, col); } -void CalendarListDialogImpl::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { +void CalendarListDialogImpl::slotRenameStarted(TQListViewItem */*item*/, int /*col*/) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (calendarList->isRenaming()) { bDelete->setEnabled(false); @@ -418,7 +418,7 @@ void CalendarListDialogImpl::slotRenameStarted(QListViewItem */*item*/, int /*co } } -void CalendarListDialogImpl::slotStartRename(QListViewItem *item, int col) { +void CalendarListDialogImpl::slotStartRename(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; static_cast<CalendarListViewItem*>(item)->oldText = item->text(col); item->setRenameEnabled(col, true); diff --git a/kplato/kptcalendarlistdialog.h b/kplato/kptcalendarlistdialog.h index 0f9bf01d..32756371 100644 --- a/kplato/kptcalendarlistdialog.h +++ b/kplato/kptcalendarlistdialog.h @@ -26,7 +26,7 @@ #include <kdialogbase.h> -#include <qstring.h> +#include <tqstring.h> class KCommand; @@ -39,21 +39,22 @@ class Part; class CalendarListDialogImpl : public CalendarListDialogBase { Q_OBJECT + TQ_OBJECT public: - CalendarListDialogImpl(Project &project, QWidget *parent); + CalendarListDialogImpl(Project &project, TQWidget *tqparent); void setBaseCalendars(); Calendar *getCalendar() { return calendar->getCalendar(); } void setCalendar(Calendar *cal); - QPtrList<CalendarListViewItem> &deletedItems(); + TQPtrList<CalendarListViewItem> &deletedItems(); - void renameStopped(QListViewItem *item); + void renameStopped(TQListViewItem *item); public slots: void slotSelectionChanged(); - void slotSelectionChanged(QListViewItem *listItem); + void slotSelectionChanged(TQListViewItem *listItem); private slots: void slotBaseCalendarActivated(int id); @@ -61,10 +62,10 @@ private slots: void slotDeleteClicked(); void slotAddClicked(); void slotEnableButtonOk(bool on); - void slotItemRenamed(QListViewItem *item, int col); - void slotListDoubleClicked(QListViewItem *item, const QPoint&, int col); - void slotStartRename(QListViewItem *item, int col); - void slotRenameStarted(QListViewItem *item, int col); + void slotItemRenamed(TQListViewItem *item, int col); + void slotListDoubleClicked(TQListViewItem *item, const TQPoint&, int col); + void slotStartRename(TQListViewItem *item, int col); + void slotRenameStarted(TQListViewItem *item, int col); signals: void obligatedFieldsFilled(bool yes); @@ -73,8 +74,8 @@ signals: void enableButtonOk(bool on); //internal - void renameStarted(QListViewItem *, int); - void startRename(QListViewItem *item, int col); + void renameStarted(TQListViewItem *, int); + void startRename(TQListViewItem *item, int col); void selectionChanged(); protected: @@ -82,15 +83,16 @@ protected: private: Project &project; - QPtrList<CalendarListViewItem> m_deletedItems; - QPtrList<CalendarListViewItem> baseCalendarList; - QListViewItem *m_renameItem; + TQPtrList<CalendarListViewItem> m_deletedItems; + TQPtrList<CalendarListViewItem> baseCalendarList; + TQListViewItem *m_renameItem; }; class CalendarListDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - CalendarListDialog(Project &project, QWidget *parent=0, const char *name=0); + CalendarListDialog(Project &project, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptcalendarlistdialogbase.cc b/kplato/kptcalendarlistdialogbase.cc index acac2637..b7207f82 100644 --- a/kplato/kptcalendarlistdialogbase.cc +++ b/kplato/kptcalendarlistdialogbase.cc @@ -20,19 +20,19 @@ #include "kptcalendarlistdialogbase.h" #include "kptcalendaredit.h" -#include <qvariant.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qheader.h> -#include <qlistview.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qtable.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqvariant.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqlistview.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqtable.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <klocale.h> #include <kdebug.h> @@ -40,13 +40,13 @@ namespace KPlato { -CalendarListDialogBase::CalendarListDialogBase( QWidget* parent, const char* name, WFlags fl ) - : CalendarListPanel( parent, name, fl ) +CalendarListDialogBase::CalendarListDialogBase( TQWidget* tqparent, const char* name, WFlags fl ) + : CalendarListPanel( tqparent, name, fl ) { if ( !name ) setName( "CalendarListDialogBase" ); - QVBoxLayout *l = new QVBoxLayout(calendarBox); + TQVBoxLayout *l = new TQVBoxLayout(calendarBox); calendar = new CalendarEdit(calendarBox); l->addWidget(calendar); } diff --git a/kplato/kptcalendarlistdialogbase.h b/kplato/kptcalendarlistdialogbase.h index 25119f68..82cf9052 100644 --- a/kplato/kptcalendarlistdialogbase.h +++ b/kplato/kptcalendarlistdialogbase.h @@ -23,18 +23,18 @@ #include "kptcalendarlistpanel.h" -#include <qvariant.h> -#include <qwidget.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; -class QLineEdit; -class QPushButton; -class QComboBox; -class QLabel; +#include <tqvariant.h> +#include <tqwidget.h> + +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQListView; +class TQListViewItem; +class TQLineEdit; +class TQPushButton; +class TQComboBox; +class TQLabel; namespace KPlato { @@ -44,8 +44,9 @@ class CalendarEdit; class CalendarListDialogBase : public CalendarListPanel { Q_OBJECT + TQ_OBJECT public: - CalendarListDialogBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + CalendarListDialogBase( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); CalendarEdit* calendar; diff --git a/kplato/kptcalendarlistpanel.ui b/kplato/kptcalendarlistpanel.ui index 94efb1f4..32ef8452 100644 --- a/kplato/kptcalendarlistpanel.ui +++ b/kplato/kptcalendarlistpanel.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::CalendarListPanel</class> <author>Dag Andersen danders@get2net.dk</author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>CalendarListPanel</cstring> </property> @@ -23,15 +23,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton" row="1" column="1"> + <widget class="TQPushButton" row="1" column="1"> <property name="name"> <cstring>bDelete</cstring> </property> @@ -39,7 +39,7 @@ <string>Remove</string> </property> </widget> - <widget class="QPushButton" row="1" column="0"> + <widget class="TQPushButton" row="1" column="0"> <property name="name"> <cstring>bAdd</cstring> </property> @@ -65,23 +65,23 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -89,14 +89,14 @@ <string>Parent calendar:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>baseCalendar</cstring> </property> </widget> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>calendarBox</cstring> </property> @@ -122,7 +122,7 @@ <tabstop>bDelete</tabstop> <tabstop>baseCalendar</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> </includehints> diff --git a/kplato/kptcalendarpanel.cc b/kplato/kptcalendarpanel.cc index 2090699c..6dfba278 100644 --- a/kplato/kptcalendarpanel.cc +++ b/kplato/kptcalendarpanel.cc @@ -31,15 +31,15 @@ #include <klocale.h> #include <kcalendarsystem.h> #include <kiconloader.h> -#include <qframe.h> -#include <qpainter.h> -#include <qdialog.h> -#include <qstyle.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qfont.h> +#include <tqframe.h> +#include <tqpainter.h> +#include <tqdialog.h> +#include <tqstyle.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqfont.h> #include <klineedit.h> -#include <qvalidator.h> +#include <tqvalidator.h> #include <kdebug.h> #include <knotifyclient.h> @@ -51,70 +51,70 @@ class CalendarPanel::CalendarPanelPrivate public: CalendarPanelPrivate() : closeButton(0L), selectWeek(0L) {} - QToolButton *closeButton; - QToolButton *selectWeek; + TQToolButton *closeButton; + TQToolButton *selectWeek; }; -CalendarPanel::CalendarPanel(QWidget *parent, QDate dt, const char *name, WFlags f) - : QFrame(parent,name, f) +CalendarPanel::CalendarPanel(TQWidget *tqparent, TQDate dt, const char *name, WFlags f) + : TQFrame(tqparent,name, f) { init( dt ); } -CalendarPanel::CalendarPanel( QWidget *parent, const char *name ) - : QFrame(parent,name) +CalendarPanel::CalendarPanel( TQWidget *tqparent, const char *name ) + : TQFrame(tqparent,name) { - init( QDate::currentDate() ); + init( TQDate::tqcurrentDate() ); } -void CalendarPanel::init( const QDate &dt ) +void CalendarPanel::init( const TQDate &dt ) { - yearForward = new QToolButton(this); - yearBackward = new QToolButton(this); - monthForward = new QToolButton(this); - monthBackward = new QToolButton(this); - selectMonth = new QToolButton(this); - selectYear = new QToolButton(this); + yearForward = new TQToolButton(this); + yearBackward = new TQToolButton(this); + monthForward = new TQToolButton(this); + monthBackward = new TQToolButton(this); + selectMonth = new TQToolButton(this); + selectYear = new TQToolButton(this); line = new KLineEdit(this); val = new DateValidator(this); table = new DateTable(this, dt, "Calendar table", 0); fontsize = 10; d = new CalendarPanelPrivate(); - d->selectWeek = new QToolButton( this ); + d->selectWeek = new TQToolButton( this ); - QToolTip::add(yearForward, i18n("Next year")); - QToolTip::add(yearBackward, i18n("Previous year")); - QToolTip::add(monthForward, i18n("Next month")); - QToolTip::add(monthBackward, i18n("Previous month")); - QToolTip::add(d->selectWeek, i18n("Select a week")); - QToolTip::add(selectMonth, i18n("Select a month")); - QToolTip::add(selectYear, i18n("Select a year")); + TQToolTip::add(yearForward, i18n("Next year")); + TQToolTip::add(yearBackward, i18n("Previous year")); + TQToolTip::add(monthForward, i18n("Next month")); + TQToolTip::add(monthBackward, i18n("Previous month")); + TQToolTip::add(d->selectWeek, i18n("Select a week")); + TQToolTip::add(selectMonth, i18n("Select a month")); + TQToolTip::add(selectYear, i18n("Select a year")); // ----- setFontSize(10); line->setValidator(val); line->installEventFilter( this ); - yearForward->setPixmap(BarIcon(QString::fromLatin1("2rightarrow"))); - yearBackward->setPixmap(BarIcon(QString::fromLatin1("2leftarrow"))); - monthForward->setPixmap(BarIcon(QString::fromLatin1("1rightarrow"))); - monthBackward->setPixmap(BarIcon(QString::fromLatin1("1leftarrow"))); + yearForward->setPixmap(BarIcon(TQString::tqfromLatin1("2rightarrow"))); + yearBackward->setPixmap(BarIcon(TQString::tqfromLatin1("2leftarrow"))); + monthForward->setPixmap(BarIcon(TQString::tqfromLatin1("1rightarrow"))); + monthBackward->setPixmap(BarIcon(TQString::tqfromLatin1("1leftarrow"))); setDate(dt); // set button texts - connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); - connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); - connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); - connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); - connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); - connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); - connect(d->selectWeek, SIGNAL(clicked()), SLOT(selectWeekClicked())); - connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); - connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); - connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); - - connect(table, SIGNAL(weekdaySelected(int)), SLOT(slotWeekdaySelected(int))); - connect(table, SIGNAL(weekSelected(int, int)), SLOT(slotWeekSelected(int, int))); - connect(table, SIGNAL(selectionCleared()), SLOT(slotSelectionCleared())); + connect(table, TQT_SIGNAL(dateChanged(TQDate)), TQT_SLOT(dateChangedSlot(TQDate))); + connect(table, TQT_SIGNAL(tableClicked()), TQT_SLOT(tableClickedSlot())); + connect(monthForward, TQT_SIGNAL(clicked()), TQT_SLOT(monthForwardClicked())); + connect(monthBackward, TQT_SIGNAL(clicked()), TQT_SLOT(monthBackwardClicked())); + connect(yearForward, TQT_SIGNAL(clicked()), TQT_SLOT(yearForwardClicked())); + connect(yearBackward, TQT_SIGNAL(clicked()), TQT_SLOT(yearBackwardClicked())); + connect(d->selectWeek, TQT_SIGNAL(clicked()), TQT_SLOT(selectWeekClicked())); + connect(selectMonth, TQT_SIGNAL(clicked()), TQT_SLOT(selectMonthClicked())); + connect(selectYear, TQT_SIGNAL(clicked()), TQT_SLOT(selectYearClicked())); + connect(line, TQT_SIGNAL(returnPressed()), TQT_SLOT(lineEnterPressed())); + + connect(table, TQT_SIGNAL(weekdaySelected(int)), TQT_SLOT(slotWeekdaySelected(int))); + connect(table, TQT_SIGNAL(weekSelected(int, int)), TQT_SLOT(slotWeekSelected(int, int))); + connect(table, TQT_SIGNAL(selectionCleared()), TQT_SLOT(slotSelectionCleared())); table->setFocus(); } @@ -125,28 +125,28 @@ CalendarPanel::~CalendarPanel() } bool -CalendarPanel::eventFilter(QObject *o, QEvent *e ) +CalendarPanel::eventFilter(TQObject *o, TQEvent *e ) { - if ( e->type() == QEvent::KeyPress ) { - QKeyEvent *k = (QKeyEvent *)e; + if ( e->type() == TQEvent::KeyPress ) { + TQKeyEvent *k = (TQKeyEvent *)e; - if ( (k->key() == Qt::Key_Prior) || - (k->key() == Qt::Key_Next) || - (k->key() == Qt::Key_Up) || - (k->key() == Qt::Key_Down) ) + if ( (k->key() == TQt::Key_Prior) || + (k->key() == TQt::Key_Next) || + (k->key() == TQt::Key_Up) || + (k->key() == TQt::Key_Down) ) { - QApplication::sendEvent( table, e ); + TQApplication::sendEvent( table, e ); table->setFocus(); return TRUE; // eat event } } - return QFrame::eventFilter( o, e ); + return TQFrame::eventFilter( o, e ); } void -CalendarPanel::resizeEvent(QResizeEvent*) +CalendarPanel::resizeEvent(TQResizeEvent*) { - QWidget *buttons[] = { + TQWidget *buttons[] = { yearBackward, monthBackward, selectMonth, @@ -156,7 +156,7 @@ CalendarPanel::resizeEvent(QResizeEvent*) d->closeButton }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); - QSize sizes[NoOfButtons]; + TQSize sizes[NoOfButtons]; int buttonHeight=0; int count; int w=0; @@ -164,18 +164,18 @@ CalendarPanel::resizeEvent(QResizeEvent*) // ----- calculate button row height: for(count=0; count<NoOfButtons; ++count) { if ( buttons[count] ) { // closeButton may be 0L - sizes[count]=buttons[count]->sizeHint(); - buttonHeight=QMAX(buttonHeight, sizes[count].height()); + sizes[count]=buttons[count]->tqsizeHint(); + buttonHeight=TQMAX(buttonHeight, sizes[count].height()); } else - sizes[count] = QSize(0,0); // closeButton + sizes[count] = TQSize(0,0); // closeButton } // ----- calculate size of the month button: for(count=0; count<NoOfButtons; ++count) { if(buttons[count]==selectMonth) { - QSize metricBound = style().sizeFromContents(QStyle::CT_ToolButton, selectMonth, maxMonthRect); - sizes[count].setWidth(QMAX(metricBound.width(), maxMonthRect.width()+2*QApplication::style().pixelMetric(QStyle::PM_ButtonMargin))); + TQSize metricBound = tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); + sizes[count].setWidth(TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin))); } } // ----- center buttons @@ -184,7 +184,7 @@ CalendarPanel::resizeEvent(QResizeEvent*) { w +=sizes[count].width(); } - x = (QMAX(w, width())-w)/2; + x = (TQMAX(w, width())-w)/2; // ----- place the buttons: for(count=0; count<NoOfButtons; ++count) @@ -195,7 +195,7 @@ CalendarPanel::resizeEvent(QResizeEvent*) x+=w; } // ----- place the line edit for direct input: - sizes[0]=line->sizeHint(); + sizes[0]=line->tqsizeHint(); int week_width=d->selectWeek->fontMetrics().width(i18n("Week XX"))+((d->closeButton != 0L) ? 50 : 20); line->setGeometry(0, height()-sizes[0].height(), width()-week_width, sizes[0].height()); d->selectWeek->setGeometry(width()-week_width, height()-sizes[0].height(), week_width, sizes[0].height()); @@ -205,11 +205,11 @@ CalendarPanel::resizeEvent(QResizeEvent*) } void -CalendarPanel::dateChangedSlot(QDate date) +CalendarPanel::dateChangedSlot(TQDate date) { //kdDebug() << "CalendarPanel::dateChangedSlot: date changed (" << date.year() << "/" << date.month() << "/" << date.day() << ")." << endl; line->setText(KGlobal::locale()->formatDate(date, true)); - d->selectWeek->setText(i18n("Week %1").arg(weekOfYear(date))); + d->selectWeek->setText(i18n("Week %1").tqarg(weekOfYear(date))); selectMonth->setText(KGlobal::locale()->calendar()->monthName(date.month(), false)); selectYear->setText(date.toString("yyyy")); emit(dateChanged(date)); @@ -223,26 +223,26 @@ CalendarPanel::tableClickedSlot() emit(tableClicked()); } -const QDate& +const TQDate& CalendarPanel::getDate() const { return table->getDate(); } -const QDate & +const TQDate & CalendarPanel::date() const { return table->getDate(); } bool -CalendarPanel::setDate(const QDate& date) +CalendarPanel::setDate(const TQDate& date) { if(date.isValid()) { - QString temp; + TQString temp; // ----- table->setDate(date); - d->selectWeek->setText(i18n("Week %1").arg(weekOfYear(date))); + d->selectWeek->setText(i18n("Week %1").tqarg(weekOfYear(date))); selectMonth->setText(KGlobal::locale()->calendar()->monthName(date.month(), false)); temp.setNum(date.year()); selectYear->setText(temp); @@ -285,13 +285,13 @@ CalendarPanel::selectWeekClicked() PopupFrame* popup = new PopupFrame(this); DateInternalWeekSelector* picker = new DateInternalWeekSelector(fontsize, popup); // ----- - picker->resize(picker->sizeHint()); + picker->resize(picker->tqsizeHint()); popup->setMainWidget(picker); - connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); + connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); - if(popup->exec(d->selectWeek->mapToGlobal(QPoint(0, d->selectWeek->height())))) + if(popup->exec(d->selectWeek->mapToGlobal(TQPoint(0, d->selectWeek->height())))) { - QDate date; + TQDate date; int year; // ----- week=picker->getWeek(); @@ -322,13 +322,13 @@ CalendarPanel::selectMonthClicked() PopupFrame* popup = new PopupFrame(this); DateInternalMonthPicker* picker = new DateInternalMonthPicker(fontsize, popup); // ----- - picker->resize(picker->sizeHint()); + picker->resize(picker->tqsizeHint()); popup->setMainWidget(picker); picker->setFocus(); - connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); - if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height())))) + connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); + if(popup->exec(selectMonth->mapToGlobal(TQPoint(0, selectMonth->height())))) { - QDate date; + TQDate date; int day; // ----- month=picker->getResult(); @@ -336,7 +336,7 @@ CalendarPanel::selectMonthClicked() day=date.day(); // ----- construct a valid date in this month: date.setYMD(date.year(), month, 1); - date.setYMD(date.year(), month, QMIN(day, date.daysInMonth())); + date.setYMD(date.year(), month, TQMIN(day, date.daysInMonth())); // ----- set this month setDate(date); } else { @@ -352,13 +352,13 @@ CalendarPanel::selectYearClicked() PopupFrame* popup = new PopupFrame(this); DateInternalYearSelector* picker = new DateInternalYearSelector(fontsize, popup); // ----- - picker->resize(picker->sizeHint()); + picker->resize(picker->tqsizeHint()); popup->setMainWidget(picker); - connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); + connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); - if(popup->exec(selectYear->mapToGlobal(QPoint(0, selectMonth->height())))) + if(popup->exec(selectYear->mapToGlobal(TQPoint(0, selectMonth->height())))) { - QDate date; + TQDate date; int day; // ----- year=picker->getYear(); @@ -366,7 +366,7 @@ CalendarPanel::selectYearClicked() day=date.day(); // ----- construct a valid date in this month: date.setYMD(year, date.month(), 1); - date.setYMD(year, date.month(), QMIN(day, date.daysInMonth())); + date.setYMD(year, date.month(), TQMIN(day, date.daysInMonth())); // ----- set this month setDate(date); } else { @@ -378,7 +378,7 @@ CalendarPanel::selectYearClicked() void CalendarPanel::setEnabled(bool enable) { - QWidget *widgets[]= { + TQWidget *widgets[]= { yearForward, yearBackward, monthForward, monthBackward, selectMonth, selectYear, line, table, d->selectWeek }; @@ -395,9 +395,9 @@ CalendarPanel::setEnabled(bool enable) void CalendarPanel::lineEnterPressed() { - QDate temp; + TQDate temp; // ----- - if(val->date(line->text(), temp)==QValidator::Acceptable) + if(val->date(line->text(), temp)==TQValidator::Acceptable) { //kdDebug() << "CalendarPanel::lineEnterPressed: valid date entered." << endl; emit(dateEntered(temp)); @@ -408,11 +408,11 @@ CalendarPanel::lineEnterPressed() } } -QSize -CalendarPanel::sizeHint() const +TQSize +CalendarPanel::tqsizeHint() const { - QSize tableSize=table->sizeHint(); - QWidget *buttons[]={ + TQSize tableSize=table->tqsizeHint(); + TQWidget *buttons[]={ yearBackward, monthBackward, selectMonth, @@ -422,34 +422,34 @@ CalendarPanel::sizeHint() const d->closeButton }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); - QSize sizes[NoOfButtons]; + TQSize sizes[NoOfButtons]; int cx=0, cy=0, count; // ----- store the size hints: for(count=0; count<NoOfButtons; ++count) { if ( buttons[count] ) - sizes[count]=buttons[count]->sizeHint(); + sizes[count]=buttons[count]->tqsizeHint(); else - sizes[count] = QSize(0,0); + sizes[count] = TQSize(0,0); if(buttons[count]==selectMonth) { - QSize metricBound = style().sizeFromContents(QStyle::CT_ToolButton, selectMonth, maxMonthRect); - cx+=QMAX(metricBound.width(), maxMonthRect.width()+2*QApplication::style().pixelMetric(QStyle::PM_ButtonMargin)); + TQSize metricBound = tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); + cx+=TQMAX(metricBound.width(), maxMonthRect.width()+2*TQApplication::tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin)); } else { cx+=sizes[count].width(); } - cy=QMAX(sizes[count].height(), cy); + cy=TQMAX(sizes[count].height(), cy); } // ----- calculate width hint: - cx=QMAX(cx, tableSize.width()); // line edit ignored + cx=TQMAX(cx, tableSize.width()); // line edit ignored // ----- calculate height hint: - cy+=tableSize.height()+line->sizeHint().height(); - return QSize(cx, cy); + cy+=tableSize.height()+line->tqsizeHint().height(); + return TQSize(cx, cy); } void CalendarPanel::setFontSize(int s) { - QWidget *buttons[]= { + TQWidget *buttons[]= { // yearBackward, // monthBackward, selectMonth, @@ -459,8 +459,8 @@ CalendarPanel::setFontSize(int s) }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); int count; - QFont font; - QRect r; + TQFont font; + TQRect r; // ----- fontsize=s; for(count=0; count<NoOfButtons; ++count) @@ -469,12 +469,12 @@ CalendarPanel::setFontSize(int s) font.setPointSize(s); buttons[count]->setFont(font); } - QFontMetrics metrics(selectMonth->fontMetrics()); + TQFontMetrics metrics(selectMonth->fontMetrics()); for(int i=1; i <= 12; ++i) - { // maxMonthRect is used by sizeHint() + { // maxMonthRect is used by tqsizeHint() r=metrics.boundingRect(KGlobal::locale()->calendar()->monthName(i, false)); - maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); - maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); + maxMonthRect.setWidth(TQMAX(r.width(), maxMonthRect.width())); + maxMonthRect.setHeight(TQMAX(r.height(), maxMonthRect.height())); } table->setFontSize(s); } @@ -486,11 +486,11 @@ CalendarPanel::setCloseButton( bool enable ) return; if ( enable ) { - d->closeButton = new QToolButton( this ); - QToolTip::add(d->closeButton, i18n("Close")); + d->closeButton = new TQToolButton( this ); + TQToolTip::add(d->closeButton, i18n("Close")); d->closeButton->setPixmap( SmallIcon("remove") ); - connect( d->closeButton, SIGNAL( clicked() ), - topLevelWidget(), SLOT( close() ) ); + connect( d->closeButton, TQT_SIGNAL( clicked() ), + tqtopLevelWidget(), TQT_SLOT( close() ) ); } else { delete d->closeButton; @@ -505,23 +505,23 @@ bool CalendarPanel::hasCloseButton() const return (d->closeButton != 0L); } -int CalendarPanel::weekOfYear(QDate date) +int CalendarPanel::weekOfYear(TQDate date) { // Calculate ISO 8601 week number (taken from glibc/Gnumeric) int year, week, wday, jan1wday, nextjan1wday; - QDate jan1date, nextjan1date; + TQDate jan1date, nextjan1date; year=date.year(); wday=date.dayOfWeek(); - jan1date=QDate(year,1,1); + jan1date=TQDate(year,1,1); jan1wday=jan1date.dayOfWeek(); week = (date.dayOfYear()-1 + jan1wday-1)/7 + ((jan1wday-1) == 0 ? 1 : 0); /* Does date belong to last week of previous year? */ if ((week == 0) && (jan1wday > 4 /*THURSDAY*/)) { - QDate tmpdate=QDate(year-1,12,31); + TQDate tmpdate=TQDate(year-1,12,31); return weekOfYear(tmpdate); } @@ -529,7 +529,7 @@ int CalendarPanel::weekOfYear(QDate date) week++; if (week == 53) { - nextjan1date=QDate(year+1, 1, 1); + nextjan1date=TQDate(year+1, 1, 1); nextjan1wday = nextjan1date.dayOfWeek(); if (nextjan1wday <= 4 /*THURSDAY*/) week = 1; @@ -553,7 +553,7 @@ void CalendarPanel::setCalendar(Calendar *cal) { table->clear(); if (cal) { table->setMarkedWeekdays(cal->weekdaysMap()); - QPtrListIterator<CalendarDay> it = cal->days(); + TQPtrListIterator<CalendarDay> it = cal->days(); //kdDebug()<<k_funcinfo<<"Days="<<it.count()<<endl; for (; it.current(); ++it) { if (it.current()->state() != Map::None) { diff --git a/kplato/kptcalendarpanel.h b/kplato/kptcalendarpanel.h index ce57e4af..18302ec1 100644 --- a/kplato/kptcalendarpanel.h +++ b/kplato/kptcalendarpanel.h @@ -26,11 +26,11 @@ #include "kptmap.h" -#include <qdatetime.h> -#include <qframe.h> +#include <tqdatetime.h> +#include <tqframe.h> -class QLineEdit; -class QToolButton; +class TQLineEdit; +class TQToolButton; namespace KPlato { @@ -43,23 +43,24 @@ class Calendar; * Provides a widget for calendar input. * **/ -class CalendarPanel: public QFrame +class CalendarPanel: public TQFrame { Q_OBJECT - Q_PROPERTY( QDate date READ date WRITE setDate) - Q_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton ) + TQ_OBJECT + TQ_PROPERTY( TQDate date READ date WRITE setDate) + TQ_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton ) public: /** The usual constructor. The given date will be displayed * initially. **/ - CalendarPanel(QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0, WFlags f=0); + CalendarPanel(TQWidget *tqparent=0, TQDate=TQDate::tqcurrentDate(), const char *name=0, WFlags f=0); /** * Standard qt widget constructor. The initial date will be the * current date. */ - CalendarPanel( QWidget *parent, const char *name ); + CalendarPanel( TQWidget *tqparent, const char *name ); /** * The destructor. @@ -72,27 +73,27 @@ public: * size hint, try adding 28 to each of the reported numbers of * pixels. **/ - QSize sizeHint() const; + TQSize tqsizeHint() const; - QSize minimumSizeHint() const { return sizeHint(); } + TQSize tqminimumSizeHint() const { return tqsizeHint(); } /** * Sets the date. * * @returns @p false and does not change anything * if the date given is invalid. **/ - bool setDate(const QDate&); + bool setDate(const TQDate&); /** * Returns the selected date. * @deprecated **/ - const QDate& getDate() const; + const TQDate& getDate() const; /** * @returns the selected date. */ - const QDate &date() const; + const TQDate &date() const; /** * Enables or disables the widget. @@ -112,7 +113,7 @@ public: /** * By calling this method with @p enable = true, CalendarPanel will show * a little close-button in the upper button-row. Clicking the - * close-button will cause the CalendarPanel's topLevelWidget()'s close() + * close-button will cause the CalendarPanel's tqtopLevelWidget()'s close() * method being called. This is mostly useful for toplevel datepickers * without a window manager decoration. * @see #hasCloseButton @@ -140,33 +141,33 @@ public: void markSelected(int state); protected: - /// to catch move keyEvents when QLineEdit has keyFocus - virtual bool eventFilter(QObject *o, QEvent *e ); + /// to catch move keyEvents when TQLineEdit has keyFocus + virtual bool eventFilter(TQObject *o, TQEvent *e ); /// the resize event - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /// the year forward button - QToolButton *yearForward; + TQToolButton *yearForward; /// the year backward button - QToolButton *yearBackward; + TQToolButton *yearBackward; /// the month forward button - QToolButton *monthForward; + TQToolButton *monthForward; /// the month backward button - QToolButton *monthBackward; + TQToolButton *monthBackward; /// the button for selecting the month directly - QToolButton *selectMonth; + TQToolButton *selectMonth; /// the button for selecting the year directly - QToolButton *selectYear; + TQToolButton *selectYear; /// the line edit to enter the date directly - QLineEdit *line; + TQLineEdit *line; /// the validator for the line edit: DateValidator *val; /// the date table DateTable *table; // the widest month string in pixels: - QSize maxMonthRect; + TQSize maxMonthRect; protected slots: - void dateChangedSlot(QDate); + void dateChangedSlot(TQDate); void tableClickedSlot(); void monthForwardClicked(); void monthBackwardClicked(); @@ -188,17 +189,17 @@ signals: * selected. * @see dateSelected */ - void dateChanged(QDate); + void dateChanged(TQDate); /** This signal is emitted each time a day has been selected by * clicking on the table (hitting a day in the current month). */ - void dateSelected(QDate); + void dateSelected(TQDate); /** This signal is emitted when enter is pressed and a VALID date * has been entered before into the line edit. Connect to both * dateEntered() and dateSelected() to receive all events where the * user really enters a date. */ - void dateEntered(QDate); + void dateEntered(TQDate); /** This signal is emitted when the day has been selected by * clicking on it in the table. */ @@ -220,11 +221,11 @@ private: protected: virtual void virtual_hook( int id, void* data ); private: - void init( const QDate &dt ); + void init( const TQDate &dt ); class CalendarPanelPrivate; CalendarPanelPrivate *d; // calculate ISO 8601 week number - int weekOfYear(QDate); + int weekOfYear(TQDate); }; } //KPlato namespace diff --git a/kplato/kptcanvasitem.cc b/kplato/kptcanvasitem.cc index c2aff602..95bf6888 100644 --- a/kplato/kptcanvasitem.cc +++ b/kplato/kptcanvasitem.cc @@ -24,10 +24,10 @@ #include "kptganttview.h" #include <klocale.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qptrlist.h> -#include <qpoint.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqptrlist.h> +#include <tqpoint.h> #include <kdebug.h> @@ -35,7 +35,7 @@ namespace KPlato { PertNodeItem::PertNodeItem( PertCanvas *view, Node &node, int row, int col ) - : QCanvasPolygon(view->canvas()), + : TQCanvasPolygon(view->canvas()), m_node(node), m_row(row), m_col(col) @@ -46,14 +46,14 @@ PertNodeItem::PertNodeItem( PertCanvas *view, Node &node, int row, int col ) m_width = view->itemSize().width(); m_height = view->itemSize().height(); - m_name = new QCanvasText(node.name(), view->canvas()); + m_name = new TQCanvasText(node.name(), view->canvas()); m_childRelations.setAutoDelete(true); } PertNodeItem::~PertNodeItem() { - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( *it == m_name ) @@ -70,15 +70,15 @@ int PertNodeItem::RTTI = 2000; void PertNodeItem::setVisible(bool yes) { //kdDebug()<<k_funcinfo<<m_node.name()<<endl; - QCanvasPolygon::setVisible(yes); - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasPolygon::tqsetVisible(yes); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( *it == m_name ) - m_name->setVisible(yes); + m_name->tqsetVisible(yes); if ( *it == m_leader ) - m_leader->setVisible(yes); + m_leader->tqsetVisible(yes); } } @@ -88,8 +88,8 @@ void PertNodeItem::move(PertCanvas *view, int row, int col) m_row = row; m_col = col; view->mapNode(this); - // Now map my children - QPtrListIterator<PertNodeRelation> it(m_childRelations); + // Now map my tqchildren + TQPtrListIterator<PertNodeRelation> it(m_childRelations); for (; it.current(); ++it) { view->mapChildNode(this, it.current()->childItem, it.current()->relation->type()); @@ -97,9 +97,9 @@ void PertNodeItem::move(PertCanvas *view, int row, int col) // now move the item on the canvas m_x = x(col); m_y = y(row); - m_left = QPoint(m_x, m_y + m_height/2); - m_right = QPoint(m_x + m_width, m_y + m_height/2); - QCanvasPolygon::move(m_x, m_y); + m_left = TQPoint(m_x, m_y + m_height/2); + m_right = TQPoint(m_x + m_width, m_y + m_height/2); + TQCanvasPolygon::move(m_x, m_y); if (m_name) m_name->move(m_x+5, m_y+2); @@ -107,12 +107,12 @@ void PertNodeItem::move(PertCanvas *view, int row, int col) //kdDebug()<<k_funcinfo<<m_node.name()<<" moved to row,col=("<<m_row<<","<<m_col<<")"<<endl; } -void PertNodeItem::drawShape(QPainter &p) +void PertNodeItem::drawShape(TQPainter &p) { - //QPen pen(pen()); + //TQPen pen(pen()); if (isSelected()) - p.setPen(QPen(Qt::red, 2)); - QPointArray a = poly; + p.setPen(TQPen(TQt::red, 2)); + TQPointArray a = poly; int size = a.size()-1; for(int i = 0; i < size; ++i) { @@ -122,35 +122,35 @@ void PertNodeItem::drawShape(QPainter &p) //setPen(pen); } -QPoint PertNodeItem::exitPoint(Relation::Type type) const +TQPoint PertNodeItem::exitPoint(Relation::Type type) const { - QPoint ret; + TQPoint ret; switch(type) { case Relation::FinishStart: case Relation::FinishFinish: - ret = m_right + QPoint(pen().width(), 0); + ret = m_right + TQPoint(pen().width(), 0); break; case Relation::StartStart: - ret = m_left + QPoint(0, 4); + ret = m_left + TQPoint(0, 4); break; } return ret; } -QPoint PertNodeItem::entryPoint(Relation::Type type) const +TQPoint PertNodeItem::entryPoint(Relation::Type type) const { - QPoint ret; + TQPoint ret; switch(type) { case Relation::FinishStart: - ret = m_left - QPoint(pen().width(), 0); + ret = m_left - TQPoint(pen().width(), 0); break; case Relation::FinishFinish: - ret = m_right - QPoint(pen().width(), 4); + ret = m_right - TQPoint(pen().width(), 4); break; case Relation::StartStart: - ret = m_left - QPoint(pen().width(), 0); + ret = m_left - TQPoint(pen().width(), 0); break; } return ret; @@ -169,12 +169,12 @@ PertProjectItem::PertProjectItem(PertCanvas *view, Node &node, int row, int col) { //kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl; - QPointArray a; + TQPointArray a; a.putPoints(0, 5, m_x+6, m_y, m_x+m_width, m_y, m_x+m_width-6, m_y+m_height, m_x, m_y+m_height, m_x+6, m_y); setPoints(a); - setPen(QPen(Qt::cyan, 2)); + setPen(TQPen(TQt::cyan, 2)); } PertProjectItem::~PertProjectItem() @@ -197,16 +197,16 @@ PertTaskItem::PertTaskItem(PertCanvas *view, Node &node, int row, int col) : PertNodeItem(view, node, row, col) { //kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl; - QPointArray a; + TQPointArray a; if (node.type() == Node::Type_Summarytask) { a.putPoints(0, 5, m_x+6, m_y, m_x+m_width, m_y, m_x+m_width-6, m_y+m_height, m_x, m_y+m_height, m_x+6, m_y); - setPen(QPen(Qt::cyan, 2)); + setPen(TQPen(TQt::cyan, 2)); } else { a.putPoints(0, 5, m_x, m_y, m_x+m_width, m_y, m_x+m_width, m_y+m_height, m_x, m_y+m_height, m_x, m_y); - setPen(QPen(Qt::green, 2)); + setPen(TQPen(TQt::green, 2)); } setPoints(a); @@ -234,7 +234,7 @@ PertMilestoneItem::PertMilestoneItem(PertCanvas *view, Node &node, int row, int { //kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl; - QPointArray a; + TQPointArray a; a.putPoints(0, 7, m_x, m_y+m_height/2, m_x+6, m_y, @@ -246,7 +246,7 @@ PertMilestoneItem::PertMilestoneItem(PertCanvas *view, Node &node, int row, int setPoints(a); - setPen(QPen(Qt::blue, 2)); + setPen(TQPen(TQt::blue, 2)); } PertMilestoneItem::~PertMilestoneItem() @@ -265,16 +265,16 @@ void PertMilestoneItem::printDebug( int /*info*/ ) //////////////////// PertRelationItem ////////////////////////// -PertRelationItem::PertRelationItem( PertCanvas *view, PertNodeItem *parent, PertNodeItem *child, Relation *rel) - : QCanvasPolygon(view->canvas()), +PertRelationItem::PertRelationItem( PertCanvas *view, PertNodeItem *tqparent, PertNodeItem *child, Relation *rel) + : TQCanvasPolygon(view->canvas()), m_view(view), m_rel(rel), - m_parentItem(parent), + m_parentItem(tqparent), m_childItem(child) { - //kdDebug()<<k_funcinfo<<"Parent="<<parent->node().name()<<" Child="<<child->node().name()<<endl; + //kdDebug()<<k_funcinfo<<"Parent="<<tqparent->node().name()<<" Child="<<child->node().name()<<endl; draw(); - setVisible(true); + tqsetVisible(true); } PertRelationItem::~PertRelationItem() @@ -289,24 +289,24 @@ void PertRelationItem::draw() { //kdDebug()<<k_funcinfo<<endl; // Some "rules": - // a) Relation::FinishStart: child column > parent column - // b) Relation::FinishFinish: child column >= parent column - // c) Relation::StartStart: child column >= parent column - // d) Child row can be >= parent row + // a) Relation::FinishStart: child column > tqparent column + // b) Relation::FinishFinish: child column >= tqparent column + // c) Relation::StartStart: child column >= tqparent column + // d) Child row can be >= tqparent row wgap = m_view->verticalGap(); hgap = m_view->horizontalGap(); // could not use ...rect() here, don't know why - parentTop = (int)(m_parentItem->y()); - parentBottom = parentTop + (int)(m_parentItem->height()); + tqparentTop = (int)(m_parentItem->y()); + tqparentBottom = tqparentTop + (int)(m_parentItem->height()); childTop = (int)(m_childItem->y()); childRow = m_childItem->row(); childCol = m_childItem->column(); - parentRow = m_parentItem->row(); - parentCol = m_parentItem->column(); - //kdDebug()<<k_funcinfo<<"Parent="<<m_parentItem->node().name()<<" ("<<parentRow<<","<<parentCol<<") Child="<<m_childItem->node().name()<<" ("<<childRow<<","<<childCol<<")"<<endl; + tqparentRow = m_parentItem->row(); + tqparentCol = m_parentItem->column(); + //kdDebug()<<k_funcinfo<<"Parent="<<m_parentItem->node().name()<<" ("<<tqparentRow<<","<<tqparentCol<<") Child="<<m_childItem->node().name()<<" ("<<childRow<<","<<childCol<<")"<<endl; switch (type()) { @@ -320,25 +320,25 @@ void PertRelationItem::draw() setStartStartPoints(); break; } - QPointArray a = poly; + TQPointArray a = poly; left = right = a[0].x(); top = bottom = a[0].y(); for (uint i = 0; i < a.size(); i++) { - left = QMIN(a[i].x(), left); - top = QMIN(a[i].y(), top); - right = QMAX(a[i].x(), right); - bottom = QMAX(a[i].y(), bottom); + left = TQMIN(a[i].x(), left); + top = TQMIN(a[i].y(), top); + right = TQMAX(a[i].x(), right); + bottom = TQMAX(a[i].y(), bottom); } top -= 3; bottom += 3; - setPen(Qt::black); + setPen(TQt::black); setZ(45); /*#ifndef NDEBUG - kdDebug()<<" PertNodeRelation from parent: "<<m_rel->parent()->name()<<" to child: "<<m_rel->child()->name()<<endl; - QPointArray pa = poly; + kdDebug()<<" PertNodeRelation from tqparent: "<<m_rel->tqparent()->name()<<" to child: "<<m_rel->child()->name()<<endl; + TQPointArray pa = poly; for (int i = 0; i < pa.size(); ++i) kdDebug()<<" pa["<<i<<"]="<<pa[i].x()<<","<<pa[i].y()<<endl; #endif*/ @@ -347,76 +347,76 @@ void PertRelationItem::draw() void PertRelationItem::setFinishStartPoints() { - QPoint parentPoint = m_parentItem->exitPoint(Relation::FinishStart); - QPoint childPoint = m_childItem->entryPoint(Relation::FinishStart); + TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::FinishStart); + TQPoint childPoint = m_childItem->entryPoint(Relation::FinishStart); - QPointArray a; - a.putPoints(0, 1, parentPoint.x(), parentPoint.y()); + TQPointArray a; + a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y()); - if ( parentRow == childRow ) + if ( tqparentRow == childRow ) { - if (parentCol == childCol - 1 || rowFree(parentRow, parentCol+1, childCol-1)) + if (tqparentCol == childCol - 1 || rowFree(tqparentRow, tqparentCol+1, childCol-1)) { a.putPoints(1, 1, childPoint.x(), childPoint.y()); } else // go around below { a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), // stop short - parentPoint.x()+(wgap/2), parentPoint.y()+3, // right/down - parentPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // stop short - parentPoint.x()+(wgap/2)+3, parentBottom+(hgap/2), // right/down - childPoint.x()-(wgap/2)-3, parentBottom+(hgap/2), // stop short - childPoint.x()-(wgap/2), parentBottom+(hgap/2)-3, // right/up + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), // stop short + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, // right/down + tqparentPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // stop short + tqparentPoint.x()+(wgap/2)+3, tqparentBottom+(hgap/2), // right/down + childPoint.x()-(wgap/2)-3, tqparentBottom+(hgap/2), // stop short + childPoint.x()-(wgap/2), tqparentBottom+(hgap/2)-3, // right/up childPoint.x()-(wgap/2), childPoint.y()+3, // stop short childPoint.x()-(wgap/2)+3, childPoint.y(), // right/up childPoint.x(), childPoint.y()); } } - else if ( parentRow > childRow ) + else if ( tqparentRow > childRow ) { - if (parentCol == childCol - 1) + if (tqparentCol == childCol - 1) { a.putPoints(1, 5, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()-3, - parentPoint.x()+wgap/2, childPoint.y()+3, - parentPoint.x()+(wgap/2)+3, childPoint.y(), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()-3, + tqparentPoint.x()+wgap/2, childPoint.y()+3, + tqparentPoint.x()+(wgap/2)+3, childPoint.y(), childPoint.x(), childPoint.y()); } else // go around above { a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()-3, - parentPoint.x()+wgap/2, parentTop-(hgap/2)+3, - parentPoint.x()+(wgap/2)+3, parentTop-(hgap/2), - childPoint.x()-(wgap/2)-3, parentTop-hgap/2, - childPoint.x()-(wgap/2), parentTop-(hgap/2)-3, + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()-3, + tqparentPoint.x()+wgap/2, tqparentTop-(hgap/2)+3, + tqparentPoint.x()+(wgap/2)+3, tqparentTop-(hgap/2), + childPoint.x()-(wgap/2)-3, tqparentTop-hgap/2, + childPoint.x()-(wgap/2), tqparentTop-(hgap/2)-3, childPoint.x()-wgap/2, childPoint.y()+3, childPoint.x()-(wgap/2)+3, childPoint.y(), childPoint.x(), childPoint.y()); } } - else if ( parentRow < childRow ) + else if ( tqparentRow < childRow ) { - if (parentCol == childCol - 1) + if (tqparentCol == childCol - 1) { a.putPoints(1, 5, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()+3, - parentPoint.x()+wgap/2, childPoint.y()-3, - parentPoint.x()+(wgap/2)+3, childPoint.y(), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, + tqparentPoint.x()+wgap/2, childPoint.y()-3, + tqparentPoint.x()+(wgap/2)+3, childPoint.y(), childPoint.x(), childPoint.y()); } else { a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()+3, - parentPoint.x()+wgap/2, childTop-(hgap/2)-3, - parentPoint.x()+(wgap/2)+3, childTop-(hgap/2), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, + tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3, + tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2), childPoint.x()-(wgap/2)-3, childTop-(hgap/2), childPoint.x()-(wgap/2), childTop-(hgap/2)+3, childPoint.x()-wgap/2, childPoint.y()-3, @@ -430,64 +430,64 @@ void PertRelationItem::setFinishStartPoints() void PertRelationItem::setFinishFinishPoints() { //kdDebug()<<k_funcinfo<<endl; - QPoint parentPoint = m_parentItem->exitPoint(Relation::FinishFinish); - QPoint childPoint = m_childItem->entryPoint(Relation::FinishFinish); + TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::FinishFinish); + TQPoint childPoint = m_childItem->entryPoint(Relation::FinishFinish); - QPointArray a; - a.putPoints(0, 1, parentPoint.x(), parentPoint.y()); + TQPointArray a; + a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y()); - if ( parentRow >= childRow ) + if ( tqparentRow >= childRow ) { - if (parentCol == childCol) + if (tqparentCol == childCol) { a.putPoints(1, 5, - childPoint.x()+(wgap/2)-3, parentPoint.y(), - childPoint.x()+(wgap/2), parentPoint.y()-3, + childPoint.x()+(wgap/2)-3, tqparentPoint.y(), + childPoint.x()+(wgap/2), tqparentPoint.y()-3, childPoint.x()+wgap/2, childPoint.y()+3, childPoint.x()+(wgap/2)-3, childPoint.y(), childPoint.x(), childPoint.y()); } - else if (parentCol < childCol) + else if (tqparentCol < childCol) { a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), // stop short - parentPoint.x()+(wgap/2), parentPoint.y()+3, // right/down - parentPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // stop short - parentPoint.x()+(wgap/2)+3, parentBottom+(hgap/2), // right/down - childPoint.x()+(wgap/2)-3, parentBottom+(hgap/2), // stop short - childPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // right/up + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), // stop short + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, // right/down + tqparentPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // stop short + tqparentPoint.x()+(wgap/2)+3, tqparentBottom+(hgap/2), // right/down + childPoint.x()+(wgap/2)-3, tqparentBottom+(hgap/2), // stop short + childPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // right/up childPoint.x()+(wgap/2), childPoint.y()+3, // stop short childPoint.x()+(wgap/2)-3, childPoint.y(), // left/up childPoint.x(), childPoint.y()); } } - else // parentRow < choldRow + else // tqparentRow < choldRow { - if (parentCol == childCol) + if (tqparentCol == childCol) { a.putPoints(1, 5, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()+3, - parentPoint.x()+wgap/2, childPoint.y()-3, - parentPoint.x()+(wgap/2)-3, childPoint.y(), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, + tqparentPoint.x()+wgap/2, childPoint.y()-3, + tqparentPoint.x()+(wgap/2)-3, childPoint.y(), childPoint.x(), childPoint.y()); } - else if (parentCol < childCol) + else if (tqparentCol < childCol) { - if (rowFree(parentRow, parentCol+1, childCol)) + if (rowFree(tqparentRow, tqparentCol+1, childCol)) a.putPoints(1, 5, - childPoint.x()+(wgap/2)-3, parentPoint.y(), - childPoint.x()+(wgap/2), parentPoint.y()+3, + childPoint.x()+(wgap/2)-3, tqparentPoint.y(), + childPoint.x()+(wgap/2), tqparentPoint.y()+3, childPoint.x()+(wgap/2), childPoint.y()-3, childPoint.x()+(wgap/2)-3, childPoint.y(), childPoint.x(), childPoint.y()); else a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()+3, - parentPoint.x()+wgap/2, childTop-(hgap/2)-3, - parentPoint.x()+(wgap/2)+3, childTop-(hgap/2), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, + tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3, + tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2), childPoint.x()+(wgap/2)-3, childTop-(hgap/2), childPoint.x()+(wgap/2), childTop-(hgap/2)+3, childPoint.x()+(wgap/2), childPoint.y()-3, @@ -497,10 +497,10 @@ void PertRelationItem::setFinishFinishPoints() else { a.putPoints(1, 9, - parentPoint.x()+(wgap/2)-3, parentPoint.y(), - parentPoint.x()+(wgap/2), parentPoint.y()+3, - parentPoint.x()+wgap/2, childTop-(hgap/2)-3, - parentPoint.x()+(wgap/2)+3, childTop-(hgap/2), + tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), + tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, + tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3, + tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2), childPoint.x()+(wgap/2)-3, childTop-(hgap/2), childPoint.x()+(wgap/2), childTop-(hgap/2)+3, childPoint.x()+wgap/2, childPoint.y()-3, @@ -514,31 +514,31 @@ void PertRelationItem::setFinishFinishPoints() void PertRelationItem::setStartStartPoints() { //kdDebug()<<k_funcinfo<<endl; - QPoint parentPoint = m_parentItem->exitPoint(Relation::StartStart); - QPoint childPoint = m_childItem->entryPoint(Relation::StartStart); + TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::StartStart); + TQPoint childPoint = m_childItem->entryPoint(Relation::StartStart); - QPointArray a; - a.putPoints(0, 1, parentPoint.x(), parentPoint.y()); + TQPointArray a; + a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y()); - if ( parentRow > childRow ) + if ( tqparentRow > childRow ) { - if (parentCol == childCol) // go up + if (tqparentCol == childCol) // go up { a.putPoints(1, 4, - parentPoint.x()-(wgap/2)+3, parentPoint.y(), - parentPoint.x()-(wgap/2), parentPoint.y()-3, - parentPoint.x()-(wgap/2), childPoint.y()+3, - parentPoint.x()-(wgap/2)+3, childPoint.y()); + tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(), + tqparentPoint.x()-(wgap/2), tqparentPoint.y()-3, + tqparentPoint.x()-(wgap/2), childPoint.y()+3, + tqparentPoint.x()-(wgap/2)+3, childPoint.y()); } else // go above myself { a.putPoints(1, 8, - parentPoint.x()-(wgap/2)+3, parentPoint.y(), - parentPoint.x()-(wgap/2), parentPoint.y()-3, - parentPoint.x()-(wgap/2), parentTop-(hgap/2)+3, - parentPoint.x()-(wgap/2)+3, parentTop-(hgap/2), - childPoint.x()-(wgap/2)-3, parentTop-(hgap/2), - childPoint.x()-(wgap/2), parentTop-(hgap/2)-3, + tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(), + tqparentPoint.x()-(wgap/2), tqparentPoint.y()-3, + tqparentPoint.x()-(wgap/2), tqparentTop-(hgap/2)+3, + tqparentPoint.x()-(wgap/2)+3, tqparentTop-(hgap/2), + childPoint.x()-(wgap/2)-3, tqparentTop-(hgap/2), + childPoint.x()-(wgap/2), tqparentTop-(hgap/2)-3, childPoint.x()-(wgap/2), childPoint.y()+3, childPoint.x()-(wgap/2)+3, childPoint.y()); } @@ -546,32 +546,32 @@ void PertRelationItem::setStartStartPoints() else // go left/down { a.putPoints(1, 2, - parentPoint.x()-(wgap/2)+3, parentPoint.y(), - parentPoint.x()-(wgap/2), parentPoint.y()+3); + tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(), + tqparentPoint.x()-(wgap/2), tqparentPoint.y()+3); - if (parentCol == childCol) + if (tqparentCol == childCol) { a.putPoints(3, 2, - parentPoint.x()-(wgap/2), childPoint.y()-3, - parentPoint.x()-(wgap/2)+3, childPoint.y()); + tqparentPoint.x()-(wgap/2), childPoint.y()-3, + tqparentPoint.x()-(wgap/2)+3, childPoint.y()); } else // go below myself { - if (parentRow == childRow) // go up + if (tqparentRow == childRow) // go up { a.putPoints(3, 6, - parentPoint.x()-(wgap/2), parentBottom+hgap/2-3, - parentPoint.x()-(wgap/2)+3, parentBottom+hgap/2, - childPoint.x()-(wgap/2)-3, parentBottom+hgap/2, - childPoint.x()-(wgap/2), parentBottom+hgap/2-3, + tqparentPoint.x()-(wgap/2), tqparentBottom+hgap/2-3, + tqparentPoint.x()-(wgap/2)+3, tqparentBottom+hgap/2, + childPoint.x()-(wgap/2)-3, tqparentBottom+hgap/2, + childPoint.x()-(wgap/2), tqparentBottom+hgap/2-3, childPoint.x()-(wgap/2), childPoint.y()+3, childPoint.x()-(wgap/2)+3, childPoint.y()); } else // go down { a.putPoints(3, 6, - parentPoint.x()-(wgap/2), childTop-(hgap/2)-3, - parentPoint.x()-(wgap/2)+3, childTop-hgap/2, + tqparentPoint.x()-(wgap/2), childTop-(hgap/2)-3, + tqparentPoint.x()-(wgap/2)+3, childTop-hgap/2, childPoint.x()-(wgap/2)-3, childTop-hgap/2, childPoint.x()-(wgap/2), childTop-(hgap/2)+3, childPoint.x()-(wgap/2), childPoint.y()-3, @@ -583,12 +583,12 @@ void PertRelationItem::setStartStartPoints() setPoints(a); } -void PertRelationItem::drawShape(QPainter &p) +void PertRelationItem::drawShape(TQPainter &p) { - //kdDebug()<<k_funcinfo<<" "<<m_rel->parent()->name()<<" to "<<m_rel->child()->name()<<endl; + //kdDebug()<<k_funcinfo<<" "<<m_rel->tqparent()->name()<<" to "<<m_rel->child()->name()<<endl; // cannot use polygon's drawShape() as it doesn't use the pen setBrush(Qt::NoBrush); - QPointArray a = poly; + TQPointArray a = poly; int size = a.size()-1; for(int i = 0; i < size; ++i) { @@ -600,23 +600,23 @@ void PertRelationItem::drawShape(QPainter &p) int xoffset = -3; if ( pos > 1&& a[pos-1].x() > a[pos].x()) xoffset = 3; - QPoint pnt(a[pos].x()+xoffset, a[pos].y()-3); + TQPoint pnt(a[pos].x()+xoffset, a[pos].y()-3); p.drawLine(a[pos], pnt); pnt.setY(a[pos].y()+3); p.drawLine(a[pos], pnt); } -QPointArray PertRelationItem::areaPoints () const +TQPointArray PertRelationItem::areaPoints () const { - QPointArray pa(4); + TQPointArray pa(4); int pw = (pen().width()+1)/2; if ( pw < 1 ) pw = 1; - if ( pen() == NoPen ) pw = 0; - pa[0] = QPoint(left-pw,top-pw); - pa[1] = pa[0] + QPoint(right-left+pw*2,0); - pa[2] = pa[1] + QPoint(0,bottom-top+pw*2); - pa[3] = pa[0] + QPoint(0,bottom-top+pw*2); -/* kdDebug()<<k_funcinfo<<" areaPoints: "<<m_rel->parent()->name()<<" to "<<m_rel->child()->name()<<endl; + if ( pen() == Qt::NoPen ) pw = 0; + pa[0] = TQPoint(left-pw,top-pw); + pa[1] = pa[0] + TQPoint(right-left+pw*2,0); + pa[2] = pa[1] + TQPoint(0,bottom-top+pw*2); + pa[3] = pa[0] + TQPoint(0,bottom-top+pw*2); +/* kdDebug()<<k_funcinfo<<" areaPoints: "<<m_rel->tqparent()->name()<<" to "<<m_rel->child()->name()<<endl; kdDebug()<<" "<<pa[0].x()<<","<<pa[0].y()<<" "<<pa[1].x()<<","<<pa[1].y()<<endl; kdDebug()<<" "<<pa[2].x()<<","<<pa[2].y()<<" "<<pa[3].x()<<","<<pa[3].y()<<endl;*/ return pa; @@ -624,8 +624,8 @@ QPointArray PertRelationItem::areaPoints () const bool PertRelationItem::rowFree(int row, int startCol, int endCol) { - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( (*it)->rtti() == PertProjectItem::RTTI || @@ -674,22 +674,22 @@ KDGanttViewTaskLink::LinkType ItemBase::kdLinkType(int relationType) { //////////////////// GanttViewSummaryItem ////////////////////////// -GanttViewSummaryItem::GanttViewSummaryItem(KDGanttView *parent, Node *node) - : KDGanttViewSummaryItem(parent, node->name()), +GanttViewSummaryItem::GanttViewSummaryItem(KDGanttView *tqparent, Node *node) + : KDGanttViewSummaryItem(tqparent, node->name()), m_node(node), - m_view(parent) + m_view(tqparent) { setExpandable(true); setOpen(true); } -GanttViewSummaryItem::GanttViewSummaryItem(KDGanttViewItem *parent, Node *node) - : KDGanttViewSummaryItem(parent, node->name()), +GanttViewSummaryItem::GanttViewSummaryItem(KDGanttViewItem *tqparent, Node *node) + : KDGanttViewSummaryItem(tqparent, node->name()), m_node(node), m_view(0) { m_drawn = false; - GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent); + GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent); if (p) m_view = p->ganttView(); setExpandable(true); @@ -700,18 +700,18 @@ void GanttViewSummaryItem::insertRelations(GanttView *view) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Relation> it(m_node->dependChildNodes()); + TQPtrListIterator<Relation> it(m_node->dependChildNodes()); for (; it.current(); ++it) { - KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child()); + KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child()); if (child) { KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type())); //TODO i18n - QString t = i18n("From: %1").arg(this->listViewText(0)); - t += "\n" + i18n("To: %1").arg(child->listViewText(0)); + TQString t = i18n("From: %1").tqarg(this->listViewText(0)); + t += "\n" + i18n("To: %1").tqarg(child->listViewText(0)); if (it.current()->lag() > Duration::zeroDuration) { - t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime)); + t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime)); } link->setTooltipText(t); view->addTaskLink(link); @@ -719,21 +719,21 @@ void GanttViewSummaryItem::insertRelations(GanttView *view) } } -KDGanttViewItem *GanttViewSummaryItem::find(Node *node) +KDGanttViewItem *GanttViewSummaryItem::tqfind(Node *node) { //kdDebug()<<k_funcinfo<<endl; if (m_node == node) return this; - KDGanttViewItem *item = find(firstChild(), node); + KDGanttViewItem *item = tqfind(firstChild(), node); if (item) return item; - return find(nextSibling(), node); + return tqfind(nextSibling(), node); } -KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node) +KDGanttViewItem *GanttViewSummaryItem::tqfind(KDGanttViewItem *item, Node *node) { if (!item) return 0; @@ -741,17 +741,17 @@ KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node) if (item->type() == Event) { GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Task) { GanttViewTaskItem *i = static_cast<GanttViewTaskItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Summary) { GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item); - return i->find(node); + return i->tqfind(node); } return 0; } @@ -759,20 +759,20 @@ KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node) //////////////////// GanttViewTaskItem ////////////////////////// -GanttViewTaskItem::GanttViewTaskItem(KDGanttView *parent, KPlato::Task *task) - : KDGanttViewTaskItem(parent, task->name()), +GanttViewTaskItem::GanttViewTaskItem(KDGanttView *tqparent, KPlato::Task *task) + : KDGanttViewTaskItem(tqparent, task->name()), m_task(task), - m_view(parent) + m_view(tqparent) { } -GanttViewTaskItem::GanttViewTaskItem(KDGanttViewItem *parent, KPlato::Task *task) - : KDGanttViewTaskItem(parent, task->name()), +GanttViewTaskItem::GanttViewTaskItem(KDGanttViewItem *tqparent, KPlato::Task *task) + : KDGanttViewTaskItem(tqparent, task->name()), m_task(task), m_view() { m_drawn = false; - GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent); + GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent); if (p) m_view = p->ganttView(); } @@ -781,18 +781,18 @@ void GanttViewTaskItem::insertRelations(GanttView *view) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Relation> it(m_task->dependChildNodes()); + TQPtrListIterator<Relation> it(m_task->dependChildNodes()); for (; it.current(); ++it) { - KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child()); + KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child()); if (child) { KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type())); //TODO i18n - QString t = i18n("From: %1").arg(this->listViewText(0)); - t += "\n" + i18n("To: %1").arg(child->listViewText(0)); + TQString t = i18n("From: %1").tqarg(this->listViewText(0)); + t += "\n" + i18n("To: %1").tqarg(child->listViewText(0)); if (it.current()->lag() > Duration::zeroDuration) { - t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime)); + t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime)); } link->setTooltipText(t); view->addTaskLink(link); @@ -800,21 +800,21 @@ void GanttViewTaskItem::insertRelations(GanttView *view) } } -KDGanttViewItem *GanttViewTaskItem::find(Node *node) +KDGanttViewItem *GanttViewTaskItem::tqfind(Node *node) { //kdDebug()<<k_funcinfo<<endl; if (m_task == node) return this; - KDGanttViewItem *item = find(firstChild(), node); + KDGanttViewItem *item = tqfind(firstChild(), node); if (item) return item; - return find(nextSibling(), node); + return tqfind(nextSibling(), node); } -KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node) +KDGanttViewItem *GanttViewTaskItem::tqfind(KDGanttViewItem *item, Node *node) { if (!item) return 0; @@ -822,17 +822,17 @@ KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node) if (item->type() == Event) { GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Task) { GanttViewTaskItem *i= static_cast<GanttViewTaskItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Summary) { GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item); - return i->find(node); + return i->tqfind(node); } return 0; // avoid warning } @@ -840,20 +840,20 @@ KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node) //////////////////// GanttViewEventItem ////////////////////////// -GanttViewEventItem::GanttViewEventItem(KDGanttView *parent, KPlato::Task *task) - : KDGanttViewEventItem(parent, task->name()), +GanttViewEventItem::GanttViewEventItem(KDGanttView *tqparent, KPlato::Task *task) + : KDGanttViewEventItem(tqparent, task->name()), m_task(task), - m_view(parent) + m_view(tqparent) { } -GanttViewEventItem::GanttViewEventItem(KDGanttViewItem *parent, KPlato::Task *task) - : KDGanttViewEventItem(parent, task->name()), +GanttViewEventItem::GanttViewEventItem(KDGanttViewItem *tqparent, KPlato::Task *task) + : KDGanttViewEventItem(tqparent, task->name()), m_task(task), m_view() { m_drawn = false; - GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent); + GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent); if (p) m_view = p->ganttView(); } @@ -863,18 +863,18 @@ void GanttViewEventItem::insertRelations(GanttView *view) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Relation> it(m_task->dependChildNodes()); + TQPtrListIterator<Relation> it(m_task->dependChildNodes()); for (; it.current(); ++it) { - KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child()); + KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child()); if (child) { KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type())); - QString t = i18n("From: %1").arg(this->listViewText(0)); - t += "\n" + i18n("To: %1").arg(child->listViewText(0)); + TQString t = i18n("From: %1").tqarg(this->listViewText(0)); + t += "\n" + i18n("To: %1").tqarg(child->listViewText(0)); if (it.current()->lag() > Duration::zeroDuration) { - t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime)); + t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime)); } link->setTooltipText(t); view->addTaskLink(link); @@ -882,21 +882,21 @@ void GanttViewEventItem::insertRelations(GanttView *view) } } -KDGanttViewItem *GanttViewEventItem::find(Node *node) +KDGanttViewItem *GanttViewEventItem::tqfind(Node *node) { //kdDebug()<<k_funcinfo<<endl; if (m_task == node) return this; - KDGanttViewItem *item = find(firstChild(), node); + KDGanttViewItem *item = tqfind(firstChild(), node); if (item) return item; - return find(nextSibling(), node); + return tqfind(nextSibling(), node); } -KDGanttViewItem *GanttViewEventItem::find(KDGanttViewItem *item, Node *node) +KDGanttViewItem *GanttViewEventItem::tqfind(KDGanttViewItem *item, Node *node) { if (!item) return 0; @@ -904,17 +904,17 @@ KDGanttViewItem *GanttViewEventItem::find(KDGanttViewItem *item, Node *node) if (item->type() == Event) { GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Task) { GanttViewTaskItem *i = static_cast<GanttViewTaskItem *>(item); - return i->find(node); + return i->tqfind(node); } else if (item->type() == Summary) { GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item); - return i->find(node); + return i->tqfind(node); } return 0; } diff --git a/kplato/kptcanvasitem.h b/kplato/kptcanvasitem.h index fdd5891e..81d0dc0f 100644 --- a/kplato/kptcanvasitem.h +++ b/kplato/kptcanvasitem.h @@ -27,10 +27,10 @@ #include "KDGanttViewTaskItem.h" #include "KDGanttViewEventItem.h" -#include <qcanvas.h> -#include <qrect.h> +#include <tqcanvas.h> +#include <tqrect.h> -class QPainter; +class TQPainter; namespace KPlato { @@ -42,7 +42,7 @@ class PertRelationItem; class PertNodeItem; class GanttView; -class PertNodeItem : public QCanvasPolygon +class PertNodeItem : public TQCanvasPolygon { private: class PertNodeRelation @@ -64,12 +64,12 @@ public: void setVisible(bool yes); void move(PertCanvas *view, int row, int col); - QPoint exitPoint(Relation::Type type) const; - QPoint entryPoint(Relation::Type type) const; + TQPoint exitPoint(Relation::Type type) const; + TQPoint entryPoint(Relation::Type type) const; Node &node() const { return m_node; } - QRect rect() const { return QRect(m_left, m_right); } + TQRect rect() const { return TQRect(m_left, m_right); } void setRow(int row) { m_row = row; } int row() const { return m_row; } void setColumn(int col) { m_col = col; } @@ -88,7 +88,7 @@ public: bool hasChild() { return m_node.numDependChildNodes(); } protected: - void drawShape(QPainter & p); + void drawShape(TQPainter & p); int m_wgap; int m_hgap; @@ -97,15 +97,15 @@ protected: int m_x; int m_y; - QPtrList<PertNodeRelation> m_childRelations; + TQPtrList<PertNodeRelation> m_childRelations; private: Node &m_node; int m_row, m_col; - QPoint m_right; // Entry/exit point - QPoint m_left; // Entry/exit point - QCanvasText *m_name; - QCanvasText *m_leader; + TQPoint m_right; // Entry/exit point + TQPoint m_left; // Entry/exit point + TQCanvasText *m_name; + TQCanvasText *m_leader; #ifndef NDEBUG void printDebug( int ); @@ -162,10 +162,10 @@ public: ///////////////// PertRelationItem //////////////////// -class PertRelationItem : public QCanvasPolygon +class PertRelationItem : public TQCanvasPolygon { public: - PertRelationItem(PertCanvas *view, PertNodeItem *parent, PertNodeItem *child, Relation *rel); + PertRelationItem(PertCanvas *view, PertNodeItem *tqparent, PertNodeItem *child, Relation *rel); virtual ~PertRelationItem(); virtual int rtti() const; @@ -177,12 +177,12 @@ public: void setFinishStartPoints(); void setFinishFinishPoints(); void setStartStartPoints(); - QPointArray areaPoints() const; + TQPointArray areaPoints() const; bool rowFree(int row, int startCol, int endCol); protected: - void drawShape(QPainter &p); + void drawShape(TQPainter &p); private: PertCanvas *m_view; @@ -191,14 +191,14 @@ private: PertNodeItem *m_childItem; int left, top, right, bottom; - int parentTop; - int parentBottom; + int tqparentTop; + int tqparentBottom; int childTop; int childRow; int childCol; - int parentRow; - int parentCol; + int tqparentRow; + int tqparentCol; int wgap; int hgap; @@ -222,13 +222,13 @@ protected: class GanttViewSummaryItem : public KDGanttViewSummaryItem, public ItemBase { public: - GanttViewSummaryItem(KDGanttView *parent, Node *node); - GanttViewSummaryItem(KDGanttViewItem *parent, Node *node); + GanttViewSummaryItem(KDGanttView *tqparent, Node *node); + GanttViewSummaryItem(KDGanttViewItem *tqparent, Node *node); Node *getNode() { return m_node; } void insertRelations(GanttView *view); - KDGanttViewItem *find(Node *node); - KDGanttViewItem *find(KDGanttViewItem *item, Node *node); + KDGanttViewItem *tqfind(Node *node); + KDGanttViewItem *tqfind(KDGanttViewItem *item, Node *node); KDGanttView *ganttView() const { return m_view; } bool isDrawn() const { return m_drawn; } void setDrawn(bool drawn) { m_drawn = drawn; } @@ -244,13 +244,13 @@ protected: class GanttViewTaskItem : public KDGanttViewTaskItem, public ItemBase { public: - GanttViewTaskItem(KDGanttView *parent, KPlato::Task *task); - GanttViewTaskItem(KDGanttViewItem *parent, KPlato::Task *task); + GanttViewTaskItem(KDGanttView *tqparent, KPlato::Task *task); + GanttViewTaskItem(KDGanttViewItem *tqparent, KPlato::Task *task); KPlato::Task *getTask() const { return m_task; } void insertRelations(GanttView *view); - KDGanttViewItem *find(Node *node); - KDGanttViewItem *find(KDGanttViewItem *item, Node *node); + KDGanttViewItem *tqfind(Node *node); + KDGanttViewItem *tqfind(KDGanttViewItem *item, Node *node); KDGanttView *ganttView() const { return m_view; } bool isDrawn() const { return m_drawn; } void setDrawn(bool drawn) { m_drawn = drawn; } @@ -266,13 +266,13 @@ protected: class GanttViewEventItem : public KDGanttViewEventItem, public ItemBase { public: - GanttViewEventItem(KDGanttView *parent, KPlato::Task *task); - GanttViewEventItem(KDGanttViewItem *parent, KPlato::Task *task); + GanttViewEventItem(KDGanttView *tqparent, KPlato::Task *task); + GanttViewEventItem(KDGanttViewItem *tqparent, KPlato::Task *task); KPlato::Task *getTask() { return m_task; } void insertRelations(GanttView *view); - KDGanttViewItem *find(Node *node); - KDGanttViewItem *find(KDGanttViewItem *item, Node *node); + KDGanttViewItem *tqfind(Node *node); + KDGanttViewItem *tqfind(KDGanttViewItem *item, Node *node); KDGanttView *ganttView() const { return m_view; } bool isDrawn() const { return m_drawn; } void setDrawn(bool drawn) { m_drawn = drawn; } diff --git a/kplato/kptcommand.cc b/kplato/kptcommand.cc index 043dc776..96efa2f7 100644 --- a/kplato/kptcommand.cc +++ b/kplato/kptcommand.cc @@ -30,8 +30,8 @@ #include <kdebug.h> #include <klocale.h> -#include <qintdict.h> -#include <qmap.h> +#include <tqintdict.h> +#include <tqmap.h> namespace KPlato { @@ -42,28 +42,28 @@ void NamedCommand::setCommandType(int type) { } void NamedCommand::setSchDeleted() { - QMap<Schedule*, bool>::Iterator it; + TQMap<Schedule*, bool>::Iterator it; for (it = m_schedules.begin(); it != m_schedules.end(); ++it) { kdDebug()<<k_funcinfo<<it.key()->id()<<": "<<it.data()<<endl; it.key()->setDeleted(it.data()); } } void NamedCommand::setSchDeleted(bool state) { - QMap<Schedule*, bool>::Iterator it; + TQMap<Schedule*, bool>::Iterator it; for (it = m_schedules.begin(); it != m_schedules.end(); ++it) { kdDebug()<<k_funcinfo<<it.key()->id()<<": "<<state<<endl; it.key()->setDeleted(state); } } void NamedCommand::setSchScheduled() { -QMap<Schedule*, bool>::Iterator it; +TQMap<Schedule*, bool>::Iterator it; for (it = m_schedules.begin(); it != m_schedules.end(); ++it) { kdDebug()<<k_funcinfo<<it.key()->id()<<": "<<it.data()<<endl; it.key()->setScheduled(it.data()); } } void NamedCommand::setSchScheduled(bool state) { - QMap<Schedule*, bool>::Iterator it; + TQMap<Schedule*, bool>::Iterator it; for (it = m_schedules.begin(); it != m_schedules.end(); ++it) { kdDebug()<<k_funcinfo<<it.key()->id()<<": "<<state<<endl; it.key()->setScheduled(state); @@ -72,7 +72,7 @@ void NamedCommand::setSchScheduled(bool state) { void NamedCommand::addSchScheduled(Schedule *sch) { kdDebug()<<k_funcinfo<<sch->id()<<": "<<sch->isScheduled()<<endl; m_schedules.insert(sch, sch->isScheduled()); - QPtrListIterator<Appointment> it = sch->appointments(); + TQPtrListIterator<Appointment> it = sch->appointments(); for (; it.current(); ++it) { if (it.current()->node() == sch) { m_schedules.insert(it.current()->resource(), it.current()->resource()->isScheduled()); @@ -84,7 +84,7 @@ void NamedCommand::addSchScheduled(Schedule *sch) { void NamedCommand::addSchDeleted(Schedule *sch) { kdDebug()<<k_funcinfo<<sch->id()<<": "<<sch->isDeleted()<<endl; m_schedules.insert(sch, sch->isDeleted()); - QPtrListIterator<Appointment> it = sch->appointments(); + TQPtrListIterator<Appointment> it = sch->appointments(); for (; it.current(); ++it) { if (it.current()->node() == sch) { m_schedules.insert(it.current()->resource(), it.current()->resource()->isDeleted()); @@ -95,7 +95,7 @@ void NamedCommand::addSchDeleted(Schedule *sch) { } //------------------------------------------------- -CalendarAddCmd::CalendarAddCmd(Part *part, Project *project,Calendar *cal, QString name) +CalendarAddCmd::CalendarAddCmd(Part *part, Project *project,Calendar *cal, TQString name) : NamedCommand(part, name), m_project(project), m_cal(cal), @@ -122,13 +122,13 @@ void CalendarAddCmd::unexecute() { //kdDebug()<<k_funcinfo<<m_cal->name()<<endl; } -CalendarDeleteCmd::CalendarDeleteCmd(Part *part, Calendar *cal, QString name) +CalendarDeleteCmd::CalendarDeleteCmd(Part *part, Calendar *cal, TQString name) : NamedCommand(part, name), m_cal(cal) { // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -147,7 +147,7 @@ void CalendarDeleteCmd::unexecute() { setCommandType(0); } -CalendarModifyNameCmd::CalendarModifyNameCmd(Part *part, Calendar *cal, QString newvalue, QString name) +CalendarModifyNameCmd::CalendarModifyNameCmd(Part *part, Calendar *cal, TQString newvalue, TQString name) : NamedCommand(part, name), m_cal(cal) { @@ -166,16 +166,16 @@ void CalendarModifyNameCmd::unexecute() { //kdDebug()<<k_funcinfo<<m_cal->name()<<endl; } -CalendarModifyParentCmd::CalendarModifyParentCmd(Part *part, Calendar *cal, Calendar *newvalue, QString name) +CalendarModifyParentCmd::CalendarModifyParentCmd(Part *part, Calendar *cal, Calendar *newvalue, TQString name) : NamedCommand(part, name), m_cal(cal) { - m_oldvalue = cal->parent(); + m_oldvalue = cal->tqparent(); m_newvalue = newvalue; //kdDebug()<<k_funcinfo<<cal->name()<<endl; // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -192,7 +192,7 @@ void CalendarModifyParentCmd::unexecute() { setCommandType(1); } -CalendarAddDayCmd::CalendarAddDayCmd(Part *part, Calendar *cal, CalendarDay *newvalue, QString name) +CalendarAddDayCmd::CalendarAddDayCmd(Part *part, Calendar *cal, CalendarDay *newvalue, TQString name) : NamedCommand(part, name), m_cal(cal), m_mine(true) { @@ -201,7 +201,7 @@ CalendarAddDayCmd::CalendarAddDayCmd(Part *part, Calendar *cal, CalendarDay *new //kdDebug()<<k_funcinfo<<cal->name()<<endl; // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -227,7 +227,7 @@ void CalendarAddDayCmd::unexecute() { setCommandType(1); } -CalendarRemoveDayCmd::CalendarRemoveDayCmd(Part *part, Calendar *cal, const QDate &day, QString name) +CalendarRemoveDayCmd::CalendarRemoveDayCmd(Part *part, Calendar *cal, const TQDate &day, TQString name) : NamedCommand(part, name), m_cal(cal), m_mine(false) { @@ -236,7 +236,7 @@ CalendarRemoveDayCmd::CalendarRemoveDayCmd(Part *part, Calendar *cal, const QDat //kdDebug()<<k_funcinfo<<cal->name()<<endl; // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -257,7 +257,7 @@ void CalendarRemoveDayCmd::unexecute() { setCommandType(1); } -CalendarModifyDayCmd::CalendarModifyDayCmd(Part *part, Calendar *cal, CalendarDay *value, QString name) +CalendarModifyDayCmd::CalendarModifyDayCmd(Part *part, Calendar *cal, CalendarDay *value, TQString name) : NamedCommand(part, name), m_cal(cal), m_mine(true) { @@ -267,7 +267,7 @@ CalendarModifyDayCmd::CalendarModifyDayCmd(Part *part, Calendar *cal, CalendarDa //kdDebug()<<k_funcinfo<<cal->name()<<" old:("<<m_oldvalue<<") new:("<<m_newvalue<<")"<<endl; // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -298,7 +298,7 @@ void CalendarModifyDayCmd::unexecute() { setCommandType(1); } -CalendarModifyWeekdayCmd::CalendarModifyWeekdayCmd(Part *part, Calendar *cal, int weekday, CalendarDay *value, QString name) +CalendarModifyWeekdayCmd::CalendarModifyWeekdayCmd(Part *part, Calendar *cal, int weekday, CalendarDay *value, TQString name) : NamedCommand(part, name), m_weekday(weekday), m_cal(cal), @@ -308,7 +308,7 @@ CalendarModifyWeekdayCmd::CalendarModifyWeekdayCmd(Part *part, Calendar *cal, in kdDebug()<<k_funcinfo<<cal->name()<<" ("<<value<<")"<<endl; // TODO check if any resources uses this calendar if (part) { - QIntDictIterator<Schedule> it = part->getProject().schedules(); + TQIntDictIterator<Schedule> it = part->getProject().schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -320,17 +320,17 @@ CalendarModifyWeekdayCmd::~CalendarModifyWeekdayCmd() { } void CalendarModifyWeekdayCmd::execute() { - m_value = m_cal->weekdays()->replace(m_weekday, m_value); + m_value = m_cal->weekdays()->tqreplace(m_weekday, m_value); setSchScheduled(false); setCommandType(1); } void CalendarModifyWeekdayCmd::unexecute() { - m_value = m_cal->weekdays()->replace(m_weekday, m_value); + m_value = m_cal->weekdays()->tqreplace(m_weekday, m_value); setSchScheduled(); setCommandType(1); } -NodeDeleteCmd::NodeDeleteCmd(Part *part, Node *node, QString name) +NodeDeleteCmd::NodeDeleteCmd(Part *part, Node *node, TQString name) : NamedCommand(part, name), m_node(node), m_index(-1) { @@ -343,11 +343,11 @@ NodeDeleteCmd::NodeDeleteCmd(Part *part, Node *node, QString name) m_project = static_cast<Project*>(node->projectNode()); if (m_project) { - QIntDictIterator<Schedule> it = m_project->schedules(); + TQIntDictIterator<Schedule> it = m_project->schedules(); for (; it.current(); ++it) { Schedule *s = node->findSchedule(it.current()->id()); if (s && s->isScheduled()) { - // Only invalidate schedules this node is part of + // Only tqinvalidate schedules this node is part of addSchScheduled(it.current()); } } @@ -360,7 +360,7 @@ NodeDeleteCmd::~NodeDeleteCmd() { void NodeDeleteCmd::execute() { if (m_parent && m_project) { //kdDebug()<<k_funcinfo<<m_node->name()<<" "<<m_index<<endl; - QPtrListIterator<Appointment> it = m_node->appointments(); + TQPtrListIterator<Appointment> it = m_node->appointments(); for (; it.current(); ++it) { it.current()->detach(); m_appointments.append(it.current()); @@ -385,7 +385,7 @@ void NodeDeleteCmd::unexecute() { } } -TaskAddCmd::TaskAddCmd(Part *part, Project *project, Node *node, Node *after, QString name) +TaskAddCmd::TaskAddCmd(Part *part, Project *project, Node *node, Node *after, TQString name) : NamedCommand(part, name), m_project(project), m_node(node), @@ -428,15 +428,15 @@ void TaskAddCmd::unexecute() { setCommandType(1); } -SubtaskAddCmd::SubtaskAddCmd(Part *part, Project *project, Node *node, Node *parent, QString name) +SubtaskAddCmd::SubtaskAddCmd(Part *part, Project *project, Node *node, Node *tqparent, TQString name) : NamedCommand(part, name), m_project(project), m_node(node), - m_parent(parent), + m_parent(tqparent), m_added(false) { // set some reasonable defaults for normally calculated values - node->setStartTime(parent->startTime()); + node->setStartTime(tqparent->startTime()); node->setEndTime(node->startTime() + node->duration()); node->setEarliestStart(node->startTime()); node->setLatestFinish(node->endTime()); @@ -460,7 +460,7 @@ void SubtaskAddCmd::unexecute() { setCommandType(1); } -NodeModifyNameCmd::NodeModifyNameCmd(Part *part, Node &node, QString nodename, QString name) +NodeModifyNameCmd::NodeModifyNameCmd(Part *part, Node &node, TQString nodename, TQString name) : NamedCommand(part, name), m_node(node), newName(nodename), @@ -478,7 +478,7 @@ void NodeModifyNameCmd::unexecute() { setCommandType(0); } -NodeModifyLeaderCmd::NodeModifyLeaderCmd(Part *part, Node &node, QString leader, QString name) +NodeModifyLeaderCmd::NodeModifyLeaderCmd(Part *part, Node &node, TQString leader, TQString name) : NamedCommand(part, name), m_node(node), newLeader(leader), @@ -496,7 +496,7 @@ void NodeModifyLeaderCmd::unexecute() { setCommandType(0); } -NodeModifyDescriptionCmd::NodeModifyDescriptionCmd(Part *part, Node &node, QString description, QString name) +NodeModifyDescriptionCmd::NodeModifyDescriptionCmd(Part *part, Node &node, TQString description, TQString name) : NamedCommand(part, name), m_node(node), newDescription(description), @@ -514,13 +514,13 @@ void NodeModifyDescriptionCmd::unexecute() { setCommandType(0); } -NodeModifyConstraintCmd::NodeModifyConstraintCmd(Part *part, Node &node, Node::ConstraintType c, QString name) +NodeModifyConstraintCmd::NodeModifyConstraintCmd(Part *part, Node &node, Node::ConstraintType c, TQString name) : NamedCommand(part, name), m_node(node), newConstraint(c), oldConstraint(static_cast<Node::ConstraintType>(node.constraint())) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -536,13 +536,13 @@ void NodeModifyConstraintCmd::unexecute() { setCommandType(1); } -NodeModifyConstraintStartTimeCmd::NodeModifyConstraintStartTimeCmd(Part *part, Node &node, QDateTime dt, QString name) +NodeModifyConstraintStartTimeCmd::NodeModifyConstraintStartTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), oldTime(node.constraintStartTime()) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -558,13 +558,13 @@ void NodeModifyConstraintStartTimeCmd::unexecute() { setCommandType(1); } -NodeModifyConstraintEndTimeCmd::NodeModifyConstraintEndTimeCmd(Part *part, Node &node, QDateTime dt, QString name) +NodeModifyConstraintEndTimeCmd::NodeModifyConstraintEndTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), oldTime(node.constraintEndTime()) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -580,7 +580,7 @@ void NodeModifyConstraintEndTimeCmd::unexecute() { setCommandType(1); } -NodeModifyStartTimeCmd::NodeModifyStartTimeCmd(Part *part, Node &node, QDateTime dt, QString name) +NodeModifyStartTimeCmd::NodeModifyStartTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), @@ -598,7 +598,7 @@ void NodeModifyStartTimeCmd::unexecute() { setCommandType(1); } -NodeModifyEndTimeCmd::NodeModifyEndTimeCmd(Part *part, Node &node, QDateTime dt, QString name) +NodeModifyEndTimeCmd::NodeModifyEndTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), @@ -616,7 +616,7 @@ void NodeModifyEndTimeCmd::unexecute() { setCommandType(1); } -NodeModifyIdCmd::NodeModifyIdCmd(Part *part, Node &node, QString id, QString name) +NodeModifyIdCmd::NodeModifyIdCmd(Part *part, Node &node, TQString id, TQString name) : NamedCommand(part, name), m_node(node), newId(id), @@ -634,66 +634,66 @@ void NodeModifyIdCmd::unexecute() { setCommandType(0); } -NodeIndentCmd::NodeIndentCmd(Part *part, Node &node, QString name) +NodeIndentCmd::NodeIndentCmd(Part *part, Node &node, TQString name) : NamedCommand(part, name), m_node(node), - m_newparent(0), + m_newtqparent(0), m_newindex(-1) { } void NodeIndentCmd::execute() { - m_oldparent = m_node.getParent(); - m_oldindex = m_oldparent->findChildNode(&m_node); + m_oldtqparent = m_node.getParent(); + m_oldindex = m_oldtqparent->findChildNode(&m_node); Project *p = dynamic_cast<Project *>(m_node.projectNode()); if (p && p->indentTask(&m_node)) { - m_newparent = m_node.getParent(); - m_newindex = m_newparent->findChildNode(&m_node); - m_node.setParent(m_newparent); + m_newtqparent = m_node.getParent(); + m_newindex = m_newtqparent->findChildNode(&m_node); + m_node.setParent(m_newtqparent); } setCommandType(1); } void NodeIndentCmd::unexecute() { if (m_newindex != -1) { - m_newparent->delChildNode(m_newindex, false); - m_oldparent->insertChildNode(m_oldindex, &m_node); - m_node.setParent(m_oldparent); + m_newtqparent->delChildNode(m_newindex, false); + m_oldtqparent->insertChildNode(m_oldindex, &m_node); + m_node.setParent(m_oldtqparent); m_newindex = -1; } setCommandType(1); } -NodeUnindentCmd::NodeUnindentCmd(Part *part, Node &node, QString name) +NodeUnindentCmd::NodeUnindentCmd(Part *part, Node &node, TQString name) : NamedCommand(part, name), m_node(node), - m_newparent(0), + m_newtqparent(0), m_newindex(-1) { } void NodeUnindentCmd::execute() { - m_oldparent = m_node.getParent(); - m_oldindex = m_oldparent->findChildNode(&m_node); + m_oldtqparent = m_node.getParent(); + m_oldindex = m_oldtqparent->findChildNode(&m_node); Project *p = dynamic_cast<Project *>(m_node.projectNode()); if (p && p->unindentTask(&m_node)) { - m_newparent = m_node.getParent(); - m_newindex = m_newparent->findChildNode(&m_node); - m_node.setParent(m_newparent); + m_newtqparent = m_node.getParent(); + m_newindex = m_newtqparent->findChildNode(&m_node); + m_node.setParent(m_newtqparent); } setCommandType(1); } void NodeUnindentCmd::unexecute() { if (m_newindex != -1) { - m_newparent->delChildNode(m_newindex, false); - m_oldparent->insertChildNode(m_oldindex, &m_node); - m_node.setParent(m_oldparent); + m_newtqparent->delChildNode(m_newindex, false); + m_oldtqparent->insertChildNode(m_oldindex, &m_node); + m_node.setParent(m_oldtqparent); m_newindex = -1; } setCommandType(1); } -NodeMoveUpCmd::NodeMoveUpCmd(Part *part, Node &node, QString name) +NodeMoveUpCmd::NodeMoveUpCmd(Part *part, Node &node, TQString name) : NamedCommand(part, name), m_node(node), m_moved(false) { @@ -715,7 +715,7 @@ void NodeMoveUpCmd::unexecute() { setCommandType(0); } -NodeMoveDownCmd::NodeMoveDownCmd(Part *part, Node &node, QString name) +NodeMoveDownCmd::NodeMoveDownCmd(Part *part, Node &node, TQString name) : NamedCommand(part, name), m_node(node), m_moved(false) { @@ -736,14 +736,14 @@ void NodeMoveDownCmd::unexecute() { setCommandType(0); } -AddRelationCmd::AddRelationCmd(Part *part, Relation *rel, QString name) +AddRelationCmd::AddRelationCmd(Part *part, Relation *rel, TQString name) : NamedCommand(part, name), m_rel(rel) { m_taken = true; - Node *p = rel->parent()->projectNode(); + Node *p = rel->tqparent()->projectNode(); if (p) { - QIntDictIterator<Schedule> it = p->schedules(); + TQIntDictIterator<Schedule> it = p->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -754,29 +754,29 @@ AddRelationCmd::~AddRelationCmd() { delete m_rel; } void AddRelationCmd::execute() { - //kdDebug()<<k_funcinfo<<m_rel->parent()<<" to "<<m_rel->child()<<endl; + //kdDebug()<<k_funcinfo<<m_rel->tqparent()<<" to "<<m_rel->child()<<endl; m_taken = false; - m_rel->parent()->addDependChildNode(m_rel); + m_rel->tqparent()->addDependChildNode(m_rel); m_rel->child()->addDependParentNode(m_rel); setSchScheduled(false); setCommandType(1); } void AddRelationCmd::unexecute() { m_taken = true; - m_rel->parent()->takeDependChildNode(m_rel); + m_rel->tqparent()->takeDependChildNode(m_rel); m_rel->child()->takeDependParentNode(m_rel); setSchScheduled(); setCommandType(1); } -DeleteRelationCmd::DeleteRelationCmd(Part *part, Relation *rel, QString name) +DeleteRelationCmd::DeleteRelationCmd(Part *part, Relation *rel, TQString name) : NamedCommand(part, name), m_rel(rel) { m_taken = false; - Node *p = rel->parent()->projectNode(); + Node *p = rel->tqparent()->projectNode(); if (p) { - QIntDictIterator<Schedule> it = p->schedules(); + TQIntDictIterator<Schedule> it = p->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -787,30 +787,30 @@ DeleteRelationCmd::~DeleteRelationCmd() { delete m_rel; } void DeleteRelationCmd::execute() { - //kdDebug()<<k_funcinfo<<m_rel->parent()<<" to "<<m_rel->child()<<endl; + //kdDebug()<<k_funcinfo<<m_rel->tqparent()<<" to "<<m_rel->child()<<endl; m_taken = true; - m_rel->parent()->takeDependChildNode(m_rel); + m_rel->tqparent()->takeDependChildNode(m_rel); m_rel->child()->takeDependParentNode(m_rel); setSchScheduled(false); setCommandType(1); } void DeleteRelationCmd::unexecute() { m_taken = false; - m_rel->parent()->addDependChildNode(m_rel); + m_rel->tqparent()->addDependChildNode(m_rel); m_rel->child()->addDependParentNode(m_rel); setSchScheduled(); setCommandType(1); } -ModifyRelationTypeCmd::ModifyRelationTypeCmd(Part *part, Relation *rel, Relation::Type type, QString name) +ModifyRelationTypeCmd::ModifyRelationTypeCmd(Part *part, Relation *rel, Relation::Type type, TQString name) : NamedCommand(part, name), m_rel(rel), m_newtype(type) { m_oldtype = rel->type(); - Node *p = rel->parent()->projectNode(); + Node *p = rel->tqparent()->projectNode(); if (p) { - QIntDictIterator<Schedule> it = p->schedules(); + TQIntDictIterator<Schedule> it = p->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -827,15 +827,15 @@ void ModifyRelationTypeCmd::unexecute() { setCommandType(1); } -ModifyRelationLagCmd::ModifyRelationLagCmd(Part *part, Relation *rel, Duration lag, QString name) +ModifyRelationLagCmd::ModifyRelationLagCmd(Part *part, Relation *rel, Duration lag, TQString name) : NamedCommand(part, name), m_rel(rel), m_newlag(lag) { m_oldlag = rel->lag(); - Node *p = rel->parent()->projectNode(); + Node *p = rel->tqparent()->projectNode(); if (p) { - QIntDictIterator<Schedule> it = p->schedules(); + TQIntDictIterator<Schedule> it = p->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -852,7 +852,7 @@ void ModifyRelationLagCmd::unexecute() { setCommandType(1); } -AddResourceRequestCmd::AddResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name) +AddResourceRequestCmd::AddResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, TQString name) : NamedCommand(part, name), m_group(group), m_request(request) { @@ -878,7 +878,7 @@ void AddResourceRequestCmd::unexecute() { setCommandType(1); } -RemoveResourceRequestCmd::RemoveResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name) +RemoveResourceRequestCmd::RemoveResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, TQString name) : NamedCommand(part, name), m_group(group), m_request(request) { @@ -887,7 +887,7 @@ RemoveResourceRequestCmd::RemoveResourceRequestCmd(Part *part, ResourceGroupReq //kdDebug()<<k_funcinfo<<"group="<<group<<" req="<<request<<endl; Task *t = request->task(); if (t) { // safety, something is seriously wrong! - QIntDictIterator<Schedule> it = t->schedules(); + TQIntDictIterator<Schedule> it = t->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -910,13 +910,13 @@ void RemoveResourceRequestCmd::unexecute() { setCommandType(1); } -ModifyEffortCmd::ModifyEffortCmd(Part *part, Node &node, Duration oldvalue, Duration newvalue, QString name) +ModifyEffortCmd::ModifyEffortCmd(Part *part, Node &node, Duration oldvalue, Duration newvalue, TQString name) : NamedCommand(part, name), m_effort(node.effort()), m_oldvalue(oldvalue), m_newvalue(newvalue) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -932,13 +932,13 @@ void ModifyEffortCmd::unexecute() { setCommandType(1); } -EffortModifyOptimisticRatioCmd::EffortModifyOptimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name) +EffortModifyOptimisticRatioCmd::EffortModifyOptimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name) : NamedCommand(part, name), m_effort(node.effort()), m_oldvalue(oldvalue), m_newvalue(newvalue) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -954,13 +954,13 @@ void EffortModifyOptimisticRatioCmd::unexecute() { setCommandType(1); } -EffortModifyPessimisticRatioCmd::EffortModifyPessimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name) +EffortModifyPessimisticRatioCmd::EffortModifyPessimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name) : NamedCommand(part, name), m_effort(node.effort()), m_oldvalue(oldvalue), m_newvalue(newvalue) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -976,13 +976,13 @@ void EffortModifyPessimisticRatioCmd::unexecute() { setCommandType(1); } -ModifyEffortTypeCmd::ModifyEffortTypeCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name) +ModifyEffortTypeCmd::ModifyEffortTypeCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name) : NamedCommand(part, name), m_effort(node.effort()), m_oldvalue(oldvalue), m_newvalue(newvalue) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -998,13 +998,13 @@ void ModifyEffortTypeCmd::unexecute() { setCommandType(1); } -EffortModifyRiskCmd::EffortModifyRiskCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name) +EffortModifyRiskCmd::EffortModifyRiskCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name) : NamedCommand(part, name), m_effort(node.effort()), m_oldvalue(oldvalue), m_newvalue(newvalue) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1020,7 +1020,7 @@ void EffortModifyRiskCmd::unexecute() { setCommandType(1); } -AddResourceGroupRequestCmd::AddResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, QString name) +AddResourceGroupRequestCmd::AddResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, TQString name) : NamedCommand(part, name), m_task(task), m_request(request) { @@ -1042,15 +1042,15 @@ void AddResourceGroupRequestCmd::unexecute() { setCommandType(1); } -RemoveResourceGroupRequestCmd::RemoveResourceGroupRequestCmd(Part *part, ResourceGroupRequest *request, QString name) +RemoveResourceGroupRequestCmd::RemoveResourceGroupRequestCmd(Part *part, ResourceGroupRequest *request, TQString name) : NamedCommand(part, name), - m_task(request->parent()->task()), + m_task(request->tqparent()->task()), m_request(request) { m_mine = false; } -RemoveResourceGroupRequestCmd::RemoveResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, QString name) +RemoveResourceGroupRequestCmd::RemoveResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, TQString name) : NamedCommand(part, name), m_task(task), m_request(request) { @@ -1072,7 +1072,7 @@ void RemoveResourceGroupRequestCmd::unexecute() { setCommandType(1); } -AddResourceCmd::AddResourceCmd(Part *part, ResourceGroup *group, Resource *resource, QString name) +AddResourceCmd::AddResourceCmd(Part *part, ResourceGroup *group, Resource *resource, TQString name) : NamedCommand(part, name), m_group(group), m_resource(resource) { @@ -1099,13 +1099,13 @@ void AddResourceCmd::unexecute() { setCommandType(0); } -RemoveResourceCmd::RemoveResourceCmd(Part *part, ResourceGroup *group, Resource *resource, QString name) +RemoveResourceCmd::RemoveResourceCmd(Part *part, ResourceGroup *group, Resource *resource, TQString name) : AddResourceCmd(part, group, resource, name) { //kdDebug()<<k_funcinfo<<resource<<endl; m_mine = false; m_requests = m_resource->requests(); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1114,16 +1114,16 @@ RemoveResourceCmd::~RemoveResourceCmd() { m_appointments.setAutoDelete(true); } void RemoveResourceCmd::execute() { - QPtrListIterator<ResourceRequest> it = m_requests; + TQPtrListIterator<ResourceRequest> it = m_requests; for (; it.current(); ++it) { - it.current()->parent()->takeResourceRequest(it.current()); + it.current()->tqparent()->takeResourceRequest(it.current()); //kdDebug()<<"Remove request for"<<it.current()->resource()->name()<<endl; } - QPtrListIterator<Appointment> ait = m_resource->appointments(); + TQPtrListIterator<Appointment> ait = m_resource->appointments(); for (; ait.current(); ++ait) { m_appointments.append(ait.current()); } - QPtrListIterator<Appointment> mit = m_appointments; + TQPtrListIterator<Appointment> mit = m_appointments; for (; mit.current(); ++mit) { mit.current()->detach(); //NOTE: removes from m_resource->appointments() //kdDebug()<<k_funcinfo<<"detached: "<<mit.current()<<endl; @@ -1137,16 +1137,16 @@ void RemoveResourceCmd::unexecute() { //kdDebug()<<k_funcinfo<<"attach: "<<m_appointments.current()<<endl; m_appointments.take()->attach(); } - QPtrListIterator<ResourceRequest> it = m_requests; + TQPtrListIterator<ResourceRequest> it = m_requests; for (; it.current(); ++it) { - it.current()->parent()->addResourceRequest(it.current()); + it.current()->tqparent()->addResourceRequest(it.current()); //kdDebug()<<"Add request for "<<it.current()->resource()->name()<<endl; } AddResourceCmd::execute(); setSchScheduled(); } -ModifyResourceNameCmd::ModifyResourceNameCmd(Part *part, Resource *resource, QString value, QString name) +ModifyResourceNameCmd::ModifyResourceNameCmd(Part *part, Resource *resource, TQString value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { @@ -1162,7 +1162,7 @@ void ModifyResourceNameCmd::unexecute() { setCommandType(0); } -ModifyResourceInitialsCmd::ModifyResourceInitialsCmd(Part *part, Resource *resource, QString value, QString name) +ModifyResourceInitialsCmd::ModifyResourceInitialsCmd(Part *part, Resource *resource, TQString value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { @@ -1178,7 +1178,7 @@ void ModifyResourceInitialsCmd::unexecute() { setCommandType(0); } -ModifyResourceEmailCmd::ModifyResourceEmailCmd(Part *part, Resource *resource, QString value, QString name) +ModifyResourceEmailCmd::ModifyResourceEmailCmd(Part *part, Resource *resource, TQString value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { @@ -1194,13 +1194,13 @@ void ModifyResourceEmailCmd::unexecute() { setCommandType(0); } -ModifyResourceTypeCmd::ModifyResourceTypeCmd(Part *part, Resource *resource, int value, QString name) +ModifyResourceTypeCmd::ModifyResourceTypeCmd(Part *part, Resource *resource, int value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { m_oldvalue = resource->type(); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1215,13 +1215,13 @@ void ModifyResourceTypeCmd::unexecute() { setSchScheduled(); setCommandType(1); } -ModifyResourceUnitsCmd::ModifyResourceUnitsCmd(Part *part, Resource *resource, int value, QString name) +ModifyResourceUnitsCmd::ModifyResourceUnitsCmd(Part *part, Resource *resource, int value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { m_oldvalue = resource->units(); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1237,16 +1237,16 @@ void ModifyResourceUnitsCmd::unexecute() { setCommandType(1); } -ModifyResourceAvailableFromCmd::ModifyResourceAvailableFromCmd(Part *part, Resource *resource, DateTime value, QString name) +ModifyResourceAvailableFromCmd::ModifyResourceAvailableFromCmd(Part *part, Resource *resource, DateTime value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { m_oldvalue = resource->availableFrom(); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); if (!it.isEmpty() && resource->project()) { - QDateTime s; - QDateTime e; + TQDateTime s; + TQDateTime e; for (; it.current(); ++it) { Schedule *sch = resource->project()->findSchedule(it.current()->id()); if (sch) { @@ -1271,16 +1271,16 @@ void ModifyResourceAvailableFromCmd::unexecute() { setCommandType(1); //FIXME } -ModifyResourceAvailableUntilCmd::ModifyResourceAvailableUntilCmd(Part *part, Resource *resource, DateTime value, QString name) +ModifyResourceAvailableUntilCmd::ModifyResourceAvailableUntilCmd(Part *part, Resource *resource, DateTime value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { m_oldvalue = resource->availableUntil(); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); if (!it.isEmpty()) { - QDateTime s; - QDateTime e; + TQDateTime s; + TQDateTime e; for (; it.current(); ++it) { Schedule *sch = resource->project()->findSchedule(it.current()->id()); if (sch) { @@ -1305,7 +1305,7 @@ void ModifyResourceAvailableUntilCmd::unexecute() { setCommandType(1); //FIXME } -ModifyResourceNormalRateCmd::ModifyResourceNormalRateCmd(Part *part, Resource *resource, double value, QString name) +ModifyResourceNormalRateCmd::ModifyResourceNormalRateCmd(Part *part, Resource *resource, double value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { @@ -1321,7 +1321,7 @@ void ModifyResourceNormalRateCmd::unexecute() { setCommandType(0); } -ModifyResourceOvertimeRateCmd::ModifyResourceOvertimeRateCmd(Part *part, Resource *resource, double value, QString name) +ModifyResourceOvertimeRateCmd::ModifyResourceOvertimeRateCmd(Part *part, Resource *resource, double value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { @@ -1338,13 +1338,13 @@ void ModifyResourceOvertimeRateCmd::unexecute() { setCommandType(0); } -ModifyResourceCalendarCmd::ModifyResourceCalendarCmd(Part *part, Resource *resource, Calendar *value, QString name) +ModifyResourceCalendarCmd::ModifyResourceCalendarCmd(Part *part, Resource *resource, Calendar *value, TQString name) : NamedCommand(part, name), m_resource(resource), m_newvalue(value) { m_oldvalue = resource->calendar(true); - QIntDictIterator<Schedule> it = resource->schedules(); + TQIntDictIterator<Schedule> it = resource->schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1360,7 +1360,7 @@ void ModifyResourceCalendarCmd::unexecute() { setCommandType(1); } -RemoveResourceGroupCmd::RemoveResourceGroupCmd(Part *part, ResourceGroup *group, QString name) +RemoveResourceGroupCmd::RemoveResourceGroupCmd(Part *part, ResourceGroup *group, TQString name) : NamedCommand(part, name), m_group(group) { @@ -1373,10 +1373,10 @@ RemoveResourceGroupCmd::~RemoveResourceGroupCmd() { void RemoveResourceGroupCmd::execute() { // remove all requests to this group int c=0; - QPtrListIterator<ResourceGroupRequest> it = m_group->requests(); + TQPtrListIterator<ResourceGroupRequest> it = m_group->requests(); for (; it.current(); ++it) { - if (it.current()->parent()) { - it.current()->parent()->takeRequest(it.current()); + if (it.current()->tqparent()) { + it.current()->tqparent()->takeRequest(it.current()); } c = 1; } @@ -1389,10 +1389,10 @@ void RemoveResourceGroupCmd::execute() { void RemoveResourceGroupCmd::unexecute() { // add all requests int c=0; - QPtrListIterator<ResourceGroupRequest> it = m_group->requests(); + TQPtrListIterator<ResourceGroupRequest> it = m_group->requests(); for (; it.current(); ++it) { - if (it.current()->parent()) { - it.current()->parent()->addRequest(it.current()); + if (it.current()->tqparent()) { + it.current()->tqparent()->addRequest(it.current()); } c = 1; } @@ -1404,7 +1404,7 @@ void RemoveResourceGroupCmd::unexecute() { setCommandType(c); } -AddResourceGroupCmd::AddResourceGroupCmd(Part *part, ResourceGroup *group, QString name) +AddResourceGroupCmd::AddResourceGroupCmd(Part *part, ResourceGroup *group, TQString name) : RemoveResourceGroupCmd(part, group, name) { m_mine = true; @@ -1416,7 +1416,7 @@ void AddResourceGroupCmd::unexecute() { RemoveResourceGroupCmd::execute(); } -ModifyResourceGroupNameCmd::ModifyResourceGroupNameCmd(Part *part, ResourceGroup *group, QString value, QString name) +ModifyResourceGroupNameCmd::ModifyResourceGroupNameCmd(Part *part, ResourceGroup *group, TQString value, TQString name) : NamedCommand(part, name), m_group(group), m_newvalue(value) { @@ -1433,7 +1433,7 @@ void ModifyResourceGroupNameCmd::unexecute() { setCommandType(0); } -TaskModifyProgressCmd::TaskModifyProgressCmd(Part *part, Task &task, struct Task::Progress &value, QString name) +TaskModifyProgressCmd::TaskModifyProgressCmd(Part *part, Task &task, struct Task::Progress &value, TQString name) : NamedCommand(part, name), m_task(task), m_newvalue(value) { @@ -1450,7 +1450,7 @@ void TaskModifyProgressCmd::unexecute() { setCommandType(0); } -ProjectModifyBaselineCmd::ProjectModifyBaselineCmd(Part *part, Project &project, bool value, QString name) +ProjectModifyBaselineCmd::ProjectModifyBaselineCmd(Part *part, Project &project, bool value, TQString name) : NamedCommand(part, name), m_project(project), m_newvalue(value) { @@ -1467,20 +1467,20 @@ void ProjectModifyBaselineCmd::unexecute() { setCommandType(2); } -AddAccountCmd::AddAccountCmd(Part *part, Project &project, Account *account, QString parent, QString name) +AddAccountCmd::AddAccountCmd(Part *part, Project &project, Account *account, TQString tqparent, TQString name) : NamedCommand(part, name), m_project(project), m_account(account), m_parent(0), - m_parentName(parent) { + m_parentName(tqparent) { m_mine = true; } -AddAccountCmd::AddAccountCmd(Part *part, Project &project, Account *account, Account *parent, QString name) +AddAccountCmd::AddAccountCmd(Part *part, Project &project, Account *account, Account *tqparent, TQString name) : NamedCommand(part, name), m_project(project), m_account(account), - m_parent(parent) { + m_parent(tqparent) { m_mine = true; } @@ -1511,7 +1511,7 @@ void AddAccountCmd::unexecute() { m_mine = true; } -RemoveAccountCmd::RemoveAccountCmd(Part *part, Project &project, Account *account, QString name) +RemoveAccountCmd::RemoveAccountCmd(Part *part, Project &project, Account *account, TQString name) : NamedCommand(part, name), m_project(project), m_account(account) { @@ -1528,8 +1528,8 @@ void RemoveAccountCmd::execute() { if (m_isDefault) { m_project.accounts().setDefaultAccount(0); } - if (m_account->parent()) - m_account->parent()->take(m_account); + if (m_account->tqparent()) + m_account->tqparent()->take(m_account); else m_project.accounts().take(m_account); @@ -1537,8 +1537,8 @@ void RemoveAccountCmd::execute() { m_mine = true; } void RemoveAccountCmd::unexecute() { - if (m_account->parent()) - m_account->parent()->append(m_account); + if (m_account->tqparent()) + m_account->tqparent()->append(m_account); else m_project.accounts().append(m_account); @@ -1549,7 +1549,7 @@ void RemoveAccountCmd::unexecute() { m_mine = false; } -RenameAccountCmd::RenameAccountCmd(Part *part, Account *account, QString value, QString name) +RenameAccountCmd::RenameAccountCmd(Part *part, Account *account, TQString value, TQString name) : NamedCommand(part, name), m_account(account) { m_oldvalue = account->name(); @@ -1565,7 +1565,7 @@ void RenameAccountCmd::unexecute() { setCommandType(0); } -ModifyAccountDescriptionCmd::ModifyAccountDescriptionCmd(Part *part, Account *account, QString value, QString name) +ModifyAccountDescriptionCmd::ModifyAccountDescriptionCmd(Part *part, Account *account, TQString value, TQString name) : NamedCommand(part, name), m_account(account) { m_oldvalue = account->description(); @@ -1582,7 +1582,7 @@ void ModifyAccountDescriptionCmd::unexecute() { } -NodeModifyStartupCostCmd::NodeModifyStartupCostCmd(Part *part, Node &node, double value, QString name) +NodeModifyStartupCostCmd::NodeModifyStartupCostCmd(Part *part, Node &node, double value, TQString name) : NamedCommand(part, name), m_node(node) { m_oldvalue = node.startupCost(); @@ -1598,7 +1598,7 @@ void NodeModifyStartupCostCmd::unexecute() { setCommandType(0); } -NodeModifyShutdownCostCmd::NodeModifyShutdownCostCmd(Part *part, Node &node, double value, QString name) +NodeModifyShutdownCostCmd::NodeModifyShutdownCostCmd(Part *part, Node &node, double value, TQString name) : NamedCommand(part, name), m_node(node) { m_oldvalue = node.startupCost(); @@ -1614,7 +1614,7 @@ void NodeModifyShutdownCostCmd::unexecute() { setCommandType(0); } -NodeModifyRunningAccountCmd::NodeModifyRunningAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name) +NodeModifyRunningAccountCmd::NodeModifyRunningAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name) : NamedCommand(part, name), m_node(node) { m_oldvalue = oldvalue; @@ -1642,7 +1642,7 @@ void NodeModifyRunningAccountCmd::unexecute() { setCommandType(0); } -NodeModifyStartupAccountCmd::NodeModifyStartupAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name) +NodeModifyStartupAccountCmd::NodeModifyStartupAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name) : NamedCommand(part, name), m_node(node) { m_oldvalue = oldvalue; @@ -1671,7 +1671,7 @@ void NodeModifyStartupAccountCmd::unexecute() { setCommandType(0); } -NodeModifyShutdownAccountCmd::NodeModifyShutdownAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name) +NodeModifyShutdownAccountCmd::NodeModifyShutdownAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name) : NamedCommand(part, name), m_node(node) { m_oldvalue = oldvalue; @@ -1700,7 +1700,7 @@ void NodeModifyShutdownAccountCmd::unexecute() { setCommandType(0); } -ModifyDefaultAccountCmd::ModifyDefaultAccountCmd(Part *part, Accounts &acc, Account *oldvalue, Account *newvalue, QString name) +ModifyDefaultAccountCmd::ModifyDefaultAccountCmd(Part *part, Accounts &acc, Account *oldvalue, Account *newvalue, TQString name) : NamedCommand(part, name), m_accounts(acc) { m_oldvalue = oldvalue; @@ -1719,13 +1719,13 @@ void ModifyDefaultAccountCmd::unexecute() { setCommandType(0); } -ProjectModifyConstraintCmd::ProjectModifyConstraintCmd(Part *part, Project &node, Node::ConstraintType c, QString name) +ProjectModifyConstraintCmd::ProjectModifyConstraintCmd(Part *part, Project &node, Node::ConstraintType c, TQString name) : NamedCommand(part, name), m_node(node), newConstraint(c), oldConstraint(static_cast<Node::ConstraintType>(node.constraint())) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1741,13 +1741,13 @@ void ProjectModifyConstraintCmd::unexecute() { setCommandType(1); } -ProjectModifyStartTimeCmd::ProjectModifyStartTimeCmd(Part *part, Project &node, QDateTime dt, QString name) +ProjectModifyStartTimeCmd::ProjectModifyStartTimeCmd(Part *part, Project &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), oldTime(node.startTime()) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1764,13 +1764,13 @@ void ProjectModifyStartTimeCmd::unexecute() { setCommandType(1); } -ProjectModifyEndTimeCmd::ProjectModifyEndTimeCmd(Part *part, Project &node, QDateTime dt, QString name) +ProjectModifyEndTimeCmd::ProjectModifyEndTimeCmd(Part *part, Project &node, TQDateTime dt, TQString name) : NamedCommand(part, name), m_node(node), newTime(dt), oldTime(node.endTime()) { - QIntDictIterator<Schedule> it = node.schedules(); + TQIntDictIterator<Schedule> it = node.schedules(); for (; it.current(); ++it) { addSchScheduled(it.current()); } @@ -1787,7 +1787,7 @@ void ProjectModifyEndTimeCmd::unexecute() { setCommandType(1); } -CalculateProjectCmd::CalculateProjectCmd(Part *part, Project &node, QString tname, int type, QString name) +CalculateProjectCmd::CalculateProjectCmd(Part *part, Project &node, TQString tname, int type, TQString name) : NamedCommand(part, name), m_node(node), m_typename(tname), @@ -1817,7 +1817,7 @@ void CalculateProjectCmd::unexecute() { setCommandType(0); } -RecalculateProjectCmd::RecalculateProjectCmd(Part *part, Project &node, Schedule &sch, QString name) +RecalculateProjectCmd::RecalculateProjectCmd(Part *part, Project &node, Schedule &sch, TQString name) : NamedCommand(part, name), m_node(node), oldSchedule(sch), @@ -1849,7 +1849,7 @@ void RecalculateProjectCmd::unexecute() { } -ModifyStandardWorktimeYearCmd::ModifyStandardWorktimeYearCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name) +ModifyStandardWorktimeYearCmd::ModifyStandardWorktimeYearCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name) : NamedCommand(part, name), swt(wt), m_oldvalue(oldvalue), @@ -1865,7 +1865,7 @@ void ModifyStandardWorktimeYearCmd::unexecute() { setCommandType(0); } -ModifyStandardWorktimeMonthCmd::ModifyStandardWorktimeMonthCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name) +ModifyStandardWorktimeMonthCmd::ModifyStandardWorktimeMonthCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name) : NamedCommand(part, name), swt(wt), m_oldvalue(oldvalue), @@ -1881,7 +1881,7 @@ void ModifyStandardWorktimeMonthCmd::unexecute() { setCommandType(0); } -ModifyStandardWorktimeWeekCmd::ModifyStandardWorktimeWeekCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name) +ModifyStandardWorktimeWeekCmd::ModifyStandardWorktimeWeekCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name) : NamedCommand(part, name), swt(wt), m_oldvalue(oldvalue), @@ -1897,7 +1897,7 @@ void ModifyStandardWorktimeWeekCmd::unexecute() { setCommandType(0); } -ModifyStandardWorktimeDayCmd::ModifyStandardWorktimeDayCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name) +ModifyStandardWorktimeDayCmd::ModifyStandardWorktimeDayCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name) : NamedCommand(part, name), swt(wt), m_oldvalue(oldvalue), diff --git a/kplato/kptcommand.h b/kplato/kptcommand.h index a61da649..4c94e978 100644 --- a/kplato/kptcommand.h +++ b/kplato/kptcommand.h @@ -28,7 +28,7 @@ #include "kptpart.h" #include "kpttask.h" -class QString; +class TQString; namespace KPlato { @@ -50,7 +50,7 @@ class StandardWorktime; class NamedCommand : public KNamedCommand { public: - NamedCommand(Part *part, QString name) + NamedCommand(Part *part, TQString name) : KNamedCommand(name), m_part(part) {} @@ -64,7 +64,7 @@ protected: void addSchScheduled(Schedule *sch); void addSchDeleted(Schedule *sch); - QMap<Schedule*, bool> m_schedules; + TQMap<Schedule*, bool> m_schedules; private: Part *m_part; }; @@ -72,7 +72,7 @@ private: class CalendarAddCmd : public NamedCommand { public: - CalendarAddCmd(Part *part, Project *project, Calendar *cal, QString name=0); + CalendarAddCmd(Part *part, Project *project, Calendar *cal, TQString name=0); void execute(); void unexecute(); @@ -85,7 +85,7 @@ private: class CalendarDeleteCmd : public NamedCommand { public: - CalendarDeleteCmd(Part *part, Calendar *cal, QString name=0); + CalendarDeleteCmd(Part *part, Calendar *cal, TQString name=0); void execute(); void unexecute(); @@ -96,20 +96,20 @@ private: class CalendarModifyNameCmd : public NamedCommand { public: - CalendarModifyNameCmd(Part *part, Calendar *cal, QString newvalue, QString name=0); + CalendarModifyNameCmd(Part *part, Calendar *cal, TQString newvalue, TQString name=0); void execute(); void unexecute(); private: Calendar *m_cal; - QString m_newvalue; - QString m_oldvalue; + TQString m_newvalue; + TQString m_oldvalue; }; class CalendarModifyParentCmd : public NamedCommand { public: - CalendarModifyParentCmd(Part *part, Calendar *cal, Calendar *newvalue, QString name=0); + CalendarModifyParentCmd(Part *part, Calendar *cal, Calendar *newvalue, TQString name=0); void execute(); void unexecute(); @@ -122,7 +122,7 @@ private: class CalendarAddDayCmd : public NamedCommand { public: - CalendarAddDayCmd(Part *part, Calendar *cal, CalendarDay *newvalue, QString name=0); + CalendarAddDayCmd(Part *part, Calendar *cal, CalendarDay *newvalue, TQString name=0); ~CalendarAddDayCmd(); void execute(); void unexecute(); @@ -136,7 +136,7 @@ protected: class CalendarRemoveDayCmd : public NamedCommand { public: - CalendarRemoveDayCmd(Part *part, Calendar *cal, const QDate &day, QString name=0); + CalendarRemoveDayCmd(Part *part, Calendar *cal, const TQDate &day, TQString name=0); void execute(); void unexecute(); @@ -149,7 +149,7 @@ protected: class CalendarModifyDayCmd : public NamedCommand { public: - CalendarModifyDayCmd(Part *part, Calendar *cal, CalendarDay *value, QString name=0); + CalendarModifyDayCmd(Part *part, Calendar *cal, CalendarDay *value, TQString name=0); ~CalendarModifyDayCmd(); void execute(); void unexecute(); @@ -164,7 +164,7 @@ private: class CalendarModifyWeekdayCmd : public NamedCommand { public: - CalendarModifyWeekdayCmd(Part *part, Calendar *cal, int weekday, CalendarDay *value, QString name=0); + CalendarModifyWeekdayCmd(Part *part, Calendar *cal, int weekday, CalendarDay *value, TQString name=0); ~CalendarModifyWeekdayCmd(); void execute(); void unexecute(); @@ -180,7 +180,7 @@ private: class NodeDeleteCmd : public NamedCommand { public: - NodeDeleteCmd(Part *part, Node *node, QString name=0); + NodeDeleteCmd(Part *part, Node *node, TQString name=0); ~NodeDeleteCmd(); void execute(); void unexecute(); @@ -191,14 +191,14 @@ private: Project *m_project; int m_index; bool m_mine; - QPtrList<Appointment> m_appointments; + TQPtrList<Appointment> m_appointments; }; class TaskAddCmd : public NamedCommand { public: - TaskAddCmd(Part *part, Project *project, Node *node, Node *after, QString name=0); + TaskAddCmd(Part *part, Project *project, Node *node, Node *after, TQString name=0); ~TaskAddCmd(); void execute(); void unexecute(); @@ -213,7 +213,7 @@ private: class SubtaskAddCmd : public NamedCommand { public: - SubtaskAddCmd(Part *part, Project *project, Node *node, Node *parent, QString name=0); + SubtaskAddCmd(Part *part, Project *project, Node *node, Node *tqparent, TQString name=0); ~SubtaskAddCmd(); void execute(); void unexecute(); @@ -229,46 +229,46 @@ private: class NodeModifyNameCmd : public NamedCommand { public: - NodeModifyNameCmd(Part *part, Node &node, QString nodename, QString name=0); + NodeModifyNameCmd(Part *part, Node &node, TQString nodename, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QString newName; - QString oldName; + TQString newName; + TQString oldName; }; class NodeModifyLeaderCmd : public NamedCommand { public: - NodeModifyLeaderCmd(Part *part, Node &node, QString leader, QString name=0); + NodeModifyLeaderCmd(Part *part, Node &node, TQString leader, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QString newLeader; - QString oldLeader; + TQString newLeader; + TQString oldLeader; }; class NodeModifyDescriptionCmd : public NamedCommand { public: - NodeModifyDescriptionCmd(Part *part, Node &node, QString description, QString name=0); + NodeModifyDescriptionCmd(Part *part, Node &node, TQString description, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QString newDescription; - QString oldDescription; + TQString newDescription; + TQString oldDescription; }; class NodeModifyConstraintCmd : public NamedCommand { public: - NodeModifyConstraintCmd(Part *part, Node &node, Node::ConstraintType c, QString name=0); + NodeModifyConstraintCmd(Part *part, Node &node, Node::ConstraintType c, TQString name=0); void execute(); void unexecute(); @@ -282,96 +282,96 @@ private: class NodeModifyConstraintStartTimeCmd : public NamedCommand { public: - NodeModifyConstraintStartTimeCmd(Part *part, Node &node, QDateTime dt, QString name=0); + NodeModifyConstraintStartTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; class NodeModifyConstraintEndTimeCmd : public NamedCommand { public: - NodeModifyConstraintEndTimeCmd(Part *part, Node &node, QDateTime dt, QString name=0); + NodeModifyConstraintEndTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; class NodeModifyStartTimeCmd : public NamedCommand { public: - NodeModifyStartTimeCmd(Part *part, Node &node, QDateTime dt, QString name=0); + NodeModifyStartTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; class NodeModifyEndTimeCmd : public NamedCommand { public: - NodeModifyEndTimeCmd(Part *part, Node &node, QDateTime dt, QString name=0); + NodeModifyEndTimeCmd(Part *part, Node &node, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; class NodeModifyIdCmd : public NamedCommand { public: - NodeModifyIdCmd(Part *part, Node &node, QString id, QString name=0); + NodeModifyIdCmd(Part *part, Node &node, TQString id, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - QString newId; - QString oldId; + TQString newId; + TQString oldId; }; class NodeIndentCmd : public NamedCommand { public: - NodeIndentCmd(Part *part, Node &node, QString name=0); + NodeIndentCmd(Part *part, Node &node, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - Node *m_oldparent, *m_newparent; + Node *m_oldtqparent, *m_newtqparent; int m_oldindex, m_newindex; }; class NodeUnindentCmd : public NamedCommand { public: - NodeUnindentCmd(Part *part, Node &node, QString name=0); + NodeUnindentCmd(Part *part, Node &node, TQString name=0); void execute(); void unexecute(); private: Node &m_node; - Node *m_oldparent, *m_newparent; + Node *m_oldtqparent, *m_newtqparent; int m_oldindex, m_newindex; }; class NodeMoveUpCmd : public NamedCommand { public: - NodeMoveUpCmd(Part *part, Node &node, QString name=0); + NodeMoveUpCmd(Part *part, Node &node, TQString name=0); void execute(); void unexecute(); @@ -384,7 +384,7 @@ private: class NodeMoveDownCmd : public NamedCommand { public: - NodeMoveDownCmd(Part *part, Node &node, QString name=0); + NodeMoveDownCmd(Part *part, Node &node, TQString name=0); void execute(); void unexecute(); @@ -397,7 +397,7 @@ private: class AddRelationCmd : public NamedCommand { public: - AddRelationCmd(Part *part, Relation *rel, QString name=0); + AddRelationCmd(Part *part, Relation *rel, TQString name=0); ~AddRelationCmd(); void execute(); void unexecute(); @@ -411,7 +411,7 @@ private: class DeleteRelationCmd : public NamedCommand { public: - DeleteRelationCmd(Part *part, Relation *rel, QString name=0); + DeleteRelationCmd(Part *part, Relation *rel, TQString name=0); ~DeleteRelationCmd(); void execute(); void unexecute(); @@ -425,7 +425,7 @@ private: class ModifyRelationTypeCmd : public NamedCommand { public: - ModifyRelationTypeCmd(Part *part, Relation *rel, Relation::Type type, QString name=0); + ModifyRelationTypeCmd(Part *part, Relation *rel, Relation::Type type, TQString name=0); void execute(); void unexecute(); @@ -439,7 +439,7 @@ private: class ModifyRelationLagCmd : public NamedCommand { public: - ModifyRelationLagCmd(Part *part, Relation *rel, Duration lag, QString name=0); + ModifyRelationLagCmd(Part *part, Relation *rel, Duration lag, TQString name=0); void execute(); void unexecute(); @@ -453,7 +453,7 @@ private: class AddResourceRequestCmd : public NamedCommand { public: - AddResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name=0); + AddResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, TQString name=0); ~AddResourceRequestCmd(); void execute(); void unexecute(); @@ -468,7 +468,7 @@ private: class RemoveResourceRequestCmd : public NamedCommand { public: - RemoveResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, QString name=0); + RemoveResourceRequestCmd(Part *part, ResourceGroupRequest *group, ResourceRequest *request, TQString name=0); ~RemoveResourceRequestCmd(); void execute(); void unexecute(); @@ -483,7 +483,7 @@ private: class ModifyEffortCmd : public NamedCommand { public: - ModifyEffortCmd(Part *part, Node &node, Duration oldvalue, Duration newvalue, QString name=0); + ModifyEffortCmd(Part *part, Node &node, Duration oldvalue, Duration newvalue, TQString name=0); void execute(); void unexecute(); @@ -496,7 +496,7 @@ private: class EffortModifyOptimisticRatioCmd : public NamedCommand { public: - EffortModifyOptimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name=0); + EffortModifyOptimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name=0); void execute(); void unexecute(); @@ -509,7 +509,7 @@ private: class EffortModifyPessimisticRatioCmd : public NamedCommand { public: - EffortModifyPessimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name=0); + EffortModifyPessimisticRatioCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name=0); void execute(); void unexecute(); @@ -522,7 +522,7 @@ private: class ModifyEffortTypeCmd : public NamedCommand { public: - ModifyEffortTypeCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name=0); + ModifyEffortTypeCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name=0); void execute(); void unexecute(); @@ -535,7 +535,7 @@ private: class EffortModifyRiskCmd : public NamedCommand { public: - EffortModifyRiskCmd(Part *part, Node &node, int oldvalue, int newvalue, QString name=0); + EffortModifyRiskCmd(Part *part, Node &node, int oldvalue, int newvalue, TQString name=0); void execute(); void unexecute(); @@ -548,7 +548,7 @@ private: class AddResourceGroupRequestCmd : public NamedCommand { public: - AddResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, QString name=0); + AddResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, TQString name=0); void execute(); void unexecute(); @@ -561,8 +561,8 @@ private: class RemoveResourceGroupRequestCmd : public NamedCommand { public: - RemoveResourceGroupRequestCmd(Part *part, ResourceGroupRequest *request, QString name=0); - RemoveResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, QString name=0); + RemoveResourceGroupRequestCmd(Part *part, ResourceGroupRequest *request, TQString name=0); + RemoveResourceGroupRequestCmd(Part *part, Task &task, ResourceGroupRequest *request, TQString name=0); void execute(); void unexecute(); @@ -575,7 +575,7 @@ private: class AddResourceCmd : public NamedCommand { public: - AddResourceCmd(Part *part, ResourceGroup *group, Resource *resource, QString name=0); + AddResourceCmd(Part *part, ResourceGroup *group, Resource *resource, TQString name=0); ~AddResourceCmd(); void execute(); void unexecute(); @@ -590,57 +590,57 @@ protected: class RemoveResourceCmd : public AddResourceCmd { public: - RemoveResourceCmd(Part *part, ResourceGroup *group, Resource *resource, QString name=0); + RemoveResourceCmd(Part *part, ResourceGroup *group, Resource *resource, TQString name=0); ~RemoveResourceCmd(); void execute(); void unexecute(); private: - QPtrList<ResourceRequest> m_requests; - QPtrList<Appointment> m_appointments; + TQPtrList<ResourceRequest> m_requests; + TQPtrList<Appointment> m_appointments; }; class ModifyResourceNameCmd : public NamedCommand { public: - ModifyResourceNameCmd(Part *part, Resource *resource, QString value, QString name=0); + ModifyResourceNameCmd(Part *part, Resource *resource, TQString value, TQString name=0); void execute(); void unexecute(); private: Resource *m_resource; - QString m_newvalue; - QString m_oldvalue; + TQString m_newvalue; + TQString m_oldvalue; }; class ModifyResourceInitialsCmd : public NamedCommand { public: - ModifyResourceInitialsCmd(Part *part, Resource *resource, QString value, QString name=0); + ModifyResourceInitialsCmd(Part *part, Resource *resource, TQString value, TQString name=0); void execute(); void unexecute(); private: Resource *m_resource; - QString m_newvalue; - QString m_oldvalue; + TQString m_newvalue; + TQString m_oldvalue; }; class ModifyResourceEmailCmd : public NamedCommand { public: - ModifyResourceEmailCmd(Part *part, Resource *resource, QString value, QString name=0); + ModifyResourceEmailCmd(Part *part, Resource *resource, TQString value, TQString name=0); void execute(); void unexecute(); private: Resource *m_resource; - QString m_newvalue; - QString m_oldvalue; + TQString m_newvalue; + TQString m_oldvalue; }; class ModifyResourceTypeCmd : public NamedCommand { public: - ModifyResourceTypeCmd(Part *part, Resource *resource, int value, QString name=0); + ModifyResourceTypeCmd(Part *part, Resource *resource, int value, TQString name=0); void execute(); void unexecute(); @@ -653,7 +653,7 @@ private: class ModifyResourceUnitsCmd : public NamedCommand { public: - ModifyResourceUnitsCmd(Part *part, Resource *resource, int value, QString name=0); + ModifyResourceUnitsCmd(Part *part, Resource *resource, int value, TQString name=0); void execute(); void unexecute(); @@ -666,7 +666,7 @@ private: class ModifyResourceAvailableFromCmd : public NamedCommand { public: - ModifyResourceAvailableFromCmd(Part *part, Resource *resource, DateTime value, QString name=0); + ModifyResourceAvailableFromCmd(Part *part, Resource *resource, DateTime value, TQString name=0); void execute(); void unexecute(); @@ -678,7 +678,7 @@ private: class ModifyResourceAvailableUntilCmd : public NamedCommand { public: - ModifyResourceAvailableUntilCmd(Part *part, Resource *resource, DateTime value, QString name=0); + ModifyResourceAvailableUntilCmd(Part *part, Resource *resource, DateTime value, TQString name=0); void execute(); void unexecute(); @@ -691,7 +691,7 @@ private: class ModifyResourceNormalRateCmd : public NamedCommand { public: - ModifyResourceNormalRateCmd(Part *part, Resource *resource, double value, QString name=0); + ModifyResourceNormalRateCmd(Part *part, Resource *resource, double value, TQString name=0); void execute(); void unexecute(); @@ -703,7 +703,7 @@ private: class ModifyResourceOvertimeRateCmd : public NamedCommand { public: - ModifyResourceOvertimeRateCmd(Part *part, Resource *resource, double value, QString name=0); + ModifyResourceOvertimeRateCmd(Part *part, Resource *resource, double value, TQString name=0); void execute(); void unexecute(); @@ -715,7 +715,7 @@ private: class ModifyResourceCalendarCmd : public NamedCommand { public: - ModifyResourceCalendarCmd(Part *part, Resource *resource, Calendar *value, QString name=0); + ModifyResourceCalendarCmd(Part *part, Resource *resource, Calendar *value, TQString name=0); void execute(); void unexecute(); @@ -728,7 +728,7 @@ private: class RemoveResourceGroupCmd : public NamedCommand { public: - RemoveResourceGroupCmd(Part *part, ResourceGroup *group, QString name=0); + RemoveResourceGroupCmd(Part *part, ResourceGroup *group, TQString name=0); ~RemoveResourceGroupCmd(); void execute(); void unexecute(); @@ -742,7 +742,7 @@ protected: class AddResourceGroupCmd : public RemoveResourceGroupCmd { public: - AddResourceGroupCmd(Part *part, ResourceGroup *group, QString name=0); + AddResourceGroupCmd(Part *part, ResourceGroup *group, TQString name=0); void execute(); void unexecute(); }; @@ -750,20 +750,20 @@ public: class ModifyResourceGroupNameCmd : public NamedCommand { public: - ModifyResourceGroupNameCmd(Part *part, ResourceGroup *group, QString value, QString name=0); + ModifyResourceGroupNameCmd(Part *part, ResourceGroup *group, TQString value, TQString name=0); void execute(); void unexecute(); private: ResourceGroup *m_group; - QString m_newvalue; - QString m_oldvalue; + TQString m_newvalue; + TQString m_oldvalue; }; class TaskModifyProgressCmd : public NamedCommand { public: - TaskModifyProgressCmd(Part *part, Task &task, struct Task::Progress &value, QString name=0); + TaskModifyProgressCmd(Part *part, Task &task, struct Task::Progress &value, TQString name=0); void execute(); void unexecute(); @@ -776,7 +776,7 @@ private: class ProjectModifyBaselineCmd : public NamedCommand { public: - ProjectModifyBaselineCmd(Part *part, Project &project, bool value, QString name=0); + ProjectModifyBaselineCmd(Part *part, Project &project, bool value, TQString name=0); void execute(); void unexecute(); @@ -789,8 +789,8 @@ private: class AddAccountCmd : public NamedCommand { public: - AddAccountCmd(Part *part, Project &project, Account *account, Account *parent=0, QString name=0); - AddAccountCmd(Part *part, Project &project, Account *account, QString parent, QString name=0); + AddAccountCmd(Part *part, Project &project, Account *account, Account *tqparent=0, TQString name=0); + AddAccountCmd(Part *part, Project &project, Account *account, TQString tqparent, TQString name=0); ~AddAccountCmd(); void execute(); void unexecute(); @@ -802,13 +802,13 @@ private: Project &m_project; Account *m_account; Account *m_parent; - QString m_parentName; + TQString m_parentName; }; class RemoveAccountCmd : public NamedCommand { public: - RemoveAccountCmd(Part *part, Project &project, Account *account, QString name=0); + RemoveAccountCmd(Part *part, Project &project, Account *account, TQString name=0); ~RemoveAccountCmd(); void execute(); void unexecute(); @@ -824,33 +824,33 @@ private: class RenameAccountCmd : public NamedCommand { public: - RenameAccountCmd(Part *part, Account *account, QString value, QString name=0); + RenameAccountCmd(Part *part, Account *account, TQString value, TQString name=0); void execute(); void unexecute(); private: Account *m_account; - QString m_oldvalue; - QString m_newvalue; + TQString m_oldvalue; + TQString m_newvalue; }; class ModifyAccountDescriptionCmd : public NamedCommand { public: - ModifyAccountDescriptionCmd(Part *part, Account *account, QString value, QString name=0); + ModifyAccountDescriptionCmd(Part *part, Account *account, TQString value, TQString name=0); void execute(); void unexecute(); private: Account *m_account; - QString m_oldvalue; - QString m_newvalue; + TQString m_oldvalue; + TQString m_newvalue; }; class NodeModifyStartupCostCmd : public NamedCommand { public: - NodeModifyStartupCostCmd(Part *part, Node &node, double value, QString name=0); + NodeModifyStartupCostCmd(Part *part, Node &node, double value, TQString name=0); void execute(); void unexecute(); @@ -863,7 +863,7 @@ private: class NodeModifyShutdownCostCmd : public NamedCommand { public: - NodeModifyShutdownCostCmd(Part *part, Node &node, double value, QString name=0); + NodeModifyShutdownCostCmd(Part *part, Node &node, double value, TQString name=0); void execute(); void unexecute(); @@ -876,7 +876,7 @@ private: class NodeModifyRunningAccountCmd : public NamedCommand { public: - NodeModifyRunningAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name=0); + NodeModifyRunningAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name=0); void execute(); void unexecute(); @@ -889,7 +889,7 @@ private: class NodeModifyStartupAccountCmd : public NamedCommand { public: - NodeModifyStartupAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name=0); + NodeModifyStartupAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name=0); void execute(); void unexecute(); @@ -902,7 +902,7 @@ private: class NodeModifyShutdownAccountCmd : public NamedCommand { public: - NodeModifyShutdownAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, QString name=0); + NodeModifyShutdownAccountCmd(Part *part, Node &node, Account *oldvalue, Account *newvalue, TQString name=0); void execute(); void unexecute(); @@ -915,7 +915,7 @@ private: class ModifyDefaultAccountCmd : public NamedCommand { public: - ModifyDefaultAccountCmd(Part *part, Accounts &acc, Account *oldvalue, Account *newvalue, QString name=0); + ModifyDefaultAccountCmd(Part *part, Accounts &acc, Account *oldvalue, Account *newvalue, TQString name=0); void execute(); void unexecute(); @@ -928,7 +928,7 @@ private: class ProjectModifyConstraintCmd : public NamedCommand { public: - ProjectModifyConstraintCmd(Part *part, Project &node, Node::ConstraintType c, QString name=0); + ProjectModifyConstraintCmd(Part *part, Project &node, Node::ConstraintType c, TQString name=0); void execute(); void unexecute(); @@ -942,28 +942,28 @@ private: class ProjectModifyStartTimeCmd : public NamedCommand { public: - ProjectModifyStartTimeCmd(Part *part, Project &node, QDateTime dt, QString name=0); + ProjectModifyStartTimeCmd(Part *part, Project &node, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Project &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; class ProjectModifyEndTimeCmd : public NamedCommand { public: - ProjectModifyEndTimeCmd(Part *part, Project &project, QDateTime dt, QString name=0); + ProjectModifyEndTimeCmd(Part *part, Project &project, TQDateTime dt, TQString name=0); void execute(); void unexecute(); private: Project &m_node; - QDateTime newTime; - QDateTime oldTime; + TQDateTime newTime; + TQDateTime oldTime; }; @@ -971,13 +971,13 @@ private: class CalculateProjectCmd : public NamedCommand { public: - CalculateProjectCmd(Part *part, Project &project, QString tname, int type, QString name=0); + CalculateProjectCmd(Part *part, Project &project, TQString tname, int type, TQString name=0); void execute(); void unexecute(); private: Project &m_node; - QString m_typename; + TQString m_typename; int m_type; Schedule *newSchedule; Schedule *oldCurrent; @@ -986,7 +986,7 @@ private: class RecalculateProjectCmd : public NamedCommand { public: - RecalculateProjectCmd(Part *part, Project &project, Schedule &sch, QString name=0); + RecalculateProjectCmd(Part *part, Project &project, Schedule &sch, TQString name=0); void execute(); void unexecute(); @@ -1001,7 +1001,7 @@ private: class ModifyStandardWorktimeYearCmd : public NamedCommand { public: - ModifyStandardWorktimeYearCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name=0); + ModifyStandardWorktimeYearCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name=0); void execute(); void unexecute(); private: @@ -1013,7 +1013,7 @@ private: class ModifyStandardWorktimeMonthCmd : public NamedCommand { public: - ModifyStandardWorktimeMonthCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name=0); + ModifyStandardWorktimeMonthCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name=0); void execute(); void unexecute(); private: @@ -1025,7 +1025,7 @@ private: class ModifyStandardWorktimeWeekCmd : public NamedCommand { public: - ModifyStandardWorktimeWeekCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name=0); + ModifyStandardWorktimeWeekCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name=0); void execute(); void unexecute(); private: @@ -1037,7 +1037,7 @@ private: class ModifyStandardWorktimeDayCmd : public NamedCommand { public: - ModifyStandardWorktimeDayCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, QString name=0); + ModifyStandardWorktimeDayCmd(Part *part, StandardWorktime *wt, double oldvalue, double newvalue, TQString name=0); void execute(); void unexecute(); private: diff --git a/kplato/kptconfig.cc b/kplato/kptconfig.cc index fc7945e4..442fc7e8 100644 --- a/kplato/kptconfig.cc +++ b/kplato/kptconfig.cc @@ -55,7 +55,7 @@ void Config::load() { m_taskDefaults.setConstraintStartTime(config->readDateTimeEntry("ConstraintStartTime")); m_taskDefaults.setConstraintEndTime(config->readDateTimeEntry("ConstraintEndTime")); m_taskDefaults.effort()->setType((Effort::Type)config->readNumEntry("EffortType")); - m_taskDefaults.effort()->set(Duration((Q_INT64)config->readNumEntry("ExpectedEffort"))); + m_taskDefaults.effort()->set(Duration((TQ_INT64)config->readNumEntry("ExpectedEffort"))); m_taskDefaults.effort()->setPessimisticRatio(config->readNumEntry("PessimisticEffort")); m_taskDefaults.effort()->setOptimisticRatio(config->readNumEntry("OptimisticEffort")); } diff --git a/kplato/kptconfigbehaviorpanel.cc b/kplato/kptconfigbehaviorpanel.cc index d7724237..45cbf64a 100644 --- a/kplato/kptconfigbehaviorpanel.cc +++ b/kplato/kptconfigbehaviorpanel.cc @@ -33,15 +33,15 @@ #include <kstandarddirs.h> #include <kdebug.h> -#include <qlayout.h> -#include <qdatetime.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> +#include <tqlayout.h> +#include <tqdatetime.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> namespace KPlato { -ConfigBehaviorPanel::ConfigBehaviorPanel(Behavior &behavior, QWidget *p, const char *n) +ConfigBehaviorPanel::ConfigBehaviorPanel(Behavior &behavior, TQWidget *p, const char *n) : ConfigBehaviorPanelBase(p, n), m_oldvalues(behavior), m_behavior(behavior) diff --git a/kplato/kptconfigbehaviorpanel.h b/kplato/kptconfigbehaviorpanel.h index 167810a6..bf1ec649 100644 --- a/kplato/kptconfigbehaviorpanel.h +++ b/kplato/kptconfigbehaviorpanel.h @@ -33,8 +33,9 @@ class Part; class ConfigBehaviorPanel : public ConfigBehaviorPanelBase { Q_OBJECT + TQ_OBJECT public: - ConfigBehaviorPanel(Behavior &behavior, QWidget *parent=0, const char *name=0); + ConfigBehaviorPanel(Behavior &behavior, TQWidget *tqparent=0, const char *name=0); void setStartValues(); bool ok(); diff --git a/kplato/kptconfigbehaviorpanelbase.ui b/kplato/kptconfigbehaviorpanelbase.ui index 33eb4129..007e4c0d 100644 --- a/kplato/kptconfigbehaviorpanelbase.ui +++ b/kplato/kptconfigbehaviorpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>ConfigBehaviorPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ConfigBehaviorPanelBase</cstring> </property> @@ -17,7 +17,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>calculationGroup</cstring> </property> @@ -28,7 +28,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>calcManual</cstring> </property> @@ -36,7 +36,7 @@ <string>Manual</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>calcImmedate</cstring> </property> @@ -46,7 +46,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -57,7 +57,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>allowOverbooking</cstring> </property> @@ -92,11 +92,11 @@ <includes> <include location="local" impldecl="in implementation">kptconfigbehaviorpanelbase.ui.h</include> </includes> -<signals> +<Q_SIGNALS> <signal>changed()</signal> -</signals> -<slots> +</Q_SIGNALS> +<Q_SLOTS> <slot>slotChanged()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kptconfigbehaviorpanelbase.ui.h b/kplato/kptconfigbehaviorpanelbase.ui.h index 8db0f361..7960270f 100644 --- a/kplato/kptconfigbehaviorpanelbase.ui.h +++ b/kplato/kptconfigbehaviorpanelbase.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. +** TQt Designer to update this file, preserving your code. ** ** You should not define a constructor or destructor in this file. ** Instead, write your code in functions called init() and destroy(). diff --git a/kplato/kptconfigdialog.cc b/kplato/kptconfigdialog.cc index f6cb8ae4..5f7ca9ed 100644 --- a/kplato/kptconfigdialog.cc +++ b/kplato/kptconfigdialog.cc @@ -31,7 +31,7 @@ #include <klocale.h> #include <kcommand.h> -#include <qvbox.h> +#include <tqvbox.h> #include <kdebug.h> @@ -39,30 +39,30 @@ namespace KPlato { // little helper stolen from kmail/kword -static inline QPixmap loadIcon( const char * name ) { +static inline TQPixmap loadIcon( const char * name ) { return KGlobal::instance()->iconLoader() - ->loadIcon( QString::fromLatin1(name), KIcon::NoGroup, KIcon::SizeMedium ); + ->loadIcon( TQString::tqfromLatin1(name), KIcon::NoGroup, KIcon::SizeMedium ); } -ConfigDialog::ConfigDialog(Config &config, Project &project, QWidget *parent, const char *) +ConfigDialog::ConfigDialog(Config &config, Project &project, TQWidget *tqparent, const char *) : KDialogBase(KDialogBase::IconList, i18n("Configure KPlato"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel| KDialogBase::Default, - KDialogBase::Ok, parent), + KDialogBase::Ok, tqparent), m_config(config) { -/* QVBox *page = addVBoxPage(i18n("Behavior"), i18n("Behavior"), loadIcon("misc")); +/* TQVBox *page = addVBoxPage(i18n("Behavior"), i18n("Behavior"), loadIcon("misc")); m_behaviorPage = new ConfigBehaviorPanel(config.behavior(), page);*/ - QVBox *page = addVBoxPage(i18n("Task Defaults"), i18n("Task Defaults"), loadIcon("misc")); + TQVBox *page = addVBoxPage(i18n("Task Defaults"), i18n("Task Defaults"), loadIcon("misc")); m_taskDefaultPage = new TaskDefaultPanel(config.taskDefaults(), project.standardWorktime(), page); enableButtonOK(false); enableButtonApply(false); -// connect(m_behaviorPage, SIGNAL(changed()), SLOT(slotChanged())); - connect(m_taskDefaultPage, SIGNAL(changed()), SLOT(slotChanged())); +// connect(m_behaviorPage, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged())); + connect(m_taskDefaultPage, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged())); } diff --git a/kplato/kptconfigdialog.h b/kplato/kptconfigdialog.h index 1b2004b5..c30cd47b 100644 --- a/kplato/kptconfigdialog.h +++ b/kplato/kptconfigdialog.h @@ -22,7 +22,7 @@ #include <kdialogbase.h> -class QWidget; +class TQWidget; namespace KPlato { @@ -34,8 +34,9 @@ class Config; class ConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ConfigDialog(Config &config, Project &project, QWidget *parent=0, const char *name=0); + ConfigDialog(Config &config, Project &project, TQWidget *tqparent=0, const char *name=0); protected slots: void slotApply(); diff --git a/kplato/kptconfigtaskpanelbase.ui b/kplato/kptconfigtaskpanelbase.ui index 0cd3818c..e972c5c1 100644 --- a/kplato/kptconfigtaskpanelbase.ui +++ b/kplato/kptconfigtaskpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::ConfigTaskPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ConfigTaskPanelBase</cstring> </property> @@ -23,15 +23,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>leaderlabel</cstring> </property> @@ -57,7 +57,7 @@ This is not limited to persons available in a resource group but can be anyone. This is not limited to persons available in a resource group but can be anyone. You can even directly access your address book with the Choose button.</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>chooseLeader</cstring> </property> @@ -76,7 +76,7 @@ This is not limited to persons available in a resource group but can be anyone. </widget> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>schedulingGroup</cstring> </property> @@ -153,7 +153,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>scheduleType</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -172,7 +172,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>scheduleType</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -203,7 +203,7 @@ The estimation can be either effort based or duration based. If it is effort bas </date> </property> </widget> - <widget class="QTimeEdit" row="0" column="3"> + <widget class="TQTimeEdit" row="0" column="3"> <property name="name"> <cstring>scheduleStartTime</cstring> </property> @@ -216,7 +216,7 @@ The estimation can be either effort based or duration based. If it is effort bas <enum>WheelFocus</enum> </property> </widget> - <widget class="QTimeEdit" row="1" column="3"> + <widget class="TQTimeEdit" row="1" column="3"> <property name="name"> <cstring>scheduleEndTime</cstring> </property> @@ -229,15 +229,15 @@ The estimation can be either effort based or duration based. If it is effort bas <enum>WheelFocus</enum> </property> </widget> - <widget class="QLayoutWidget" row="3" column="2" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="3" column="2" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout41</cstring> + <cstring>tqlayout41</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -248,7 +248,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>optimisticValueoptimisticValue</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>optimisticValue</cstring> </property> @@ -262,7 +262,7 @@ The estimation can be either effort based or duration based. If it is effort bas <number>-99</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -273,7 +273,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>pessimisticValue</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>pessimisticValue</cstring> </property> @@ -288,7 +288,7 @@ The estimation can be either effort based or duration based. If it is effort bas </widget> </grid> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>descriptionlabell6</cstring> </property> @@ -348,7 +348,7 @@ The estimation can be either effort based or duration based. If it is effort bas <tabstop>pessimisticValue</tabstop> <tabstop>descriptionfield</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>kcombobox.h</includehint> diff --git a/kplato/kptcontext.cc b/kplato/kptcontext.cc index bdcd7e79..830c6c95 100644 --- a/kplato/kptcontext.cc +++ b/kplato/kptcontext.cc @@ -19,7 +19,7 @@ #include "kptcontext.h" -#include <qdom.h> +#include <tqdom.h> #include <kdebug.h> @@ -34,7 +34,7 @@ Context::Context() Context::~Context() { } -bool Context::load(QDomElement &element) { +bool Context::load(TQDomElement &element) { currentView = element.attribute("current-view"); currentEstimateType = element.attribute("estimate-type").toInt(); currentSchedule = element.attribute("current-schedule").toLong(); @@ -42,10 +42,10 @@ bool Context::load(QDomElement &element) { actionViewOptimistic = element.attribute("view-optimistic").toInt(); actionViewPessimistic = element.attribute("view-pessimistic").toInt(); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "gantt-view") { ganttview.ganttviewsize = e.attribute("ganttview-size").toInt(); ganttview.taskviewsize = e.attribute("taskview-size").toInt(); @@ -59,15 +59,15 @@ bool Context::load(QDomElement &element) { ganttview.showCriticalPath = e.attribute("show-criticalpath").toInt(); ganttview.showNoInformation = e.attribute("show-noinformation").toInt(); - QDomNodeList list = e.childNodes(); + TQDomNodeList list = e.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement g = list.item(i).toElement(); + TQDomElement g = list.item(i).toElement(); if (g.tagName() == "closed-nodes") { - QDomNodeList list = g.childNodes(); + TQDomNodeList list = g.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement ei = list.item(i).toElement(); + TQDomElement ei = list.item(i).toElement(); if (ei.tagName() == "node") { ganttview.closedNodes.append(ei.attribute("id")); } @@ -79,19 +79,19 @@ bool Context::load(QDomElement &element) { } else if (e.tagName() == "accounts-view") { accountsview.accountsviewsize = e.attribute("accountsview-size").toInt(); accountsview.periodviewsize = e.attribute("periodview-size").toInt(); - accountsview.date = QDate::fromString(e.attribute("date"), Qt::ISODate); + accountsview.date = TQDate::fromString(e.attribute("date"), Qt::ISODate); accountsview.period = e.attribute("period").toInt(); accountsview.cumulative = e.attribute("cumulative").toInt(); - QDomNodeList list = e.childNodes(); + TQDomNodeList list = e.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement g = list.item(i).toElement(); + TQDomElement g = list.item(i).toElement(); if (g.tagName() == "closed-items") { - QDomNodeList list = g.childNodes(); + TQDomNodeList list = g.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement ei = list.item(i).toElement(); + TQDomElement ei = list.item(i).toElement(); if (ei.tagName() == "account") { accountsview.closedItems.append(ei.attribute("name")); } @@ -109,8 +109,8 @@ bool Context::load(QDomElement &element) { return true; } -void Context::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("context"); +void Context::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("context"); element.appendChild(me); me.setAttribute("current-view", currentView); me.setAttribute("estimate-type", currentEstimateType); @@ -119,7 +119,7 @@ void Context::save(QDomElement &element) const { me.setAttribute("view-optimistic", actionViewOptimistic); me.setAttribute("view-pessimistic", actionViewPessimistic); // Ganttview - QDomElement g = me.ownerDocument().createElement("gantt-view"); + TQDomElement g = me.ownerDocument().createElement("gantt-view"); me.appendChild(g); g.setAttribute("ganttview-size", ganttview.ganttviewsize); g.setAttribute("taskview-size", ganttview.taskviewsize); @@ -133,16 +133,16 @@ void Context::save(QDomElement &element) const { g.setAttribute("show-criticalpath", ganttview.showCriticalPath); g.setAttribute("show-noinformation", ganttview.showNoInformation); if (!ganttview.closedNodes.isEmpty()) { - QDomElement e = g.ownerDocument().createElement("closed-nodes"); + TQDomElement e = g.ownerDocument().createElement("closed-nodes"); g.appendChild(e); - for (QStringList::ConstIterator it = ganttview.closedNodes.begin(); it != ganttview.closedNodes.end(); ++it) { - QDomElement c = e.ownerDocument().createElement("node"); + for (TQStringList::ConstIterator it = ganttview.closedNodes.begin(); it != ganttview.closedNodes.end(); ++it) { + TQDomElement c = e.ownerDocument().createElement("node"); e.appendChild(c); c.setAttribute("id", (*it)); } } // Accountsview - QDomElement a = me.ownerDocument().createElement("accounts-view"); + TQDomElement a = me.ownerDocument().createElement("accounts-view"); me.appendChild(a); a.setAttribute("accountsview-size", accountsview.accountsviewsize); a.setAttribute("periodview-size", accountsview.periodviewsize); @@ -150,10 +150,10 @@ void Context::save(QDomElement &element) const { a.setAttribute("period", accountsview.period); a.setAttribute("cumulative", accountsview.cumulative); if (!accountsview.closedItems.isEmpty()) { - QDomElement e = a.ownerDocument().createElement("closed-items"); + TQDomElement e = a.ownerDocument().createElement("closed-items"); a.appendChild(e); - for (QStringList::ConstIterator it = accountsview.closedItems.begin(); it != accountsview.closedItems.end(); ++it) { - QDomElement c = e.ownerDocument().createElement("account"); + for (TQStringList::ConstIterator it = accountsview.closedItems.begin(); it != accountsview.closedItems.end(); ++it) { + TQDomElement c = e.ownerDocument().createElement("account"); e.appendChild(c); c.setAttribute("name", (*it)); } diff --git a/kplato/kptcontext.h b/kplato/kptcontext.h index 5ad7b8d7..bbf7a011 100644 --- a/kplato/kptcontext.h +++ b/kplato/kptcontext.h @@ -21,11 +21,11 @@ #ifndef KPTCONTEXT_H #define KPTCONTEXT_H -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> -class QDomElement; +class TQDomElement; namespace KPlato { @@ -35,12 +35,12 @@ public: Context(); virtual ~Context(); - virtual bool load(QDomElement &element); - virtual void save(QDomElement &element) const; + virtual bool load(TQDomElement &element); + virtual void save(TQDomElement &element) const; // View - QString currentView; + TQString currentView; int currentEstimateType; long currentSchedule; bool actionViewExpected; @@ -50,7 +50,7 @@ public: struct Ganttview { int ganttviewsize; int taskviewsize; - QString currentNode; + TQString currentNode; bool showResources; bool showTaskName; bool showTaskLinks; @@ -59,7 +59,7 @@ public: bool showCriticalTasks; bool showCriticalPath; bool showNoInformation; - QStringList closedNodes; + TQStringList closedNodes; } ganttview; struct Pertview { @@ -71,10 +71,10 @@ public: struct Accountsview { int accountsviewsize; int periodviewsize; - QDate date; + TQDate date; int period; bool cumulative; - QStringList closedItems; + TQStringList closedItems; } accountsview; struct Reportview { diff --git a/kplato/kptdatetable.cc b/kplato/kptdatetable.cc index db49e657..6117a941 100644 --- a/kplato/kptdatetable.cc +++ b/kplato/kptdatetable.cc @@ -26,14 +26,14 @@ #include <knotifyclient.h> #include <kcalendarsystem.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qpen.h> -#include <qpainter.h> -#include <qdialog.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqpen.h> +#include <tqpainter.h> +#include <tqdialog.h> #include <assert.h> -#include <qlayout.h> -#include <qvaluelist.h> +#include <tqlayout.h> +#include <tqvaluelist.h> #include <kglobalsettings.h> #include <kdebug.h> @@ -41,23 +41,23 @@ namespace KPlato { -DateValidator::DateValidator(QWidget* parent, const char* name) - : QValidator(parent, name) +DateValidator::DateValidator(TQWidget* tqparent, const char* name) + : TQValidator(TQT_TQOBJECT(tqparent), name) { } -QValidator::State -DateValidator::validate(QString& text, int&) const +TQValidator::State +DateValidator::validate(TQString& text, int&) const { - QDate temp; + TQDate temp; // ----- everything is tested in date(): return date(text, temp); } -QValidator::State -DateValidator::date(const QString& text, QDate& d) const +TQValidator::State +DateValidator::date(const TQString& text, TQDate& d) const { - QDate tmp = KGlobal::locale()->readDate(text); + TQDate tmp = KGlobal::locale()->readDate(text); if (!tmp.isNull()) { d = tmp; @@ -67,14 +67,14 @@ DateValidator::date(const QString& text, QDate& d) const } void -DateValidator::fixup( QString& ) const +DateValidator::fixup( TQString& ) const { } -DateTable::DateTable(QWidget *parent, QDate date_, const char* name, WFlags f) - : QGridView(parent, name, f), +DateTable::DateTable(TQWidget *tqparent, TQDate date_, const char* name, WFlags f) + : TQGridView(tqparent, name, f), m_enabled(true) { //kdDebug()<<k_funcinfo<<endl; @@ -82,15 +82,15 @@ DateTable::DateTable(QWidget *parent, QDate date_, const char* name, WFlags f) m_selectedDates.clear(); m_selectedWeekdays.clear(); - QPair<int, int> p(0,0); + TQPair<int, int> p(0,0); m_weeks.fill(p, 7); setFontSize(10); if(!date_.isValid()) { kdError() <<k_funcinfo<<"Given date is invalid, using current date." << endl; - date_=QDate::currentDate(); + date_=TQDate::tqcurrentDate(); } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setNumCols(7+m_dateStartCol); // 7 days a week + maybe 1 for weeknumbers setNumRows(7); // 6 weeks max + headline @@ -99,9 +99,9 @@ DateTable::DateTable(QWidget *parent, QDate date_, const char* name, WFlags f) viewport()->setEraseColor(KGlobalSettings::baseColor()); setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth - colorBackgroundHoliday = QColor(0, 245, 255, QColor::Hsv); + colorBackgroundHoliday = TQColor(0, 245, 255, TQColor::Hsv); //colorBackgroundHoliday = colorBackgroundHoliday.light(); - colorBackgroundWorkday = QColor(208, 230, 240, QColor::Hsv);; + colorBackgroundWorkday = TQColor(208, 230, 240, TQColor::Hsv);; //colorBackgroundWorkday = colorBackgroundWorkday.light(); colorTextHoliday = black; colorTextWorkday = black; @@ -111,12 +111,12 @@ DateTable::DateTable(QWidget *parent, QDate date_, const char* name, WFlags f) } -void DateTable::paintWeekday(QPainter *painter, int col) { - QRect rect; +void DateTable::paintWeekday(TQPainter *painter, int col) { + TQRect rect; int w=cellWidth(); int h=cellHeight(); - QFont font = KGlobalSettings::generalFont(); + TQFont font = KGlobalSettings::generalFont(); font.setBold(true); if (!m_enabled) font.setItalic(true); @@ -142,7 +142,7 @@ void DateTable::paintWeekday(QPainter *painter, int col) { painter->drawRect(0, 0, w, h); painter->setPen(colorTextHoliday); } - if (m_selectedWeekdays.contains(day)) { + if (m_selectedWeekdays.tqcontains(day)) { painter->setPen(backgroundSelectColor); painter->setBrush(backgroundSelectColor); painter->drawRect(2, 2, w-4, h-4); @@ -159,12 +159,12 @@ void DateTable::paintWeekday(QPainter *painter, int col) { //kdDebug()<<k_funcinfo<<"headline: row,col=("<<row<<","<<col<<")"<<" day="<<daystr<<endl; } -void DateTable::paintWeekNumber(QPainter *painter, int row) { - QRect rect; +void DateTable::paintWeekNumber(TQPainter *painter, int row) { + TQRect rect; int w=cellWidth(); int h=cellHeight(); - QFont font=KGlobalSettings::generalFont(); + TQFont font=KGlobalSettings::generalFont(); font.setBold(true); if (!m_enabled) font.setItalic(true); @@ -175,7 +175,7 @@ void DateTable::paintWeekNumber(QPainter *painter, int row) { painter->drawRect(0, 0, w, h); painter->setPen(KGlobalSettings::textColor()); - painter->drawText(0, 0, w, h-1, AlignCenter, QString("%1").arg(m_weeks[row].first), -1, &rect); + painter->drawText(0, 0, w, h-1, AlignCenter, TQString("%1").tqarg(m_weeks[row].first), -1, &rect); painter->setPen(colorLine); painter->moveTo(w-1, 0); painter->lineTo(w-1, h-1); @@ -184,19 +184,19 @@ void DateTable::paintWeekNumber(QPainter *painter, int row) { if(rect.height()>maxCell.height()) maxCell.setHeight(rect.height()); } -void DateTable::paintDay(QPainter *painter, int row, int col) { +void DateTable::paintDay(TQPainter *painter, int row, int col) { //kdDebug()<<k_funcinfo<<"row,col=("<<row<<","<<col<<")"<<" num col="<<numCols()<<endl; - QRect rect; + TQRect rect; int w=cellWidth(); int h=cellHeight(); - QFont font=KGlobalSettings::generalFont(); + TQFont font=KGlobalSettings::generalFont(); font.setPointSize(fontsize); if (!m_enabled) font.setItalic(true); painter->setFont(font); - QDate d = getDate(position(row, col)); + TQDate d = getDate(position(row, col)); painter->setBrush(KGlobalSettings::baseColor()); painter->setPen(KGlobalSettings::baseColor()); @@ -214,14 +214,14 @@ void DateTable::paintDay(QPainter *painter, int row, int col) { painter->setBrush(colorBackgroundWorkday); painter->drawRect(0, 0, w, h); } - if(m_selectedDates.contains(d)) { + if(m_selectedDates.tqcontains(d)) { //kdDebug()<<k_funcinfo<<"Selected: "<<d<<" row,col=("<<row<<","<<col<<")"<<endl; painter->setPen(backgroundSelectColor); painter->setBrush(backgroundSelectColor); painter->drawRect(2, 2, w-4, h-4); } // If weeks or weekdays are selected/marked we draw lines around the date - QPen pen = painter->pen(); + TQPen pen = painter->pen(); if (m_markedWeekdays.state(weekday(col)) == Map::Working) { //kdDebug()<<k_funcinfo<<"Marked weekday: row,dayCol=("<<row<<","<<dayCol<<")=Working"<<endl; pen.setColor(colorBackgroundWorkday); @@ -232,20 +232,20 @@ void DateTable::paintDay(QPainter *painter, int row, int col) { painter->lineTo(w-1, h-1); } // then paint square if current date - if (d == QDate::currentDate()) { + if (d == TQDate::tqcurrentDate()) { painter->setPen(colorLine); painter->drawRect(1, 1, w-2, h-2); } // and now the day number d.month() == date.month() ? painter->setPen(KGlobalSettings::textColor()) : painter->setPen(gray); - painter->drawText(0, 0, w, h, AlignCenter, QString().setNum(d.day()), -1, &rect); + painter->drawText(0, 0, w, h, AlignCenter, TQString().setNum(d.day()), -1, &rect); if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); if(rect.height()>maxCell.height()) maxCell.setHeight(rect.height()); } -void DateTable::paintCell(QPainter *painter, int row, int col) { +void DateTable::paintCell(TQPainter *painter, int row, int col) { //kdDebug()<<k_funcinfo<<"row,col=("<<row<<","<<col<<")"<<"enabled="<<m_enabled<<endl; if (row == 0 && col == 0) { painter->save(); @@ -271,67 +271,67 @@ void DateTable::paintCell(QPainter *painter, int row, int col) { } //FIXME -void DateTable::keyPressEvent( QKeyEvent *e ) { +void DateTable::keyPressEvent( TQKeyEvent *e ) { if (!m_enabled) return; - if ( e->key() == Qt::Key_Prior ) { + if ( e->key() == TQt::Key_Prior ) { setDate(date.addMonths(-1)); return; } - if ( e->key() == Qt::Key_Next ) { + if ( e->key() == TQt::Key_Next ) { setDate(date.addMonths(1)); return; } - if ( e->key() == Qt::Key_Up ) { + if ( e->key() == TQt::Key_Up ) { if ( date.day() > 7 ) { setDate(date.addDays(-7)); return; } } - if ( e->key() == Qt::Key_Down ) { + if ( e->key() == TQt::Key_Down ) { if ( date.day() <= date.daysInMonth()-7 ) { setDate(date.addDays(7)); return; } } - if ( e->key() == Qt::Key_Left ) { + if ( e->key() == TQt::Key_Left ) { if ( date.day() > 1 ) { setDate(date.addDays(-1)); return; } } - if ( e->key() == Qt::Key_Right ) { + if ( e->key() == TQt::Key_Right ) { if ( date.day() < date.daysInMonth() ) { setDate(date.addDays(1)); return; } } - if ( e->key() == Qt::Key_Minus ) { + if ( e->key() == TQt::Key_Minus ) { setDate(date.addDays(-1)); return; } - if ( e->key() == Qt::Key_Plus ) { + if ( e->key() == TQt::Key_Plus ) { setDate(date.addDays(1)); return; } - if ( e->key() == Qt::Key_N ) { - setDate(QDate::currentDate()); + if ( e->key() == TQt::Key_N ) { + setDate(TQDate::tqcurrentDate()); return; } - if ( e->key() == Qt::Key_Control ) { + if ( e->key() == TQt::Key_Control ) { return; } - if ( e->key() == Qt::Key_Shift ) { + if ( e->key() == TQt::Key_Shift ) { return; } KNotifyClient::beep(); } -void DateTable::viewportResizeEvent(QResizeEvent * e) { - QGridView::viewportResizeEvent(e); +void DateTable::viewportResizeEvent(TQResizeEvent * e) { + TQGridView::viewportResizeEvent(e); setCellWidth(viewport()->width()/numCols()); setCellHeight(viewport()->height()/numRows()); @@ -339,8 +339,8 @@ void DateTable::viewportResizeEvent(QResizeEvent * e) { void DateTable::setFontSize(int size) { int count; - QFontMetrics metrics(fontMetrics()); - QRect rect; + TQFontMetrics metrics(fontMetrics()); + TQRect rect; // ----- store rectangles: fontsize=size; // ----- find largest day name: @@ -349,37 +349,37 @@ void DateTable::setFontSize(int size) { for(count=0; count<7; ++count) { rect=metrics.boundingRect(KGlobal::locale()->calendar()->weekDayName(count+1, true)); - maxCell.setWidth(QMAX(maxCell.width(), rect.width())); - maxCell.setHeight(QMAX(maxCell.height(), rect.height())); + maxCell.setWidth(TQMAX(maxCell.width(), rect.width())); + maxCell.setHeight(TQMAX(maxCell.height(), rect.height())); } // ----- compare with a real wide number and add some space: - rect=metrics.boundingRect(QString::fromLatin1("88")); - maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); - maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); + rect=metrics.boundingRect(TQString::tqfromLatin1("88")); + maxCell.setWidth(TQMAX(maxCell.width()+2, rect.width())); + maxCell.setHeight(TQMAX(maxCell.height()+4, rect.height())); } //FIXME -void DateTable::wheelEvent ( QWheelEvent * e ) { +void DateTable::wheelEvent ( TQWheelEvent * e ) { setDate(date.addMonths( -(int)(e->delta()/120)) ); e->accept(); } -void DateTable::contentsMousePressEvent(QMouseEvent *e) { +void DateTable::contentsMousePressEvent(TQMouseEvent *e) { if (!m_enabled) return; //kdDebug()<<k_funcinfo<<endl; - if(e->type()!=QEvent::MouseButtonPress) { + if(e->type()!=TQEvent::MouseButtonPress) { return; } - QPoint mouseCoord = e->pos(); + TQPoint mouseCoord = e->pos(); int row=rowAt(mouseCoord.y()); int col=columnAt(mouseCoord.x()); if (row == 0 && col == 0) { // user clicked on (unused) upper left square updateSelectedCells(); m_selectedWeekdays.clear(); m_selectedDates.clear(); - repaintContents(false); + tqrepaintContents(false); emit selectionCleared(); return; } @@ -388,7 +388,7 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { m_selectedWeekdays.clear(); m_selectedDates.clear(); updateSelectedCells(); - repaintContents(false); + tqrepaintContents(false); return; } if (row==0 && col>0) { // the user clicked on weekdays @@ -401,7 +401,7 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { bool select = false; for(int i=m_dateStartCol; i < col; ++i) { //kdDebug()<<"Down["<<i<<"]: col="<<col<<" day="<<day<<" column(i)="<<column(i)<<endl; - if (m_selectedWeekdays.contains(weekday(i))) { + if (m_selectedWeekdays.tqcontains(weekday(i))) { select = true; // we have hit a selected day; select the rest } else if (select) { m_selectedWeekdays.toggle(weekday(i)); // select @@ -411,14 +411,14 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { select = false; for(int i=7; i > col; --i) { //kdDebug()<<"Up["<<i<<"]: col="<<col<<" day="<<day<<" column(i)="<<column(i)<<endl; - if (m_selectedWeekdays.contains(weekday(i))) { + if (m_selectedWeekdays.tqcontains(weekday(i))) { if (selected) m_selectedWeekdays.toggle(weekday(i)); // deselect else select = true; } else if (select) { m_selectedWeekdays.toggle(weekday(i)); // select } } - if (!m_selectedWeekdays.contains(day)) { + if (!m_selectedWeekdays.tqcontains(day)) { m_selectedWeekdays.toggle(day); // always select } } else if (e->state() & ControlButton) { @@ -429,7 +429,7 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { m_selectedWeekdays.toggleClear(day); } updateSelectedCells(); - repaintContents(false); + tqrepaintContents(false); if (m_enabled) { //kdDebug()<<k_funcinfo<<"emit weekdaySelected("<<day<<")"<<endl; emit weekdaySelected(day); // day= 1..7 @@ -442,12 +442,12 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { m_selectedWeekdays.clear(); if (e->state() & ShiftButton) { // find first&last date - QDate first; - QDate last; + TQDate first; + TQDate last; DateMap::ConstIterator it; for (it = m_selectedDates.constBegin(); it != m_selectedDates.constEnd(); ++it) { //kdDebug()<<k_funcinfo<<it.key()<<endl; - QDate d = QDate::fromString(it.key(), Qt::ISODate); + TQDate d = TQDate::fromString(it.key(), Qt::ISODate); if (!d.isValid()) continue; if (!first.isValid() || first > d) @@ -458,7 +458,7 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { // select between anchor and pressed date inclusive m_selectedDates.clear(); if (first.isValid() && last.isValid()) { - QDate anchor = first < date ? first : last; + TQDate anchor = first < date ? first : last; int i = anchor > date ? -1 : 1; while (anchor != date) { //kdDebug()<<k_funcinfo<<anchor.toString(Qt::ISODate)<<endl; @@ -478,11 +478,11 @@ void DateTable::contentsMousePressEvent(QMouseEvent *e) { //kdDebug()<<k_funcinfo<<"toggleClear date: "<<date.toString()<<" state="<<m_selectedDates.state(date)<<endl; } } - repaintContents(false); + tqrepaintContents(false); } -bool DateTable::contentsMousePressEvent_internal(QMouseEvent *e) { - QPoint mouseCoord = e->pos(); +bool DateTable::contentsMousePressEvent_internal(TQMouseEvent *e) { + TQPoint mouseCoord = e->pos(); int row=rowAt(mouseCoord.y()); int col=columnAt(mouseCoord.x()); if(row<1 || col<0) { // the user clicked on the frame of the table @@ -493,10 +493,10 @@ bool DateTable::contentsMousePressEvent_internal(QMouseEvent *e) { return true; } -bool DateTable::selectDate(const QDate& date_) { +bool DateTable::selectDate(const TQDate& date_) { //kdDebug()<<k_funcinfo<<"date="<<date_.toString()<<endl; bool changed=false; - QDate temp; + TQDate temp; // ----- if(!date_.isValid()) { return false; @@ -512,25 +512,25 @@ bool DateTable::selectDate(const QDate& date_) { numdays=date.daysInMonth(); if(date.month()==1) { // set to december of previous year temp.setYMD(date.year()-1, 12, 1); - setWeekNumbers(QDate(date.year()-1, 12, 31)); + setWeekNumbers(TQDate(date.year()-1, 12, 31)); } else { // set to previous month temp.setYMD(date.year(), date.month()-1, 1); - QDate d(date.year(), date.month()-1,1); + TQDate d(date.year(), date.month()-1,1); setWeekNumbers(d.addDays(d.daysInMonth()-1)); } numDaysPrevMonth=temp.daysInMonth(); if(changed) { - repaintContents(false); + tqrepaintContents(false); } if (m_enabled) emit(dateChanged(date)); return true; } -bool DateTable::setDate(const QDate& date_, bool repaint) { +bool DateTable::setDate(const TQDate& date_, bool tqrepaint) { //kdDebug()<<k_funcinfo<<"date="<<date_.toString()<<endl; bool changed=false; - QDate temp; + TQDate temp; // ----- if(!date_.isValid()) { //kdDebug() << "DateTable::setDate: refusing to set invalid date." << endl; @@ -549,54 +549,54 @@ bool DateTable::setDate(const QDate& date_, bool repaint) { numdays=date.daysInMonth(); if(date.month()==1) { // set to december of previous year temp.setYMD(date.year()-1, 12, 1); - setWeekNumbers(QDate(date.year()-1, 12, 31)); + setWeekNumbers(TQDate(date.year()-1, 12, 31)); } else { // set to previous month temp.setYMD(date.year(), date.month()-1, 1); - QDate d(date.year(), date.month()-1,1); + TQDate d(date.year(), date.month()-1,1); setWeekNumbers(d.addDays(d.daysInMonth()-1)); } /* if (m_selectedWeekdays.isEmpty() && - !m_selectedDates.isEmpty() && !m_selectedDates.contains(date)) + !m_selectedDates.isEmpty() && !m_selectedDates.tqcontains(date)) { //kdDebug()<<k_funcinfo<<"date inserted"<<endl; m_selectedDates.insert(date); }*/ numDaysPrevMonth=temp.daysInMonth(); - if(changed && repaint) { - repaintContents(false); + if(changed && tqrepaint) { + tqrepaintContents(false); } if (m_enabled) emit(dateChanged(date)); return true; } -const QDate& DateTable::getDate() const { +const TQDate& DateTable::getDate() const { return date; } -void DateTable::focusInEvent( QFocusEvent *e ) { - QGridView::focusInEvent( e ); +void DateTable::focusInEvent( TQFocusEvent *e ) { + TQGridView::focusInEvent( e ); } -void DateTable::focusOutEvent( QFocusEvent *e ) { - QGridView::focusOutEvent( e ); +void DateTable::focusOutEvent( TQFocusEvent *e ) { + TQGridView::focusOutEvent( e ); } -QSize DateTable::sizeHint() const { +TQSize DateTable::tqsizeHint() const { if(maxCell.height()>0 && maxCell.width()>0) { - return QSize(maxCell.width()*numCols()+2*frameWidth(), + return TQSize(maxCell.width()*numCols()+2*frameWidth(), (maxCell.height()+2)*numRows()+2*frameWidth()); } else { - //kdDebug() << "DateTable::sizeHint: obscure failure - " << endl; - return QSize(-1, -1); + //kdDebug() << "DateTable::tqsizeHint: obscure failure - " << endl; + return TQSize(-1, -1); } } -void DateTable::setWeekNumbers(QDate date) { +void DateTable::setWeekNumbers(TQDate date) { if (!date.isValid()) { kdError()<<k_funcinfo<<"Invalid date"<<endl; } - QDate d(date); + TQDate d(date); for (int i = 1; i < 7; ++i) { m_weeks[i].first = d.weekNumber(&(m_weeks[i].second)); //kdDebug()<<k_funcinfo<<"date="<<d.toString()<<" week=("<<m_weeks[i].first<<","<<m_weeks[i].second<<")"<<endl; @@ -615,11 +615,11 @@ void DateTable::updateCells() { void DateTable::updateSelectedCells() { //kdDebug()<<k_funcinfo<<endl; - QDate dt(date.year(), date.month(), 1); + TQDate dt(date.year(), date.month(), 1); dt = dt.addDays(-firstday); for (int pos=0; pos < 42; ++pos) { - if (m_selectedDates.contains(dt.addDays(pos)) || - m_selectedWeekdays.contains(pos%7+1)) + if (m_selectedDates.tqcontains(dt.addDays(pos)) || + m_selectedWeekdays.tqcontains(pos%7+1)) { updateCell(pos/7+1, pos%7+1); //kdDebug()<<k_funcinfo<<" update cell ("<<pos/7+1<<","<<pos%7+1<<") date="<<dt.addDays(pos).toString()<<endl; @@ -628,11 +628,11 @@ void DateTable::updateSelectedCells() { } void DateTable::updateMarkedCells() { - QDate dt(date.year(), date.month(), 1); + TQDate dt(date.year(), date.month(), 1); dt = dt.addDays(-firstday); for (int pos=0; pos < 42; ++pos) { - if (m_markedDates.contains(dt.addDays(pos)) || - m_markedWeekdays.contains(pos%7+1)) + if (m_markedDates.tqcontains(dt.addDays(pos)) || + m_markedWeekdays.tqcontains(pos%7+1)) { updateCell(pos/7+1, pos%7+1); //kdDebug()<<k_funcinfo<<" update cell ("<<pos/7+1<<","<<pos%7+1<<") date="<<dt.addDays(pos).toString()<<endl; @@ -645,19 +645,19 @@ void DateTable::setMarkedWeekdays(const IntMap days) { m_markedWeekdays.clear(); m_markedWeekdays = days; updateMarkedCells(); - repaintContents(false); + tqrepaintContents(false); } bool DateTable::weekdayMarked(int day) { - return m_markedWeekdays.contains(day); + return m_markedWeekdays.tqcontains(day); } -bool DateTable::dateMarked(QDate date) { +bool DateTable::dateMarked(TQDate date) { return m_markedDates[date.toString()]; } -QDate DateTable::getDate(int pos) const { - return QDate(date.year(), date.month(), 1).addDays(pos-firstday); +TQDate DateTable::getDate(int pos) const { + return TQDate(date.year(), date.month(), 1).addDays(pos-firstday); } int DateTable::weekday(int col) const { @@ -678,13 +678,13 @@ void DateTable::clear() { clearSelection(); m_markedDates.clear(); m_markedWeekdays.clear(); - repaintContents(false); + tqrepaintContents(false); } void DateTable::clearSelection() { m_selectedDates.clear(); m_selectedWeekdays.clear(); - repaintContents(false); + tqrepaintContents(false); } void DateTable::setEnabled(bool yes) { @@ -709,24 +709,24 @@ void DateTable::markSelected(int state) { } } updateSelectedCells(); - repaintContents(false); + tqrepaintContents(false); } DateInternalWeekSelector::DateInternalWeekSelector -(int fontsize, QWidget* parent, const char* name) - : QLineEdit(parent, name), - val(new QIntValidator(this)), +(int fontsize, TQWidget* tqparent, const char* name) + : TQLineEdit(tqparent, name), + val(new TQIntValidator(TQT_TQOBJECT(this))), result(0) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); font.setPointSize(fontsize); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); val->setRange(1, 53); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(weekEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(weekEnteredSlot())); } void @@ -754,19 +754,19 @@ DateInternalWeekSelector::getWeek() const void DateInternalWeekSelector::setWeek(int week) { - QString temp; + TQString temp; // ----- temp.setNum(week); setText(temp); } DateInternalMonthPicker::DateInternalMonthPicker -(int fontsize, QWidget* parent, const char* name) - : QGridView(parent, name), +(int fontsize, TQWidget* tqparent, const char* name) + : TQGridView(tqparent, name), result(0) // invalid { - QRect rect; - QFont font; + TQRect rect; + TQFont font; // ----- activeCol = -1; activeRow = -1; @@ -775,7 +775,7 @@ DateInternalMonthPicker::DateInternalMonthPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); setNumRows(4); setNumCols(3); // enable to find drawing failures: @@ -783,7 +783,7 @@ DateInternalMonthPicker::DateInternalMonthPicker viewport()->setEraseColor(KGlobalSettings::baseColor()); // for consistency with the datepicker // ----- find the preferred size // (this is slow, possibly, but unfortunatly it is needed here): - QFontMetrics metrics(font); + TQFontMetrics metrics(font); for(int i=1; i <= 12; ++i) { rect=metrics.boundingRect(KGlobal::locale()->calendar()->monthName(i, false)); @@ -793,10 +793,10 @@ DateInternalMonthPicker::DateInternalMonthPicker } -QSize -DateInternalMonthPicker::sizeHint() const +TQSize +DateInternalMonthPicker::tqsizeHint() const { - return QSize((max.width()+6)*numCols()+2*frameWidth(), + return TQSize((max.width()+6)*numCols()+2*frameWidth(), (max.height()+6)*numRows()+2*frameWidth()); } @@ -807,23 +807,23 @@ DateInternalMonthPicker::getResult() const } void -DateInternalMonthPicker::setupPainter(QPainter *p) +DateInternalMonthPicker::setupPainter(TQPainter *p) { p->setPen(KGlobalSettings::textColor()); } void -DateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) +DateInternalMonthPicker::viewportResizeEvent(TQResizeEvent*) { setCellWidth(width()/3); setCellHeight(height()/4); } void -DateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) +DateInternalMonthPicker::paintCell(TQPainter* painter, int row, int col) { int index; - QString text; + TQString text; // ----- find the number of the cell: index=3*row+col+1; text=KGlobal::locale()->calendar()->monthName(index, false); @@ -833,16 +833,16 @@ DateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) } void -DateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) +DateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { KNotifyClient::beep(); return; } // ----- int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -860,12 +860,12 @@ DateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) } void -DateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) +DateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -894,13 +894,13 @@ DateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) updateCell( row, col /*, false */ ); // mark the new active cell } } - if ( tmpRow > -1 ) // repaint the former active cell + if ( tmpRow > -1 ) // tqrepaint the former active cell updateCell( tmpRow, tmpCol /*, true */ ); } } void -DateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) +DateInternalMonthPicker::contentsMouseReleaseEvent(TQMouseEvent *e) { if(!isEnabled()) { @@ -908,7 +908,7 @@ DateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) } // ----- int row, col, pos; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -925,21 +925,21 @@ DateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) DateInternalYearSelector::DateInternalYearSelector -(int fontsize, QWidget* parent, const char* name) - : QLineEdit(parent, name), - val(new QIntValidator(this)), +(int fontsize, TQWidget* tqparent, const char* name) + : TQLineEdit(tqparent, name), + val(new TQIntValidator(TQT_TQOBJECT(this))), result(0) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); font.setPointSize(fontsize); setFont(font); - setFrameStyle(QFrame::NoFrame); - // we have to respect the limits of QDate here, I fear: + setFrameStyle(TQFrame::NoFrame); + // we have to respect the limits of TQDate here, I fear: val->setRange(0, 8000); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(yearEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(yearEnteredSlot())); } void @@ -947,7 +947,7 @@ DateInternalYearSelector::yearEnteredSlot() { bool ok; int year; - QDate date; + TQDate date; // ----- check if this is a valid year: year=text().toInt(&ok); if(!ok) @@ -974,28 +974,28 @@ DateInternalYearSelector::getYear() const void DateInternalYearSelector::setYear(int year) { - QString temp; + TQString temp; // ----- temp.setNum(year); setText(temp); } -PopupFrame::PopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), +PopupFrame::PopupFrame(TQWidget* tqparent, const char* name) + : TQFrame(tqparent, name, WType_Popup), result(0), // rejected main(0) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(TQFrame::Box|TQFrame::Raised); setMidLineWidth(2); } void -PopupFrame::keyPressEvent(QKeyEvent* e) +PopupFrame::keyPressEvent(TQKeyEvent* e) { if(e->key()==Key_Escape) { result=0; // rejected - qApp->exit_loop(); + tqApp->exit_loop(); } } @@ -1003,11 +1003,11 @@ void PopupFrame::close(int r) { result=r; - qApp->exit_loop(); + tqApp->exit_loop(); } void -PopupFrame::setMainWidget(QWidget* m) +PopupFrame::setMainWidget(TQWidget* m) { main=m; if(main!=0) @@ -1017,7 +1017,7 @@ PopupFrame::setMainWidget(QWidget* m) } void -PopupFrame::resizeEvent(QResizeEvent*) +PopupFrame::resizeEvent(TQResizeEvent*) { if(main!=0) { @@ -1027,10 +1027,10 @@ PopupFrame::resizeEvent(QResizeEvent*) } void -PopupFrame::popup(const QPoint &pos) +PopupFrame::popup(const TQPoint &pos) { // Make sure the whole popup is visible. - QRect d = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(pos)); + TQRect d = TQApplication::desktop()->screenGeometry(TQApplication::desktop()->screenNumber(pos)); int x = pos.x(); int y = pos.y(); int w = width(); @@ -1050,11 +1050,11 @@ PopupFrame::popup(const QPoint &pos) } int -PopupFrame::exec(QPoint pos) +PopupFrame::exec(TQPoint pos) { popup(pos); - repaint(); - qApp->enter_loop(); + tqrepaint(); + tqApp->enter_loop(); hide(); return result; } @@ -1062,7 +1062,7 @@ PopupFrame::exec(QPoint pos) int PopupFrame::exec(int x, int y) { - return exec(QPoint(x, y)); + return exec(TQPoint(x, y)); } void PopupFrame::virtual_hook( int, void* ) diff --git a/kplato/kptdatetable.h b/kplato/kptdatetable.h index 40576e8c..65e0d05f 100644 --- a/kplato/kptdatetable.h +++ b/kplato/kptdatetable.h @@ -27,14 +27,14 @@ #include <kglobal.h> #include <klocale.h> -#include <qgridview.h> -#include <qmemarray.h> -#include <qdict.h> -#include <qpair.h> +#include <tqgridview.h> +#include <tqmemarray.h> +#include <tqdict.h> +#include <tqpair.h> -#include <qvalidator.h> -#include <qlineedit.h> -#include <qdatetime.h> +#include <tqvalidator.h> +#include <tqlineedit.h> +#include <tqdatetime.h> namespace KPlato { @@ -44,11 +44,12 @@ namespace KPlato * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Stephan Binner */ -class DateInternalWeekSelector : public QLineEdit +class DateInternalWeekSelector : public TQLineEdit { Q_OBJECT + TQ_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void weekEnteredSlot(); @@ -56,7 +57,7 @@ signals: void closeMe(int); public: DateInternalWeekSelector(int fontsize, - QWidget* parent=0, + TQWidget* tqparent=0, const char* name=0); int getWeek() const; void setWeek(int week); @@ -72,9 +73,10 @@ private: * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Tim Gilman, Mirko Boehm */ -class DateInternalMonthPicker : public QGridView +class DateInternalMonthPicker : public TQGridView { Q_OBJECT + TQ_OBJECT protected: /** * Store the month that has been clicked [1..12]. @@ -88,7 +90,7 @@ protected: /** * Contains the largest rectangle needed by the month names. */ - QRect max; + TQRect max; signals: /** * This is send from the mouse click event handler. @@ -98,15 +100,15 @@ public: /** * The constructor. */ - DateInternalMonthPicker(int fontsize, QWidget* parent, const char* name=0); + DateInternalMonthPicker(int fontsize, TQWidget* tqparent, const char* name=0); /** * The size hint. */ - QSize sizeHint() const; + TQSize tqsizeHint() const; /** * The minimum size hint. */ - QSize minimumSizeHint() const { return sizeHint(); } + TQSize tqminimumSizeHint() const { return tqsizeHint(); } /** * Return the result. 0 means no selection (reject()), 1..12 are the * months. @@ -116,24 +118,24 @@ protected: /** * Set up the painter. */ - void setupPainter(QPainter *p); + void setupPainter(TQPainter *p); /** * The resize event. */ - virtual void viewportResizeEvent(QResizeEvent*); + virtual void viewportResizeEvent(TQResizeEvent*); /** * Paint a cell. This simply draws the month names in it. */ - virtual void paintCell(QPainter* painter, int row, int col); + virtual void paintCell(TQPainter* painter, int row, int col); /** * Catch mouse click and move events to paint a rectangle around the item. */ - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void contentsMouseMoveEvent(QMouseEvent *e); + virtual void contentsMousePressEvent(TQMouseEvent *e); + virtual void contentsMouseMoveEvent(TQMouseEvent *e); /** * Emit monthSelected(int) when a cell has been released. */ - virtual void contentsMouseReleaseEvent(QMouseEvent *e); + virtual void contentsMouseReleaseEvent(TQMouseEvent *e); private: class DateInternalMonthPrivate; @@ -145,11 +147,12 @@ private: * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ * @author Tim Gilman, Mirko Boehm */ -class DateInternalYearSelector : public QLineEdit +class DateInternalYearSelector : public TQLineEdit { Q_OBJECT + TQ_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void yearEnteredSlot(); @@ -157,7 +160,7 @@ signals: void closeMe(int); public: DateInternalYearSelector(int fontsize, - QWidget* parent=0, + TQWidget* tqparent=0, const char* name=0); int getYear() const; void setYear(int year); @@ -172,9 +175,10 @@ private: * @author Tim Gilman, Mirko Boehm * @version $Id: kptdatetable.h 576264 2006-08-23 16:28:46Z danders $ */ -class PopupFrame : public QFrame +class PopupFrame : public TQFrame { Q_OBJECT + TQ_OBJECT protected: /** * The result. It is returned from exec() when the popup window closes. @@ -183,11 +187,11 @@ protected: /** * Catch key press events. */ - virtual void keyPressEvent(QKeyEvent* e); + virtual void keyPressEvent(TQKeyEvent* e); /** * The only subwidget that uses the whole dialog window. */ - QWidget *main; + TQWidget *main; public slots: /** * Close the popup window. This is called from the main widget, usually. @@ -198,7 +202,7 @@ public: /** * The contructor. Creates a dialog without buttons. */ - PopupFrame(QWidget* parent=0, const char* name=0); + PopupFrame(TQWidget* tqparent=0, const char* name=0); /** * Set the main widget. You cannot set the main widget from the constructor, * since it must be a child of the frame itselfes. @@ -206,20 +210,20 @@ public: * set the main widgets correct size before setting it as the main * widget. */ - void setMainWidget(QWidget* m); + void setMainWidget(TQWidget* m); /** * The resize event. Simply resizes the main widget to the whole * widgets client size. */ - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /** * Open the popup window at position pos. */ - void popup(const QPoint &pos); + void popup(const TQPoint &pos); /** * Execute the popup window. */ - int exec(QPoint p); + int exec(TQPoint p); /** * Dito. */ @@ -227,7 +231,7 @@ public: private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return TQFrame::close(alsoDelete); } protected: virtual void virtual_hook( int id, void* data ); private: @@ -238,24 +242,25 @@ private: /** * Validates user-entered dates. */ -class DateValidator : public QValidator +class DateValidator : public TQValidator { public: - DateValidator(QWidget* parent=0, const char* name=0); - virtual State validate(QString&, int&) const; - virtual void fixup ( QString & input ) const; - State date(const QString&, QDate&) const; + DateValidator(TQWidget* tqparent=0, const char* name=0); + virtual State validate(TQString&, int&) const; + virtual void fixup ( TQString & input ) const; + State date(const TQString&, TQDate&) const; }; -class DateTable : public QGridView +class DateTable : public TQGridView { Q_OBJECT + TQ_OBJECT public: /** * The constructor. */ - DateTable(QWidget *parent=0, QDate date=QDate::currentDate(), + DateTable(TQWidget *tqparent=0, TQDate date=TQDate::tqcurrentDate(), const char* name="DateTable", WFlags f=0); /** @@ -263,9 +268,9 @@ public: * To save some time, the size of the largest used cell content is * calculated in each paintCell() call, since all calculations have * to be done there anyway. The size is stored in maxCell. The - * sizeHint() simply returns a multiple of maxCell. + * tqsizeHint() simply returns a multiple of maxCell. */ - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; /** * Set the font size of the date table. */ @@ -273,12 +278,12 @@ public: /** * Select and display this date. */ - bool setDate(const QDate&, bool repaint=true); - const QDate& getDate() const; - bool selectDate(const QDate& date_); + bool setDate(const TQDate&, bool tqrepaint=true); + const TQDate& getDate() const; + bool selectDate(const TQDate& date_); - void addMarkedDate(QDate date, int state) { m_markedDates.insert(date, state); } - bool dateMarked(QDate date); + void addMarkedDate(TQDate date, int state) { m_markedDates.insert(date, state); } + bool dateMarked(TQDate date); void addMarkedWeekday(int day, int state); void setMarkedWeekday(int day, int state) { m_markedWeekdays.insert(day, state); } @@ -303,36 +308,36 @@ protected: /** * Paint a cell. */ - virtual void paintCell(QPainter*, int, int); + virtual void paintCell(TQPainter*, int, int); /** * Handle the resize events. */ - virtual void viewportResizeEvent(QResizeEvent *); + virtual void viewportResizeEvent(TQResizeEvent *); /** * React on mouse clicks that select a date. */ - virtual void contentsMousePressEvent(QMouseEvent *); - virtual void wheelEvent( QWheelEvent * e ); - virtual void keyPressEvent( QKeyEvent *e ); - virtual void focusInEvent( QFocusEvent *e ); - virtual void focusOutEvent( QFocusEvent *e ); + virtual void contentsMousePressEvent(TQMouseEvent *); + virtual void wheelEvent( TQWheelEvent * e ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void focusInEvent( TQFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); - bool contentsMousePressEvent_internal(QMouseEvent *); + bool contentsMousePressEvent_internal(TQMouseEvent *); - int weekOfYear(QDate date) const; - void setWeekNumbers(QDate); + int weekOfYear(TQDate date) const; + void setWeekNumbers(TQDate); bool weekSelected(int row); bool weekSelected(); bool weekdaySelected(); bool isWeekdaySelected(int day); - bool dateSelected(QDate date); + bool dateSelected(TQDate date); bool dateSelected(); void updateSelectedCells(); void updateMarkedCells(); void updateCells(); - QDate getDate(int pos) const; + TQDate getDate(int pos) const; /** * pos can be 1..42 @@ -343,9 +348,9 @@ protected: int weekday(int col) const; int column(int weekday) const; - void paintWeekday(QPainter *painter, int col); - void paintWeekNumber(QPainter *painter, int row); - void paintDay(QPainter *painter, int row, int col); + void paintWeekday(TQPainter *painter, int col); + void paintWeekNumber(TQPainter *painter, int row); + void paintDay(TQPainter *painter, int row, int col); /** * The font size of the displayed text. @@ -354,7 +359,7 @@ protected: /** * The currently selected date. */ - QDate date; + TQDate date; /** * The day of the first day in the month [1..7]. */ @@ -370,13 +375,13 @@ protected: /** * Save the size of the largest used cell content. */ - QRect maxCell; + TQRect maxCell; signals: /** * The selected date changed. */ - void dateChanged(QDate); + void dateChanged(TQDate); /** * A date has been selected by clicking on the table. */ @@ -391,7 +396,7 @@ signals: private: - QMemArray< QPair<int, int> > m_weeks; + TQMemArray< TQPair<int, int> > m_weeks; int m_currentRow; // row of selected date @@ -407,13 +412,13 @@ private: int m_dateStartCol; bool m_enabled; - QColor colorBackgroundHoliday; - QColor colorBackgroundWorkday; - QColor colorTextHoliday; - QColor colorTextWorkday; - QColor colorLine; - QColor backgroundSelectColor; - QColor penSelectColor; + TQColor colorBackgroundHoliday; + TQColor colorBackgroundWorkday; + TQColor colorTextHoliday; + TQColor colorTextWorkday; + TQColor colorLine; + TQColor backgroundSelectColor; + TQColor penSelectColor; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kplato/kptdatetime.cc b/kplato/kptdatetime.cc index 6cdfae24..2a05ace5 100644 --- a/kplato/kptdatetime.cc +++ b/kplato/kptdatetime.cc @@ -24,24 +24,24 @@ namespace KPlato { -DateTime::DateTime() : QDateTime() { +DateTime::DateTime() : TQDateTime() { } -DateTime::DateTime(const QDateTime &dt) : QDateTime(dt.date(), dt.time()) { +DateTime::DateTime(const TQDateTime &dt) : TQDateTime(dt.date(), dt.time()) { } -DateTime::DateTime(const QDate &date, const QTime &time) : QDateTime(date, time) { +DateTime::DateTime(const TQDate &date, const TQTime &time) : TQDateTime(date, time) { } void DateTime::add(const Duration &duration) { if (isValid()) - *this = addSecs(duration.seconds()); + *this = TQDateTime(addSecs(duration.seconds())); //kdDebug()<<k_funcinfo<<"days,secs: "<<days<<","<<secs<<" gives: "<<toString()<<endl; } void DateTime::subtract(const Duration &duration) { if (isValid()) - *this = addSecs(-duration.seconds()); + *this = TQDateTime(addSecs(-duration.seconds())); //kdDebug()<<k_funcinfo<<"days,secs: "<<days<<","<<secs<<" gives: "<<toString()<<endl; } diff --git a/kplato/kptdatetime.h b/kplato/kptdatetime.h index cb682c13..beef4858 100644 --- a/kplato/kptdatetime.h +++ b/kplato/kptdatetime.h @@ -19,7 +19,7 @@ #ifndef KPTDATETIME_H #define KPTDATETIME_H -#include <qdatetime.h> +#include <tqdatetime.h> #include "kptduration.h" namespace KPlato @@ -28,14 +28,14 @@ namespace KPlato class Duration; /** - * DateTime is a @ref QDateTime which knows about @ref Duration + * DateTime is a @ref TQDateTime which knows about @ref Duration */ -class DateTime : public QDateTime { +class DateTime : public TQDateTime { public: DateTime(); - DateTime(const QDateTime &dt); - DateTime(const QDate &date, const QTime &time); + DateTime(const TQDateTime &dt); + DateTime(const TQDate &date, const TQTime &time); /** * Adds the duration @param duration to the datetime @@ -54,14 +54,14 @@ public: DateTime &operator+=(const Duration &duration); DateTime &operator-=(const Duration &duration); - static DateTime fromString(const QString dts) { - QDateTime dt; + static DateTime fromString(const TQString dts) { + TQDateTime dt; if (dts.isEmpty()) return DateTime(); - dt = QDateTime::fromString(dts, Qt::ISODate); + dt = TQDateTime::fromString(dts, Qt::ISODate); if (dt.isValid()) return DateTime(dt); - return DateTime(QDateTime::fromString(dts)); + return DateTime(TQDateTime::fromString(dts)); } private: diff --git a/kplato/kptdoublelistviewbase.cc b/kplato/kptdoublelistviewbase.cc index 27d8e3f7..5a41776b 100644 --- a/kplato/kptdoublelistviewbase.cc +++ b/kplato/kptdoublelistviewbase.cc @@ -22,74 +22,74 @@ #include "kptproject.h" #include "kptview.h" -#include <qheader.h> -#include <qlayout.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qptrvector.h> -#include <qsplitter.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qpoint.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqptrvector.h> +#include <tqsplitter.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqpoint.h> #include <kcalendarsystem.h> #include <kglobal.h> #include <klocale.h> #include <kprinter.h> -#include <qrect.h> +#include <tqrect.h> #include <kdebug.h> namespace KPlato { -void ListView::paintToPrinter(QPainter * p, int cx, int cy, int cw, int ch) { - //kdDebug()<<k_funcinfo<<QRect(cx, cy, cw, ch)<<endl; +void ListView::paintToPrinter(TQPainter * p, int cx, int cy, int cw, int ch) { + //kdDebug()<<k_funcinfo<<TQRect(cx, cy, cw, ch)<<endl; // draw header labels p->save(); - QRegion r = p->clipRegion(QPainter::CoordPainter); - p->setClipRegion(r.intersect(QRegion(cx, 0, cw, ch)), QPainter::CoordPainter); - QColor bgc(193, 223, 255); - QBrush bg(bgc); + TQRegion r = p->clipRegion(TQPainter::CoordPainter); + p->setClipRegion(r.intersect(TQRegion(cx, 0, cw, ch)), TQPainter::CoordPainter); + TQColor bgc(193, 223, 255); + TQBrush bg(bgc); p->setBackgroundMode(Qt::OpaqueMode); p->setBackgroundColor(bgc); - QHeader *h = header(); + TQHeader *h = header(); int hei = 0; for (int s = 0; s < h->count(); ++s) { - QRect r = h->sectionRect(s); + TQRect r = h->sectionRect(s); //kdDebug()<<s<<": "<<h->label(s)<<" "<<r<<endl; int x, y; viewportToContents(r.x(), r.y(), x, y); - QRect sr(x, y, r.width(), r.height()); + TQRect sr(x, y, r.width(), r.height()); //kdDebug()<<s<<": "<<h->label(s)<<" "<<sr<<endl; if (sr.x()+sr.width() <= cx || sr.x() >= cx+cw) { //kdDebug()<<s<<": "<<h->label(s)<<" "<<sr<<": continue"<<endl; continue; } - QRect tr = sr; + TQRect tr = sr; if (sr.x() < cx) { tr.setX(cx); //kdDebug()<<s<<": "<<h->label(s)<<" "<<tr<<endl; } p->eraseRect(tr); - p->drawText(tr, columnAlignment(s)|Qt::AlignVCenter, h->label(s), -1); - hei = QMAX(tr.height(), hei); + p->drawText(tr, columnAlignment(s)|TQt::AlignVCenter, h->label(s), -1); + hei = TQMAX(tr.height(), hei); } - r = p->clipRegion(QPainter::CoordPainter); + r = p->clipRegion(TQPainter::CoordPainter); p->restore(); // p->drawRect(r.boundingRect()); p->save(); p->translate(0, hei+2); - r = p->clipRegion(QPainter::CoordPainter); + r = p->clipRegion(TQPainter::CoordPainter); // FIXME: Doesn't clip correctly, haven't figured out why - p->setClipRegion(r.intersect(QRegion(cx, cy, cw, ch)), QPainter::CoordPainter); + p->setClipRegion(r.intersect(TQRegion(cx, cy, cw, ch)), TQPainter::CoordPainter); drawContentsOffset(p, 0, 0, cx, cy, cw, ch); // p->drawRect(r.boundingRect()); p->restore(); } -DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListItem *master, QListView *parent, QListViewItem *after, bool highlight) - : KListViewItem(parent, after), +DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListItem *master, TQListView *tqparent, TQListViewItem *after, bool highlight) + : KListViewItem(tqparent, after), m_masterItem(master), m_value(0.0), m_highlight(highlight), @@ -98,10 +98,10 @@ DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListI setFormat(); setExpandable(master->isExpandable()); setOpen(master->isOpen()); - //kdDebug()<<"DoubleListViewBase::SlaveListItem "<<master->text(0)<<" parent="<<static_cast<DoubleListViewBase::SlaveListItem*>(parent)->m_masterItem->text(0)<<endl; + //kdDebug()<<"DoubleListViewBase::SlaveListItem "<<master->text(0)<<" tqparent="<<static_cast<DoubleListViewBase::SlaveListItem*>(tqparent)->m_masterItem->text(0)<<endl; } -DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListItem *master, QListViewItem *parent, QListViewItem *after, bool highlight) - : KListViewItem(parent, after), +DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListItem *master, TQListViewItem *tqparent, TQListViewItem *after, bool highlight) + : KListViewItem(tqparent, after), m_masterItem(master), m_value(0.0), m_highlight(highlight), @@ -110,7 +110,7 @@ DoubleListViewBase::SlaveListItem::SlaveListItem(DoubleListViewBase::MasterListI setFormat(); setExpandable(master->isExpandable()); setOpen(master->isOpen()); - //kdDebug()<<"DoubleListViewBase::SlaveListItem "<<master->text(0)<<" parent="<<static_cast<DoubleListViewBase::SlaveListItem*>(parent)->m_masterItem->text(0)<<endl; + //kdDebug()<<"DoubleListViewBase::SlaveListItem "<<master->text(0)<<" tqparent="<<static_cast<DoubleListViewBase::SlaveListItem*>(tqparent)->m_masterItem->text(0)<<endl; } DoubleListViewBase::SlaveListItem::~SlaveListItem() { //kdDebug()<<k_funcinfo<<endl; @@ -128,9 +128,9 @@ void DoubleListViewBase::SlaveListItem::clearColumn(int col) { } void DoubleListViewBase::SlaveListItem::setColumn(int col, double value) { if (col < listView()->columns()) { - //setText(col, QString("%1").arg(value, m_fieldwidth, m_fmt, m_prec)); + //setText(col, TQString("%1").tqarg(value, m_fieldwidth, m_fmt, m_prec)); setText(col, KGlobal::locale()->formatNumber(value, m_prec)); - m_valueMap.replace(col, value); + m_valueMap.tqreplace(col, value); //kdDebug()<<k_funcinfo<<m_masterItem->text(0)<<": column["<<col<<"]="<<value<<endl; } } @@ -139,15 +139,15 @@ void DoubleListViewBase::SlaveListItem::setLimit(int col, double limit) { m_limitMap[col] = limit; } -void DoubleListViewBase::SlaveListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) { +void DoubleListViewBase::SlaveListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { //kdDebug()<<k_funcinfo<<"c="<<column<<endl; - QColorGroup g = cg; + TQColorGroup g = cg; if (m_highlight) { - if (m_limitMap.contains(column)) { + if (m_limitMap.tqcontains(column)) { if (m_valueMap[column] > m_limitMap[column]) { - g.setColor(QColorGroup::Text, QColor(red)); + g.setColor(TQColorGroup::Text, TQColor(red)); } else if (m_valueMap[column] < m_limitMap[column]) { - g.setColor(QColorGroup::Text, QColor(green)); + g.setColor(TQColorGroup::Text, TQColor(green)); } } } @@ -161,8 +161,8 @@ void DoubleListViewBase::SlaveListItem::setFormat(int fieldwidth, char fmt, int } //---------------------------- -DoubleListViewBase::MasterListItem::MasterListItem(QListView *parent, bool highlight) - : KListViewItem(parent), +DoubleListViewBase::MasterListItem::MasterListItem(TQListView *tqparent, bool highlight) + : KListViewItem(tqparent), m_slaveItem(0), m_value(0.0), m_limit(0.0), @@ -172,8 +172,8 @@ DoubleListViewBase::MasterListItem::MasterListItem(QListView *parent, bool highl //kdDebug()<<k_funcinfo<<endl; } -DoubleListViewBase::MasterListItem::MasterListItem(QListView *parent, QString text, bool highlight) - : KListViewItem(parent, text), +DoubleListViewBase::MasterListItem::MasterListItem(TQListView *tqparent, TQString text, bool highlight) + : KListViewItem(tqparent, text), m_slaveItem(0), m_value(0.0), m_limit(0.0), @@ -183,8 +183,8 @@ DoubleListViewBase::MasterListItem::MasterListItem(QListView *parent, QString te //kdDebug()<<k_funcinfo<<endl; } -DoubleListViewBase::MasterListItem::MasterListItem(QListViewItem *parent, bool highlight) - : KListViewItem(parent), +DoubleListViewBase::MasterListItem::MasterListItem(TQListViewItem *tqparent, bool highlight) + : KListViewItem(tqparent), m_slaveItem(0), m_value(0.0), m_limit(0.0), @@ -194,8 +194,8 @@ DoubleListViewBase::MasterListItem::MasterListItem(QListViewItem *parent, bool h //kdDebug()<<k_funcinfo<<endl; } -DoubleListViewBase::MasterListItem::MasterListItem(QListViewItem *parent, QString text, bool highlight) - : KListViewItem(parent, text), +DoubleListViewBase::MasterListItem::MasterListItem(TQListViewItem *tqparent, TQString text, bool highlight) + : KListViewItem(tqparent, text), m_slaveItem(0), m_value(0.0), m_limit(0.0), @@ -210,19 +210,19 @@ DoubleListViewBase::MasterListItem::~MasterListItem() { m_slaveItem->masterItemDeleted(); } -void DoubleListViewBase::MasterListItem::createSlaveItems(QListView *lv, QListViewItem *after) { +void DoubleListViewBase::MasterListItem::createSlaveItems(TQListView *lv, TQListViewItem *after) { //kdDebug()<<k_funcinfo<<text(0)<<endl; if (m_slaveItem) { kdError()<<k_funcinfo<<"Slave item allready exists"<<endl; } else { - if (parent() == 0) { + if (tqparent() == 0) { m_slaveItem = new DoubleListViewBase::SlaveListItem(this, lv, after); } else { - m_slaveItem = new DoubleListViewBase::SlaveListItem(this, static_cast<DoubleListViewBase::MasterListItem*>(parent())->m_slaveItem, after); + m_slaveItem = new DoubleListViewBase::SlaveListItem(this, static_cast<DoubleListViewBase::MasterListItem*>(tqparent())->m_slaveItem, after); } } DoubleListViewBase::SlaveListItem *prev = 0; - for (QListViewItem *item = firstChild(); item; item = item->nextSibling()) { + for (TQListViewItem *item = firstChild(); item; item = item->nextSibling()) { static_cast<DoubleListViewBase::MasterListItem*>(item)->createSlaveItems(lv, prev); prev = static_cast<DoubleListViewBase::MasterListItem*>(item)->m_slaveItem; } @@ -240,20 +240,20 @@ void DoubleListViewBase::MasterListItem::slaveItemDeleted() { void DoubleListViewBase::MasterListItem::setTotal(double tot) { m_value = tot; - //setText(1, QString("%1").arg(tot, m_fieldwidth, m_fmt, m_prec)); + //setText(1, TQString("%1").tqarg(tot, m_fieldwidth, m_fmt, m_prec)); setText(1, KGlobal::locale()->formatNumber(tot, m_prec)); //kdDebug()<<k_funcinfo<<text(0)<<"="<<tot<<endl; } void DoubleListViewBase::MasterListItem::addToTotal(double v) { m_value += v; - //setText(1, QString("%1").arg(m_value, m_fieldwidth, m_fmt, m_prec)); + //setText(1, TQString("%1").tqarg(m_value, m_fieldwidth, m_fmt, m_prec)); setText(1, KGlobal::locale()->formatNumber(m_value, m_prec)); } double DoubleListViewBase::MasterListItem::calcTotal() { double tot=0.0; - QListViewItem *item=firstChild(); + TQListViewItem *item=firstChild(); if (!item) { tot = m_value; } else { @@ -272,7 +272,7 @@ void DoubleListViewBase::MasterListItem::setSlaveItem(int col, double value) { } void DoubleListViewBase::MasterListItem::clearColumn(int col) { - for (QListViewItem *item=firstChild(); item; item=item->nextSibling()) { + for (TQListViewItem *item=firstChild(); item; item=item->nextSibling()) { static_cast<DoubleListViewBase::MasterListItem*>(item)->clearColumn(col); } setTotal(0); @@ -297,7 +297,7 @@ void DoubleListViewBase::MasterListItem::calcSlaveItems() { double DoubleListViewBase::MasterListItem::calcSlaveItems(int col) { if (m_slaveItem == 0) return 0.0; - QListViewItem *item=firstChild(); + TQListViewItem *item=firstChild(); if (!item) { return m_slaveItem->value(col); } @@ -322,14 +322,14 @@ void DoubleListViewBase::MasterListItem::setSlaveHighlight(bool on) { } } -void DoubleListViewBase::MasterListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) { +void DoubleListViewBase::MasterListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { //kdDebug()<<k_funcinfo<<"c="<<column<<" value="<<m_value<<" limit="<<m_limit<<endl; - QColorGroup g = cg; + TQColorGroup g = cg; if (column == 1 && m_highlight) { if (m_value > m_limit) { - g.setColor(QColorGroup::Text, QColor(red)); + g.setColor(TQColorGroup::Text, TQColor(red)); } else if (m_value < m_limit) { - g.setColor(QColorGroup::Text, QColor(green)); + g.setColor(TQColorGroup::Text, TQColor(green)); } } KListViewItem::paintCell(p, g, column, width, align); @@ -342,17 +342,17 @@ void DoubleListViewBase::MasterListItem::setFormat(int fieldwidth, char fmt, int } //------------------------------------- -DoubleListViewBase::DoubleListViewBase(QWidget *parent, bool description) - : QSplitter(parent), +DoubleListViewBase::DoubleListViewBase(TQWidget *tqparent, bool description) + : TQSplitter(tqparent), m_fieldwidth(0), m_fmt('f'), m_prec(0) { - setOrientation(QSplitter::Horizontal); - setHandleWidth(QMIN(2, handleWidth())); + setOrientation(Qt::Horizontal); + setHandleWidth(TQMIN(2, handleWidth())); m_masterList = new ListView(this); - m_masterList->setSelectionMode(QListView::NoSelection); + m_masterList->setSelectionMode(TQListView::NoSelection); m_masterList->setItemMargin(2); m_masterList->setRootIsDecorated(true); #if KDE_IS_VERSION(3,3,9) @@ -369,28 +369,28 @@ DoubleListViewBase::DoubleListViewBase(QWidget *parent, bool description) } else { m_masterList->header()->setStretchEnabled(true, 0); } - m_masterList->setVScrollBarMode(QScrollView::AlwaysOff); - m_masterList->setHScrollBarMode(QScrollView::AlwaysOn); + m_masterList->setVScrollBarMode(TQScrollView::AlwaysOff); + m_masterList->setHScrollBarMode(TQScrollView::AlwaysOn); m_slaveList = new ListView(this); - m_slaveList->setSelectionMode(QListView::NoSelection); + m_slaveList->setSelectionMode(TQListView::NoSelection); m_slaveList->setItemMargin(2); m_slaveList->setSortColumn(-1); // Disable sort!! m_slaveList->setTreeStepSize(0); - m_slaveList->setHScrollBarMode(QScrollView::AlwaysOn); + m_slaveList->setHScrollBarMode(TQScrollView::AlwaysOn); - connect(m_slaveList->verticalScrollBar(), SIGNAL(valueChanged(int)), - m_masterList->verticalScrollBar(), SLOT(setValue(int))); + connect(m_slaveList->verticalScrollBar(), TQT_SIGNAL(valueChanged(int)), + m_masterList->verticalScrollBar(), TQT_SLOT(setValue(int))); - connect(m_masterList, SIGNAL(expanded(QListViewItem*)), SLOT(slotExpanded(QListViewItem*))); - connect(m_masterList, SIGNAL(collapsed(QListViewItem*)), SLOT(slotCollapsed(QListViewItem*))); + connect(m_masterList, TQT_SIGNAL(expanded(TQListViewItem*)), TQT_SLOT(slotExpanded(TQListViewItem*))); + connect(m_masterList, TQT_SIGNAL(collapsed(TQListViewItem*)), TQT_SLOT(slotCollapsed(TQListViewItem*))); } -QSize DoubleListViewBase::sizeHint() const { - //kdDebug()<<k_funcinfo<<minimumSizeHint()<<endl; - return minimumSizeHint(); //HACK: koshell splitter problem +TQSize DoubleListViewBase::tqsizeHint() const { + //kdDebug()<<k_funcinfo<<tqminimumSizeHint()<<endl; + return tqminimumSizeHint(); //HACK: koshell splitter problem } void DoubleListViewBase::clearSlaveList() { @@ -403,7 +403,7 @@ void DoubleListViewBase::clearSlaveList() { void DoubleListViewBase::createSlaveItems() { clearSlaveList(); DoubleListViewBase::SlaveListItem *prev = 0; - for (QListViewItem *item = m_masterList->firstChild(); item; item = item->nextSibling()) { + for (TQListViewItem *item = m_masterList->firstChild(); item; item = item->nextSibling()) { static_cast<DoubleListViewBase::MasterListItem*>(item)->createSlaveItems(m_slaveList, prev); prev = static_cast<DoubleListViewBase::MasterListItem*>(item)->slaveItem(); } @@ -415,44 +415,44 @@ void DoubleListViewBase::print(KPrinter &printer) { Q_UNUSED(printer); } -void DoubleListViewBase::setOpen(QListViewItem *item, bool open) { +void DoubleListViewBase::setOpen(TQListViewItem *item, bool open) { //kdDebug()<<k_funcinfo<<endl; m_masterList->setOpen(item, open); } -void DoubleListViewBase::slotExpanded(QListViewItem* item) { +void DoubleListViewBase::slotExpanded(TQListViewItem* item) { //kdDebug()<<k_funcinfo<<endl; if (item) { static_cast<DoubleListViewBase::MasterListItem*>(item)->setSlaveOpen(true); } } -void DoubleListViewBase::slotCollapsed(QListViewItem*item) { +void DoubleListViewBase::slotCollapsed(TQListViewItem*item) { //kdDebug()<<k_funcinfo<<endl; if (item) { static_cast<DoubleListViewBase::MasterListItem*>(item)->setSlaveOpen(false); } } -void DoubleListViewBase::setDescriptionHeader(QString text) { +void DoubleListViewBase::setDescriptionHeader(TQString text) { m_masterList->setColumnText(1, text); } -void DoubleListViewBase::setNameHeader(QString text) { +void DoubleListViewBase::setNameHeader(TQString text) { m_masterList->setColumnText(0, text); } -void DoubleListViewBase::setTotalHeader(QString text) { +void DoubleListViewBase::setTotalHeader(TQString text) { m_masterList->setColumnText(2, text); } -void DoubleListViewBase::addSlaveColumn(QString text) { +void DoubleListViewBase::addSlaveColumn(TQString text) { m_slaveList->addColumn(text); m_slaveList->setColumnAlignment(m_slaveList->columns()-1, AlignRight); } void DoubleListViewBase::calculate() { - for (QListViewItem *lvi=m_masterList->firstChild(); lvi; lvi = lvi->nextSibling()) { + for (TQListViewItem *lvi=m_masterList->firstChild(); lvi; lvi = lvi->nextSibling()) { static_cast<DoubleListViewBase::MasterListItem *>(lvi)->calcSlaveItems(); static_cast<DoubleListViewBase::MasterListItem *>(lvi)->calcTotal(); } @@ -464,13 +464,13 @@ void DoubleListViewBase::clearLists() { } void DoubleListViewBase::setMasterFormat(int fieldwidth, char fmt, int prec) { - QListViewItemIterator it = m_masterList; + TQListViewItemIterator it = m_masterList; for (; it.current(); ++it) { static_cast<DoubleListViewBase::MasterListItem*>(it.current())->setFormat(fieldwidth, fmt, prec); } } void DoubleListViewBase::setSlaveFormat(int fieldwidth, char fmt, int prec) { - QListViewItemIterator it = m_slaveList; + TQListViewItemIterator it = m_slaveList; for (; it.current(); ++it) { static_cast<DoubleListViewBase::SlaveListItem*>(it.current())->setFormat(fieldwidth, fmt, prec); } @@ -484,10 +484,10 @@ void DoubleListViewBase::setFormat(int fieldwidth, char fmt, int prec) { setSlaveFormat(fieldwidth, fmt, prec); } -void DoubleListViewBase::paintContents(QPainter *p) { +void DoubleListViewBase::paintContents(TQPainter *p) { //kdDebug()<<k_funcinfo<<endl; - QRect cm = m_masterList->contentsRect(); - QRect cs = m_slaveList->contentsRect(); + TQRect cm = m_masterList->contentsRect(); + TQRect cs = m_slaveList->contentsRect(); int mx, my, sx, sy; m_masterList->contentsToViewport(cm.x(), cm.y(), mx, my); m_slaveList->contentsToViewport(cs.x(), cs.y(), sx, sy); @@ -501,7 +501,7 @@ void DoubleListViewBase::paintContents(QPainter *p) { p->save(); p->translate(cm.width() + 8 + sx, sy); m_slaveList->paintToPrinter(p, -sx, -sy, cs.width(), cs.height()); - //p->fillRect(-8, 0, 0, sy, Qt::white); + //p->fillRect(-8, 0, 0, sy, TQt::white); p->restore(); } } diff --git a/kplato/kptdoublelistviewbase.h b/kplato/kptdoublelistviewbase.h index c02f4bcb..a92c4cb9 100644 --- a/kplato/kptdoublelistviewbase.h +++ b/kplato/kptdoublelistviewbase.h @@ -20,14 +20,14 @@ #ifndef KPTDOUBLELISTVIEWBASE_H #define KPTDOUBLELISTVIEWBASE_H -#include <qcolor.h> -#include <qmap.h> -#include <qptrvector.h> -#include <qsplitter.h> +#include <tqcolor.h> +#include <tqmap.h> +#include <tqptrvector.h> +#include <tqsplitter.h> #include <klistview.h> -class QListViewItem; +class TQListViewItem; class KListViewItem; class KPrinter; @@ -41,11 +41,11 @@ class Project; class ListView : public KListView { public: - ListView(QWidget *parent) - : KListView(parent) + ListView(TQWidget *tqparent) + : KListView(tqparent) {} - virtual void paintToPrinter(QPainter * p, int cx, int cy, int cw, int ch); + virtual void paintToPrinter(TQPainter * p, int cx, int cy, int cw, int ch); }; /** @@ -56,23 +56,24 @@ public: * This makes it possible to scroll the slave listview and still see the values * in the master listview. */ -class DoubleListViewBase : public QSplitter +class DoubleListViewBase : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - DoubleListViewBase(QWidget *parent, bool description=false); + DoubleListViewBase(TQWidget *tqparent, bool description=false); //~DoubleListViewBase(); ListView *masterListView() const { return m_masterList; } ListView *slaveListView() const { return m_slaveList; } - void setOpen(QListViewItem *item, bool open); + void setOpen(TQListViewItem *item, bool open); - void setNameHeader(QString text); - void setTotalHeader(QString text); - void setDescriptionHeader(QString text); - void addSlaveColumn(QString text); + void setNameHeader(TQString text); + void setTotalHeader(TQString text); + void setDescriptionHeader(TQString text); + void addSlaveColumn(TQString text); virtual void print(KPrinter &printer); virtual void calculate(); @@ -82,13 +83,13 @@ public: void setFormat(int fieldwidth=0, char fmt='f', int prec=0); void setMasterFormat(int fieldwidth=0, char fmt='f', int prec=0); void setSlaveFormat(int fieldwidth=0, char fmt='f', int prec=0); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; class MasterListItem; class SlaveListItem : public KListViewItem { public: - SlaveListItem(MasterListItem *master, QListView *parent, QListViewItem *after, bool highlight=false); - SlaveListItem(MasterListItem *master, QListViewItem *parent, QListViewItem *after, bool highlight=false); + SlaveListItem(MasterListItem *master, TQListView *tqparent, TQListViewItem *after, bool highlight=false); + SlaveListItem(MasterListItem *master, TQListViewItem *tqparent, TQListViewItem *after, bool highlight=false); ~SlaveListItem(); void masterItemDeleted() { m_masterItem = 0; } @@ -99,7 +100,7 @@ public: void setLimit(int col, double limit); void setHighlight(bool on) { m_highlight = on; } - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); void setFormat(int fieldwidth=0, char fmt='f', int prec=0); @@ -108,8 +109,8 @@ public: double m_value; bool m_highlight; - QMap<int, double> m_valueMap; - QMap<int, double> m_limitMap; + TQMap<int, double> m_valueMap; + TQMap<int, double> m_limitMap; int m_fieldwidth; char m_fmt; @@ -118,14 +119,14 @@ public: class MasterListItem : public KListViewItem { public: - MasterListItem(QListView *parent, bool highlight=false); - MasterListItem(QListView *parent, QString text, bool highlight=false); - MasterListItem(QListViewItem *parent, bool highlight=false); - MasterListItem(QListViewItem *parent, QString text, bool highlight=false); + MasterListItem(TQListView *tqparent, bool highlight=false); + MasterListItem(TQListView *tqparent, TQString text, bool highlight=false); + MasterListItem(TQListViewItem *tqparent, bool highlight=false); + MasterListItem(TQListViewItem *tqparent, TQString text, bool highlight=false); ~MasterListItem(); - /// Creates slaveitems for myself and my children - void createSlaveItems(QListView *lv, QListViewItem *after=0); + /// Creates slaveitems for myself and my tqchildren + void createSlaveItems(TQListView *lv, TQListViewItem *after=0); void slaveItemDeleted(); void setSlaveOpen(bool on); SlaveListItem *slaveItem() const { return m_slaveItem; } @@ -143,7 +144,7 @@ public: void calcSlaveItems(); virtual double calcSlaveItems(int col); - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align); + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); void setFormat(int fieldwidth=0, char fmt='f', int prec=0); @@ -153,7 +154,7 @@ public: double m_limit; bool m_highlight; - QMap<int, double> m_valueMap; + TQMap<int, double> m_valueMap; int m_fieldwidth; char m_fmt; @@ -161,11 +162,11 @@ public: }; public: - virtual void paintContents(QPainter *p); + virtual void paintContents(TQPainter *p); protected slots: - void slotExpanded(QListViewItem* item); - void slotCollapsed(QListViewItem* item); + void slotExpanded(TQListViewItem* item); + void slotCollapsed(TQListViewItem* item); private: diff --git a/kplato/kptduration.cc b/kplato/kptduration.cc index 384ac754..4da4aaff 100644 --- a/kplato/kptduration.cc +++ b/kplato/kptduration.cc @@ -24,7 +24,7 @@ #include <kglobal.h> #include <klocale.h> #include <kdebug.h> -#include <qregexp.h> +#include <tqregexp.h> namespace KPlato { @@ -42,13 +42,13 @@ Duration::Duration(const Duration &d) { Duration::Duration(unsigned d, unsigned h, unsigned m, unsigned s, unsigned ms) { m_ms = ms; - m_ms += static_cast<Q_INT64>(s) * 1000; // cast to avoid potential overflow problem - m_ms += static_cast<Q_INT64>(m) * 60 * 1000; - m_ms += static_cast<Q_INT64>(h) * 60 * 60 * 1000; - m_ms += static_cast<Q_INT64>(d) * 24 * 60 * 60 * 1000; + m_ms += static_cast<TQ_INT64>(s) * 1000; // cast to avoid potential overflow problem + m_ms += static_cast<TQ_INT64>(m) * 60 * 1000; + m_ms += static_cast<TQ_INT64>(h) * 60 * 60 * 1000; + m_ms += static_cast<TQ_INT64>(d) * 24 * 60 * 60 * 1000; } -Duration::Duration(Q_INT64 seconds) { +Duration::Duration(TQ_INT64 seconds) { m_ms = seconds * 1000; } @@ -59,8 +59,8 @@ void Duration::add(const Duration &delta) { m_ms += delta.m_ms; } -void Duration::add(Q_INT64 delta) { - Q_INT64 tmp = m_ms + delta; +void Duration::add(TQ_INT64 delta) { + TQ_INT64 tmp = m_ms + delta; if (tmp < 0) { kdDebug()<<k_funcinfo<<"Underflow"<<(long int)delta<<" from "<<this->toString()<<endl; m_ms = 0; @@ -102,7 +102,7 @@ Duration Duration::operator/(int unit) const { Duration Duration::operator*(const double value) const { Duration dur(*this); - dur.m_ms = QABS(m_ms * (Q_INT64)value); + dur.m_ms = TQABS(m_ms * (TQ_INT64)value); return dur; } @@ -114,33 +114,33 @@ double Duration::operator/(const Duration &d) const { return (double)(m_ms) / (double)(d.m_ms); } -QString Duration::toString(Format format) const { - Q_INT64 ms; +TQString Duration::toString(Format format) const { + TQ_INT64 ms; double days; unsigned hours; unsigned minutes; unsigned seconds; double f; - QString result; + TQString result; switch (format) { case Format_Hour: ms = m_ms; hours = ms / (1000 * 60 * 60); - ms -= (Q_INT64)hours * (1000 * 60 * 60); + ms -= (TQ_INT64)hours * (1000 * 60 * 60); minutes = ms / (1000 * 60); - result = QString("%1h%2m").arg(hours).arg(minutes); + result = TQString("%1h%2m").tqarg(hours).tqarg(minutes); break; case Format_Day: days = m_ms / (1000 * 60 * 60 * 24.0); - result = QString("%1d").arg(QString::number(days, 'f', 4)); + result = TQString("%1d").tqarg(TQString::number(days, 'f', 4)); break; case Format_DayTime: ms = m_ms; days = m_ms / (1000 * 60 * 60 * 24); - ms -= (Q_INT64)days * (1000 * 60 * 60 * 24); + ms -= (TQ_INT64)days * (1000 * 60 * 60 * 24); hours = ms / (1000 * 60 * 60); - ms -= (Q_INT64)hours * (1000 * 60 * 60); + ms -= (TQ_INT64)hours * (1000 * 60 * 60); minutes = ms / (1000 * 60); ms -= minutes * (1000 * 60); seconds = ms / (1000); @@ -154,9 +154,9 @@ QString Duration::toString(Format format) const { case Format_i18nHour: ms = m_ms; hours = ms / (1000 * 60 * 60); - ms -= (Q_INT64)hours * (1000 * 60 * 60); + ms -= (TQ_INT64)hours * (1000 * 60 * 60); minutes = ms / (1000 * 60); - result = i18n("<hours>h:<minutes>m", "%1h:%2m").arg(hours).arg(minutes); + result = i18n("<hours>h:<minutes>m", "%1h:%2m").tqarg(hours).tqarg(minutes); break; case Format_i18nDay: result = KGlobal::locale()->formatNumber(toDouble(Unit_d), 2); @@ -164,9 +164,9 @@ QString Duration::toString(Format format) const { case Format_i18nDayTime: ms = m_ms; days = m_ms / (1000 * 60 * 60 * 24); - ms -= (Q_INT64)days * (1000 * 60 * 60 * 24); + ms -= (TQ_INT64)days * (1000 * 60 * 60 * 24); hours = ms / (1000 * 60 * 60); - ms -= (Q_INT64)hours * (1000 * 60 * 60); + ms -= (TQ_INT64)hours * (1000 * 60 * 60); minutes = ms / (1000 * 60); ms -= minutes * (1000 * 60); seconds = ms / (1000); @@ -174,7 +174,7 @@ QString Duration::toString(Format format) const { if (days == 0) { result = toString(Format_i18nHour); } else { - result = i18n("<days>d <hours>h:<minutes>m", "%1d %2h:%3m").arg(days).arg(hours).arg(minutes); + result = i18n("<days>d <hours>h:<minutes>m", "%1d %2h:%3m").tqarg(days).tqarg(hours).tqarg(minutes); } break; case Format_i18nHourFraction: @@ -187,9 +187,9 @@ QString Duration::toString(Format format) const { return result; } -Duration::Duration Duration::fromString(const QString &s, Format format, bool *ok) { +Duration::Duration Duration::fromString(const TQString &s, Format format, bool *ok) { if (ok) *ok = false; - QRegExp matcher; + TQRegExp matcher; Duration tmp; switch (format) { case Format_Hour: { @@ -221,7 +221,7 @@ Duration::Duration Duration::fromString(const QString &s, Format format, bool *o double f = KGlobal::locale()->readNumber(s, &res); if (ok) *ok = res; if (res) { - return Duration((Q_INT64)(f*3600.0)); + return Duration((TQ_INT64)(f*3600.0)); } break; } @@ -233,8 +233,8 @@ Duration::Duration Duration::fromString(const QString &s, Format format, bool *o } void Duration::get(unsigned *days, unsigned *hours, unsigned *minutes, unsigned *seconds, unsigned *milliseconds) const { - Q_INT64 ms; - Q_INT64 tmp; + TQ_INT64 ms; + TQ_INT64 tmp; ms = m_ms; tmp = ms / (1000 * 60 * 60 * 24); diff --git a/kplato/kptduration.h b/kplato/kptduration.h index 116d0660..6305528d 100644 --- a/kplato/kptduration.h +++ b/kplato/kptduration.h @@ -21,8 +21,8 @@ #ifndef KPTDURATION_H #define KPTDURATION_H -#include <qglobal.h> -#include <qstring.h> +#include <tqglobal.h> +#include <tqstring.h> namespace KPlato { @@ -44,54 +44,54 @@ class Duration { Duration(); Duration(const Duration &d); Duration(unsigned d, unsigned h, unsigned m, unsigned s=0, unsigned ms=0); - Duration(Q_INT64 seconds); + Duration(TQ_INT64 seconds); ~Duration(); /** * Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration. */ - void addMilliseconds(Q_INT64 delta) { add(delta); } + void addMilliseconds(TQ_INT64 delta) { add(delta); } /** * Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration. */ - void addSeconds(Q_INT64 delta) { addMilliseconds(delta * 1000); } + void addSeconds(TQ_INT64 delta) { addMilliseconds(delta * 1000); } /** * Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration. */ - void addMinutes(Q_INT64 delta) { addSeconds(delta * 60); } + void addMinutes(TQ_INT64 delta) { addSeconds(delta * 60); } /** * Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration. */ - void addHours(Q_INT64 delta) { addMinutes(delta * 60); } + void addHours(TQ_INT64 delta) { addMinutes(delta * 60); } /** * Adds @param delta to *this. If @param delta > *this, *this is set to zeroDuration. */ - void addDays(Q_INT64 delta) { addHours(delta * 24); } + void addDays(TQ_INT64 delta) { addHours(delta * 24); } //FIXME: overflow problem - Q_INT64 milliseconds() const { return m_ms; } - Q_INT64 seconds() const { return m_ms / 1000; } - Q_INT64 minutes() const { return seconds() / 60; } + TQ_INT64 milliseconds() const { return m_ms; } + TQ_INT64 seconds() const { return m_ms / 1000; } + TQ_INT64 minutes() const { return seconds() / 60; } unsigned hours() const { return minutes() / 60; } unsigned days() const { return hours() / 24; } void get(unsigned *days, unsigned *hours, unsigned *minutes, unsigned *seconds=0, unsigned *milliseconds=0) const; bool operator==( const Duration &d ) const { return m_ms == d.m_ms; } - bool operator==( Q_INT64 d ) const { return m_ms == d; } + bool operator==( TQ_INT64 d ) const { return m_ms == d; } bool operator!=( const Duration &d ) const { return m_ms != d.m_ms; } - bool operator!=( Q_INT64 d ) const { return m_ms != d; } + bool operator!=( TQ_INT64 d ) const { return m_ms != d; } bool operator<( const Duration &d ) const { return m_ms < d.m_ms; } - bool operator<( Q_INT64 d ) const { return m_ms < d; } + bool operator<( TQ_INT64 d ) const { return m_ms < d; } bool operator<=( const Duration &d ) const { return m_ms <= d.m_ms; } - bool operator<=( Q_INT64 d ) const { return m_ms <= d; } + bool operator<=( TQ_INT64 d ) const { return m_ms <= d; } bool operator>( const Duration &d ) const { return m_ms > d.m_ms; } - bool operator>( Q_INT64 d ) const { return m_ms > d; } + bool operator>( TQ_INT64 d ) const { return m_ms > d; } bool operator>=( const Duration &d ) const { return m_ms >= d.m_ms; } - bool operator>=( Q_INT64 d ) const { return m_ms >= d; } + bool operator>=( TQ_INT64 d ) const { return m_ms >= d; } Duration &operator=(const Duration &d ) { m_ms = d.m_ms; return *this;} Duration operator*(int unit) const; Duration operator*(const double value) const; @@ -106,8 +106,8 @@ class Duration { {Duration dur(*this); dur.subtract(d); return dur; } Duration &operator-=(const Duration &d) {subtract(d); return *this; } - QString toString(Format format = Format_DayTime) const; - static Duration fromString(const QString &s, Format format = Format_DayTime, bool *ok=0); + TQString toString(Format format = Format_DayTime) const; + static Duration fromString(const TQString &s, Format format = Format_DayTime, bool *ok=0); //NOTE: These must match fieldnumbers in duration widget! enum Unit { Unit_d, Unit_h, Unit_m, Unit_s, Unit_ms }; @@ -130,9 +130,9 @@ class Duration { * Duration in milliseconds. Signed to allow for simple calculations which * might go negative for intermediate results. */ - Q_INT64 m_ms; + TQ_INT64 m_ms; - void add(Q_INT64 delta); + void add(TQ_INT64 delta); void add(const Duration &delta); /** diff --git a/kplato/kptdurationwidget.ui b/kplato/kptdurationwidget.ui index 73944e3d..19273780 100644 --- a/kplato/kptdurationwidget.ui +++ b/kplato/kptdurationwidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::DurationWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>DurationWidget</cstring> </property> @@ -20,7 +20,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32767</width> <height>32767</height> @@ -36,7 +36,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>m_frame</cstring> </property> @@ -48,13 +48,13 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32676</width> <height>20</height> @@ -83,7 +83,7 @@ <property name="margin"> <number>1</number> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_hhSpace</cstring> </property> @@ -94,7 +94,7 @@ <cstring>m_ddd</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_ddd</cstring> </property> @@ -106,13 +106,13 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>70</width> <height>32767</height> @@ -125,11 +125,11 @@ <property name="frame"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_ddUnit</cstring> </property> @@ -140,7 +140,7 @@ <cstring>m_ddd</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_mmColon</cstring> </property> @@ -151,7 +151,7 @@ <cstring>m_hh</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_hh</cstring> </property> @@ -163,7 +163,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>50</width> <height>32767</height> @@ -175,11 +175,11 @@ <property name="frame"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_hhUnit</cstring> </property> @@ -190,7 +190,7 @@ <cstring>m_hh</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_mm</cstring> </property> @@ -202,7 +202,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>50</width> <height>32767</height> @@ -214,11 +214,11 @@ <property name="frame"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_mmUnit</cstring> </property> @@ -229,7 +229,7 @@ <cstring>m_mm</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_ssColon</cstring> </property> @@ -240,7 +240,7 @@ <cstring>m_ss</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_ss</cstring> </property> @@ -252,7 +252,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>50</width> <height>32767</height> @@ -264,11 +264,11 @@ <property name="frame"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_ssUnit</cstring> </property> @@ -279,7 +279,7 @@ <cstring>m_ss</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_dot</cstring> </property> @@ -290,7 +290,7 @@ <cstring>m_ms</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_ms</cstring> </property> @@ -302,13 +302,13 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>0</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>50</width> <height>32767</height> @@ -320,11 +320,11 @@ <property name="frame"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_msUnit</cstring> </property> @@ -373,8 +373,8 @@ </connections> <includes> <include location="local" impldecl="in declaration">kptduration.h</include> - <include location="global" impldecl="in implementation">qvalidator.h</include> - <include location="global" impldecl="in implementation">qregexp.h</include> + <include location="global" impldecl="in implementation">tqvalidator.h</include> + <include location="global" impldecl="in implementation">tqregexp.h</include> <include location="local" impldecl="in implementation">kptdurationwidget.ui.h</include> </includes> <forwards> @@ -382,14 +382,14 @@ </forwards> <variables> <variable access="public">enum { Days = 0x1, Hours = 0x2, Minutes = 0x4, Seconds = 0x8, Milliseconds = 0x10 } Fields;</variable> - <variable access="private">QString m_decimalPoint;</variable> - <variable access="private">QRegExpValidator *m_validator;</variable> + <variable access="private">TQString m_decimalPoint;</variable> + <variable access="private">TQRegExpValidator *m_validator;</variable> <variable access="private">struct FieldDescriptor *m_fields;</variable> </variables> -<signals> +<Q_SIGNALS> <signal>valueChanged()</signal> -</signals> -<slots> +</Q_SIGNALS> +<Q_SLOTS> <slot>setValue( const KPlato::Duration & newDuration )</slot> <slot access="private">dddLostFocus()</slot> <slot access="private">hhLostFocus()</slot> @@ -397,7 +397,7 @@ <slot access="private">ssLostFocus()</slot> <slot access="private">msLostFocus()</slot> <slot>handleLostFocus( int field )</slot> -</slots> +</Q_SLOTS> <functions> <function access="private">init()</function> <function access="private" specifier="non virtual">destroy()</function> @@ -412,9 +412,9 @@ <function>setFieldLeftscale( int f, double ls )</function> <function>setFieldRightscale( int f, double rs )</function> <function>setFieldScale( int f, double scale )</function> - <function>setFieldUnit( int f, QString unit )</function> + <function>setFieldUnit( int f, TQString unit )</function> <function access="private" specifier="non virtual" returnType="double">power( double m, int e )</function> - <function access="private" specifier="non virtual" returnType="double">fraction( QString number, int * exp )</function> + <function access="private" specifier="non virtual" returnType="double">fraction( TQString number, int * exp )</function> </functions> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kptdurationwidget.ui.h b/kplato/kptdurationwidget.ui.h index 87b63c20..2bf5b033 100644 --- a/kplato/kptdurationwidget.ui.h +++ b/kplato/kptdurationwidget.ui.h @@ -2,7 +2,7 @@ // ui.h extension file, included from the uic-generated form implementation. // // If you wish to add, delete or rename functions or slots use -// Qt Designer which will update this file, preserving your code. Create an +// TQt Designer which will update this file, preserving your code. Create an // init() function in place of a constructor, and a destroy() function in // place of a destructor. // @@ -41,26 +41,26 @@ namespace KPlato struct FieldDescriptor { // Which field is to my left, and what conversion factor separates us? - QLineEdit *left; + TQLineEdit *left; double leftScale; // Which field am I, and how am I formatted? - QLineEdit *current; + TQLineEdit *current; const char *format; // Which field is to my right, and what conversion factor separates us? - QLineEdit *right; + TQLineEdit *right; double rightScale; // If I am hidden, who else hides with me? - QLabel *separator; + TQLabel *separator; // Used for calculating a correct duration double fullScale; double scale; // Used for displaying a unit behind each field - QLabel *unit; + TQLabel *unit; }; #define setField(f, l, ls, c, fmt, r, rs, s, fs, sc, u) \ @@ -100,10 +100,10 @@ void DurationWidget::init() // - any overflow from the integer part is carried left one field // // and the process repeated until the rightmost and leftmost fields are reached. - QRegExp re(QString("\\d{1,10}|\\d{1,7}\\") + m_decimalPoint + - QString("\\d{0,10}|\\d{0,7}\\") + m_decimalPoint + - QString("\\d{1,3}")); - m_validator = new QRegExpValidator(re, this); + TQRegExp re(TQString("\\d{1,10}|\\d{1,7}\\") + m_decimalPoint + + TQString("\\d{0,10}|\\d{0,7}\\") + m_decimalPoint + + TQString("\\d{1,3}")); + m_validator = new TQRegExpValidator(re, TQT_TQOBJECT(this)); m_ddd->setValidator(m_validator); m_hh->setValidator(m_validator); m_mm->setValidator(m_validator); @@ -127,67 +127,67 @@ void DurationWidget::init() void DurationWidget::destroy() { delete m_fields; - //delete m_validator; //QWidget takes care of this + //delete m_validator; //TQWidget takes care of this } -Q_INT64 DurationWidget::setValueMilliseconds(Q_INT64 milliseconds) +TQ_INT64 DurationWidget::setValueMilliseconds(TQ_INT64 milliseconds) { unsigned sc = (unsigned)m_fields[4].leftScale; - Q_INT64 secs = milliseconds / sc; - Q_INT64 ms = milliseconds % sc; - QString tmp; + TQ_INT64 secs = milliseconds / sc; + TQ_INT64 ms = milliseconds % sc; + TQString tmp; tmp.sprintf(m_fields[4].format, ms); m_fields[4].current->setText(tmp); return secs; } -Q_INT64 DurationWidget::setValueSeconds(Q_INT64 seconds) +TQ_INT64 DurationWidget::setValueSeconds(TQ_INT64 seconds) { unsigned sc = (unsigned)m_fields[3].leftScale; - Q_INT64 mins = seconds / sc; - Q_INT64 s = seconds % sc; - QString tmp; + TQ_INT64 mins = seconds / sc; + TQ_INT64 s = seconds % sc; + TQString tmp; tmp.sprintf(m_fields[3].format, s); m_fields[3].current->setText(tmp); return mins; } -Q_INT64 DurationWidget::setValueMinutes(Q_INT64 mins) +TQ_INT64 DurationWidget::setValueMinutes(TQ_INT64 mins) { unsigned sc = (unsigned)m_fields[2].leftScale; - Q_INT64 hours = mins / sc; - Q_INT64 m = mins % sc; - QString tmp; + TQ_INT64 hours = mins / sc; + TQ_INT64 m = mins % sc; + TQString tmp; tmp.sprintf(m_fields[2].format, m); m_fields[2].current->setText(tmp); return hours; } // NOTE: Input is minutes and also returns minutes! -Q_INT64 DurationWidget::setValueHours(Q_INT64 mins) +TQ_INT64 DurationWidget::setValueHours(TQ_INT64 mins) { if (m_fields[1].current->isHidden()) return mins; unsigned sc = (unsigned)m_fields[1].rightScale; - Q_INT64 hours = (Q_INT64)(mins / sc); - Q_INT64 m = mins - (Q_INT64)(hours * sc); + TQ_INT64 hours = (TQ_INT64)(mins / sc); + TQ_INT64 m = mins - (TQ_INT64)(hours * sc); //kdDebug()<<k_funcinfo<<"mins="<<mins<<" -> hours="<<hours<<" rem="<<m<<endl; - QString tmp; + TQString tmp; tmp.sprintf(m_fields[1].format, hours); m_fields[1].current->setText(tmp); return m; } // NOTE: Input is minutes and also returns minutes! -Q_INT64 DurationWidget::setValueDays(Q_INT64 mins) +TQ_INT64 DurationWidget::setValueDays(TQ_INT64 mins) { if (m_fields[0].current->isHidden()) return mins; double sc = m_fields[1].rightScale * m_fields[0].rightScale; - Q_INT64 days = (Q_INT64)(mins / sc); - Q_INT64 m = mins - (Q_INT64)(days * sc); + TQ_INT64 days = (TQ_INT64)(mins / sc); + TQ_INT64 m = mins - (TQ_INT64)(days * sc); //kdDebug()<<k_funcinfo<<"mins="<<mins<<" -> days="<<days<<" rem="<<m<<endl; - QString tmp; + TQString tmp; tmp.sprintf(m_fields[0].format, days); m_fields[0].current->setText(tmp); return m; @@ -195,7 +195,7 @@ Q_INT64 DurationWidget::setValueDays(Q_INT64 mins) void DurationWidget::setValue(const KPlato::Duration &newDuration) { - Q_INT64 value = newDuration.milliseconds(); + TQ_INT64 value = newDuration.milliseconds(); //kdDebug()<<k_funcinfo<<f<<": value="<<value<<endl; value = setValueMilliseconds(value); // returns seconds value = setValueSeconds(value); // returns minutes @@ -218,7 +218,7 @@ Duration DurationWidget::value() const { double v = m_fields[i].current->text().toDouble(); v = v * m_fields[i].scale / m_fields[i].fullScale;; - d.addMilliseconds((Q_INT64)(v*(1000*60*60*24))); + d.addMilliseconds((TQ_INT64)(v*(1000*60*60*24))); } ++i; if (!m_fields[i].current->isHidden() && @@ -227,7 +227,7 @@ Duration DurationWidget::value() const { double v = m_fields[i].current->text().toDouble(); v = v * m_fields[i].scale / m_fields[i].fullScale;; - d.addMilliseconds((Q_INT64)(v*(1000*60*60))); + d.addMilliseconds((TQ_INT64)(v*(1000*60*60))); } ++i; if (!m_fields[i].current->isHidden() && @@ -236,7 +236,7 @@ Duration DurationWidget::value() const { double v = m_fields[i].current->text().toDouble(); v = v * m_fields[i].scale / m_fields[i].fullScale;; - d.addMilliseconds((Q_INT64)(v*(1000*60))); + d.addMilliseconds((TQ_INT64)(v*(1000*60))); } ++i; if (!m_fields[i].current->isHidden() && @@ -245,12 +245,12 @@ Duration DurationWidget::value() const { double v = m_fields[i].current->text().toDouble(); v = v * m_fields[i].scale / m_fields[i].fullScale;; - d.addMilliseconds((Q_INT64)(v*(1000))); + d.addMilliseconds((TQ_INT64)(v*(1000))); } ++i; if (!m_fields[i].current->isHidden()) { - Q_INT64 v = m_fields[i].current->text().toUInt(); + TQ_INT64 v = m_fields[i].current->text().toUInt(); d.addMilliseconds(v); } return d; @@ -290,12 +290,12 @@ void DurationWidget::handleLostFocus( int field) { // Get our own info, and that of our left and right neighbours. - QLineEdit *left = m_fields[field].left; + TQLineEdit *left = m_fields[field].left; double leftScale = m_fields[field].leftScale; const char *leftFormat = left ? m_fields[field - 1].format : NULL; - QLineEdit *current = m_fields[field].current; + TQLineEdit *current = m_fields[field].current; const char *currentFormat = m_fields[field].format; - QLineEdit *right = m_fields[field].right; + TQLineEdit *right = m_fields[field].right; double rightScale = m_fields[field].rightScale; const char *rightFormat = right ? m_fields[field + 1].format : NULL; @@ -304,10 +304,10 @@ void DurationWidget::handleLostFocus( leftScale = 1; // Get the text and start processing... - QString newValue(current->text()); + TQString newValue(current->text()); double v = KGlobal::locale()->readNumber(newValue); unsigned currentValue = 0; - QString tmp; + TQString tmp; //kdDebug()<<k_funcinfo<<field<<": value="<<v<<" v="<<v<<endl; if (left && v >= leftScale) { @@ -321,7 +321,7 @@ void DurationWidget::handleLostFocus( v = v - (tmp.toUInt() * leftScale); newValue = KGlobal::locale()->formatNumber(v); } - int point = newValue.find(m_decimalPoint); + int point = newValue.tqfind(m_decimalPoint); if (point != -1) { //HACK doubles may be rounded(at fractions > 6 digits on my system) @@ -419,7 +419,7 @@ void DurationWidget::setFieldScale(int f, double scale) m_fields[f].scale = scale; } -void DurationWidget::setFieldUnit(int f, QString unit) +void DurationWidget::setFieldUnit(int f, TQString unit) { if (m_fields[f].unit) { @@ -436,12 +436,12 @@ double DurationWidget::power(double m, int e) { return value; } -double DurationWidget::fraction(QString number, int *exp) { - int point = number.find(m_decimalPoint); +double DurationWidget::fraction(TQString number, int *exp) { + int point = number.tqfind(m_decimalPoint); if (point == -1) { return 0.0; } - QString v; + TQString v; if (exp) { v = number.mid(point+m_decimalPoint.length()); *exp = v.length(); diff --git a/kplato/kpteffortcostmap.h b/kplato/kpteffortcostmap.h index 7317d400..7910adb5 100644 --- a/kplato/kpteffortcostmap.h +++ b/kplato/kpteffortcostmap.h @@ -20,8 +20,8 @@ #ifndef KPTEFFORTCOST_H #define KPTEFFORTCOST_H -#include <qdatetime.h> -#include <qmap.h> +#include <tqdatetime.h> +#include <tqmap.h> #include "kptduration.h" @@ -60,7 +60,7 @@ private: Duration m_effort; double m_cost; }; -typedef QMap<QDate, EffortCost> EffortCostDayMap; +typedef TQMap<TQDate, EffortCost> EffortCostDayMap; class EffortCostMap { public: @@ -73,18 +73,18 @@ public: m_days.clear(); } - EffortCost effortCost(const QDate &date) const { + EffortCost effortCost(const TQDate &date) const { EffortCost ec; if (!date.isValid()) { kdError()<<k_funcinfo<<"Date not valid"<<endl; return ec; } - EffortCostDayMap::const_iterator it = m_days.find(date); + EffortCostDayMap::const_iterator it = m_days.tqfind(date); if (it != m_days.end()) ec = it.data(); return ec; } - void insert(const QDate &date, const Duration &effort, const double cost) { + void insert(const TQDate &date, const Duration &effort, const double cost) { if (!date.isValid()) { kdError()<<k_funcinfo<<"Date not valid"<<endl; return; @@ -95,14 +95,14 @@ public: * If data for this date allready exists add the new values to the old, * else the new values are inserted. */ - EffortCost &add(const QDate &date, const Duration &effort, const double cost) { + EffortCost &add(const TQDate &date, const Duration &effort, const double cost) { return add(date, EffortCost(effort, cost)); } /** * If data for this date allready exists add the new values to the old, * else the new value is inserted. */ - EffortCost &add(const QDate &date, const EffortCost &ec) { + EffortCost &add(const TQDate &date, const EffortCost &ec) { if (!date.isValid()) { kdError()<<k_funcinfo<<"Date not valid"<<endl; return zero(); @@ -132,33 +132,33 @@ public: } return *this; } - EffortCost &effortCostOnDate(const QDate &date) { + EffortCost &effortCostOnDate(const TQDate &date) { return m_days[date]; } /// Return total cost for the next num days starting at date - double cost(const QDate &date, int num=7) { + double cost(const TQDate &date, int num=7) { double r=0.0; for (int i=0; i < num; ++i) { r += costOnDate(date.addDays(i)); } return r; } - double costOnDate(const QDate &date) const { + double costOnDate(const TQDate &date) const { if (!date.isValid()) { kdError()<<k_funcinfo<<"Date not valid"<<endl; return 0.0; } - if (m_days.contains(date)) { + if (m_days.tqcontains(date)) { return m_days[date].cost(); } return 0.0; } - Duration effortOnDate(const QDate &date) const { + Duration effortOnDate(const TQDate &date) const { if (!date.isValid()) { kdError()<<k_funcinfo<<"Date not valid"<<endl; return Duration::zeroDuration; } - if (m_days.contains(date)) { + if (m_days.tqcontains(date)) { return m_days[date].effort(); } return Duration::zeroDuration; diff --git a/kplato/kptfactory.cc b/kplato/kptfactory.cc index d71cdaaf..4c31ef79 100644 --- a/kplato/kptfactory.cc +++ b/kplato/kptfactory.cc @@ -34,8 +34,8 @@ K_EXPORT_COMPONENT_FACTORY( libkplatopart, Factory ) KInstance* Factory::s_global = 0L; KAboutData* Factory::s_aboutData = 0L; -Factory::Factory( QObject* parent, const char* name ) - : KoFactory( parent, name ) +Factory::Factory( TQObject* tqparent, const char* name ) + : KoFactory( tqparent, name ) { global(); } @@ -48,20 +48,20 @@ Factory::~Factory() s_global = 0L; } -KParts::Part *Factory::createPartObject(QWidget *parentWidget, +KParts::Part *Factory::createPartObject(TQWidget *tqparentWidget, const char *widgetName, - QObject* parent, const char* name, + TQObject* tqparent, const char* name, const char* classname, - const QStringList &) + const TQStringList &) { // If classname is "KoDocument", our host is a koffice application // otherwise, the host wants us as a simple part, so switch to readonly // and single view. bool bWantKoDocument = (strcmp(classname, "KoDocument") == 0); - // parentWidget and widgetName are used by KoDocument for the + // tqparentWidget and widgetName are used by KoDocument for the // "readonly+singleView" case. - Part *part = new Part(parentWidget, widgetName, parent, name, + Part *part = new Part(tqparentWidget, widgetName, tqparent, name, !bWantKoDocument); if (!bWantKoDocument) diff --git a/kplato/kptfactory.h b/kplato/kptfactory.h index 49e51ce9..a8126835 100644 --- a/kplato/kptfactory.h +++ b/kplato/kptfactory.h @@ -30,11 +30,12 @@ namespace KPlato class Factory : public KoFactory { Q_OBJECT + TQ_OBJECT public: - Factory( QObject* parent = 0, const char* name = 0 ); + Factory( TQObject* tqparent = 0, const char* name = 0 ); ~Factory(); - virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", const QStringList &args = QStringList() ); + virtual KParts::Part *createPartObject( TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject *tqparent = 0, const char *name = 0, const char *classname = "KoDocument", const TQStringList &args = TQStringList() ); static KInstance* global(); 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); } diff --git a/kplato/kptganttview.h b/kplato/kptganttview.h index 8a249abc..b6d0b8a4 100644 --- a/kplato/kptganttview.h +++ b/kplato/kptganttview.h @@ -23,15 +23,15 @@ #include "kptcontext.h" -#include <qsplitter.h> -#include <qcursor.h> +#include <tqsplitter.h> +#include <tqcursor.h> -class QLayout; -class QListViewItem; -class QPoint; -class QListView; -class QLineEdit; -class QSpinBox; +class TQLayout; +class TQListViewItem; +class TQPoint; +class TQListView; +class TQLineEdit; +class TQSpinBox; class KDGanttViewSummaryItem; class KDGanttViewTaskItem; @@ -52,13 +52,14 @@ class Task; class Project; class Relation; -class GanttView : public QSplitter +class GanttView : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - GanttView(QWidget *parent, bool readWrite=true, const char* name = 0 ); + GanttView(TQWidget *tqparent, bool readWrite=true, const char* name = 0 ); //~GanttView(); @@ -70,7 +71,7 @@ class GanttView : public QSplitter /** * Call draw() or drawChanges() before calling this. */ - void drawOnPainter(QPainter* painter, const QRect rect); + void drawOnPainter(TQPainter* painter, const TQRect rect); Node *currentNode() const; @@ -79,7 +80,7 @@ class GanttView : public QSplitter void addTaskLink(KDGanttViewTaskLink *link); - bool exportGantt(QIODevice* device); // testing + bool exportGantt(TQIODevice* device); // testing virtual bool setContext(Context::Ganttview &context, Project &project); virtual void getContext(Context::Ganttview &context) const; @@ -98,19 +99,19 @@ signals: void addRelation(Node *par, Node *child, int linkType); void itemDoubleClicked(); - void itemRenamed(Node*, const QString&); + void itemRenamed(Node*, const TQString&); /** * Requests a specific type of popup menu. * Usually a KPlato::View object is connected to this signal. */ - void requestPopupMenu(const QString& menuname, const QPoint & pos); + void requestPopupMenu(const TQString& menuname, const TQPoint & pos); public slots: /** * Determines the correct type of popup menu and emits requestPopupMenu() */ - void popupMenuRequested(KDGanttViewItem * item, const QPoint & pos, int); + void popupMenuRequested(KDGanttViewItem * item, const TQPoint & pos, int); void setShowExpected(bool on) { m_showExpected = on; } void setShowOptimistic(bool on) { m_showOptimistic = on; } @@ -127,8 +128,8 @@ public slots: private slots: void currentItemChanged(KDGanttViewItem *); - void slotItemDoubleClicked(QListViewItem*); - void slotItemRenamed(KDGanttViewItem*, int, const QString&); + void slotItemDoubleClicked(TQListViewItem*); + void slotItemRenamed(KDGanttViewItem*, int, const TQString&); void slotLinkItems(KDGanttViewItem* from, KDGanttViewItem* to, int linkType); @@ -138,7 +139,7 @@ private slots: protected: int linkTypeToRelation(int linkType); - void setRenameEnabled(QListViewItem *item, bool on); + void setRenameEnabled(TQListViewItem *item, bool on); private: KDGanttViewItem *findItem(Node *node); KDGanttViewItem *findItem(Node *node, KDGanttViewItem *item); @@ -162,20 +163,20 @@ private: void modifyTask(KDGanttViewItem *item, Task *task); void modifyMilestone(KDGanttViewItem *item, Task *task); - KDGanttViewItem *addNode(KDGanttViewItem *parentItem, Node *node,KDGanttViewItem *after=0); + KDGanttViewItem *addNode(KDGanttViewItem *tqparentItem, Node *node,KDGanttViewItem *after=0); - KDGanttViewItem *addProject(KDGanttViewItem *parentItem, Node *node, KDGanttViewItem *after=0); - KDGanttViewItem *addSubProject(KDGanttViewItem *parentItem, Node *node, KDGanttViewItem *after=0); - KDGanttViewItem *addSummaryTask(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after=0); - KDGanttViewItem *addTask(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after=0); - KDGanttViewItem *addMilestone(KDGanttViewItem *parentItem, Task *task, KDGanttViewItem *after=0); + KDGanttViewItem *addProject(KDGanttViewItem *tqparentItem, Node *node, KDGanttViewItem *after=0); + KDGanttViewItem *addSubProject(KDGanttViewItem *tqparentItem, Node *node, KDGanttViewItem *after=0); + KDGanttViewItem *addSummaryTask(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after=0); + KDGanttViewItem *addTask(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after=0); + KDGanttViewItem *addMilestone(KDGanttViewItem *tqparentItem, Task *task, KDGanttViewItem *after=0); void drawChildren(KDGanttViewItem *item, Node &node); - void drawProject(KDGanttViewItem *parentItem, Node *node); - void drawSubProject(KDGanttViewItem *parentItem, Node *node); - void drawSummaryTask(KDGanttViewItem *parentItem, Task *task); - void drawTask(KDGanttViewItem *parentItem, Task *task); - void drawMilestone(KDGanttViewItem *parentItem, Task *task); + void drawProject(KDGanttViewItem *tqparentItem, Node *node); + void drawSubProject(KDGanttViewItem *tqparentItem, Node *node); + void drawSummaryTask(KDGanttViewItem *tqparentItem, Task *task); + void drawTask(KDGanttViewItem *tqparentItem, Task *task); + void drawMilestone(KDGanttViewItem *tqparentItem, Task *task); void drawRelations(); void drawRelations(KDGanttViewItem *item); @@ -202,7 +203,7 @@ private: bool m_showNoInformation; bool m_showAppointments; bool m_firstTime; - QPtrList<KDGanttViewTaskLink> m_taskLinks; + TQPtrList<KDGanttViewTaskLink> m_taskLinks; Project *m_project; }; diff --git a/kplato/kptintervaledit.cc b/kplato/kptintervaledit.cc index 8d74b357..7985d7db 100644 --- a/kplato/kptintervaledit.cc +++ b/kplato/kptintervaledit.cc @@ -20,16 +20,16 @@ #include "kptintervaledit.h" #include "intervalitem.h" -#include <qpushbutton.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qlistview.h> -#include <qpair.h> -#include <qdatetime.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqlistview.h> +#include <tqpair.h> +#include <tqdatetime.h> #include <klocale.h> #include <kdebug.h> @@ -37,23 +37,23 @@ namespace KPlato { -IntervalEdit::IntervalEdit(QWidget *parent, const char *name) - : IntervalEditImpl(parent) +IntervalEdit::IntervalEdit(TQWidget *tqparent, const char *name) + : IntervalEditImpl(tqparent) { //kdDebug()<<k_funcinfo<<endl; } //-------------------------------------------- -IntervalEditImpl::IntervalEditImpl(QWidget *parent) - : IntervalEditBase(parent) { +IntervalEditImpl::IntervalEditImpl(TQWidget *tqparent) + : IntervalEditBase(tqparent) { intervalList->header()->setStretchEnabled(true); intervalList->setSortColumn(0); - connect(bClear, SIGNAL(clicked()), SLOT(slotClearClicked())); - connect(bAddInterval, SIGNAL(clicked()), SLOT(slotAddIntervalClicked())); - connect(intervalList, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotIntervalSelectionChanged(QListViewItem*))); + connect(bClear, TQT_SIGNAL(clicked()), TQT_SLOT(slotClearClicked())); + connect(bAddInterval, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddIntervalClicked())); + connect(intervalList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotIntervalSelectionChanged(TQListViewItem*))); } @@ -69,7 +69,7 @@ void IntervalEditImpl::slotAddIntervalClicked() { emit changed(); } -void IntervalEditImpl::slotIntervalSelectionChanged(QListViewItem *item) { +void IntervalEditImpl::slotIntervalSelectionChanged(TQListViewItem *item) { IntervalItem *ii = dynamic_cast<IntervalItem *>(item); if (!ii) return; @@ -77,20 +77,20 @@ void IntervalEditImpl::slotIntervalSelectionChanged(QListViewItem *item) { endTime->setTime(ii->interval().second); } -QPtrList<QPair<QTime, QTime> > IntervalEditImpl::intervals() const { - QPtrList<QPair<QTime, QTime> > l; - QListViewItem *i = intervalList->firstChild(); +TQPtrList<TQPair<TQTime, TQTime> > IntervalEditImpl::intervals() const { + TQPtrList<TQPair<TQTime, TQTime> > l; + TQListViewItem *i = intervalList->firstChild(); for (; i; i = i->nextSibling()) { IntervalItem *item = dynamic_cast<IntervalItem*>(i); if (i) - l.append(new QPair<QTime, QTime>(item->interval().first, item->interval().second)); + l.append(new TQPair<TQTime, TQTime>(item->interval().first, item->interval().second)); } return l; } -void IntervalEditImpl::setIntervals(const QPtrList<QPair<QTime, QTime> > &intervals) const { +void IntervalEditImpl::setIntervals(const TQPtrList<TQPair<TQTime, TQTime> > &intervals) const { intervalList->clear(); - QPtrListIterator<QPair<QTime, QTime> > it =intervals; + TQPtrListIterator<TQPair<TQTime, TQTime> > it =intervals; for (; it.current(); ++it) { new IntervalItem(intervalList, it.current()->first, it.current()->second); } diff --git a/kplato/kptintervaledit.h b/kplato/kptintervaledit.h index 981b4349..0d889241 100644 --- a/kplato/kptintervaledit.h +++ b/kplato/kptintervaledit.h @@ -24,26 +24,27 @@ #include <kdialogbase.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qpair.h> -#include <qwidget.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqpair.h> +#include <tqwidget.h> namespace KPlato { class IntervalEditImpl : public IntervalEditBase { Q_OBJECT + TQ_OBJECT public: - IntervalEditImpl(QWidget *parent); + IntervalEditImpl(TQWidget *tqparent); - QPtrList<QPair<QTime, QTime> > intervals() const; - void setIntervals(const QPtrList<QPair<QTime, QTime> > &intervals) const; + TQPtrList<TQPair<TQTime, TQTime> > intervals() const; + void setIntervals(const TQPtrList<TQPair<TQTime, TQTime> > &intervals) const; private slots: void slotClearClicked(); void slotAddIntervalClicked(); - void slotIntervalSelectionChanged(QListViewItem *item); + void slotIntervalSelectionChanged(TQListViewItem *item); signals: void changed(); @@ -51,8 +52,9 @@ signals: class IntervalEdit : public IntervalEditImpl { Q_OBJECT + TQ_OBJECT public: - IntervalEdit(QWidget *parent=0, const char *name=0); + IntervalEdit(TQWidget *tqparent=0, const char *name=0); }; diff --git a/kplato/kptintervaleditbase.ui b/kplato/kptintervaleditbase.ui index 69ad5288..78580d56 100644 --- a/kplato/kptintervaleditbase.ui +++ b/kplato/kptintervaleditbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::IntervalEditBase</class> <author>Dag Andersen</author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>IntervalEditBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Work Interval</string> @@ -48,29 +48,29 @@ <enum>AllColumns</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTimeEdit"> + <widget class="TQTimeEdit"> <property name="name"> <cstring>startTime</cstring> </property> </widget> - <widget class="QTimeEdit"> + <widget class="TQTimeEdit"> <property name="name"> <cstring>endTime</cstring> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -86,14 +86,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>51</width> <height>21</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bClear</cstring> </property> @@ -101,7 +101,7 @@ <string>Clear</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bAddInterval</cstring> </property> @@ -120,5 +120,5 @@ <tabstop>bAddInterval</tabstop> <tabstop>intervalList</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kptmainprojectdialog.cc b/kplato/kptmainprojectdialog.cc index 32d0a0f1..71e2ba4e 100644 --- a/kplato/kptmainprojectdialog.cc +++ b/kplato/kptmainprojectdialog.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qvbox.h> +#include <tqvbox.h> #include <klocale.h> #include <kcommand.h> @@ -31,16 +31,16 @@ namespace KPlato { -MainProjectDialog::MainProjectDialog(Project &p, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Project Settings"), Ok|Cancel, Ok, parent, name, true, true), +MainProjectDialog::MainProjectDialog(Project &p, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Project Settings"), Ok|Cancel, Ok, tqparent, name, true, true), project(p) { panel = new MainProjectPanel(project, this); setMainWidget(panel); enableButtonOK(false); - resize( QSize(500, 410).expandedTo(minimumSizeHint())); - connect(panel, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOK(bool))); + resize( TQSize(500, 410).expandedTo(tqminimumSizeHint())); + connect(panel, TQT_SIGNAL(obligatedFieldsFilled(bool)), TQT_SLOT(enableButtonOK(bool))); } @@ -53,7 +53,7 @@ void MainProjectDialog::slotOk() { KCommand *MainProjectDialog::buildCommand(Part *part) { KMacroCommand *m = 0; - QString c = i18n("Modify main project"); + TQString c = i18n("Modify main project"); KCommand *cmd = panel->buildCommand(part); if (cmd) { if (!m) m = new KMacroCommand(c); diff --git a/kplato/kptmainprojectdialog.h b/kplato/kptmainprojectdialog.h index 986b9f25..4930e9ae 100644 --- a/kplato/kptmainprojectdialog.h +++ b/kplato/kptmainprojectdialog.h @@ -34,8 +34,9 @@ class Part; class MainProjectDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - MainProjectDialog(Project &project, QWidget *parent=0, const char *name=0); + MainProjectDialog(Project &project, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptmainprojectpanel.cc b/kplato/kptmainprojectpanel.cc index 119a53f8..402bdc4a 100644 --- a/kplato/kptmainprojectpanel.cc +++ b/kplato/kptmainprojectpanel.cc @@ -19,14 +19,14 @@ #include "kptmainprojectpanel.h" -#include <qcheckbox.h> -#include <qbuttongroup.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> -#include <qradiobutton.h> -#include <qpushbutton.h> - -#include <qlabel.h> +#include <tqcheckbox.h> +#include <tqbuttongroup.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> +#include <tqradiobutton.h> +#include <tqpushbutton.h> + +#include <tqlabel.h> #include <klineedit.h> #include <ktextedit.h> #include <kdatewidget.h> @@ -45,8 +45,8 @@ namespace KPlato { -MainProjectPanel::MainProjectPanel(Project &p, QWidget *parent, const char *name) - : MainProjectPanelImpl(parent, name), +MainProjectPanel::MainProjectPanel(Project &p, TQWidget *tqparent, const char *name) + : MainProjectPanelImpl(tqparent, name), project(p) { namefield->setText(project.name()); @@ -57,12 +57,12 @@ MainProjectPanel::MainProjectPanel(Project &p, QWidget *parent, const char *name //baseline->setChecked(project.isBaselined()); FIXME: Removed for this release - QDateTime st = project.constraintStartTime(); - QDateTime et = project.constraintEndTime(); - QString s = i18n("Scheduling"); + TQDateTime st = project.constraintStartTime(); + TQDateTime et = project.constraintEndTime(); + TQString s = i18n("Scheduling"); Schedule *sch = project.currentSchedule(); if (sch) { - s = i18n("Scheduling (%1)").arg(sch->typeToString(true)); + s = i18n("Scheduling (%1)").tqarg(sch->typeToString(true)); } schedulingGroup->setTitle(s); if (project.constraint() == Node::MustStartOn) { @@ -100,7 +100,7 @@ bool MainProjectPanel::ok() { KCommand *MainProjectPanel::buildCommand(Part *part) { KMacroCommand *m = 0; - QString c = i18n("Modify main project"); + TQString c = i18n("Modify main project"); if (project.name() != namefield->text()) { if (!m) m = new KMacroCommand(c); m->addCommand(new NodeModifyNameCmd(part, project, namefield->text())); @@ -142,25 +142,25 @@ KCommand *MainProjectPanel::buildCommand(Part *part) { } //------------------------------------------------------------------- -MainProjectPanelImpl::MainProjectPanelImpl(QWidget *parent, const char *name) - : MainProjectPanelBase(parent, name) { +MainProjectPanelImpl::MainProjectPanelImpl(TQWidget *tqparent, const char *name) + : MainProjectPanelBase(tqparent, name) { // signals and slots connections - connect( bStartDate, SIGNAL( clicked() ), this, SLOT( slotStartDateClicked() ) ); - connect( bEndDate, SIGNAL( clicked() ), this, SLOT( slotEndDateClicked() ) ); - connect( bStartDate, SIGNAL( clicked() ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( bEndDate, SIGNAL( clicked() ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( descriptionfield, SIGNAL( textChanged() ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( endDate, SIGNAL( changed(QDate) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( endTime, SIGNAL( valueChanged(const QTime&) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( startDate, SIGNAL( changed(QDate) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( startTime, SIGNAL( valueChanged(const QTime&) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - //connect( baseline, SIGNAL( toggled(bool) ), this, SLOT( slotCheckAllFieldsFilled() ) ); FIXME: Removed for this release - connect( namefield, SIGNAL( textChanged(const QString&) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( idfield, SIGNAL( textChanged(const QString&) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - connect( leaderfield, SIGNAL( textChanged(const QString&) ), this, SLOT( slotCheckAllFieldsFilled() ) ); - //connect( baseline, SIGNAL( toggled(bool) ), this, SLOT( slotBaseline() ) ); FIXME: Removed for this release - connect( chooseLeader, SIGNAL( clicked() ), this, SLOT( slotChooseLeader() ) ); + connect( bStartDate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotStartDateClicked() ) ); + connect( bEndDate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEndDateClicked() ) ); + connect( bStartDate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( bEndDate, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( descriptionfield, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( endDate, TQT_SIGNAL( changed(TQDate) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( endTime, TQT_SIGNAL( valueChanged(const TQTime&) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( startDate, TQT_SIGNAL( changed(TQDate) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( startTime, TQT_SIGNAL( valueChanged(const TQTime&) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + //connect( baseline, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); FIXME: Removed for this release + connect( namefield, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( idfield, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + connect( leaderfield, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( slotCheckAllFieldsFilled() ) ); + //connect( baseline, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotBaseline() ) ); FIXME: Removed for this release + connect( chooseLeader, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChooseLeader() ) ); } void MainProjectPanelImpl::slotCheckAllFieldsFilled() @@ -212,15 +212,15 @@ void MainProjectPanelImpl::enableDateTime() } -QDateTime MainProjectPanelImpl::startDateTime() +TQDateTime MainProjectPanelImpl::startDateTime() { - return QDateTime(startDate->date(), startTime->time()); + return TQDateTime(startDate->date(), startTime->time()); } -QDateTime MainProjectPanelImpl::endDateTime() +TQDateTime MainProjectPanelImpl::endDateTime() { - return QDateTime(endDate->date(), endTime->time()); + return TQDateTime(endDate->date(), endTime->time()); } diff --git a/kplato/kptmainprojectpanel.h b/kplato/kptmainprojectpanel.h index dd7a5821..50043a3f 100644 --- a/kplato/kptmainprojectpanel.h +++ b/kplato/kptmainprojectpanel.h @@ -22,9 +22,9 @@ #include "kptmainprojectpanelbase.h" -#include <qdatetime.h> +#include <tqdatetime.h> -class QWidget; +class TQWidget; class KCommand; @@ -36,11 +36,12 @@ class Part; class MainProjectPanelImpl : public MainProjectPanelBase { Q_OBJECT + TQ_OBJECT public: - MainProjectPanelImpl(QWidget *parent=0, const char *name=0); + MainProjectPanelImpl(TQWidget *tqparent=0, const char *name=0); - virtual QDateTime startDateTime(); - virtual QDateTime endDateTime(); + virtual TQDateTime startDateTime(); + virtual TQDateTime endDateTime(); public slots: virtual void slotCheckAllFieldsFilled(); @@ -58,8 +59,9 @@ signals: class MainProjectPanel : public MainProjectPanelImpl { Q_OBJECT + TQ_OBJECT public: - MainProjectPanel(Project &project, QWidget *parent=0, const char *name=0); + MainProjectPanel(Project &project, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptmainprojectpanelbase.ui b/kplato/kptmainprojectpanelbase.ui index 54155a97..712f691d 100644 --- a/kplato/kptmainprojectpanelbase.ui +++ b/kplato/kptmainprojectpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::MainProjectPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>MainProjectPanelBase</cstring> </property> @@ -23,9 +23,9 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <grid> <property name="name"> @@ -39,14 +39,14 @@ <string>The project leader.</string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> <property name="text"> <string>&Leader:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> <property name="buddy" stdset="0"> @@ -64,7 +64,7 @@ <string>The project name.</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -88,18 +88,18 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>270</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>wbs</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>20</width> <height>0</height> @@ -115,7 +115,7 @@ <string></string> </property> </widget> - <widget class="QLabel" row="0" column="3"> + <widget class="TQLabel" row="0" column="3"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -129,7 +129,7 @@ <string>The unique project identification</string> </property> </widget> - <widget class="QPushButton" row="2" column="5"> + <widget class="TQPushButton" row="2" column="5"> <property name="name"> <cstring>chooseLeader</cstring> </property> @@ -148,7 +148,7 @@ <string>The unique project identification</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -158,7 +158,7 @@ </widget> </grid> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>schedulingGroup</cstring> </property> @@ -186,12 +186,12 @@ If end time is defined, the project is scheduled backwards from this time. When <string>Define when the project shall start.</string> </property> </widget> - <widget class="QTimeEdit" row="0" column="2"> + <widget class="TQTimeEdit" row="0" column="2"> <property name="name"> <cstring>startTime</cstring> </property> </widget> - <widget class="QTimeEdit" row="1" column="2"> + <widget class="TQTimeEdit" row="1" column="2"> <property name="name"> <cstring>endTime</cstring> </property> @@ -204,7 +204,7 @@ If end time is defined, the project is scheduled backwards from this time. When <string>Define when the project shall end.</string> </property> </widget> - <widget class="QRadioButton" row="1" column="0"> + <widget class="TQRadioButton" row="1" column="0"> <property name="name"> <cstring>bEndDate</cstring> </property> @@ -218,7 +218,7 @@ If end time is defined, the project is scheduled backwards from this time. When <string>Select this to schedule the project backward from end time.</string> </property> </widget> - <widget class="QRadioButton" row="0" column="0"> + <widget class="TQRadioButton" row="0" column="0"> <property name="name"> <cstring>bStartDate</cstring> </property> @@ -234,7 +234,7 @@ If end time is defined, the project is scheduled backwards from this time. When </widget> </grid> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -275,7 +275,7 @@ Here you can enter any additional text you want to be stored with the project. T <tabstop>descriptionfield</tabstop> <tabstop>idfield</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kplato/kptmap.h b/kplato/kptmap.h index 9edae25f..f21612c3 100644 --- a/kplato/kptmap.h +++ b/kplato/kptmap.h @@ -21,11 +21,11 @@ #define KPTMAP_H -#include <qmap.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qpair.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include <kdebug.h> @@ -36,35 +36,35 @@ namespace Map { enum State { None=0, NonWorking=1, Working=2 }; } // Map namespace -typedef QMap<QString, int> DateMapType; +typedef TQMap<TQString, int> DateMapType; class DateMap : public DateMapType { public: DateMap() {} virtual ~DateMap() {} - virtual bool contains(QDate date) const { return DateMapType::contains(date.toString(Qt::ISODate)); } + virtual bool tqcontains(TQDate date) const { return DateMapType::tqcontains(date.toString(Qt::ISODate)); } - void insert(QString date, int state=Map::NonWorking) { + void insert(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; if (state == Map::None) DateMapType::remove(date); else DateMapType::insert(date, state); } - void insert(QDate date, int state=Map::NonWorking) { insert(date.toString(Qt::ISODate), state); } + void insert(TQDate date, int state=Map::NonWorking) { insert(date.toString(Qt::ISODate), state); } - void remove(QDate date) { + void remove(TQDate date) { //kdDebug()<<k_funcinfo<<date.toString(Qt::ISODate)<<endl; DateMapType::remove(date.toString(Qt::ISODate)); } - int state(QString date) { - DateMapType::iterator it = find(date); + int state(TQString date) { + DateMapType::iterator it = tqfind(date); if (it == end()) return 0; else return it.data(); } - int state(QDate date) { return state(date.toString(Qt::ISODate)); } + int state(TQDate date) { return state(date.toString(Qt::ISODate)); } bool operator==(const DateMap &m) const { return keys() == m.keys() && values() == m.values(); @@ -74,24 +74,24 @@ public: } // boolean use - void toggle(QString date, int state=Map::NonWorking) { + void toggle(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; - if (DateMapType::contains(date)) + if (DateMapType::tqcontains(date)) DateMapType::remove(date); else DateMapType::insert(date, state); } - void toggle(QDate date, int state=Map::NonWorking) { return toggle(date.toString(Qt::ISODate)); } - void toggleClear(QString date, int state=Map::NonWorking) { + void toggle(TQDate date, int state=Map::NonWorking) { return toggle(date.toString(Qt::ISODate)); } + void toggleClear(TQString date, int state=Map::NonWorking) { //kdDebug()<<k_funcinfo<<date<<"="<<state<<endl; - bool s = DateMapType::contains(date); + bool s = DateMapType::tqcontains(date); clear(); if (!s) insert(date, state); } - void toggleClear(QDate date, int state=Map::NonWorking) { toggleClear(date.toString(Qt::ISODate)); } + void toggleClear(TQDate date, int state=Map::NonWorking) { toggleClear(date.toString(Qt::ISODate)); } }; -typedef QMap<int, int> IntMapType; +typedef TQMap<int, int> IntMapType; class IntMap : public IntMapType { public: @@ -105,7 +105,7 @@ public: IntMapType::insert(key, state); } virtual int state(int key) { - IntMapType::iterator it = IntMapType::find(key); + IntMapType::iterator it = IntMapType::tqfind(key); if (it == IntMapType::end()) return 0; else return it.data(); } @@ -118,9 +118,9 @@ public: } // boolean use - void toggle(int key, int state=Map::NonWorking) { IntMapType::contains(key) ? remove(key) : insert(key, state); } + void toggle(int key, int state=Map::NonWorking) { IntMapType::tqcontains(key) ? remove(key) : insert(key, state); } void toggleClear(int key, int state=Map::NonWorking) { - bool s =contains(key); + bool s =tqcontains(key); clear(); if (!s) insert(key, state); } @@ -129,29 +129,29 @@ public: class WeekMap : public IntMap { public: - bool contains(int week, int year) { return IntMap::contains(week*10000 + year); } - bool contains(QPair<int,int> week) { return contains(week.first, week.second); } + bool tqcontains(int week, int year) { return IntMap::tqcontains(week*10000 + year); } + bool tqcontains(TQPair<int,int> week) { return tqcontains(week.first, week.second); } void insert(int week, int year, int state=Map::NonWorking) { if (week < 1 || week > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week<<endl; return; } IntMap::insert(week*10000 + year, state); } - void insert(QPair<int,int> week, int state=Map::NonWorking) { insert(week.first, week.second, state); } + void insert(TQPair<int,int> week, int state=Map::NonWorking) { insert(week.first, week.second, state); } void insert(WeekMap::iterator it, int state) { insert(week(it.key()), state); } - void remove(QPair<int,int> week) { IntMap::remove(week.first*10000 + week.second); } + void remove(TQPair<int,int> week) { IntMap::remove(week.first*10000 + week.second); } - static QPair<int, int> week(int key) { return QPair<int, int>(key/10000, key%10000); } + static TQPair<int, int> week(int key) { return TQPair<int, int>(key/10000, key%10000); } - int state(QPair<int, int> week) { return IntMap::state(week.first*10000 + week.second); } - int state(int week, int year) { return state(QPair<int, int>(week, year)); } + int state(TQPair<int, int> week) { return IntMap::state(week.first*10000 + week.second); } + int state(int week, int year) { return state(TQPair<int, int>(week, year)); } - void toggle(QPair<int,int> week, int state=Map::NonWorking) { + void toggle(TQPair<int,int> week, int state=Map::NonWorking) { if (week.first < 1 || week.first > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week.first<<endl; return; } IntMap::toggle(week.first*10000 + week.second, state); } - void toggleClear(QPair<int,int> week, int state=Map::NonWorking) { + void toggleClear(TQPair<int,int> week, int state=Map::NonWorking) { if (week.first < 1 || week.first > 53) { kdError()<<k_funcinfo<<"Illegal week number: "<<week.first<<endl; return; } IntMap::toggleClear(week.first*10000 + week.second, state); } diff --git a/kplato/kptmilestoneprogressdialog.cc b/kplato/kptmilestoneprogressdialog.cc index 75f91f49..e453d473 100644 --- a/kplato/kptmilestoneprogressdialog.cc +++ b/kplato/kptmilestoneprogressdialog.cc @@ -28,7 +28,7 @@ namespace KPlato { -MilestoneProgressDialog::MilestoneProgressDialog(Task &task, QWidget *p) +MilestoneProgressDialog::MilestoneProgressDialog(Task &task, TQWidget *p) : KDialogBase(Swallow, i18n("Milestone Progress"), Ok|Cancel, Ok, p, "Milestone Progress Dialog", true, true) { m_panel = new MilestoneProgressPanel(task, this); @@ -37,7 +37,7 @@ MilestoneProgressDialog::MilestoneProgressDialog(Task &task, QWidget *p) enableButtonOK(false); - connect(m_panel, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_panel, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged())); } void MilestoneProgressDialog::slotChanged() { diff --git a/kplato/kptmilestoneprogressdialog.h b/kplato/kptmilestoneprogressdialog.h index a9b78fee..9cff7dba 100644 --- a/kplato/kptmilestoneprogressdialog.h +++ b/kplato/kptmilestoneprogressdialog.h @@ -33,8 +33,9 @@ class Part; class MilestoneProgressDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - MilestoneProgressDialog(Task &task, QWidget *parent=0); + MilestoneProgressDialog(Task &task, TQWidget *tqparent=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptmilestoneprogresspanel.cc b/kplato/kptmilestoneprogresspanel.cc index fc32fd1e..14e83b06 100644 --- a/kplato/kptmilestoneprogresspanel.cc +++ b/kplato/kptmilestoneprogresspanel.cc @@ -19,7 +19,7 @@ #include "kptmilestoneprogresspanel.h" -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kdatetimewidget.h> #include <klocale.h> @@ -34,8 +34,8 @@ namespace KPlato { -MilestoneProgressPanel::MilestoneProgressPanel(Task &task, QWidget *parent, const char *name) - : MilestoneProgressPanelImpl(parent, name), +MilestoneProgressPanel::MilestoneProgressPanel(Task &task, TQWidget *tqparent, const char *name) + : MilestoneProgressPanelImpl(tqparent, name), m_task(task) { kdDebug()<<k_funcinfo<<endl; @@ -59,7 +59,7 @@ bool MilestoneProgressPanel::ok() { KCommand *MilestoneProgressPanel::buildCommand(Part *part) { KCommand *cmd = 0; - QString c = i18n("Modify progress"); + TQString c = i18n("Modify progress"); if (m_task.progress() != m_progress) { cmd = new TaskModifyProgressCmd(part, m_task, m_progress, c); } @@ -68,13 +68,13 @@ KCommand *MilestoneProgressPanel::buildCommand(Part *part) { //------------------------------------- -MilestoneProgressPanelImpl::MilestoneProgressPanelImpl(QWidget *parent, const char *name, WFlags f) - : MilestoneProgressPanelBase(parent, name, f) { +MilestoneProgressPanelImpl::MilestoneProgressPanelImpl(TQWidget *tqparent, const char *name, WFlags f) + : MilestoneProgressPanelBase(tqparent, name, f) { - connect(finished, SIGNAL(toggled(bool)), SLOT(slotFinishedChanged(bool))); - connect(finished, SIGNAL(toggled(bool)), SLOT(slotChanged())); + connect(finished, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotFinishedChanged(bool))); + connect(finished, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); - connect(finishTime, SIGNAL(valueChanged(const QDateTime &)), SLOT(slotChanged())); + connect(finishTime, TQT_SIGNAL(valueChanged(const TQDateTime &)), TQT_SLOT(slotChanged())); } @@ -85,7 +85,7 @@ void MilestoneProgressPanelImpl::slotChanged() { void MilestoneProgressPanelImpl::slotFinishedChanged(bool state) { if (state) { if (!finishTime->dateTime().isValid()) { - finishTime->setDateTime(QDateTime::currentDateTime()); + finishTime->setDateTime(TQDateTime::tqcurrentDateTime()); } } enableWidgets(); diff --git a/kplato/kptmilestoneprogresspanel.h b/kplato/kptmilestoneprogresspanel.h index 9ad8a116..4129e80c 100644 --- a/kplato/kptmilestoneprogresspanel.h +++ b/kplato/kptmilestoneprogresspanel.h @@ -33,8 +33,9 @@ class StandardWorktime; class MilestoneProgressPanelImpl : public MilestoneProgressPanelBase { Q_OBJECT + TQ_OBJECT public: - MilestoneProgressPanelImpl(QWidget *parent=0, const char *name=0, WFlags f=0); + MilestoneProgressPanelImpl(TQWidget *tqparent=0, const char *name=0, WFlags f=0); void enableWidgets(); @@ -48,8 +49,9 @@ public slots: class MilestoneProgressPanel : public MilestoneProgressPanelImpl { Q_OBJECT + TQ_OBJECT public: - MilestoneProgressPanel(Task &task, QWidget *parent=0, const char *name=0); + MilestoneProgressPanel(Task &task, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptmilestoneprogresspanelbase.ui b/kplato/kptmilestoneprogresspanelbase.ui index 9455fce6..27e295d0 100644 --- a/kplato/kptmilestoneprogresspanelbase.ui +++ b/kplato/kptmilestoneprogresspanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::MilestoneProgressPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>MilestoneProgressPanelBase</cstring> </property> @@ -20,7 +20,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>finished</cstring> </property> @@ -43,7 +43,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -54,7 +54,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatetimewidget.h</includehint> <includehint>kdatewidget.h</includehint> diff --git a/kplato/kptnode.cc b/kplato/kptnode.cc index cab767f8..48135a71 100644 --- a/kplato/kptnode.cc +++ b/kplato/kptnode.cc @@ -25,8 +25,8 @@ #include "kptresource.h" #include "kptschedule.h" -#include <qptrlist.h> -#include <qdom.h> +#include <tqptrlist.h> +#include <tqdom.h> #include <klocale.h> #include <kdebug.h> @@ -34,19 +34,19 @@ namespace KPlato { -Node::Node(Node *parent) : m_nodes(), m_dependChildNodes(), m_dependParentNodes() { +Node::Node(Node *tqparent) : m_nodes(), m_dependChildNodes(), m_dependParentNodes() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; - m_parent = parent; + m_parent = tqparent; init(); - m_id = QString(); // Not mapped + m_id = TQString(); // Not mapped } -Node::Node(Node &node, Node *parent) +Node::Node(Node &node, Node *tqparent) : m_nodes(), m_dependChildNodes(), m_dependParentNodes() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; - m_parent = parent; + m_parent = tqparent; init(); m_name = node.name(); m_leader = node.leader(); @@ -96,7 +96,7 @@ void Node::init() { m_visitedForward = false; m_visitedBackward = false; - m_dateOnlyStartDate = m_dateOnlyEndDate = QDate::currentDate(); + m_dateOnlyStartDate = m_dateOnlyEndDate = TQDate::tqcurrentDate(); m_dateOnlyDuration.addDays(1); m_runningAccount = 0; @@ -113,13 +113,13 @@ Node *Node::projectNode() { if (m_parent) return m_parent->projectNode(); - kdError()<<k_funcinfo<<"Ooops, no parent and no project found"<<endl; + kdError()<<k_funcinfo<<"Ooops, no tqparent and no project found"<<endl; return 0; } void Node::delChildNode( Node *node, bool remove) { - //kdDebug()<<k_funcinfo<<"find="<<m_nodes.findRef(node)<<endl; - if ( m_nodes.findRef(node) != -1 ) { + //kdDebug()<<k_funcinfo<<"tqfind="<<m_nodes.tqfindRef(node)<<endl; + if ( m_nodes.tqfindRef(node) != -1 ) { if(remove) m_nodes.remove(); else @@ -149,7 +149,7 @@ void Node::insertChildNode( unsigned int index, Node *node) { void Node::addChildNode( Node *node, Node *after) { //kdDebug()<<k_funcinfo<<endl; - int index = m_nodes.findRef(after); + int index = m_nodes.tqfindRef(after); if (index == -1) { //kdDebug()<<k_funcinfo<<"append id="<<node->id()<<": "<<node->name()<<endl; m_nodes.append(node); @@ -163,14 +163,14 @@ void Node::addChildNode( Node *node, Node *after) { int Node::findChildNode( Node* node ) { - return m_nodes.findRef( node ); + return m_nodes.tqfindRef( node ); } const Node* Node::getChildNode(int number) const { - // Work around missing const at() method in QPtrList - const QPtrList<Node> &nodes = m_nodes; - return (const_cast<QPtrList<Node> &>(nodes)).at(number); + // Work around missing const at() method in TQPtrList + const TQPtrList<Node> &nodes = m_nodes; + return (const_cast<TQPtrList<Node> &>(nodes)).at(number); } Duration *Node::getDelay() { @@ -201,7 +201,7 @@ void Node::insertDependChildNode( unsigned int index, Node *node, Relation::Type } bool Node::addDependChildNode( Relation *relation) { - if(m_dependChildNodes.findRef(relation) != -1) + if(m_dependChildNodes.tqfindRef(relation) != -1) return false; m_dependChildNodes.append(relation); return true; @@ -209,7 +209,7 @@ bool Node::addDependChildNode( Relation *relation) { // These delDepend... methods look suspicious to me, can someone review? void Node::delDependChildNode( Node *node, bool remove) { - if ( m_nodes.findRef(node) != -1 ) { + if ( m_nodes.tqfindRef(node) != -1 ) { if(remove) m_dependChildNodes.remove(); else @@ -218,7 +218,7 @@ void Node::delDependChildNode( Node *node, bool remove) { } void Node::delDependChildNode( Relation *rel, bool remove) { - if ( m_dependChildNodes.findRef(rel) != -1 ) { + if ( m_dependChildNodes.tqfindRef(rel) != -1 ) { if(remove) m_dependChildNodes.remove(); else @@ -234,7 +234,7 @@ void Node::delDependChildNode( int number, bool remove) { } void Node::takeDependChildNode(Relation *rel) { - if (m_dependChildNodes.findRef(rel) != -1) { + if (m_dependChildNodes.tqfindRef(rel) != -1) { m_dependChildNodes.take(); } } @@ -260,7 +260,7 @@ void Node::insertDependParentNode( unsigned int index, Node *node, Relation::Typ } bool Node::addDependParentNode( Relation *relation) { - if(m_dependParentNodes.findRef(relation) != -1) + if(m_dependParentNodes.tqfindRef(relation) != -1) return false; m_dependParentNodes.append(relation); return true; @@ -268,7 +268,7 @@ bool Node::addDependParentNode( Relation *relation) { // These delDepend... methods look suspicious to me, can someone review? void Node::delDependParentNode( Node *node, bool remove) { - if ( m_nodes.findRef(node) != -1 ) { + if ( m_nodes.tqfindRef(node) != -1 ) { if(remove) m_dependParentNodes.remove(); else @@ -277,7 +277,7 @@ void Node::delDependParentNode( Node *node, bool remove) { } void Node::delDependParentNode( Relation *rel, bool remove) { - if ( m_dependParentNodes.findRef(rel) != -1 ) { + if ( m_dependParentNodes.tqfindRef(rel) != -1 ) { if(remove) m_dependParentNodes.remove(); else @@ -293,16 +293,16 @@ void Node::delDependParentNode( int number, bool remove) { } void Node::takeDependParentNode(Relation *rel) { - if (m_dependParentNodes.findRef(rel) != -1) { + if (m_dependParentNodes.tqfindRef(rel) != -1) { rel = m_dependParentNodes.take(); } } bool Node::isParentOf(Node *node) { - if (m_nodes.findRef(node) != -1) + if (m_nodes.tqfindRef(node) != -1) return true; - QPtrListIterator<Node> nit(childNodeIterator()); + TQPtrListIterator<Node> nit(childNodeIterator()); for ( ; nit.current(); ++nit ) { if (nit.current()->isParentOf(node)) return true; @@ -313,7 +313,7 @@ bool Node::isParentOf(Node *node) { Relation *Node::findParentRelation(Node *node) { for (int i=0; i<numDependParentNodes(); i++) { Relation *rel = getDependParentNode(i); - if (rel->parent() == node) + if (rel->tqparent() == node) return rel; } return (Relation *)0; @@ -339,9 +339,9 @@ bool Node::isDependChildOf(Node *node) { //kdDebug()<<k_funcinfo<<" '"<<m_name<<"' checking against '"<<node->name()<<"'"<<endl; for (int i=0; i<numDependParentNodes(); i++) { Relation *rel = getDependParentNode(i); - if (rel->parent() == node) + if (rel->tqparent() == node) return true; - if (rel->parent()->isDependChildOf(node)) + if (rel->tqparent()->isDependChildOf(node)) return true; } return false; @@ -367,35 +367,35 @@ Duration Node::duration(const DateTime &time, int use, bool backward) { } void Node::makeAppointments() { - QPtrListIterator<Node> nit(m_nodes); + TQPtrListIterator<Node> nit(m_nodes); for ( ; nit.current(); ++nit ) { nit.current()->makeAppointments(); } } void Node::calcResourceOverbooked() { - QPtrListIterator<Node> nit(m_nodes); + TQPtrListIterator<Node> nit(m_nodes); for ( ; nit.current(); ++nit ) { nit.current()->calcResourceOverbooked(); } } -QStringList Node::overbookedResources() const { - return m_currentSchedule ? m_currentSchedule->overbookedResources() : QStringList(); +TQStringList Node::overbookedResources() const { + return m_currentSchedule ? m_currentSchedule->overbookedResources() : TQStringList(); } -void Node::saveRelations(QDomElement &element) const { - QPtrListIterator<Relation> it(m_dependChildNodes); +void Node::saveRelations(TQDomElement &element) const { + TQPtrListIterator<Relation> it(m_dependChildNodes); for (; it.current(); ++it) { it.current()->save(element); } - QPtrListIterator<Node> nodes(m_nodes); + TQPtrListIterator<Node> nodes(m_nodes); for ( ; nodes.current(); ++nodes ) { nodes.current()->saveRelations(element); } } -void Node::setConstraint(QString &type) { +void Node::setConstraint(TQString &type) { // Do not i18n these, they are used in load() if (type == "ASAP") setConstraint(ASAP); @@ -415,24 +415,24 @@ void Node::setConstraint(QString &type) { setConstraint(ASAP); // default } -QString Node::constraintToString() const { +TQString Node::constraintToString() const { // Do not i18n these, they are used in save() if (m_constraint == ASAP) - return QString("ASAP"); + return TQString("ASAP"); else if (m_constraint == ALAP) - return QString("ALAP"); + return TQString("ALAP"); else if (m_constraint == StartNotEarlier) - return QString("StartNotEarlier"); + return TQString("StartNotEarlier"); else if (m_constraint == FinishNotLater) - return QString("FinishNotLater"); + return TQString("FinishNotLater"); else if (m_constraint == MustStartOn) - return QString("MustStartOn"); + return TQString("MustStartOn"); else if (m_constraint == MustFinishOn) - return QString("MustFinishOn"); + return TQString("MustFinishOn"); else if (m_constraint == FixedInterval) - return QString("FixedInterval"); + return TQString("FixedInterval"); - return QString(); + return TQString(); } void Node::propagateEarliestStart(DateTime &time) { @@ -440,7 +440,7 @@ void Node::propagateEarliestStart(DateTime &time) { return; m_currentSchedule->earliestStart = time; //kdDebug()<<k_funcinfo<<m_name<<": "<<m_currentSchedule->earliestStart.toString()<<endl; - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->propagateEarliestStart(time); } @@ -451,7 +451,7 @@ void Node::propagateLatestFinish(DateTime &time) { return; m_currentSchedule->latestFinish = time; //kdDebug()<<k_funcinfo<<m_name<<": "<<m_currentSchedule->latestFinish<<endl; - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->propagateLatestFinish(time); } @@ -462,7 +462,7 @@ void Node::moveEarliestStart(DateTime &time) { return; if (m_currentSchedule->earliestStart < time) m_currentSchedule->earliestStart = time; - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->moveEarliestStart(time); } @@ -473,14 +473,14 @@ void Node::moveLatestFinish(DateTime &time) { return; if (m_currentSchedule->latestFinish > time) m_currentSchedule->latestFinish = time; - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->moveLatestFinish(time); } } void Node::initiateCalculation(Schedule &sch) { - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->initiateCalculation(sch); } @@ -489,7 +489,7 @@ void Node::initiateCalculation(Schedule &sch) { void Node::resetVisited() { m_visitedForward = false; m_visitedBackward = false; - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->resetVisited(); } @@ -504,7 +504,7 @@ Node *Node::siblingBefore() { Node *Node::childBefore(Node *node) { //kdDebug()<<k_funcinfo<<endl; - int index = m_nodes.findRef(node); + int index = m_nodes.tqfindRef(node); if (index > 0){ return m_nodes.at(index-1); } @@ -521,7 +521,7 @@ Node *Node::siblingAfter() { Node *Node::childAfter(Node *node) { //kdDebug()<<k_funcinfo<<endl; - uint index = m_nodes.findRef(node); + uint index = m_nodes.tqfindRef(node); if (index < m_nodes.count()-1) { return m_nodes.at(index+1); } return 0; @@ -570,7 +570,7 @@ bool Node::isStartNode() const { return m_dependParentNodes.isEmpty(); } -bool Node::setId(QString id) { +bool Node::setId(TQString id) { //kdDebug()<<k_funcinfo<<id<<endl; if (id.isEmpty()) { kdError()<<k_funcinfo<<"id is empty"<<endl; @@ -589,7 +589,7 @@ bool Node::setId(QString id) { } if (findNode(id)) { kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different node: "<<findNode(id)->name()<<endl; - m_id = QString(); // hmmm + m_id = TQString(); // hmmm return false; } m_id = id; @@ -613,16 +613,16 @@ void Node::setEndTime(DateTime endTime) { m_dateOnlyEndDate = m_dateOnlyEndDate.addDays(-1); } -void Node::saveAppointments(QDomElement &element, long id) const { +void Node::saveAppointments(TQDomElement &element, long id) const { //kdDebug()<<k_funcinfo<<m_name<<" id="<<id<<endl; - QPtrListIterator<Node> it(m_nodes); + TQPtrListIterator<Node> it(m_nodes); for (; it.current(); ++it ) { it.current()->saveAppointments(element, id); } } -QPtrList<Appointment> Node::appointments() { - QPtrList<Appointment> lst; +TQPtrList<Appointment> Node::appointments() { + TQPtrList<Appointment> lst; if (m_currentSchedule) lst = m_currentSchedule->appointments(); return lst; @@ -652,7 +652,7 @@ bool Node::addAppointment(Appointment *appointment, Schedule &main) { void Node::addAppointment(ResourceSchedule *resource, DateTime &start, DateTime &end, double load) { Schedule *node = findSchedule(resource->id()); if (node == 0) { - node = createSchedule(resource->parent()); + node = createSchedule(resource->tqparent()); } node->addAppointment(resource, start, end, load); } @@ -668,25 +668,25 @@ void Node::takeSchedule(const Schedule *schedule) { void Node::addSchedule(Schedule *schedule) { if (schedule == 0) return; - m_schedules.replace(schedule->id(), schedule); + m_schedules.tqreplace(schedule->id(), schedule); } -Schedule *Node::createSchedule(QString name, Schedule::Type type, long id) { +Schedule *Node::createSchedule(TQString name, Schedule::Type type, long id) { //kdDebug()<<k_funcinfo<<name<<" type="<<type<<" id="<<(int)id<<endl; NodeSchedule *sch = new NodeSchedule(this, name, type, id); addSchedule(sch); return sch; } -Schedule *Node::createSchedule(Schedule *parent) { +Schedule *Node::createSchedule(Schedule *tqparent) { //kdDebug()<<k_funcinfo<<name<<" type="<<type<<" id="<<(int)id<<endl; - NodeSchedule *sch = new NodeSchedule(parent, this); + NodeSchedule *sch = new NodeSchedule(tqparent, this); addSchedule(sch); return sch; } -Schedule *Node::findSchedule(const QString name, const Schedule::Type type) const { - QIntDictIterator<Schedule> it = m_schedules; +Schedule *Node::findSchedule(const TQString name, const Schedule::Type type) const { + TQIntDictIterator<Schedule> it = m_schedules; for (; it.current(); ++it) { if (!it.current()->isDeleted() && it.current()->name() == name && it.current()->type() == type) @@ -697,7 +697,7 @@ Schedule *Node::findSchedule(const QString name, const Schedule::Type type) cons Schedule *Node::findSchedule(const Schedule::Type type) const { //kdDebug()<<k_funcinfo<<m_name<<" find type="<<type<<" nr="<<m_schedules.count()<<endl; - QIntDictIterator<Schedule> it = m_schedules; + TQIntDictIterator<Schedule> it = m_schedules; for (; it.current(); ++it) { if (!it.current()->isDeleted() && it.current()->type() == type) { return it.current(); @@ -720,7 +720,7 @@ void Node::setParentSchedule(Schedule *sch) { if (s) { s->setParent(sch); } - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->setParentSchedule(sch); } @@ -741,9 +741,9 @@ bool Node::calcCriticalPath(bool fromEnd) { m_currentSchedule->inCriticalPath = true; return true; } - QPtrListIterator<Relation> pit(m_dependParentNodes); + TQPtrListIterator<Relation> pit(m_dependParentNodes); for (; pit.current(); ++pit) { - if (pit.current()->parent()->calcCriticalPath(fromEnd)) { + if (pit.current()->tqparent()->calcCriticalPath(fromEnd)) { m_currentSchedule->inCriticalPath = true; } } @@ -755,11 +755,11 @@ int Node::level() { return n ? n->level() + 1 : 0; } -void Node::generateWBS(int count, WBSDefinition &def, QString wbs) { +void Node::generateWBS(int count, WBSDefinition &def, TQString wbs) { m_wbs = wbs + def.code(count, level()); //kdDebug()<<k_funcinfo<<m_name<<" wbs: "<<m_wbs<<endl; - QString w = wbs + def.wbs(count, level()); - QPtrListIterator<Node> it = m_nodes; + TQString w = wbs + def.wbs(count, level()); + TQPtrListIterator<Node> it = m_nodes; for (int i=0; it.current(); ++it) { it.current()->generateWBS(++i, def, w); } @@ -767,7 +767,7 @@ void Node::generateWBS(int count, WBSDefinition &def, QString wbs) { } void Node::setCurrentSchedule(long id) { - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->setCurrentSchedule(id); } @@ -860,7 +860,7 @@ Duration Effort::effort(int use) const { return m_expectedEffort; // default } -bool Effort::load(QDomElement &element) { +bool Effort::load(TQDomElement &element) { m_expectedEffort = Duration::fromString(element.attribute("expected")); m_optimisticEffort = Duration::fromString(element.attribute("optimistic")); m_pessimisticEffort = Duration::fromString(element.attribute("pessimistic")); @@ -869,8 +869,8 @@ bool Effort::load(QDomElement &element) { return true; } -void Effort::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("effort"); +void Effort::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("effort"); element.appendChild(me); me.setAttribute("expected", m_expectedEffort.toString()); me.setAttribute("optimistic", m_optimisticEffort.toString()); @@ -879,16 +879,16 @@ void Effort::save(QDomElement &element) const { me.setAttribute("risk", risktypeToString()); } -QString Effort::typeToString() const { +TQString Effort::typeToString() const { if (m_type == Type_Effort) - return QString("Effort"); + return TQString("Effort"); if (m_type == Type_FixedDuration) - return QString("Type_FixedDuration"); + return TQString("Type_FixedDuration"); - return QString(); + return TQString(); } -void Effort::setType(QString type) { +void Effort::setType(TQString type) { if (type == "Effort") setType(Type_Effort); else if (type == "Type_FixedDuration") @@ -897,18 +897,18 @@ void Effort::setType(QString type) { setType(Type_Effort); // default } -QString Effort::risktypeToString() const { +TQString Effort::risktypeToString() const { if (m_risktype == Risk_None) - return QString("None"); + return TQString("None"); if (m_risktype == Risk_Low) - return QString("Low"); + return TQString("Low"); if (m_risktype == Risk_High) - return QString("High"); + return TQString("High"); - return QString(); + return TQString(); } -void Effort::setRisktype(QString type) { +void Effort::setRisktype(TQString type) { if (type == "High") setRisktype(Risk_High); else if (type == "Low") @@ -942,10 +942,10 @@ int Effort::pessimisticRatio() const { // Debugging #ifndef NDEBUG -void Node::printDebug(bool children, QCString indent) { +void Node::printDebug(bool tqchildren, TQCString indent) { kdDebug()<<indent<<" Unique node identity="<<m_id<<endl; if (m_effort) m_effort->printDebug(indent); - QString s = " Constraint: " + constraintToString(); + TQString s = " Constraint: " + constraintToString(); if (m_constraint == MustStartOn || m_constraint == StartNotEarlier || m_constraint == FixedInterval) kdDebug()<<indent<<s<<" ("<<constraintStartTime().toString()<<")"<<endl; if (m_constraint == MustFinishOn || m_constraint == FinishNotLater || m_constraint == FixedInterval) @@ -956,23 +956,23 @@ void Node::printDebug(bool children, QCString indent) { } else { kdDebug()<<indent<<" Current schedule: None"<<endl; } - QIntDictIterator<Schedule> it = m_schedules; + TQIntDictIterator<Schedule> it = m_schedules; for (; it.current(); ++it) { it.current()->printDebug(indent+" "); } - kdDebug()<<indent<<" Parent: "<<(m_parent ? m_parent->name() : QString("None"))<<endl; + kdDebug()<<indent<<" Parent: "<<(m_parent ? m_parent->name() : TQString("None"))<<endl; kdDebug()<<indent<<" Level: "<<level()<<endl; kdDebug()<<indent<<" No of predecessors: "<<m_dependParentNodes.count()<<endl; - QPtrListIterator<Relation> pit(m_dependParentNodes); - //kdDebug()<<indent<<" Dependant parents="<<pit.count()<<endl; + TQPtrListIterator<Relation> pit(m_dependParentNodes); + //kdDebug()<<indent<<" Dependant tqparents="<<pit.count()<<endl; if (pit.count() > 0) { for ( ; pit.current(); ++pit ) { pit.current()->printDebug(indent); } } kdDebug()<<indent<<" No of successors: "<<m_dependChildNodes.count()<<endl; - QPtrListIterator<Relation> cit(m_dependChildNodes); - //kdDebug()<<indent<<" Dependant children="<<cit.count()<<endl; + TQPtrListIterator<Relation> cit(m_dependChildNodes); + //kdDebug()<<indent<<" Dependant tqchildren="<<cit.count()<<endl; if (cit.count() > 0) { for ( ; cit.current(); ++cit ) { cit.current()->printDebug(indent); @@ -981,8 +981,8 @@ void Node::printDebug(bool children, QCString indent) { //kdDebug()<<indent<<endl; indent += " "; - if (children) { - QPtrListIterator<Node> it(m_nodes); + if (tqchildren) { + TQPtrListIterator<Node> it(m_nodes); for ( ; it.current(); ++it ) { it.current()->printDebug(true,indent); } @@ -993,7 +993,7 @@ void Node::printDebug(bool children, QCString indent) { #ifndef NDEBUG -void Effort::printDebug(QCString indent) { +void Effort::printDebug(TQCString indent) { kdDebug()<<indent<<" Effort:"<<endl; indent += " "; kdDebug()<<indent<<" Expected: "<<m_expectedEffort.toString()<<endl; diff --git a/kplato/kptnode.h b/kplato/kptnode.h index 65623028..d6a6bbef 100644 --- a/kplato/kptnode.h +++ b/kplato/kptnode.h @@ -26,15 +26,15 @@ #include "kptdatetime.h" #include "kptschedule.h" -#include <qintdict.h> -#include <qrect.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qcanvas.h> +#include <tqintdict.h> +#include <tqrect.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqcanvas.h> #include <vector> -class QDomElement; +class TQDomElement; namespace KPlato { @@ -59,15 +59,15 @@ class Node { public: enum ConstraintType { ASAP, ALAP, MustStartOn, MustFinishOn, StartNotEarlier, FinishNotLater, FixedInterval }; - Node(Node *parent = 0); - Node(Node &node, Node *parent = 0); + Node(Node *tqparent = 0); + Node(Node &node, Node *tqparent = 0); // Declare the class abstract virtual ~Node() = 0; - bool setId(QString id); - QString id() const { return m_id; } // unique identity + bool setId(TQString id); + TQString id() const { return m_id; } // unique identity enum NodeTypes { Type_Node = 0, @@ -88,11 +88,11 @@ public: virtual Node *projectNode(); // The load and save methods - virtual bool load(QDomElement &) { return true; } - virtual bool load(QDomElement &, Project &) { return true; } - virtual void save(QDomElement &element) const = 0; - /// Save my and my childrens relations. - virtual void saveRelations(QDomElement &element) const; + virtual bool load(TQDomElement &) { return true; } + virtual bool load(TQDomElement &, Project &) { return true; } + virtual void save(TQDomElement &element) const = 0; + /// Save my and my tqchildrens relations. + virtual void saveRelations(TQDomElement &element) const; // simple child node management // Child nodes are things like subtasks, basically a task can exists of @@ -100,7 +100,7 @@ public: // 2) cutting 3) building 4) painting. Node *getParent() const { return m_parent; } void setParent( Node* newParent ) { m_parent = newParent;} - const QPtrList<Node> &childNodeIterator() const { return m_nodes; } + const TQPtrList<Node> &childNodeIterator() const { return m_nodes; } int numChildren() const { return m_nodes.count(); } virtual void addChildNode(Node *node, Node *after=0); virtual void insertChildNode(unsigned int index, Node *node); @@ -131,7 +131,7 @@ public: Relation *getDependChildNode( int number) { return m_dependChildNodes.at(number); } - QPtrList<Relation> &dependChildNodes() { return m_dependChildNodes; } + TQPtrList<Relation> &dependChildNodes() { return m_dependChildNodes; } /** * Takes the relation rel from this node only. @@ -154,7 +154,7 @@ public: Relation *getDependParentNode( int number) { return m_dependParentNodes.at(number); } - QPtrList<Relation> &dependParentNodes() { return m_dependParentNodes; } + TQPtrList<Relation> &dependParentNodes() { return m_dependParentNodes; } /** * Takes the relation rel from this node only. @@ -173,12 +173,12 @@ public: /// Return the scheduled start time virtual DateTime startTime() const { return m_currentSchedule ? m_currentSchedule->startTime : DateTime(); } - const QDate &startDate() const { return m_dateOnlyStartDate; } + const TQDate &startDate() const { return m_dateOnlyStartDate; } void setEndTime(DateTime endTime); /// Return the scheduled end time virtual DateTime endTime() const { return m_currentSchedule ? m_currentSchedule->endTime : DateTime(); } - const QDate &endDate() const { return m_dateOnlyEndDate; } + const TQDate &endDate() const { return m_dateOnlyEndDate; } void setEffort(Effort* e) { m_effort = e; } Effort* effort() const { return m_effort; } @@ -228,23 +228,23 @@ public: void setLatestFinish(const DateTime &dt) { if (m_currentSchedule) m_currentSchedule->latestFinish = dt; } - QString &name() { return m_name; } - QString &leader() { return m_leader; } - QString &description() { return m_description; } - const QString &name() const { return m_name; } - const QString &leader() const { return m_leader; } - const QString &description() const { return m_description; } - void setName(const QString &n) { m_name = n; } - void setLeader(const QString &l) { m_leader = l; } - void setDescription(const QString &d) { m_description = d; } + TQString &name() { return m_name; } + TQString &leader() { return m_leader; } + TQString &description() { return m_description; } + const TQString &name() const { return m_name; } + const TQString &leader() const { return m_leader; } + const TQString &description() const { return m_description; } + void setName(const TQString &n) { m_name = n; } + void setLeader(const TQString &l) { m_leader = l; } + void setDescription(const TQString &d) { m_description = d; } virtual void setConstraint(Node::ConstraintType type) { m_constraint = type; } - void setConstraint(QString &type); + void setConstraint(TQString &type); int constraint() const { return m_constraint; } - QString constraintToString() const; + TQString constraintToString() const; - virtual void setConstraintStartTime(QDateTime time) { m_constraintStartTime = time; } - virtual void setConstraintEndTime(QDateTime time) { m_constraintEndTime = time; } + virtual void setConstraintStartTime(TQDateTime time) { m_constraintStartTime = time; } + virtual void setConstraintEndTime(TQDateTime time) { m_constraintEndTime = time; } virtual DateTime constraintStartTime() const { return m_constraintStartTime; } virtual DateTime constraintEndTime() const { return m_constraintEndTime; } @@ -263,7 +263,7 @@ public: virtual bool resourceOverbooked() const { return m_currentSchedule ? m_currentSchedule->resourceOverbooked : false; } /// Return a list of overbooked resources - virtual QStringList overbookedResources() const; + virtual TQStringList overbookedResources() const; /// Calculates if the assigned resource is overbooked /// within the duration of this node virtual void calcResourceOverbooked(); @@ -277,21 +277,21 @@ public: bool notScheduled() const { return m_currentSchedule == 0 || m_currentSchedule->isDeleted() || m_currentSchedule->notScheduled; } - virtual EffortCostMap plannedEffortCostPrDay(const QDate &start, const QDate &end) const=0; + virtual EffortCostMap plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const=0; /// Returns the total planned effort for this task (or subtasks) virtual Duration plannedEffort() { return Duration::zeroDuration; } /// Returns the total planned effort for this task (or subtasks) on date - virtual Duration plannedEffort(const QDate &) { return Duration::zeroDuration; } + virtual Duration plannedEffort(const TQDate &) { return Duration::zeroDuration; } /// Returns the planned effort up to and including date - virtual Duration plannedEffortTo(const QDate &) { return Duration::zeroDuration; } + virtual Duration plannedEffortTo(const TQDate &) { return Duration::zeroDuration; } /// Returns the total actual effort for this task (or subtasks) virtual Duration actualEffort() { return Duration::zeroDuration; } /// Returns the total actual effort for this task (or subtasks) on date - virtual Duration actualEffort(const QDate &/*date*/) { return Duration::zeroDuration; } + virtual Duration actualEffort(const TQDate &/*date*/) { return Duration::zeroDuration; } /// Returns the total actual effort for this task (or subtasks) up to and including date - virtual Duration actualEffortTo(const QDate &/*date*/) { return Duration::zeroDuration; } + virtual Duration actualEffortTo(const TQDate &/*date*/) { return Duration::zeroDuration; } /** * Planned cost is the sum total of all resources and other costs @@ -300,28 +300,28 @@ public: virtual double plannedCost() { return 0; } /// Planned cost on date - virtual double plannedCost(const QDate &/*date*/) { return 0; } + virtual double plannedCost(const TQDate &/*date*/) { return 0; } /** * Planned cost from start of activity up to and including date * is the sum of all resource costs and other costs planned for this node. */ - virtual double plannedCostTo(const QDate &/*date*/) { return 0; } + virtual double plannedCostTo(const TQDate &/*date*/) { return 0; } /** * Actual cost is the sum total of the reported costs actually used * for this node. */ virtual double actualCost() { return 0; } /// Actual cost on date - virtual double actualCost(const QDate &/*date*/) { return 0; } + virtual double actualCost(const TQDate &/*date*/) { return 0; } /// Actual cost up to and including date - virtual double actualCostTo(const QDate &/*date*/) { return 0; } + virtual double actualCostTo(const TQDate &/*date*/) { return 0; } /// Effort based performance index - double effortPerformanceIndex(const QDate &/*date*/, bool */*error=0*/) { return 0.0; } + double effortPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; } /// Cost performance index - double costPerformanceIndex(const QDate &/*date*/, bool */*error=0*/) { return 0.0; } + double costPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; } - virtual void initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> &endnodes, QPtrList<Node> &summarytasks) = 0; + virtual void initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks) = 0; virtual DateTime calculateForward(int /*use*/) = 0; virtual DateTime calculateBackward(int /*use*/) = 0; virtual DateTime scheduleForward(const DateTime &, int /*use*/) = 0; @@ -374,18 +374,18 @@ public: virtual bool legalToLink(Node *, Node *) { return false; } /// Check if this node has any dependent child nodes virtual bool isEndNode() const; - /// Check if this node has any dependent parent nodes + /// Check if this node has any dependent tqparent nodes virtual bool isStartNode() const; virtual void clearProxyRelations() {} - virtual void addParentProxyRelations(QPtrList<Relation> &) {} - virtual void addChildProxyRelations(QPtrList<Relation> &) {} + virtual void addParentProxyRelations(TQPtrList<Relation> &) {} + virtual void addChildProxyRelations(TQPtrList<Relation> &) {} virtual void addParentProxyRelation(Node *, const Relation *) {} virtual void addChildProxyRelation(Node *, const Relation *) {} /// Save appointments for schedule with id - virtual void saveAppointments(QDomElement &element, long id) const; + virtual void saveAppointments(TQDomElement &element, long id) const; ///Return the list of appointments for current schedule. - QPtrList<Appointment> appointments(); + TQPtrList<Appointment> appointments(); /// Return appointment this node have with resource // Appointment *findAppointment(Resource *resource); /// Adds appointment to this node only (not to resource) @@ -398,17 +398,17 @@ public: /// Find the node with my id virtual Node *findNode() const { return findNode(m_id); } /// Find the node with identity id - virtual Node *findNode(const QString &id) const + virtual Node *findNode(const TQString &id) const { return (m_parent ? m_parent->findNode(id) : 0); } /// Remove myself from the id register virtual bool removeId() { return removeId(m_id); } /// Remove the registered identity id - virtual bool removeId(const QString &id) + virtual bool removeId(const TQString &id) { return (m_parent ? m_parent->removeId(id) : false); } /// Insert myself into the id register - virtual void insertId(const QString &id) { insertId(id, this); } + virtual void insertId(const TQString &id) { insertId(id, this); } /// Insert node with identity id into the register - virtual void insertId(const QString &id, const Node *node) + virtual void insertId(const TQString &id, const Node *node) { if (m_parent) m_parent->insertId(id, node); } /** @@ -439,8 +439,8 @@ public: /// Returns the level this node is in the hierarchy. Top node is level 0. virtual int level(); /// Generate WBS - virtual void generateWBS(int count, WBSDefinition &def, QString wbs=QString()); - QString wbs() const { return m_wbs; } + virtual void generateWBS(int count, WBSDefinition &def, TQString wbs=TQString()); + TQString wbs() const { return m_wbs; } double startupCost() const { return m_startupCost; } void setStartupCost(double cost) { m_startupCost = cost; } @@ -458,14 +458,14 @@ public: void setRunningAccount(Account *acc) { m_runningAccount = acc; } Schedule *currentSchedule() const { return m_currentSchedule; } - /// Set current schedule to schedule with identity id, for me and my children + /// Set current schedule to schedule with identity id, for me and my tqchildren virtual void setCurrentSchedule(long id); // NOTE: Cannot use setCurrentSchedule() due to overload/casting problems void setCurrentSchedulePtr(Schedule *schedule) { m_currentSchedule = schedule; } - QIntDict<Schedule> &schedules() { return m_schedules; } + TQIntDict<Schedule> &schedules() { return m_schedules; } /// Find schedule matching name and type. Does not return deleted schedule. - Schedule *findSchedule(const QString name, const Schedule::Type type) const; + Schedule *findSchedule(const TQString name, const Schedule::Type type) const; /// Find schedule matching type. Does not return deleted schedule. Schedule *findSchedule(const Schedule::Type type) const; /// Find schedule matching id. Also returns deleted schedule. @@ -475,13 +475,13 @@ public: /// Add schedule to list, replace if schedule with same id allready exists. void addSchedule(Schedule *schedule); /// Create a new schedule. - Schedule *createSchedule(QString name, Schedule::Type type, long id); + Schedule *createSchedule(TQString name, Schedule::Type type, long id); /// Create a new schedule. - Schedule *createSchedule(Schedule *parent); + Schedule *createSchedule(Schedule *tqparent); /// Set deleted = onoff for schedule with id void setScheduleDeleted(long id, bool onoff); - /// Set parent schedule recursivly + /// Set tqparent schedule recursivly virtual void setParentSchedule(Schedule *sch); DateTime startTime() @@ -490,15 +490,15 @@ public: { return m_currentSchedule ? m_currentSchedule->endTime : DateTime(); } protected: - QPtrList<Node> m_nodes; - QPtrList<Relation> m_dependChildNodes; - QPtrList<Relation> m_dependParentNodes; + TQPtrList<Node> m_nodes; + TQPtrList<Relation> m_dependChildNodes; + TQPtrList<Relation> m_dependParentNodes; Node *m_parent; - QString m_id; // unique id - QString m_name; // Name of this node - QString m_leader; // Person or group responsible for this node - QString m_description; // Description of this node + TQString m_id; // unique id + TQString m_name; // Name of this node + TQString m_leader; // Person or group responsible for this node + TQString m_description; // Description of this node Effort* m_effort; @@ -521,14 +521,14 @@ protected: Duration m_durationForward; Duration m_durationBackward; - QDate m_dateOnlyStartDate; - QDate m_dateOnlyEndDate; + TQDate m_dateOnlyStartDate; + TQDate m_dateOnlyEndDate; Duration m_dateOnlyDuration; - QIntDict<Schedule> m_schedules; + TQIntDict<Schedule> m_schedules; Schedule *m_currentSchedule; - QString m_wbs; + TQString m_wbs; double m_startupCost; Account *m_startupAccount; @@ -541,7 +541,7 @@ private: #ifndef NDEBUG public: - virtual void printDebug(bool children, QCString indent); + virtual void printDebug(bool tqchildren, TQCString indent); #endif }; @@ -568,14 +568,14 @@ public: }; Type type() const { return m_type; } void setType(Type type) { m_type = type; } - void setType(QString type); - QString typeToString() const; + void setType(TQString type); + TQString typeToString() const; enum Risktype { Risk_None, Risk_Low, Risk_High }; Risktype risktype() const { return m_risktype; } void setRisktype(Risktype type) { m_risktype = type; } - void setRisktype(QString type); - QString risktypeToString() const; + void setRisktype(TQString type); + TQString risktypeToString() const; enum Use { Use_Expected=0, Use_Optimistic=1, Use_Pessimistic=2 }; Duration effort(int use) const; @@ -588,8 +588,8 @@ public: void set(unsigned days, unsigned hours, unsigned minutes); void expectedEffort(unsigned *days, unsigned *hours, unsigned *minutes); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; /** * Set the optimistic duration @@ -632,7 +632,7 @@ private: #ifndef NDEBUG public: - void printDebug(QCString indent); + void printDebug(TQCString indent); #endif }; diff --git a/kplato/kptpart.cc b/kplato/kptpart.cc index 42055e88..459f0854 100644 --- a/kplato/kptpart.cc +++ b/kplato/kptpart.cc @@ -30,8 +30,8 @@ #include "kptganttview.h" #include "KDGanttViewTaskLink.h" -#include <qpainter.h> -#include <qfileinfo.h> +#include <tqpainter.h> +#include <tqfileinfo.h> #include <kdebug.h> #include <kconfig.h> @@ -48,11 +48,11 @@ namespace KPlato { -Part::Part(QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, bool singleViewMode) - : KoDocument(parentWidget, widgetName, parent, name, singleViewMode), - m_project(0), m_projectDialog(0), m_parentWidget(parentWidget), m_view(0), - m_embeddedGanttView(new GanttView(parentWidget)), +Part::Part(TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, bool singleViewMode) + : KoDocument(tqparentWidget, widgetName, tqparent, name, singleViewMode), + m_project(0), m_projectDialog(0), m_parentWidget(tqparentWidget), m_view(0), + m_embeddedGanttView(new GanttView(tqparentWidget)), m_embeddedContext(new Context()), m_embeddedContextInitialized(false), m_context(0), m_xmlLoader() { @@ -67,13 +67,13 @@ Part::Part(QWidget *parentWidget, const char *widgetName, delete m_project; m_project = new Project(); // after config is loaded - connect(m_commandHistory, SIGNAL(commandExecuted()), SLOT(slotCommandExecuted())); - connect(m_commandHistory, SIGNAL(documentRestored()), SLOT(slotDocumentRestored())); + connect(m_commandHistory, TQT_SIGNAL(commandExecuted()), TQT_SLOT(slotCommandExecuted())); + connect(m_commandHistory, TQT_SIGNAL(documentRestored()), TQT_SLOT(slotDocumentRestored())); //FIXME the following is really dirty, we should make KPlato::Context a real class // with getter and setter and signals when content changes, thus we can keep track - QTimer* timer = new QTimer(this,"context update timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(slotCopyContextFromView())); + TQTimer* timer = new TQTimer(this,"context update timer"); + connect(timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotCopyContextFromView())); timer->start(500); } @@ -90,7 +90,7 @@ Part::~Part() { } -bool Part::initDoc(InitDocFlags flags, QWidget* parentWidget) { +bool Part::initDoc(InitDocFlags flags, TQWidget* tqparentWidget) { bool result = true; if (flags==KoDocument::InitDocEmpty) @@ -102,7 +102,7 @@ bool Part::initDoc(InitDocFlags flags, QWidget* parentWidget) { return true; } - QString templateDoc; + TQString templateDoc; KoTemplateChooseDia::ReturnType ret; KoTemplateChooseDia::DialogType dlgtype; if (flags != KoDocument::InitDocFileNew ) @@ -113,7 +113,7 @@ bool Part::initDoc(InitDocFlags flags, QWidget* parentWidget) { ret = KoTemplateChooseDia::choose(Factory::global(), templateDoc, dlgtype, "kplato_template", - parentWidget); + tqparentWidget); if (ret == KoTemplateChooseDia::Template) { resetURL(); result = loadNativeFormat(templateDoc); @@ -141,12 +141,12 @@ bool Part::initDoc(InitDocFlags flags, QWidget* parentWidget) { } -KoView *Part::createViewInstance(QWidget *parent, const char *name) { - m_view = new View(this, parent, name); - connect(m_view,SIGNAL(destroyed()),this,SLOT(slotViewDestroyed())); +KoView *Part::createViewInstance(TQWidget *tqparent, const char *name) { + m_view = new View(this, tqparent, name); + connect(m_view,TQT_SIGNAL(destroyed()),this,TQT_SLOT(slotViewDestroyed())); // If there is a project dialog this should be deleted so it will - // use the m_view as parent. If the dialog will be needed again, + // use the m_view as tqparent. If the dialog will be needed again, // it will be made at that point if (m_projectDialog != 0) { kdDebug() << "Deleting m_projectDialog because of new ViewInstance\n"; @@ -169,28 +169,28 @@ KoView *Part::createViewInstance(QWidget *parent, const char *name) { void Part::editProject() { - QWidget* parent = m_parentWidget; + TQWidget* tqparent = m_parentWidget; if (m_view) - parent = m_view; + tqparent = m_view; if (m_projectDialog == 0) // Make the dialog - m_projectDialog = new ProjectDialog(*m_project, parent); + m_projectDialog = new ProjectDialog(*m_project, tqparent); m_projectDialog->exec(); } -bool Part::loadXML(QIODevice *, const QDomDocument &document) { - QTime dt; +bool Part::loadXML(TQIODevice *, const TQDomDocument &document) { + TQTime dt; dt.start(); emit sigProgress( 0 ); - QString value; - QDomElement plan = document.documentElement(); + TQString value; + TQDomElement plan = document.documentElement(); // Check if this is the right app - value = plan.attribute("mime", QString::null); + value = plan.attribute("mime", TQString()); if (value.isEmpty()) { kdError() << "No mime type specified!" << endl; setErrorMessage(i18n("Invalid document. No mimetype specified.")); @@ -198,14 +198,14 @@ bool Part::loadXML(QIODevice *, const QDomDocument &document) { } else if (value != "application/x-vnd.kde.kplato") { kdError() << "Unknown mime type " << value << endl; - setErrorMessage(i18n("Invalid document. Expected mimetype application/x-vnd.kde.kplato, got %1").arg(value)); + setErrorMessage(i18n("Invalid document. Expected mimetype application/x-vnd.kde.kplato, got %1").tqarg(value)); return false; } - QString m_syntaxVersion = plan.attribute("version", CURRENT_SYNTAX_VERSION); + TQString m_syntaxVersion = plan.attribute("version", CURRENT_SYNTAX_VERSION); if (m_syntaxVersion > CURRENT_SYNTAX_VERSION) { int ret = KMessageBox::warningContinueCancel( 0, i18n("This document was created with a newer version of KPlato (syntax version: %1)\n" - "Opening it in this version of KPlato will lose some information.").arg(m_syntaxVersion), + "Opening it in this version of KPlato will lose some information.").tqarg(m_syntaxVersion), i18n("File-Format Mismatch"), i18n("Continue") ); if (ret == KMessageBox::Cancel) { @@ -215,7 +215,7 @@ bool Part::loadXML(QIODevice *, const QDomDocument &document) { } emit sigProgress(5); - QDomNodeList list = plan.childNodes(); + TQDomNodeList list = plan.childNodes(); if (list.count() > 2) { // TODO: Make a proper bitching about this kdDebug() << "*** Error ***\n"; @@ -226,7 +226,7 @@ bool Part::loadXML(QIODevice *, const QDomDocument &document) { m_xmlLoader.startLoad(); for (unsigned int i = 0; i < list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "context") { delete m_context; @@ -265,14 +265,14 @@ bool Part::loadXML(QIODevice *, const QDomDocument &document) { return true; } -QDomDocument Part::saveXML() { - QDomDocument document("kplato"); +TQDomDocument Part::saveXML() { + TQDomDocument document("kplato"); document.appendChild(document.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"")); - QDomElement doc = document.createElement("kplato"); + TQDomElement doc = document.createElement("kplato"); doc.setAttribute("editor", "KPlato"); doc.setAttribute("mime", "application/x-vnd.kde.kplato"); doc.setAttribute("version", CURRENT_SYNTAX_VERSION); @@ -301,7 +301,7 @@ void Part::slotDocumentRestored() { } -void Part::paintContent(QPainter &painter, const QRect &rect, +void Part::paintContent(TQPainter &painter, const TQRect &rect, bool /*transparent*/, double zoomX, double /*zoomY*/) { @@ -328,7 +328,7 @@ void Part::paintContent(QPainter &painter, const QRect &rect, { kdWarning() << "Don't have any context to set!" << endl; } - painter.setClipRect(rect, QPainter::CoordPainter); + painter.setClipRect(rect, TQPainter::CoordPainter); // We don't support zoom yet, so use the painters scaling double d_zoom = 1.0; setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); diff --git a/kplato/kptpart.h b/kplato/kptpart.h index dbafa9f6..6aafea3e 100644 --- a/kplato/kptpart.h +++ b/kplato/kptpart.h @@ -46,18 +46,19 @@ class GanttView; class Part : public KoDocument, public KoTextZoomHandler { Q_OBJECT + TQ_OBJECT public: - Part(QWidget *parentWidget = 0, const char *widgetName = 0, - QObject* parent = 0, const char* name = 0, + Part(TQWidget *tqparentWidget = 0, const char *widgetName = 0, + TQObject* tqparent = 0, const char* name = 0, bool singleViewMode = false); ~Part(); - virtual void paintContent(QPainter& painter, const QRect& rect, + virtual void paintContent(TQPainter& painter, const TQRect& rect, bool transparent = FALSE, double zoomX = 1.0, double zoomY = 1.0); - virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0); + virtual bool initDoc(InitDocFlags flags, TQWidget* tqparentWidget=0); /** * Edit the settings of the project @@ -68,11 +69,11 @@ public: const Project &getProject() const { return *m_project; } // The load and save functions. Look in the file kplato.dtd for info - virtual bool loadXML(QIODevice *, const QDomDocument &document); - virtual QDomDocument saveXML(); + virtual bool loadXML(TQIODevice *, const TQDomDocument &document); + virtual TQDomDocument saveXML(); bool saveOasis(KoStore*, KoXmlWriter*) { return false; } - bool loadOasis(const QDomDocument &, KoOasisStyles &, const QDomDocument&, KoStore *) { return false; } + bool loadOasis(const TQDomDocument &, KoOasisStyles &, const TQDomDocument&, KoStore *) { return false; } void addCommand(KCommand * cmd, bool execute=true); @@ -85,7 +86,7 @@ public: const XMLLoaderObject &xmlLoader() const { return m_xmlLoader; } protected: - virtual KoView* createViewInstance(QWidget* parent, const char* name); + virtual KoView* createViewInstance(TQWidget* tqparent, const char* name); protected slots: void slotDocumentRestored(); @@ -96,7 +97,7 @@ protected slots: private: Project *m_project; ProjectDialog *m_projectDialog; - QWidget* m_parentWidget; + TQWidget* m_parentWidget; View *m_view; /** diff --git a/kplato/kptpertcanvas.cc b/kplato/kptpertcanvas.cc index a50672bc..910ec600 100644 --- a/kplato/kptpertcanvas.cc +++ b/kplato/kptpertcanvas.cc @@ -23,17 +23,17 @@ #include "kptrelationdialog.h" #include "kptcanvasitem.h" -#include <qbuffer.h> -#include <qtimer.h> -#include <qclipboard.h> -#include <qprogressdialog.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qheader.h> -#include <qcursor.h> -#include <qrect.h> -#include <qsize.h> -#include <qptrlist.h> +#include <tqbuffer.h> +#include <tqtimer.h> +#include <tqclipboard.h> +#include <tqprogressdialog.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqheader.h> +#include <tqcursor.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqptrlist.h> #include <KoStore.h> #include <ktempfile.h> @@ -48,15 +48,15 @@ namespace KPlato { -PertCanvas::PertCanvas( QWidget *parent ) - : QCanvasView( parent, "Pert canvas" /*WNorthWestGravity WStaticContents| WResizeNoErase | WRepaintNoErase */), +PertCanvas::PertCanvas( TQWidget *tqparent ) + : TQCanvasView( tqparent, "Pert canvas" /*WNorthWestGravity WStaticContents| WResizeNoErase | WRepaintNoErase */), m_verticalGap(20), m_horizontalGap(10), m_itemSize(100,30) { - //setHScrollBarMode(QScrollView::AlwaysOn); - m_canvas = new QCanvas( this ); + //setHScrollBarMode(TQScrollView::AlwaysOn); + m_canvas = new TQCanvas( TQT_TQOBJECT(this) ); setCanvas( m_canvas ); } @@ -71,19 +71,19 @@ void PertCanvas::draw(Project& project) updateContents(); // First make node items - QPtrListIterator<Node> nit(project.childNodeIterator()); + TQPtrListIterator<Node> nit(project.childNodeIterator()); for ( ; nit.current(); ++nit ) { createChildItems(createNodeItem(nit.current())); } // First all items with relations - QPtrDictIterator<PertNodeItem> it(m_nodes); + TQPtrDictIterator<PertNodeItem> it(m_nodes); for(; it.current(); ++it) { if (!(it.current()->hasParent()) && it.current()->hasChild()) { - m_rows.append(new QMemArray<bool>(1)); // New node always goes into new row, first column - it.current()->move(this, m_rows.count()-1, 0); // item also moves it's children + m_rows.append(new TQMemArray<bool>(1)); // New node always goes into new row, first column + it.current()->move(this, m_rows.count()-1, 0); // item also moves it's tqchildren } } // now items without relations @@ -91,19 +91,19 @@ void PertCanvas::draw(Project& project) { if (!(it.current()->hasParent() || it.current()->hasChild())) { - m_rows.append(new QMemArray<bool>(1)); // New node always goes into new row, first column + m_rows.append(new TQMemArray<bool>(1)); // New node always goes into new row, first column it.current()->move(this, m_rows.count()-1, 0); } } drawRelations(); // done _after_ all nodes are drawn - QSize s = canvasSize(); + TQSize s = canvasSize(); m_canvas->resize(s.width(), s.height()); update(); } PertNodeItem *PertCanvas::createNodeItem(Node *node) { - PertNodeItem *item = m_nodes.find(node); + PertNodeItem *item = m_nodes.tqfind(node); if (!item) { if ( node->type() == Node::Type_Project) @@ -125,23 +125,23 @@ PertNodeItem *PertCanvas::createNodeItem(Node *node) return item; } -void PertCanvas::createChildItems(PertNodeItem *parentItem) +void PertCanvas::createChildItems(PertNodeItem *tqparentItem) { - //kdDebug()<<k_funcinfo<<"parentItem="<<(parentItem ? parentItem->node().name() : "nil")<<endl; - if (!parentItem) + //kdDebug()<<k_funcinfo<<"tqparentItem="<<(tqparentItem ? tqparentItem->node().name() : "nil")<<endl; + if (!tqparentItem) return; - QPtrListIterator<Relation> it(parentItem->node().dependChildNodes()); + TQPtrListIterator<Relation> it(tqparentItem->node().dependChildNodes()); for (; it.current(); ++it) { PertNodeItem *childItem = createNodeItem(it.current()->child()); if (childItem) - parentItem->addChildRelation(it.current(), childItem); + tqparentItem->addChildRelation(it.current(), childItem); m_relations.append(it.current()); } - // Now my children - QPtrListIterator<Node> nit(parentItem->node().childNodeIterator()); + // Now my tqchildren + TQPtrListIterator<Node> nit(tqparentItem->node().childNodeIterator()); for ( ; nit.current(); ++nit ) { createChildItems(createNodeItem(nit.current())); } @@ -150,14 +150,14 @@ void PertCanvas::createChildItems(PertNodeItem *parentItem) void PertCanvas::drawRelations() { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Relation> it(m_relations); + TQPtrListIterator<Relation> it(m_relations); for (; it.current(); ++it) { - PertNodeItem *parentItem = m_nodes.find(it.current()->parent()); - PertNodeItem *childItem = m_nodes.find(it.current()->child()); - if (parentItem && childItem) + PertNodeItem *tqparentItem = m_nodes.tqfind(it.current()->tqparent()); + PertNodeItem *childItem = m_nodes.tqfind(it.current()->child()); + if (tqparentItem && childItem) { - PertRelationItem *item = new PertRelationItem(this, parentItem, childItem, it.current()); + PertRelationItem *item = new PertRelationItem(this, tqparentItem, childItem, it.current()); item->show(); } } @@ -174,25 +174,25 @@ void PertCanvas::mapNode(PertNodeItem *item) m_rows.at(item->row())->at(item->column()) = true; } -void PertCanvas::mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, Relation::Type type) +void PertCanvas::mapChildNode(PertNodeItem *tqparentItem, PertNodeItem *childItem, Relation::Type type) { - //kdDebug()<<k_funcinfo<<"Parent: "<<parentItem->node().name()<<" to child: "<<(childItem ? childItem->node().name() : "None")<<endl; + //kdDebug()<<k_funcinfo<<"Parent: "<<tqparentItem->node().name()<<" to child: "<<(childItem ? childItem->node().name() : "None")<<endl; if (!childItem) { // shouldn't happen... kdError()<<k_funcinfo<<"No childItem"<<endl; return; } - int row = parentItem->row(); - int col = parentItem->column(); + int row = tqparentItem->row(); + int col = tqparentItem->column(); int chRow = childItem->row(); int chCol = childItem->column(); bool chMapped = (chRow > -1 && chCol > -1); - //kdDebug()<<k_funcinfo<<"Parent: "<<parentItem->node().name()<<" at ("<<row<<","<<col<<"): Moving "<<childItem->node().name()<<" from: "<<chRow<<","<<chCol<<endl; + //kdDebug()<<k_funcinfo<<"Parent: "<<tqparentItem->node().name()<<" at ("<<row<<","<<col<<"): Moving "<<childItem->node().name()<<" from: "<<chRow<<","<<chCol<<endl; if (type == Relation::StartStart || type == Relation::FinishFinish) { - // node goes into row below parent, at least same col + // node goes into row below tqparent, at least same col if (chMapped) { m_rows.at(chRow)->at(chCol) = false; @@ -201,7 +201,7 @@ void PertCanvas::mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, { chRow = row+1; if (chRow >= 0 && m_rows.count() <= uint(chRow)) { - m_rows.append(new QMemArray<bool>(1)); // make a new row + m_rows.append(new TQMemArray<bool>(1)); // make a new row chRow = m_rows.count()-1; // to be safe } //kdDebug()<<k_funcinfo<<" Moving "<<childItem->node().name()<<" to row: "<<chRow<<endl; @@ -221,7 +221,7 @@ void PertCanvas::mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, if (!(m_rows.at(row+1)) || // next row does not exists m_rows.at(row+1)->at(col) == true) // col is not free { - m_rows.append(new QMemArray<bool>(col+1)); // make a new row + m_rows.append(new TQMemArray<bool>(col+1)); // make a new row } else if (col >= 0 && m_rows.at(row+1)->count() <= uint(col)) // col does not exist m_rows.at(row)->resize(col+1); @@ -251,7 +251,7 @@ void PertCanvas::mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, if (col >= 0 && m_rows.at(row)->count() <= uint(col)) m_rows.at(row)->resize(col+1); // make new column else if (m_rows.at(row)->at(col) = true) - m_rows.append(new QMemArray<bool>(col+1)); // col not free, so make a new row + m_rows.append(new TQMemArray<bool>(col+1)); // col not free, so make a new row chRow = m_rows.count() -1; chCol = col; @@ -265,17 +265,17 @@ void PertCanvas::mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, childItem->move(this, chRow, chCol); } -QSize PertCanvas::canvasSize() +TQSize PertCanvas::canvasSize() { //kdDebug()<<k_funcinfo<<endl; - QSize s(0,0); - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQSize s(0,0); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { - QRect r = (*it)->boundingRect(); - s.setWidth(QMAX(s.width(), r.right())); - s.setHeight(QMAX(s.height(), r.bottom())); + TQRect r = (*it)->boundingRect(); + s.setWidth(TQMAX(s.width(), r.right())); + s.setHeight(TQMAX(s.height(), r.bottom())); } s.setWidth(s.width()+20); s.setHeight(s.height()+20); @@ -287,8 +287,8 @@ void PertCanvas::clear() m_nodes.clear(); m_relations.clear(); m_rows.clear(); - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( *it ) @@ -296,24 +296,24 @@ void PertCanvas::clear() } } -void PertCanvas::contentsMousePressEvent ( QMouseEvent * e ) +void PertCanvas::contentsMousePressEvent ( TQMouseEvent * e ) { //kdDebug()<<k_funcinfo<<" gl.X,gl.Y="<<e->globalX()<<","<<e->globalY()<<" x,y="<<e->x()<<","<<e->y()<<endl; switch (e->button()) { - case QEvent::LeftButton: + case Qt::LeftButton: { break; } - case QEvent::RightButton: + case Qt::RightButton: { PertNodeItem *item = selectedItem(); if (item) item->setSelected(false); canvas()->update(); - QCanvasItemList l = canvas()->collisions(e->pos()); - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) + TQCanvasItemList l = canvas()->collisions(e->pos()); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { if ( (*it)->rtti() == PertProjectItem::RTTI || (*it)->rtti() == PertTaskItem::RTTI || @@ -335,23 +335,23 @@ void PertCanvas::contentsMousePressEvent ( QMouseEvent * e ) } break; } - case QEvent::MidButton: + case Qt::MidButton: break; default: break; } } -void PertCanvas::contentsMouseReleaseEvent ( QMouseEvent * e ) +void PertCanvas::contentsMouseReleaseEvent ( TQMouseEvent * e ) { //kdDebug()<<k_funcinfo<<" gl.X,gl.Y="<<e->globalX()<<","<<e->globalY()<<" x,y="<<e->x()<<","<<e->y()<<endl; switch (e->button()) { - case QEvent::LeftButton: + case Qt::LeftButton: { bool hit = false; - QCanvasItemList l = canvas()->collisions(e->pos()); - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) + TQCanvasItemList l = canvas()->collisions(e->pos()); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { if ( (*it)->rtti() == PertProjectItem::RTTI || (*it)->rtti() == PertTaskItem::RTTI || @@ -393,11 +393,11 @@ void PertCanvas::contentsMouseReleaseEvent ( QMouseEvent * e ) canvas()->update(); break; } - case QEvent::RightButton: + case Qt::RightButton: { break; } - case QEvent::MidButton: + case Qt::MidButton: break; default: break; @@ -406,8 +406,8 @@ void PertCanvas::contentsMouseReleaseEvent ( QMouseEvent * e ) PertNodeItem *PertCanvas::selectedItem() { - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( (*it)->isSelected() ) diff --git a/kplato/kptpertcanvas.h b/kplato/kptpertcanvas.h index 8d2ae403..19f0408a 100644 --- a/kplato/kptpertcanvas.h +++ b/kplato/kptpertcanvas.h @@ -23,42 +23,43 @@ #include "kptnode.h" #include "kptproject.h" -#include <qcanvas.h> -#include <qmemarray.h> -#include <qptrdict.h> +#include <tqcanvas.h> +#include <tqmemarray.h> +#include <tqptrdict.h> -class QTimer; -class QPainter; -class QPoint; -class QSize; +class TQTimer; +class TQPainter; +class TQPoint; +class TQSize; namespace KPlato { class PertNodeItem; -class PertCanvas : public QCanvasView +class PertCanvas : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - PertCanvas( QWidget *parent ); + PertCanvas( TQWidget *tqparent ); virtual ~PertCanvas(); void draw(Project& project); void clear(); - QSize canvasSize(); + TQSize canvasSize(); PertNodeItem *selectedItem(); int verticalGap() { return m_verticalGap; } int horizontalGap() { return m_horizontalGap; } - QSize itemSize() { return m_itemSize; } + TQSize itemSize() { return m_itemSize; } void setColumn(int row, int col) { m_rows.at(row)[col] = true; } void mapNode(PertNodeItem *item); - void mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, Relation::Type type); + void mapChildNode(PertNodeItem *tqparentItem, PertNodeItem *childItem, Relation::Type type); Node *selectedNode(); @@ -68,31 +69,31 @@ protected: void createChildItems(PertNodeItem *node); PertNodeItem *createNodeItem(Node *node); - void contentsMousePressEvent ( QMouseEvent * e ); - void contentsMouseReleaseEvent ( QMouseEvent * e ); + void contentsMousePressEvent ( TQMouseEvent * e ); + void contentsMouseReleaseEvent ( TQMouseEvent * e ); signals: - void rightButtonPressed(Node *node, const QPoint & point); + void rightButtonPressed(Node *node, const TQPoint & point); void updateView(bool calculate); void addRelation(Node *par, Node *child); void modifyRelation(Relation *rel); private: - QCanvas *m_canvas; + TQCanvas *m_canvas; - QTimer *m_scrollTimer; + TQTimer *m_scrollTimer; bool m_mousePressed; bool m_printing; int m_verticalGap; int m_horizontalGap; - QSize m_itemSize; + TQSize m_itemSize; - QPtrDict<PertNodeItem> m_nodes; - QPtrList<Relation> m_relations; + TQPtrDict<PertNodeItem> m_nodes; + TQPtrList<Relation> m_relations; - QPtrList<QMemArray<bool> > m_rows; + TQPtrList<TQMemArray<bool> > m_rows; #ifndef NDEBUG void printDebug( int ); diff --git a/kplato/kptpertview.cc b/kplato/kptpertview.cc index 20932857..3bd37636 100644 --- a/kplato/kptpertview.cc +++ b/kplato/kptpertview.cc @@ -28,42 +28,42 @@ #include <kdebug.h> -#include <qsplitter.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qlistview.h> -#include <qheader.h> -#include <qpopupmenu.h> +#include <tqsplitter.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlistview.h> +#include <tqheader.h> +#include <tqpopupmenu.h> #include <kprinter.h> namespace KPlato { -PertView::PertView( View *view, QWidget *parent, QLayout *layout ) - : QWidget( parent, "Pert view" ), +PertView::PertView( View *view, TQWidget *tqparent, TQLayout *tqlayout ) + : TQWidget( tqparent, "Pert view" ), m_mainview( view ), m_node( 0 ) { - init(layout); + init(tqlayout); } PertView::~PertView() { } -void PertView::init(QLayout */*layout*/) +void PertView::init(TQLayout */*tqlayout*/) { //kdDebug()<<k_funcinfo<<endl; - QGridLayout *gl = new QGridLayout(this, 1, 1, -1, -1, "Pert QGridLayout"); + TQGridLayout *gl = new TQGridLayout(this, 1, 1, -1, -1, "Pert TQGridLayout"); m_canvasview = new PertCanvas(this); gl->addWidget(m_canvasview, 0, 0); draw(); - connect(m_canvasview, SIGNAL(rightButtonPressed(Node *, const QPoint &)), this, SLOT(slotRMBPressed(Node *,const QPoint &))); - connect(m_canvasview, SIGNAL(updateView(bool)), m_mainview, SLOT(slotUpdate(bool))); + connect(m_canvasview, TQT_SIGNAL(rightButtonPressed(Node *, const TQPoint &)), this, TQT_SLOT(slotRMBPressed(Node *,const TQPoint &))); + connect(m_canvasview, TQT_SIGNAL(updateView(bool)), m_mainview, TQT_SLOT(slotUpdate(bool))); - connect(m_canvasview, SIGNAL(addRelation(Node*, Node*)), SLOT(slotAddRelation(Node*, Node*))); - connect(m_canvasview, SIGNAL(modifyRelation(Relation*)), SLOT(slotModifyRelation(Relation*))); + connect(m_canvasview, TQT_SIGNAL(addRelation(Node*, Node*)), TQT_SLOT(slotAddRelation(Node*, Node*))); + connect(m_canvasview, TQT_SIGNAL(modifyRelation(Relation*)), TQT_SLOT(slotModifyRelation(Relation*))); } void PertView::draw() @@ -73,12 +73,12 @@ void PertView::draw() m_canvasview->show(); } -void PertView::slotRMBPressed(Node *node, const QPoint & point) +void PertView::slotRMBPressed(Node *node, const TQPoint & point) { //kdDebug()<<k_funcinfo<<" node: "<<node->name()<<endl; m_node = node; if (node && (node->type() == Node::Type_Task || node->type() == Node::Type_Milestone)) { - QPopupMenu *menu = m_mainview->popupMenu("task_popup"); + TQPopupMenu *menu = m_mainview->popupMenu("task_popup"); if (menu) { /*int id =*/ menu->exec(point); @@ -87,7 +87,7 @@ void PertView::slotRMBPressed(Node *node, const QPoint & point) return; } if (node && node->type() == Node::Type_Summarytask) { - QPopupMenu *menu = m_mainview->popupMenu("node_popup"); + TQPopupMenu *menu = m_mainview->popupMenu("node_popup"); if (menu) { /*int id =*/ menu->exec(point); diff --git a/kplato/kptpertview.h b/kplato/kptpertview.h index a51bb95d..ed4e3c28 100644 --- a/kplato/kptpertview.h +++ b/kplato/kptpertview.h @@ -22,10 +22,10 @@ #include "kptcontext.h" -#include <qsplitter.h> +#include <tqsplitter.h> -class QLayout; -class QListViewItem; +class TQLayout; +class TQListViewItem; class KPrinter; @@ -37,13 +37,14 @@ class PertCanvas; class Node; class Relation; -class PertView : public QWidget +class PertView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PertView( View *view, QWidget *parent, QLayout *layout ); + PertView( View *view, TQWidget *tqparent, TQLayout *tqlayout ); ~PertView(); @@ -60,7 +61,7 @@ public: virtual void getContext(Context::Pertview &context) const; public slots: - void slotRMBPressed(Node *node, const QPoint & point); + void slotRMBPressed(Node *node, const TQPoint & point); void slotAddRelation(Node *par, Node *child); void slotModifyRelation(Relation *rel); @@ -69,7 +70,7 @@ signals: void modifyRelation(Relation *rel); private: - void init(QLayout *layout); + void init(TQLayout *tqlayout); View *m_mainview; PertCanvas *m_canvasview; Node *m_node; diff --git a/kplato/kptproject.cc b/kplato/kptproject.cc index 0451f34d..85992dcf 100644 --- a/kplato/kptproject.cc +++ b/kplato/kptproject.cc @@ -28,12 +28,12 @@ #include "kpteffortcostmap.h" #include "kptschedule.h" -#include <qdom.h> -#include <qstring.h> -#include <qdatetime.h> -#include <qbrush.h> -#include <qcanvas.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqbrush.h> +#include <tqcanvas.h> +#include <tqptrlist.h> #include <kdatetimewidget.h> #include <kdebug.h> @@ -42,8 +42,8 @@ namespace KPlato { -Project::Project(Node *parent) - : Node(parent), +Project::Project(Node *tqparent) + : Node(tqparent), m_accounts(*this), m_baselined(false) { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; @@ -55,9 +55,9 @@ Project::Project(Node *parent) void Project::init() { if (m_parent == 0) { - // set sensible defaults for a project wo parent - m_constraintStartTime = QDateTime(QDate::currentDate(), QTime()); - m_constraintEndTime = m_constraintStartTime.addDays(1); + // set sensible defaults for a project wo tqparent + m_constraintStartTime = TQDateTime(TQDate::tqcurrentDate(), TQTime()); + m_constraintEndTime = TQDateTime(m_constraintStartTime.addDays(1)); } m_calendars.setAutoDelete(true); } @@ -132,12 +132,12 @@ void Project::calculate() { bool Project::calcCriticalPath(bool fromEnd) { //kdDebug()<<k_funcinfo<<endl; if (fromEnd) { - QPtrListIterator<Node> startnodes = m_startNodes; + TQPtrListIterator<Node> startnodes = m_startNodes; for (; startnodes.current(); ++startnodes) { startnodes.current()->calcCriticalPath(fromEnd); } } else { - QPtrListIterator<Node> endnodes = m_endNodes; + TQPtrListIterator<Node> endnodes = m_endNodes; for (; endnodes.current(); ++endnodes) { endnodes.current()->calcCriticalPath(fromEnd); } @@ -173,11 +173,11 @@ Duration *Project::getRandomDuration() { DateTime Project::calculateForward(int use) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Node::Type_Project) { - // Follow *parent* relations back and + // Follow *tqparent* relations back and // calculate forwards following the child relations DateTime finish; DateTime time; - QPtrListIterator<Node> endnodes = m_endNodes; + TQPtrListIterator<Node> endnodes = m_endNodes; for (; endnodes.current(); ++endnodes) { time = endnodes.current()->calculateForward(use); if (!finish.isValid() || time > finish) @@ -195,10 +195,10 @@ DateTime Project::calculateBackward(int use) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Node::Type_Project) { // Follow *child* relations back and - // calculate backwards following parent relation + // calculate backwards following tqparent relation DateTime start; DateTime time; - QPtrListIterator<Node> startnodes = m_startNodes; + TQPtrListIterator<Node> startnodes = m_startNodes; for (; startnodes.current(); ++startnodes) { time = startnodes.current()->calculateBackward(use); if (!start.isValid() || time < start) @@ -216,7 +216,7 @@ DateTime Project::scheduleForward(const DateTime &earliest, int use) { resetVisited(); DateTime end = earliest; DateTime time; - QPtrListIterator<Node> it(m_endNodes); + TQPtrListIterator<Node> it(m_endNodes); for (; it.current(); ++it) { time = it.current()->scheduleForward(earliest, use); if (time > end) @@ -231,7 +231,7 @@ DateTime Project::scheduleBackward(const DateTime &latest, int use) { resetVisited(); DateTime start = latest; DateTime time; - QPtrListIterator<Node> it(m_startNodes); + TQPtrListIterator<Node> it(m_startNodes); for (; it.current(); ++it) { time = it.current()->scheduleBackward(latest, use); if (time < start) @@ -243,7 +243,7 @@ DateTime Project::scheduleBackward(const DateTime &latest, int use) { } void Project::adjustSummarytask() { - QPtrListIterator<Node> it(m_summarytasks); + TQPtrListIterator<Node> it(m_summarytasks); for (; it.current(); ++it) { it.current()->adjustSummarytask(); } @@ -254,7 +254,7 @@ void Project::initiateCalculation(Schedule &sch) { // clear all resource appointments m_visitedForward = false; m_visitedBackward = false; - QPtrListIterator<ResourceGroup> git(m_resourceGroups); + TQPtrListIterator<ResourceGroup> git(m_resourceGroups); for ( ; git.current(); ++git ) { git.current()->initiateCalculation(sch); } @@ -265,10 +265,10 @@ void Project::initiateCalculation(Schedule &sch) { initiateCalculationLists(m_startNodes, m_endNodes, m_summarytasks); } -void Project::initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> &endnodes, QPtrList<Node> &summarytasks) { +void Project::initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Node::Type_Project) { - QPtrListIterator<Node> it = childNodeIterator(); + TQPtrListIterator<Node> it = childNodeIterator(); for (; it.current(); ++it) { it.current()->initiateCalculationLists(startnodes, endnodes, summarytasks); } @@ -277,11 +277,11 @@ void Project::initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node } } -bool Project::load(QDomElement &element) { +bool Project::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<"--->"<<endl; - QString s; + TQString s; bool ok = false; - QString id = element.attribute("id"); + TQString id = element.attribute("id"); if (!setId(id)) { kdWarning()<<k_funcinfo<<"Id must be unique: "<<id<<endl; } @@ -308,12 +308,12 @@ bool Project::load(QDomElement &element) { if (!s.isEmpty()) m_constraintEndTime = DateTime::fromString(s); - // Load the project children + // Load the project tqchildren // Must do these first - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "calendar") { // Load the calendar. // References by resources @@ -340,7 +340,7 @@ bool Project::load(QDomElement &element) { } for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "resource-group") { // Load the resources @@ -357,7 +357,7 @@ bool Project::load(QDomElement &element) { } for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "project") { //kdDebug()<<k_funcinfo<<"Sub project--->"<<endl; @@ -390,7 +390,7 @@ bool Project::load(QDomElement &element) { // These go last for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "accounts") { //kdDebug()<<k_funcinfo<<"Accounts--->"<<endl; // Load accounts @@ -413,10 +413,10 @@ bool Project::load(QDomElement &element) { //kdDebug()<<k_funcinfo<<"Project schedules & task appointments--->"<<endl; // Prepare for multiple schedules // References tasks and resources - QDomNodeList lst = e.childNodes(); + TQDomNodeList lst = e.childNodes(); for (unsigned int i=0; i<lst.count(); ++i) { if (lst.item(i).isElement()) { - QDomElement el = lst.item(i).toElement(); + TQDomElement el = lst.item(i).toElement(); if (el.tagName() == "schedule") { MainSchedule *sch = new MainSchedule(); if (sch->loadXML(el, *this)) { @@ -438,16 +438,16 @@ bool Project::load(QDomElement &element) { } //kdDebug()<<k_funcinfo<<"Calendars--->"<<endl; // calendars references calendars in arbritary saved order - QPtrListIterator<Calendar> calit(m_calendars); + TQPtrListIterator<Calendar> calit(m_calendars); for (; calit.current(); ++calit) { - if (calit.current()->id() == calit.current()->parentId()) { - kdError()<<k_funcinfo<<"Calendar want itself as parent"<<endl; + if (calit.current()->id() == calit.current()->tqparentId()) { + kdError()<<k_funcinfo<<"Calendar want itself as tqparent"<<endl; continue; } - calit.current()->setParent(calendar(calit.current()->parentId())); + calit.current()->setParent(calendar(calit.current()->tqparentId())); } //kdDebug()<<k_funcinfo<<"Project schedules--->"<<endl; - QIntDictIterator<Schedule> it = m_schedules; + TQIntDictIterator<Schedule> it = m_schedules; if (it.current()) { if (m_constraint == Node::MustFinishOn) m_constraintEndTime = it.current()->endTime; @@ -459,8 +459,8 @@ bool Project::load(QDomElement &element) { return true; } -void Project::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("project"); +void Project::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("project"); element.appendChild(me); me.setAttribute("name", m_name); @@ -477,7 +477,7 @@ void Project::save(QDomElement &element) const { m_accounts.save(me); // save calendars - QPtrListIterator<Calendar> calit(m_calendars); + TQPtrListIterator<Calendar> calit(m_calendars); for (; calit.current(); ++calit) { calit.current()->save(me); } @@ -486,34 +486,34 @@ void Project::save(QDomElement &element) const { m_standardWorktime->save(me); // save project resources, must be after calendars - QPtrListIterator<ResourceGroup> git(m_resourceGroups); + TQPtrListIterator<ResourceGroup> git(m_resourceGroups); for ( ; git.current(); ++git ) { git.current()->save(me); } - // Only save parent relations - QPtrListIterator<Relation> it(m_dependParentNodes); + // Only save tqparent relations + TQPtrListIterator<Relation> it(m_dependParentNodes); for ( ; it.current(); ++it ) { it.current()->save(me); } for (int i=0; i<numChildren(); i++) - // Save all children + // Save all tqchildren getChildNode(i)->save(me); // Now we can save relations assuming no tasks have relations outside the project - QPtrListIterator<Node> nodes(m_nodes); + TQPtrListIterator<Node> nodes(m_nodes); for ( ; nodes.current(); ++nodes ) { nodes.current()->saveRelations(me); } if (!m_schedules.isEmpty()) { - QDomElement el = me.ownerDocument().createElement("schedules"); + TQDomElement el = me.ownerDocument().createElement("schedules"); me.appendChild(el); - QIntDictIterator<Schedule> it = m_schedules; + TQIntDictIterator<Schedule> it = m_schedules; for (; it.current(); ++it) { if (!it.current()->isDeleted() && it.current()->isScheduled()) { - QDomElement schs = el.ownerDocument().createElement("schedule"); + TQDomElement schs = el.ownerDocument().createElement("schedule"); el.appendChild(schs); it.current()->saveXML(schs); //kdDebug()<<k_funcinfo<<m_name<<" id="<<it.current()->id()<<(it.current()->isDeleted()?" Deleted":"")<<endl; @@ -524,7 +524,7 @@ void Project::save(QDomElement &element) const { } void Project::setParentSchedule(Schedule *sch) { - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (; it.current(); ++it) { it.current()->setParentSchedule(sch); } @@ -549,7 +549,7 @@ void Project::insertResourceGroup( unsigned int /* index */, ResourceGroup * /* resource */) { } -QPtrList<ResourceGroup> &Project::resourceGroups() { +TQPtrList<ResourceGroup> &Project::resourceGroups() { return m_resourceGroups; } @@ -568,19 +568,19 @@ bool Project::addTask( Node* task, Node* position ) return addSubTask(task, position); } // find the position - // we have to tell the parent that we want to delete one of its children - Node* parentNode = position->getParent(); - if ( !parentNode ) { - kdDebug()<<k_funcinfo<<"parent node not found???"<<endl; + // we have to tell the tqparent that we want to delete one of its tqchildren + Node* tqparentNode = position->getParent(); + if ( !tqparentNode ) { + kdDebug()<<k_funcinfo<<"tqparent node not found???"<<endl; return false; } - int index = parentNode->findChildNode( position ); + int index = tqparentNode->findChildNode( position ); if ( -1 == index ) { // ok, it does not exist kdDebug()<<k_funcinfo<<"Task not found???"<<endl; return false; } - return addSubTask(task, index+1, parentNode); + return addSubTask(task, index+1, tqparentNode); } bool Project::addSubTask( Node* task, Node* position ) @@ -588,7 +588,7 @@ bool Project::addSubTask( Node* task, Node* position ) // we want to add a subtask to the node "position". It will become // position's last child. if ( 0 == position ) { - kdError()<<k_funcinfo<<"No parent, can not add subtask: "<<task->name()<<endl; + kdError()<<k_funcinfo<<"No tqparent, can not add subtask: "<<task->name()<<endl; return false; } if (!registerNodeId(task)) { @@ -599,30 +599,30 @@ bool Project::addSubTask( Node* task, Node* position ) return true; } -bool Project::addSubTask( Node* task, int index, Node* parent ) +bool Project::addSubTask( Node* task, int index, Node* tqparent ) { - // we want to add a subtask to the node "parent" at the given index. - if ( 0 == parent ) { - kdError()<<k_funcinfo<<"No parent, can not add subtask: "<<task->name()<<endl; + // we want to add a subtask to the node "tqparent" at the given index. + if ( 0 == tqparent ) { + kdError()<<k_funcinfo<<"No tqparent, can not add subtask: "<<task->name()<<endl; return false; } if (!registerNodeId(task)) { kdError()<<k_funcinfo<<"Failed to register node id, can not add subtask: "<<task->name()<<endl; return false; } - parent->insertChildNode(index, task); + tqparent->insertChildNode(index, task); return true; } void Project::delTask(Node *node) { - Node *parent = node->getParent(); - if (parent == 0) { - kdDebug()<<k_funcinfo<<"Node must have a parent!"<<endl; + Node *tqparent = node->getParent(); + if (tqparent == 0) { + kdDebug()<<k_funcinfo<<"Node must have a tqparent!"<<endl; return; } removeId(node->id()); - parent->delChildNode(node, false/*take*/); + tqparent->delChildNode(node, false/*take*/); } bool Project::canIndentTask(Node* node) @@ -636,22 +636,22 @@ bool Project::canIndentTask(Node* node) //kdDebug()<<k_funcinfo<<"The root node cannot be indented"<<endl; return false; } - // we have to find the parent of task to manipulate its list of children - Node* parentNode = node->getParent(); - if ( !parentNode ) { + // we have to find the tqparent of task to manipulate its list of tqchildren + Node* tqparentNode = node->getParent(); + if ( !tqparentNode ) { return false; } - if (parentNode->findChildNode(node) == -1) { + if (tqparentNode->findChildNode(node) == -1) { kdError()<<k_funcinfo<<"Tasknot found???"<<endl; return false; } Node *sib = node->siblingBefore(); if (!sib) { - //kdDebug()<<k_funcinfo<<"new parent node not found"<<endl; + //kdDebug()<<k_funcinfo<<"new tqparent node not found"<<endl; return false; } if (node->findParentRelation(sib) || node->findChildRelation(sib)) { - //kdDebug()<<k_funcinfo<<"Cannot have relations to parent"<<endl; + //kdDebug()<<k_funcinfo<<"Cannot have relations to tqparent"<<endl; return false; } return true; @@ -679,18 +679,18 @@ bool Project::canUnindentTask( Node* node ) //kdDebug()<<k_funcinfo<<"The root node cannot be unindented"<<endl; return false; } - // we have to find the parent of task to manipulate its list of children - // and we need the parent's parent too - Node* parentNode = node->getParent(); - if ( !parentNode ) { + // we have to find the tqparent of task to manipulate its list of tqchildren + // and we need the tqparent's tqparent too + Node* tqparentNode = node->getParent(); + if ( !tqparentNode ) { return false; } - Node* grandParentNode = parentNode->getParent(); + Node* grandParentNode = tqparentNode->getParent(); if ( !grandParentNode ) { //kdDebug()<<k_funcinfo<<"This node already is at the top level"<<endl; return false; } - int index = parentNode->findChildNode( node ); + int index = tqparentNode->findChildNode( node ); if ( -1 == index ) { kdError()<<k_funcinfo<<"Tasknot found???"<<endl; return false; @@ -701,10 +701,10 @@ bool Project::canUnindentTask( Node* node ) bool Project::unindentTask( Node* node ) { if (canUnindentTask(node)) { - Node *parentNode = node->getParent(); - Node *grandParentNode = parentNode->getParent(); - parentNode->delChildNode(node, false/*do not delete objekt*/); - grandParentNode->addChildNode(node,parentNode); + Node *tqparentNode = node->getParent(); + Node *grandParentNode = tqparentNode->getParent(); + tqparentNode->delChildNode(node, false/*do not delete objekt*/); + grandParentNode->addChildNode(node,tqparentNode); return true; } return false; @@ -714,13 +714,13 @@ bool Project::canMoveTaskUp( Node* node ) { if (node == 0) return false; // safety - // we have to find the parent of task to manipulate its list of children - Node* parentNode = node->getParent(); - if (!parentNode) { - //kdDebug()<<k_funcinfo<<"No parent found"<<endl; + // we have to find the tqparent of task to manipulate its list of tqchildren + Node* tqparentNode = node->getParent(); + if (!tqparentNode) { + //kdDebug()<<k_funcinfo<<"No tqparent found"<<endl; return false; } - if (parentNode->findChildNode(node) == -1) { + if (tqparentNode->findChildNode(node) == -1) { kdError()<<k_funcinfo<<"Tasknot found???"<<endl; return false; } @@ -742,12 +742,12 @@ bool Project::canMoveTaskDown( Node* node ) { if (node == 0) return false; // safety - // we have to find the parent of task to manipulate its list of children - Node* parentNode = node->getParent(); - if (!parentNode) { + // we have to find the tqparent of task to manipulate its list of tqchildren + Node* tqparentNode = node->getParent(); + if (!tqparentNode) { return false; } - if (parentNode->findChildNode(node) == -1) { + if (tqparentNode->findChildNode(node) == -1) { kdError()<<k_funcinfo<<"Tasknot found???"<<endl; return false; } @@ -765,32 +765,32 @@ bool Project::moveTaskDown( Node* node ) return false; } -Task *Project::createTask(Node* parent) { - Task* node = new Task(parent); +Task *Project::createTask(Node* tqparent) { + Task* node = new Task(tqparent); node->setId(uniqueNodeId()); return node; } -Task *Project::createTask(Task &def, Node* parent) { - Task* node = new Task(def, parent); +Task *Project::createTask(Task &def, Node* tqparent) { + Task* node = new Task(def, tqparent); node->setId(uniqueNodeId()); return node; } -QString Project::uniqueNodeId(int seed) { +TQString Project::uniqueNodeId(int seed) { int i = seed; - while (findNode(QString("%1").arg(i))) { + while (findNode(TQString("%1").tqarg(i))) { ++i; } - return QString("%1").arg(i); + return TQString("%1").tqarg(i); } -bool Project::removeId(const QString &id) { +bool Project::removeId(const TQString &id) { kdDebug()<<k_funcinfo<<"id="<<id<<endl; return (m_parent ? m_parent->removeId(id) : nodeIdDict.remove(id)); } -void Project::insertId(const QString &id, const Node *node) { +void Project::insertId(const TQString &id, const Node *node) { kdDebug()<<k_funcinfo<<"id="<<id<<" "<<node->name()<<endl; m_parent ? m_parent->insertId(id, node) : nodeIdDict.insert(id, node); } @@ -813,16 +813,16 @@ bool Project::registerNodeId(Node *node) { } -ResourceGroup *Project::group(QString id) { +ResourceGroup *Project::group(TQString id) { return findResourceGroup(id); } -Resource *Project::resource(QString id) { +Resource *Project::resource(TQString id) { return findResource(id); } // TODO -EffortCostMap Project::plannedEffortCostPrDay(const QDate &/*start*/, const QDate &/*end*/) const { +EffortCostMap Project::plannedEffortCostPrDay(const TQDate &/*start*/, const TQDate &/*end*/) const { //kdDebug()<<k_funcinfo<<endl; EffortCostMap ec; return ec; @@ -833,7 +833,7 @@ EffortCostMap Project::plannedEffortCostPrDay(const QDate &/*start*/, const QDat Duration Project::plannedEffort() { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffort(); } @@ -841,10 +841,10 @@ Duration Project::plannedEffort() { } // Returns the total planned effort for this project (or subproject) on date -Duration Project::plannedEffort(const QDate &date) { +Duration Project::plannedEffort(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffort(date); } @@ -852,10 +852,10 @@ Duration Project::plannedEffort(const QDate &date) { } // Returns the total planned effort for this project (or subproject) upto and including date -Duration Project::plannedEffortTo(const QDate &date) { +Duration Project::plannedEffortTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffortTo(date); } @@ -866,7 +866,7 @@ Duration Project::plannedEffortTo(const QDate &date) { Duration Project::actualEffort() { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffort(); } @@ -874,10 +874,10 @@ Duration Project::actualEffort() { } // Returns the total actual effort for this project (or subproject) on date -Duration Project::actualEffort(const QDate &date) { +Duration Project::actualEffort(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffort(date); } @@ -885,10 +885,10 @@ Duration Project::actualEffort(const QDate &date) { } // Returns the total actual effort for this project (or subproject) upto and including date -Duration Project::actualEffortTo(const QDate &date) { +Duration Project::actualEffortTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffortTo(date); } @@ -898,7 +898,7 @@ Duration Project::actualEffortTo(const QDate &date) { double Project::plannedCost() { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCost(); } @@ -906,10 +906,10 @@ double Project::plannedCost() { } // Returns the total planned effort for this project (or subproject) on date -double Project::plannedCost(const QDate &date) { +double Project::plannedCost(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCost(date); } @@ -917,10 +917,10 @@ double Project::plannedCost(const QDate &date) { } // Returns the total planned effort for this project (or subproject) upto and including date -double Project::plannedCostTo(const QDate &date) { +double Project::plannedCostTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCostTo(date); } @@ -930,7 +930,7 @@ double Project::plannedCostTo(const QDate &date) { double Project::actualCost() { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCost(); } @@ -938,10 +938,10 @@ double Project::actualCost() { } // Returns the total planned effort for this project (or subproject) on date -double Project::actualCost(const QDate &date) { +double Project::actualCost(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCost(date); } @@ -949,10 +949,10 @@ double Project::actualCost(const QDate &date) { } // Returns the total planned effort for this project (or subproject) upto and including date -double Project::actualCostTo(const QDate &date) { +double Project::actualCostTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCostTo(date); } @@ -964,13 +964,13 @@ void Project::addCalendar(Calendar *calendar) { m_calendars.append(calendar); } -Calendar *Project::calendar(const QString id) const { +Calendar *Project::calendar(const TQString id) const { return findCalendar(id); } -QPtrList<Calendar> Project::calendars() { - QPtrList<Calendar> list; - QPtrListIterator<Calendar> it = m_calendars; +TQPtrList<Calendar> Project::calendars() { + TQPtrList<Calendar> list; + TQPtrListIterator<Calendar> it = m_calendars; for (; it.current(); ++it) { if (!it.current()->isDeleted()) { list.append(it.current()); @@ -987,7 +987,7 @@ void Project::setStandardWorktime(StandardWorktime * worktime) { } bool Project::legalToLink(Node *par, Node *child) { - //kdDebug()<<k_funcinfo<<par.name()<<" ("<<par.numDependParentNodes()<<" parents) "<<child.name()<<" ("<<child.numDependChildNodes()<<" children)"<<endl; + //kdDebug()<<k_funcinfo<<par.name()<<" ("<<par.numDependParentNodes()<<" tqparents) "<<child.name()<<" ("<<child.numDependChildNodes()<<" tqchildren)"<<endl; if (!child || par->isDependChildOf(child)) { return false; @@ -1007,9 +1007,9 @@ bool Project::legalToLink(Node *par, Node *child) { bool Project::legalParents(Node *par, Node *child) { bool legal = true; - //kdDebug()<<k_funcinfo<<par->name()<<" ("<<par->numDependParentNodes()<<" parents) "<<child->name()<<" ("<<child->numDependChildNodes()<<" children)"<<endl; + //kdDebug()<<k_funcinfo<<par->name()<<" ("<<par->numDependParentNodes()<<" tqparents) "<<child->name()<<" ("<<child->numDependChildNodes()<<" tqchildren)"<<endl; for (int i=0; i < par->numDependParentNodes() && legal; ++i) { - Node *pNode = par->getDependParentNode(i)->parent(); + Node *pNode = par->getDependParentNode(i)->tqparent(); if (child->isParentOf(pNode) || pNode->isParentOf(child)) { //kdDebug()<<k_funcinfo<<"Found: "<<pNode->name()<<" is related to "<<child->name()<<endl; legal = false; @@ -1024,7 +1024,7 @@ bool Project::legalParents(Node *par, Node *child) { bool Project::legalChildren(Node *par, Node *child) { bool legal = true; - //kdDebug()<<k_funcinfo<<par->name()<<" ("<<par->numDependParentNodes()<<" parents) "<<child->name()<<" ("<<child->numDependChildNodes()<<" children)"<<endl; + //kdDebug()<<k_funcinfo<<par->name()<<" ("<<par->numDependParentNodes()<<" tqparents) "<<child->name()<<" ("<<child->numDependChildNodes()<<" tqchildren)"<<endl; for (int j=0; j < child->numDependChildNodes() && legal; ++j) { Node *cNode = child->getDependChildNode(j)->child(); if (par->isParentOf(cNode) || cNode->isParentOf(par)) { @@ -1037,11 +1037,11 @@ bool Project::legalChildren(Node *par, Node *child) { return legal; } -void Project::generateWBS(int count, WBSDefinition &def, QString wbs) { +void Project::generateWBS(int count, WBSDefinition &def, TQString wbs) { if (type() == Type_Subproject || def.level0Enabled()) { Node::generateWBS(count, def, wbs); } else { - QPtrListIterator<Node> it = m_nodes; + TQPtrListIterator<Node> it = m_nodes; for (int i=0; it.current(); ++it) { it.current()->generateWBS(++i, def, m_wbs); } @@ -1051,16 +1051,16 @@ void Project::generateWBS(int count, WBSDefinition &def, QString wbs) { void Project::setCurrentSchedule(long id) { setCurrentSchedulePtr(findSchedule(id)); Node::setCurrentSchedule(id); - QDictIterator<Resource> it = resourceIdDict; + TQDictIterator<Resource> it = resourceIdDict; for (; it.current(); ++it) { it.current()->setCurrentSchedule(id); } } -MainSchedule *Project::createSchedule(QString name, Schedule::Type type) { +MainSchedule *Project::createSchedule(TQString name, Schedule::Type type) { //kdDebug()<<k_funcinfo<<"No of schedules: "<<m_schedules.count()<<endl; long i=1; - while (m_schedules.find(i)) { + while (m_schedules.tqfind(i)) { ++i; } MainSchedule *sch = new MainSchedule(this, name, type, i); @@ -1068,30 +1068,30 @@ MainSchedule *Project::createSchedule(QString name, Schedule::Type type) { return sch; } -bool Project::removeCalendarId(const QString &id) { +bool Project::removeCalendarId(const TQString &id) { kdDebug()<<k_funcinfo<<"id="<<id<<endl; return calendarIdDict.remove(id); } -void Project::insertCalendarId(const QString &id, const Calendar *calendar) { +void Project::insertCalendarId(const TQString &id, const Calendar *calendar) { kdDebug()<<k_funcinfo<<"id="<<id<<": "<<calendar->name()<<endl; calendarIdDict.insert(id, calendar); } #ifndef NDEBUG -void Project::printDebug(bool children, QCString indent) { +void Project::printDebug(bool tqchildren, TQCString indent) { kdDebug()<<indent<<"+ Project node: "<<name()<<endl; indent += "!"; - QPtrListIterator<ResourceGroup> it(resourceGroups()); + TQPtrListIterator<ResourceGroup> it(resourceGroups()); for ( ; it.current(); ++it) it.current()->printDebug(indent); - Node::printDebug(children, indent); + Node::printDebug(tqchildren, indent); } -void Project::printCalendarDebug(QCString indent) { +void Project::printCalendarDebug(TQCString indent) { kdDebug()<<indent<<"-------- Calendars debug printout --------"<<endl; - QPtrListIterator<Calendar> it = m_calendars; + TQPtrListIterator<Calendar> it = m_calendars; for (; it.current(); ++it) { it.current()->printDebug(indent + "--"); kdDebug()<<endl; diff --git a/kplato/kptproject.h b/kplato/kptproject.h index 93953745..f9444d8b 100644 --- a/kplato/kptproject.h +++ b/kplato/kptproject.h @@ -29,9 +29,9 @@ #include "kptduration.h" #include "kptresource.h" -#include <qmap.h> -#include <qptrlist.h> -#include <qdict.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqdict.h> #include <klistview.h> #include <klocale.h> @@ -51,7 +51,7 @@ class StandardWorktime; */ class Project : public Node { public: - Project(Node *parent = 0); + Project(Node *tqparent = 0); ~Project(); /// Returns the node type. Can be Type_Project or Type_Subproject. @@ -87,20 +87,20 @@ public: */ Duration *getRandomDuration(); - virtual bool load(QDomElement &element); - virtual void save(QDomElement &element) const; + virtual bool load(TQDomElement &element); + virtual void save(TQDomElement &element) const; - QPtrList<ResourceGroup> &resourceGroups(); + TQPtrList<ResourceGroup> &resourceGroups(); virtual void addResourceGroup(ResourceGroup *resource); virtual void insertResourceGroup(unsigned int index, ResourceGroup *resource); void removeResourceGroup(ResourceGroup *resource); void removeResourceGroup(int number); ResourceGroup *takeResourceGroup(ResourceGroup *resource) - { return m_resourceGroups.take(m_resourceGroups.findRef(resource)); } + { return m_resourceGroups.take(m_resourceGroups.tqfindRef(resource)); } bool addTask( Node* task, Node* position ); bool addSubTask( Node* task, Node* position ); - bool addSubTask( Node* task, int index, Node* parent ); + bool addSubTask( Node* task, int index, Node* tqparent ); void delTask(Node *node); bool canIndentTask(Node* node); bool indentTask( Node* node ); @@ -110,52 +110,52 @@ public: bool moveTaskUp( Node* node ); bool canMoveTaskDown( Node* node ); bool moveTaskDown( Node* node ); - Task *createTask(Node* parent); - Task *createTask(Task &def, Node* parent); + Task *createTask(Node* tqparent); + Task *createTask(Task &def, Node* tqparent); /// Returns the resourcegroup with identity id. - ResourceGroup *group(QString id); + ResourceGroup *group(TQString id); /// Returns the resource with identity id. - Resource *resource(QString id); + Resource *resource(TQString id); - virtual EffortCostMap plannedEffortCostPrDay(const QDate &start, const QDate &end) const; + virtual EffortCostMap plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const; /// Returns the total planned effort for this project (or subproject) virtual Duration plannedEffort(); /// Returns the total planned effort for this project (or subproject) on date - virtual Duration plannedEffort(const QDate &date); + virtual Duration plannedEffort(const TQDate &date); /// Returns the planned effort up to and including date - virtual Duration plannedEffortTo(const QDate &date); + virtual Duration plannedEffortTo(const TQDate &date); /// Returns the actual effort virtual Duration actualEffort(); /// Returns the actual effort on date - virtual Duration actualEffort(const QDate &date); + virtual Duration actualEffort(const TQDate &date); /// Returns the actual effort up to and including date - virtual Duration actualEffortTo(const QDate &date); + virtual Duration actualEffortTo(const TQDate &date); /** * Returns the total planned cost for this project */ virtual double plannedCost(); /// Planned cost on date - virtual double plannedCost(const QDate &date); + virtual double plannedCost(const TQDate &date); /// Planned cost up to and including date - virtual double plannedCostTo(const QDate &date); + virtual double plannedCostTo(const TQDate &date); /** * Returns the actually reported cost for this project */ virtual double actualCost(); /// Actual cost on date - virtual double actualCost(const QDate &date); + virtual double actualCost(const TQDate &date); /// Actual cost up to and including date - virtual double actualCostTo(const QDate &date); + virtual double actualCostTo(const TQDate &date); Calendar *defaultCalendar() { return m_standardWorktime->calendar(); } - QPtrList<Calendar> calendars(); + TQPtrList<Calendar> calendars(); void addCalendar(Calendar *calendar); /// Returns the calendar with identity id. - Calendar *calendar(const QString id) const; + Calendar *calendar(const TQString id) const; /** * Defines the length of days, weeks, months and years @@ -169,45 +169,45 @@ public: /// Check if node par can be linked to node child. bool legalToLink(Node *par, Node *child); - virtual const QDict<Node> &nodeDict() { return nodeIdDict; } + virtual const TQDict<Node> &nodeDict() { return nodeIdDict; } /// Find the node with identity id - virtual Node *findNode(const QString &id) const - { return (m_parent ? m_parent->findNode(id) : nodeIdDict.find(id)); } + virtual Node *findNode(const TQString &id) const + { return (m_parent ? m_parent->findNode(id) : nodeIdDict.tqfind(id)); } /// Remove the node with identity id from the register - virtual bool removeId(const QString &id); + virtual bool removeId(const TQString &id); /// Insert the node with identity id - virtual void insertId(const QString &id, const Node *node); + virtual void insertId(const TQString &id, const Node *node); /// Register node. The nodes id must be unique and non-empty. bool registerNodeId(Node *node); /// Create a unique id. - QString uniqueNodeId(int seed=1); + TQString uniqueNodeId(int seed=1); - ResourceGroup *findResourceGroup(const QString &id) const - { return resourceGroupIdDict.find(id); } + ResourceGroup *findResourceGroup(const TQString &id) const + { return resourceGroupIdDict.tqfind(id); } /// Remove the resourcegroup with identity id from the register - bool removeResourceGroupId(const QString &id) + bool removeResourceGroupId(const TQString &id) { return resourceGroupIdDict.remove(id); } /// Insert the resourcegroup with identity id - void insertResourceGroupId(const QString &id, const ResourceGroup* group) + void insertResourceGroupId(const TQString &id, const ResourceGroup* group) { resourceGroupIdDict.insert(id, group); } - Resource *findResource(const QString &id) const - { return resourceIdDict.find(id); } + Resource *findResource(const TQString &id) const + { return resourceIdDict.tqfind(id); } /// Remove the resource with identity id from the register - bool removeResourceId(const QString &id) + bool removeResourceId(const TQString &id) { return resourceIdDict.remove(id); } /// Insert the resource with identity id - void insertResourceId(const QString &id, const Resource *resource) + void insertResourceId(const TQString &id, const Resource *resource) { resourceIdDict.insert(id, resource); } /// Find the calendar with identity id - virtual Calendar *findCalendar(const QString &id) const - { return id.isEmpty() ? 0 : calendarIdDict.find(id); } + virtual Calendar *findCalendar(const TQString &id) const + { return id.isEmpty() ? 0 : calendarIdDict.tqfind(id); } /// Remove the calendar with identity id from the register - virtual bool removeCalendarId(const QString &id); + virtual bool removeCalendarId(const TQString &id); /// Insert the calendar with identity id - virtual void insertCalendarId(const QString &id, const Calendar *calendar); + virtual void insertCalendarId(const TQString &id, const Calendar *calendar); /** * Setting a project to be baselined means the project data can not be edited anymore. @@ -219,22 +219,22 @@ public: */ bool isBaselined() const { return m_baselined; } - void generateWBS(int count, WBSDefinition &def, QString wbs=QString()); + void generateWBS(int count, WBSDefinition &def, TQString wbs=TQString()); Accounts &accounts() { return m_accounts; } - /// Set current schedule to schedule with identity id, for me and my children + /// Set current schedule to schedule with identity id, for me and my tqchildren virtual void setCurrentSchedule(long id); /// Create new schedule with unique id. - MainSchedule *createSchedule(QString name, Schedule::Type type); - /// Set parent schedule for my children + MainSchedule *createSchedule(TQString name, Schedule::Type type); + /// Set tqparent schedule for my tqchildren virtual void setParentSchedule(Schedule *sch); protected: Accounts m_accounts; - QPtrList<ResourceGroup> m_resourceGroups; + TQPtrList<ResourceGroup> m_resourceGroups; - QPtrList<Calendar> m_calendars; + TQPtrList<Calendar> m_calendars; StandardWorktime *m_standardWorktime; @@ -245,7 +245,7 @@ protected: void adjustSummarytask(); void initiateCalculation(Schedule &sch); - void initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> &endnodes, QPtrList<Node> &summarytasks); + void initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks); bool legalParents(Node *par, Node *child); bool legalChildren(Node *par, Node *child); @@ -253,25 +253,25 @@ protected: private: void init(); - QPtrList<Node> m_startNodes; - QPtrList<Node> m_endNodes; - QPtrList<Node> m_summarytasks; + TQPtrList<Node> m_startNodes; + TQPtrList<Node> m_endNodes; + TQPtrList<Node> m_summarytasks; bool m_baselined; - QDict<ResourceGroup> resourceGroupIdDict; - QDict<Resource> resourceIdDict; - QDict<Node> nodeIdDict; - QDict<Calendar> calendarIdDict; + TQDict<ResourceGroup> resourceGroupIdDict; + TQDict<Resource> resourceIdDict; + TQDict<Node> nodeIdDict; + TQDict<Calendar> calendarIdDict; #ifndef NDEBUG -#include <qcstring.h> +#include <tqcstring.h> public: - void printDebug(bool children, QCString indent); - void printCalendarDebug(QCString indent=""); + void printDebug(bool tqchildren, TQCString indent); + void printCalendarDebug(TQCString indent=""); #ifdef DEBUGPERT static void pert_test(); - static void printTree(Node *n, QString s); + static void printTree(Node *n, TQString s); #endif #endif }; diff --git a/kplato/kptprojectdialog.cc b/kplato/kptprojectdialog.cc index 6fe79067..add74c8e 100644 --- a/kplato/kptprojectdialog.cc +++ b/kplato/kptprojectdialog.cc @@ -17,15 +17,15 @@ * Boston, MA 02110-1301, USA. */ -#include <qpushbutton.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <qtextedit.h> -#include <qlineedit.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qtabwidget.h> -#include <qtextbrowser.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqtextedit.h> +#include <tqlineedit.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqtabwidget.h> +#include <tqtextbrowser.h> #include <kdatepicker.h> #include <klocale.h> @@ -44,8 +44,8 @@ namespace KPlato { -ProjectDialog::ProjectDialog(Project &p, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Project Settings"), Ok|Cancel, Ok, parent, name, true, true), +ProjectDialog::ProjectDialog(Project &p, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Project Settings"), Ok|Cancel, Ok, tqparent, name, true, true), project(p) { dia = new ProjectDialogImpl(this); @@ -57,21 +57,21 @@ ProjectDialog::ProjectDialog(Project &p, QWidget *parent, const char *name) dia->namefield->setText(project.name()); dia->leaderfield->setText(project.leader()); - connect(dia, SIGNAL( obligatedFieldsFilled(bool) ), this, SLOT( enableButtonOK(bool) )); - connect(dia, SIGNAL( schedulingTypeChanged(int) ), this, SLOT( slotSchedulingChanged(int) )); + connect(dia, TQT_SIGNAL( obligatedFieldsFilled(bool) ), this, TQT_SLOT( enableButtonOK(bool) )); + connect(dia, TQT_SIGNAL( schedulingTypeChanged(int) ), this, TQT_SLOT( slotSchedulingChanged(int) )); slotSchedulingChanged(dia->schedulerType->currentItem()); dia->namefield->setFocus(); - connect(resourcesTab, SIGNAL( changed() ), dia, SLOT( slotCheckAllFieldsFilled() )); + connect(resourcesTab, TQT_SIGNAL( changed() ), dia, TQT_SLOT( slotCheckAllFieldsFilled() )); } void ProjectDialog::slotOk() { project.setConstraint((Node::ConstraintType) dia->schedulerType->currentItem()); //FIXME - project.setStartTime(QDateTime(dia->schedulerDate->date(), dia->schedulerTime->time())); - project.setConstraintStartTime(QDateTime(dia->schedulerDate->date(), dia->schedulerTime->time())); + project.setStartTime(TQDateTime(dia->schedulerDate->date(), dia->schedulerTime->time())); + project.setConstraintStartTime(TQDateTime(dia->schedulerDate->date(), dia->schedulerTime->time())); project.setName(dia->namefield->text()); project.setLeader(dia->leaderfield->text()); @@ -87,28 +87,28 @@ void ProjectDialog::slotSchedulingChanged(int activated) { dia->schedulerTime->setEnabled(needDate); dia->schedulerDate->setEnabled(needDate); - QString label = QString("<p><font size=\"4\" color=\"#7797BC\"><b>%1</b></font></p><p>%2</p>"); + TQString label = TQString("<p><font size=\"4\" color=\"#7797BC\"><b>%1</b></font></p><p>%2</p>"); switch(activated) { // TODO please provide nice explenations on this. case 0: // ASAP - label = label.arg(i18n("As Soon as Possible")); - label = label.arg(i18n("Place all events at the earliest possible moment permitted in the schedule")); + label = label.tqarg(i18n("As Soon as Possible")); + label = label.tqarg(i18n("Place all events at the earliest possible moment permitted in the schedule")); break; case 1: // ALAP - label = label.arg(i18n("As Late as Possible")); - label = label.arg(i18n("Place all events at the last possible moment permitted in the schedule")); + label = label.tqarg(i18n("As Late as Possible")); + label = label.tqarg(i18n("Place all events at the last possible moment permitted in the schedule")); break; case 2: // Start not earlier then - label = label.arg(i18n("Start not Earlier then")); - label = label.arg(i18n("")); + label = label.tqarg(i18n("Start not Earlier then")); + label = label.tqarg(i18n("")); break; case 3: // Finish not later then - label = label.arg(i18n("Finish not Later then")); - label = label.arg(i18n("")); + label = label.tqarg(i18n("Finish not Later then")); + label = label.tqarg(i18n("")); break; case 4: // Must start on - label = label.arg(i18n("Must Start on")); - label = label.arg(i18n("")); + label = label.tqarg(i18n("Must Start on")); + label = label.tqarg(i18n("")); break; default: // error ... dia->lSchedulingExplain->setText(""); @@ -117,11 +117,11 @@ void ProjectDialog::slotSchedulingChanged(int activated) { dia->lSchedulingExplain->setText(label); } -ProjectDialogImpl::ProjectDialogImpl (QWidget *parent) : ProjectDialogBase(parent) { - connect (namefield, SIGNAL(textChanged( const QString& )), this, SLOT(slotCheckAllFieldsFilled()) ); - connect (leaderfield, SIGNAL(textChanged( const QString& )), this, SLOT(slotCheckAllFieldsFilled()) ); - connect (schedulerType, SIGNAL(activated( int )), this, SLOT(slotSchedulingChanged( int )) ); - connect (chooseLeader, SIGNAL(pressed()), this, SLOT(slotChooseLeader())); +ProjectDialogImpl::ProjectDialogImpl (TQWidget *tqparent) : ProjectDialogBase(tqparent) { + connect (namefield, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotCheckAllFieldsFilled()) ); + connect (leaderfield, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotCheckAllFieldsFilled()) ); + connect (schedulerType, TQT_SIGNAL(activated( int )), this, TQT_SLOT(slotSchedulingChanged( int )) ); + connect (chooseLeader, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChooseLeader())); } void ProjectDialogImpl::slotCheckAllFieldsFilled() { diff --git a/kplato/kptprojectdialog.h b/kplato/kptprojectdialog.h index 4e14a529..0f9cc95e 100644 --- a/kplato/kptprojectdialog.h +++ b/kplato/kptprojectdialog.h @@ -26,7 +26,7 @@ #include <kdialogbase.h> -#include <qstring.h> +#include <tqstring.h> namespace KPlato { @@ -37,8 +37,9 @@ class ResourcesPanel; class ProjectDialogImpl : public ProjectDialogBase { Q_OBJECT + TQ_OBJECT public: - ProjectDialogImpl (QWidget *parent); + ProjectDialogImpl (TQWidget *tqparent); private slots: void slotCheckAllFieldsFilled(); @@ -52,8 +53,9 @@ signals: class ProjectDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ProjectDialog(Project &project, QWidget *parent=0, + ProjectDialog(Project &project, TQWidget *tqparent=0, const char *name=0); diff --git a/kplato/kptprojectdialogbase.ui b/kplato/kptprojectdialogbase.ui index 5c602aee..4bffc0e2 100644 --- a/kplato/kptprojectdialogbase.ui +++ b/kplato/kptprojectdialogbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>KPlato::ProjectDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ProjectDialogBase</cstring> </property> @@ -16,11 +16,11 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTabWidget"> + <widget class="TQTabWidget"> <property name="name"> <cstring>daTabs</cstring> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -31,15 +31,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit" row="0" column="1" rowspan="1" colspan="2"> + <widget class="TQLineEdit" row="0" column="1" rowspan="1" colspan="2"> <property name="name"> <cstring>namefield</cstring> </property> @@ -50,7 +50,7 @@ <string>Give a name to the project to identify it. Example can be 'rewrite explorer' or 'housing project C2'</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -61,12 +61,12 @@ <cstring>leaderfield</cstring> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>leaderfield</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -77,7 +77,7 @@ <cstring>namefield</cstring> </property> </widget> - <widget class="QPushButton" row="1" column="2"> + <widget class="TQPushButton" row="1" column="2"> <property name="name"> <cstring>chooseLeader</cstring> </property> @@ -87,7 +87,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -101,7 +101,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>ASAP</string> @@ -131,14 +131,14 @@ <cstring>schedulerType</cstring> </property> </widget> - <widget class="QTextBrowser"> + <widget class="TQTextBrowser"> <property name="name"> <cstring>lSchedulingExplain</cstring> </property> </widget> </vbox> </widget> - <widget class="QGroupBox" row="1" column="1"> + <widget class="TQGroupBox" row="1" column="1"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -153,14 +153,14 @@ <property name="name"> <cstring>schedulerDate</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>200</height> </size> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>checkBox1</cstring> </property> @@ -168,7 +168,7 @@ <string>Specify time:</string> </property> </widget> - <widget class="QTimeEdit" row="1" column="1"> + <widget class="TQTimeEdit" row="1" column="1"> <property name="name"> <cstring>schedulerTime</cstring> </property> @@ -201,7 +201,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>121</width> <height>20</height> @@ -212,7 +212,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -223,7 +223,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -234,7 +234,7 @@ <cstring>descriptionfield</cstring> </property> </widget> - <widget class="QTextEdit"> + <widget class="TQTextEdit"> <property name="name"> <cstring>descriptionfield</cstring> </property> @@ -252,7 +252,7 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatepicker.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kplato/kptrelation.cc b/kplato/kptrelation.cc index e4cf7b26..3814c51c 100644 --- a/kplato/kptrelation.cc +++ b/kplato/kptrelation.cc @@ -23,37 +23,37 @@ #include "kptproject.h" #include "kptcanvasitem.h" -#include <qcanvas.h> -#include <qdom.h> +#include <tqcanvas.h> +#include <tqdom.h> #include <kdebug.h> namespace KPlato { -Relation::Relation(Node *parent, Node *child, Type type, Duration lag) { - m_parent=parent; +Relation::Relation(Node *tqparent, Node *child, Type type, Duration lag) { + m_parent=tqparent; m_child=child; m_type=type; m_lag=lag; } -Relation::Relation(Node *parent, Node *child, Type type) { - m_parent=parent; +Relation::Relation(Node *tqparent, Node *child, Type type) { + m_parent=tqparent; m_child=child; m_type=type; m_lag=Duration(); } Relation::Relation(Relation *rel) { - m_parent=rel->parent(); + m_parent=rel->tqparent(); m_child=rel->child(); m_type=rel->type(); m_lag=rel->lag(); } Relation::~Relation() { - //kdDebug()<<k_funcinfo<<"parent: "<<(m_parent ? m_parent->name():"none")<<" child: "<<(m_child ? m_child->name():"None")<<endl; + //kdDebug()<<k_funcinfo<<"tqparent: "<<(m_parent ? m_parent->name():"none")<<" child: "<<(m_child ? m_child->name():"None")<<endl; if (m_parent) m_parent->takeDependChildNode(this); if (m_child) @@ -65,8 +65,8 @@ void Relation::setType(Type type) { } -bool Relation::load(QDomElement &element, Project &project) { - m_parent = project.findNode(element.attribute("parent-id")); +bool Relation::load(TQDomElement &element, Project &project) { + m_parent = project.findNode(element.attribute("tqparent-id")); if (m_parent == 0) { return false; } @@ -75,13 +75,13 @@ bool Relation::load(QDomElement &element, Project &project) { return false; } if (m_child == m_parent) { - kdDebug()<<k_funcinfo<<"child == parent"<<endl; + kdDebug()<<k_funcinfo<<"child == tqparent"<<endl; return false; } if (!m_parent->legalToLink(m_child)) return false; - QString tr = element.attribute("type"); + TQString tr = element.attribute("type"); if ( tr == "Finish-Start" ) m_type = FinishStart; else if ( tr == "Finish-Finish" ) @@ -94,27 +94,27 @@ bool Relation::load(QDomElement &element, Project &project) { m_lag = Duration::fromString(element.attribute("lag")); if (!m_parent->addDependChildNode(this)) { - kdError()<<k_funcinfo<<"Failed to add relation: Child="<<m_child->name()<<" parent="<<m_parent->name()<<endl; + kdError()<<k_funcinfo<<"Failed to add relation: Child="<<m_child->name()<<" tqparent="<<m_parent->name()<<endl; return false; } if (!m_child->addDependParentNode(this)) { m_parent->delDependChildNode(this, false/*do not delete*/); - kdError()<<k_funcinfo<<"Failed to add relation: Child="<<m_child->name()<<" parent="<<m_parent->name()<<endl; + kdError()<<k_funcinfo<<"Failed to add relation: Child="<<m_child->name()<<" tqparent="<<m_parent->name()<<endl; return false; } - //kdDebug()<<k_funcinfo<<"Added relation: Child="<<m_child->name()<<" parent="<<m_parent->name()<<endl; + //kdDebug()<<k_funcinfo<<"Added relation: Child="<<m_child->name()<<" tqparent="<<m_parent->name()<<endl; return true; } -void Relation::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("relation"); +void Relation::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("relation"); element.appendChild(me); - me.setAttribute("parent-id", m_parent->id()); + me.setAttribute("tqparent-id", m_parent->id()); me.setAttribute("child-id", m_child->id()); - QString type = "Finish-Start"; + TQString type = "Finish-Start"; switch (m_type) { case FinishStart: type = "Finish-Start"; @@ -131,7 +131,7 @@ void Relation::save(QDomElement &element) const { } #ifndef NDEBUG -void Relation::printDebug(QCString indent) { +void Relation::printDebug(TQCString indent) { indent += " "; kdDebug()<<indent<<" Parent: "<<m_parent->name()<<endl; kdDebug()<<indent<<" Child: "<<m_child->name()<<endl; diff --git a/kplato/kptrelation.h b/kplato/kptrelation.h index 2ae6032d..35c2869a 100644 --- a/kplato/kptrelation.h +++ b/kplato/kptrelation.h @@ -23,10 +23,10 @@ #include "kptduration.h" -#include <qstring.h> +#include <tqstring.h> -class QCanvas; -class QDomElement; +class TQCanvas; +class TQDomElement; namespace KPlato { @@ -46,13 +46,13 @@ class Relation { public: enum Type { FinishStart, FinishFinish, StartStart }; - Relation(Node *parent, Node *child, Type type, Duration lag); - Relation(Node *parent=0, Node *child=0, Type type=FinishStart); + Relation(Node *tqparent, Node *child, Type type, Duration lag); + Relation(Node *tqparent=0, Node *child=0, Type type=FinishStart); Relation(Relation *rel); /** * When deleted the relation will remove itself from - * the parent- and child nodes lists + * the tqparent- and child nodes lists */ virtual ~Relation(); @@ -60,16 +60,16 @@ public: Type type() const { return m_type; } /** returns the lag. - * The lag of a relation is the time it takes between the parent starting/stopping + * The lag of a relation is the time it takes between the tqparent starting/stopping * and the start of the child. */ const Duration &lag() const { return m_lag; } void setLag(Duration lag) { m_lag = lag; } /** - * @return The parent dependent node. + * @return The tqparent dependent node. */ - Node *parent() const { return m_parent; } + Node *tqparent() const { return m_parent; } /** * @return The child dependent node. */ @@ -81,8 +81,8 @@ public: NOTIMPL = 2l }; - bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; protected: // variables Node *m_parent; @@ -91,11 +91,11 @@ protected: // variables Duration m_lag; private: - QString m_parentId; + TQString m_parentId; #ifndef NDEBUG public: - void printDebug(QCString indent); + void printDebug(TQCString indent); #endif }; @@ -103,8 +103,8 @@ public: class ProxyRelation : public Relation { public: - ProxyRelation(Node *parent, Node *child, Relation::Type type, Duration lag) - : Relation(parent, child, type, lag) + ProxyRelation(Node *tqparent, Node *child, Relation::Type type, Duration lag) + : Relation(tqparent, child, type, lag) {} ~ProxyRelation() { m_parent = 0; m_child = 0;} diff --git a/kplato/kptrelationdialog.cc b/kplato/kptrelationdialog.cc index ec936af5..938496b0 100644 --- a/kplato/kptrelationdialog.cc +++ b/kplato/kptrelationdialog.cc @@ -25,11 +25,11 @@ #include "kptdurationwidget.h" #include "relationpanel.h" -#include <qlayout.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> #include <kmessagebox.h> #include <klocale.h> @@ -39,7 +39,7 @@ namespace KPlato { -AddRelationDialog::AddRelationDialog(Relation *rel, QWidget *p, QString caption, int buttons, const char *n) +AddRelationDialog::AddRelationDialog(Relation *rel, TQWidget *p, TQString caption, int buttons, const char *n) : KDialogBase(Swallow, caption, buttons, Ok, p, n, true, true) { if (caption.isEmpty()) @@ -49,7 +49,7 @@ AddRelationDialog::AddRelationDialog(Relation *rel, QWidget *p, QString caption, setMainWidget(m_panel); m_panel->setActiveWindow(); - m_panel->fromName->setText(rel->parent()->name()); + m_panel->fromName->setText(rel->tqparent()->name()); m_panel->toName->setText(rel->child()->name()); m_panel->relationType->setButton(rel->type()); @@ -61,8 +61,8 @@ AddRelationDialog::AddRelationDialog(Relation *rel, QWidget *p, QString caption, m_panel->relationType->setFocus(); enableButtonOK(true); - connect(m_panel->relationType, SIGNAL(clicked(int)), SLOT(typeClicked(int))); - connect(m_panel->lag, SIGNAL(valueChanged()), SLOT(lagChanged())); + connect(m_panel->relationType, TQT_SIGNAL(clicked(int)), TQT_SLOT(typeClicked(int))); + connect(m_panel->lag, TQT_SIGNAL(valueChanged()), TQT_SLOT(lagChanged())); } KCommand *AddRelationDialog::buildCommand(Part *part) { @@ -88,7 +88,7 @@ void AddRelationDialog::typeClicked(int id) { ////////////////// -ModifyRelationDialog::ModifyRelationDialog(Relation *rel, QWidget *p, const char *n) +ModifyRelationDialog::ModifyRelationDialog(Relation *rel, TQWidget *p, const char *n) : AddRelationDialog(rel, p, i18n("Edit Relationship"), Ok|Cancel|User1, n) { setButtonText( KDialogBase::User1, i18n("Delete") ); diff --git a/kplato/kptrelationdialog.h b/kplato/kptrelationdialog.h index 22cebde0..6abeb3d0 100644 --- a/kplato/kptrelationdialog.h +++ b/kplato/kptrelationdialog.h @@ -23,7 +23,7 @@ #include <kdialogbase.h> -class QButtonGroup; +class TQButtonGroup; class KCommand; namespace KPlato @@ -40,8 +40,9 @@ class ModifyRelationTypeCmd; class AddRelationDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AddRelationDialog(Relation *rel, QWidget *p, QString caption=QString::null, int buttons=Ok|Cancel, const char *n=0); + AddRelationDialog(Relation *rel, TQWidget *p, TQString caption=TQString(), int buttons=Ok|Cancel, const char *n=0); virtual KCommand *buildCommand(Part *part); @@ -52,7 +53,7 @@ protected slots: protected: RelationPanel *m_panel; - QButtonGroup *relationType; + TQButtonGroup *relationType; Relation *m_relation; DurationWidget *m_lag; }; @@ -61,8 +62,9 @@ protected: class ModifyRelationDialog : public AddRelationDialog { Q_OBJECT + TQ_OBJECT public: - ModifyRelationDialog(Relation *rel, QWidget *p=0, const char *n=0); + ModifyRelationDialog(Relation *rel, TQWidget *p=0, const char *n=0); virtual KCommand *buildCommand(Part *part); bool relationIsDeleted() { return m_deleted; } diff --git a/kplato/kptreportview.cc b/kplato/kptreportview.cc index d5e964c7..abcf1904 100644 --- a/kplato/kptreportview.cc +++ b/kplato/kptreportview.cc @@ -41,13 +41,13 @@ #include <kdesktopfile.h> #include <kfiledialog.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qheader.h> -#include <qpopupmenu.h> -#include <qlayout.h> -#include <qdom.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqheader.h> +#include <tqpopupmenu.h> +#include <tqlayout.h> +#include <tqdom.h> +#include <tqstringlist.h> namespace KPlato { @@ -70,70 +70,70 @@ public: ~ReportTagsPrivate() {} - QString getData(QString source, QString tag) const { - if (tag.contains(".")) + TQString getData(TQString source, TQString tag) const { + if (tag.tqcontains(".")) return getData(tag); return getData(source + "." + tag); } - QString getData(QString tag) const { + TQString getData(TQString tag) const { //kdDebug()<<k_funcinfo<<"tag="<<tag<<endl; KLocale *l = KGlobal::locale(); - if (!tag.contains('.')) { + if (!tag.tqcontains('.')) { // global tags if (tag == "currentdate") { - return l->formatDate(QDate::currentDate(), true); + return l->formatDate(TQDate::tqcurrentDate(), true); } - return QString::null; + return TQString(); } if (tag.section(".", 0, 0) == "project") { if (tag.section(".", 1, 1) == "name") - return (m_project ? m_project->name() : QString::null); + return (m_project ? m_project->name() : TQString()); if (tag.section(".", 1, 1) == "leader") - return (m_project ? m_project->leader() : QString::null); + return (m_project ? m_project->leader() : TQString()); } else if (tag.section(".", 0, 0) == "task") { if (tag.section(".", 1, 1) == "name") - return (m_task ? m_task->name() : QString::null); + return (m_task ? m_task->name() : TQString()); if (tag.section(".", 1, 1) == "responsible") - return (m_task ? m_task->leader() : QString::null); + return (m_task ? m_task->leader() : TQString()); else if (tag.section(".", 1, 1) == "wbs") - return (m_task ? m_task->wbs() : QString::null); + return (m_task ? m_task->wbs() : TQString()); else if (tag.section(".", 1, 1) == "start") - return (m_task ? l->formatDateTime(m_task->startTime()) : QString::null); + return (m_task ? l->formatDateTime(m_task->startTime()) : TQString()); else if (tag.section(".", 1, 1) == "starttime") - return (m_task ? l->formatTime(m_task->startTime().time()) : QString::null); + return (m_task ? l->formatTime(m_task->startTime().time()) : TQString()); else if (tag.section(".", 1, 1) == "startdate") - return (m_task ? l->formatDate(m_task->startTime().date(), true) : QString::null); + return (m_task ? l->formatDate(m_task->startTime().date(), true) : TQString()); else if (tag.section(".", 1, 1) == "duration") { - return (m_task ? m_task->duration().toString(Duration::Format_i18nDayTime) : QString::null); + return (m_task ? m_task->duration().toString(Duration::Format_i18nDayTime) : TQString()); } else if (tag.section(".", 1, 1) == "plannedcost") { - return (m_task ? l->formatMoney(m_task->plannedCost()) : QString::null); + return (m_task ? l->formatMoney(m_task->plannedCost()) : TQString()); } } else if (tag.section(".", 0, 0) == "resourcegroup") { if (tag.section(".", 1, 1) == "name") - return (m_resourcegroup ? m_resourcegroup->name() : QString::null); + return (m_resourcegroup ? m_resourcegroup->name() : TQString()); } else if (tag.section(".", 0, 0) == "resource") { if (tag.section(".", 1, 1) == "name") - return (m_resource ? m_resource->name() : QString::null); + return (m_resource ? m_resource->name() : TQString()); if (tag.section(".", 1, 1) == "type") - return (m_resource ? m_resource->typeToString() : QString::null); + return (m_resource ? m_resource->typeToString() : TQString()); if (tag.section(".", 1, 1) == "email") - return (m_resource ? m_resource->email() : QString::null); + return (m_resource ? m_resource->email() : TQString()); if (tag.section(".", 1, 1) == "availablefrom") - return (m_resource ? l->formatDate(m_resource->availableFrom().date(), true) : QString::null); + return (m_resource ? l->formatDate(m_resource->availableFrom().date(), true) : TQString()); if (tag.section(".", 1, 1) == "availableuntil") - return (m_resource ? l->formatDate(m_resource->availableUntil().date(), true) : QString::null); + return (m_resource ? l->formatDate(m_resource->availableUntil().date(), true) : TQString()); if (tag.section(".", 1, 1) == "units") - return (m_resource ? QString("%1%").arg(m_resource->units()) : QString::null); + return (m_resource ? TQString("%1%").tqarg(m_resource->units()) : TQString()); if (tag.section(".", 1, 1) == "normalrate") - return (m_resource ? l->formatMoney(m_resource->normalRate()) : QString::null); + return (m_resource ? l->formatMoney(m_resource->normalRate()) : TQString()); if (tag.section(".", 1, 1) == "overtimerate") - return (m_resource ? l->formatMoney(m_resource->overtimeRate()) : QString::null); + return (m_resource ? l->formatMoney(m_resource->overtimeRate()) : TQString()); } - return QString::null; + return TQString(); } Project *m_project; @@ -141,25 +141,25 @@ public: ResourceGroup *m_resourcegroup; Resource *m_resource; - QString alltasksLevel; - QStringList alltasksProps; - QString summarytasksLevel; - QStringList summarytasksProps; - QString tasksLevel; - QStringList tasksProps; - QString milestonesLevel; - QStringList milestonesProps; - QString resourcegroupsLevel; - QStringList resourcegroupsProps; - QString resourcesLevel; - QStringList resourcesProps; + TQString alltasksLevel; + TQStringList alltasksProps; + TQString summarytasksLevel; + TQStringList summarytasksProps; + TQString tasksLevel; + TQStringList tasksProps; + TQString milestonesLevel; + TQStringList milestonesProps; + TQString resourcegroupsLevel; + TQStringList resourcegroupsProps; + TQString resourcesLevel; + TQStringList resourcesProps; }; class KugarReportViewer : public Kugar::MReportViewer { public: - KugarReportViewer(QWidget *parent = 0, const char *name = 0) - : MReportViewer(parent, name) + KugarReportViewer(TQWidget *tqparent = 0, const char *name = 0) + : MReportViewer(tqparent, name) {} int currentPage() { @@ -170,8 +170,8 @@ public: } }; -ReportView::ReportView(View *view, QWidget *parent) - : QSplitter(parent), +ReportView::ReportView(View *view, TQWidget *tqparent) + : TQSplitter(tqparent), m_mainview(view), m_reportTags(0) { @@ -188,17 +188,17 @@ ReportView::ReportView(View *view, QWidget *parent) initReportList(); - connect(m_reportList, SIGNAL(clicked(QListViewItem*)), SLOT(slotReportListClicked(QListViewItem*))); - connect(m_reportList, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotReportListSelectionChanged(QListViewItem*))); + connect(m_reportList, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(slotReportListClicked(TQListViewItem*))); + connect(m_reportList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotReportListSelectionChanged(TQListViewItem*))); //setCentralWidget(m_reportview); // Create the user interface. - //KStdAction::print(this,SLOT(slotPrint()),actionCollection()); - //KStdAction::quit(this,SLOT(slotFileQuit()),actionCollection()); + //KStdAction::print(this,TQT_SLOT(slotPrint()),actionCollection()); + //KStdAction::quit(this,TQT_SLOT(slotFileQuit()),actionCollection()); -// KStdAction::showToolbar(this,SLOT(slotViewToolBar()),actionCollection()); -// KStdAction::showStatusbar(this,SLOT(slotViewStatusBar()),actionCollection()); +// KStdAction::showToolbar(this,TQT_SLOT(slotViewToolBar()),actionCollection()); +// KStdAction::showStatusbar(this,TQT_SLOT(slotViewStatusBar()),actionCollection()); // statusBar(); @@ -215,19 +215,19 @@ ReportView::~ReportView() { void ReportView::initReportList() { //FIXME: We need a solution that takes care project specific reports. //kdDebug()<<k_funcinfo<<endl; - QStringList list; + TQStringList list; m_reportList->clear(); KStandardDirs std; - QStringList reportDesktopFiles = std.findAllResources("data", "kplato/reports/*.desktop", true, true); - for (QStringList::iterator it = reportDesktopFiles.begin(); it != reportDesktopFiles.end(); ++it) { + TQStringList reportDesktopFiles = std.findAllResources("data", "kplato/reports/*.desktop", true, true); + for (TQStringList::iterator it = reportDesktopFiles.begin(); it != reportDesktopFiles.end(); ++it) { KDesktopFile file((*it), true); - QString name = file.readName(); + TQString name = file.readName(); if (!name.isNull()) { //kdDebug()<<" file: "<<*it<<" name="<<name<<endl; - QString url = file.readURL(); + TQString url = file.readURL(); if (!url.isNull()) { if (url.left(1) != "/" || url.left(6) != "file:/") { - QString path = (*it).left((*it).findRev('/', -1)+1); // include '/' + TQString path = (*it).left((*it).tqfindRev('/', -1)+1); // include '/' url = path + url; } m_reportList->insertItem(new ReportItem(m_reportList, name, url)); @@ -236,7 +236,7 @@ void ReportView::initReportList() { } } -void ReportView::draw(const QString &report) { +void ReportView::draw(const TQString &report) { //kdDebug()<<k_funcinfo<<endl; m_reportview->clearReport(); m_reportTags = new ReportTagsPrivate(); @@ -262,7 +262,7 @@ void ReportView::print(KPrinter &printer) { // Generate report data based on info from the template file void ReportView::setReportData() { - QString s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; + TQString s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; s+="<KugarData>\n"; s += setReportDetail(); s+="</KugarData>\n"; @@ -270,9 +270,9 @@ void ReportView::setReportData() { m_reportview->setReportData(s); } -QString ReportView::setReportDetail() { +TQString ReportView::setReportDetail() { //kdDebug()<<k_funcinfo<<endl; - QString s; + TQString s; if (m_reportTags->alltasksLevel != "-1") { //kdDebug()<<k_funcinfo<<"alltasks level="<<m_reportTags->alltasksLevel<<endl; if (m_reportTags->summarytasksLevel == "-1") { @@ -291,7 +291,7 @@ QString ReportView::setReportDetail() { } else if (m_reportTags->summarytasksLevel == "0") { // make a report that has summarytasks as starting points - QPtrListIterator<Node> it(mainView()->getProject().childNodeIterator()); + TQPtrListIterator<Node> it(mainView()->getProject().childNodeIterator()); for (; it.current(); ++it) { if (it.current()->type() == Node::Type_Summarytask) { s += setTaskDetail(it.current()); @@ -302,7 +302,7 @@ QString ReportView::setReportDetail() { } else if (m_reportTags->tasksLevel == "0") { // make a report that has tasks as starting points - QPtrListIterator<Node> it(mainView()->getProject().childNodeIterator()); + TQPtrListIterator<Node> it(mainView()->getProject().childNodeIterator()); for (; it.current(); ++it) { if (it.current()->type() == Node::Type_Task) { s += setTaskDetail(it.current()); @@ -319,16 +319,16 @@ QString ReportView::setReportDetail() { } else if (m_reportTags->resourcegroupsLevel == "0") { // make a report that has resourcegroups as starting points - QPtrListIterator<ResourceGroup> it(mainView()->getProject().resourceGroups()); + TQPtrListIterator<ResourceGroup> it(mainView()->getProject().resourceGroups()); for (; it.current(); ++it) { s += setResourceGroupDetail(it.current()); } } else if (m_reportTags->resourcesLevel == "0") { // make a report that has resources as starting points - QPtrListIterator<ResourceGroup> it(mainView()->getProject().resourceGroups()); + TQPtrListIterator<ResourceGroup> it(mainView()->getProject().resourceGroups()); for (; it.current(); ++it) { - QPtrListIterator<Resource> rit(it.current()->resources()); + TQPtrListIterator<Resource> rit(it.current()->resources()); for (; rit.current(); ++rit) { s += setResourceDetail(rit.current()); } @@ -338,14 +338,14 @@ QString ReportView::setReportDetail() { return s; } -QString ReportView::setResourceGroupDetail(ResourceGroup *group) { +TQString ReportView::setResourceGroupDetail(ResourceGroup *group) { //kdDebug()<<k_funcinfo<<group->name()<<endl; - QString s; + TQString s; if (m_reportTags->resourcegroupsLevel != "-1") { m_reportTags->m_resourcegroup = group; //kdDebug()<<k_funcinfo<<group->name()<<": level="<<m_reportTags->resourcegroupsLevel<<endl; s = setDetail("resourcegroup", m_reportTags->resourcegroupsProps, m_reportTags->resourcegroupsLevel); - QPtrListIterator<Resource> rit(group->resources()); + TQPtrListIterator<Resource> rit(group->resources()); for (; rit.current(); ++rit) { s += setResourceDetail(rit.current()); } @@ -353,9 +353,9 @@ QString ReportView::setResourceGroupDetail(ResourceGroup *group) { return s; } -QString ReportView::setResourceDetail(Resource *res) { +TQString ReportView::setResourceDetail(Resource *res) { //kdDebug()<<k_funcinfo<<res->name()<<endl; - QString s; + TQString s; if (m_reportTags->resourcesLevel != "-1") { m_reportTags->m_resource = res; //kdDebug()<<k_funcinfo<<res->name()<<": level="<<m_reportTags->resourcesLevel<<endl; @@ -364,10 +364,10 @@ QString ReportView::setResourceDetail(Resource *res) { return s; } -QString ReportView::setTaskChildren(Node *node) { +TQString ReportView::setTaskChildren(Node *node) { //kdDebug()<<k_funcinfo<<endl; - QString s; - QPtrListIterator<Node> it(node->childNodeIterator()); + TQString s; + TQPtrListIterator<Node> it(node->childNodeIterator()); for (; it.current(); ++it) { s += setTaskDetail(it.current()); if (it.current()->type() == Node::Type_Summarytask) @@ -376,11 +376,11 @@ QString ReportView::setTaskChildren(Node *node) { return s; } -QString ReportView::setTaskDetail(Node *node) { +TQString ReportView::setTaskDetail(Node *node) { //kdDebug()<<k_funcinfo<<endl; - QString s; - QStringList props; - QString level = "-1"; + TQString s; + TQStringList props; + TQString level = "-1"; if (node->type() == Node::Type_Task) { props = m_reportTags->tasksProps; level = m_reportTags->tasksLevel; @@ -398,18 +398,18 @@ QString ReportView::setTaskDetail(Node *node) { return s; } -QString ReportView::setDetail(const QString & source, QStringList &properties, QString &level) { - QString s = "<Row"; +TQString ReportView::setDetail(const TQString & source, TQStringList &properties, TQString &level) { + TQString s = "<Row"; s += " level=\"" + level + "\""; for (unsigned int i=0; i < properties.count(); ++i) { //kdDebug()<<k_funcinfo<<"Property: "<<properties[i]<<endl; s += " " + properties[i].section('=', 0, 0) + "="; // Field - QString data = m_reportTags->getData(source, properties[i].section('=', 1, 1)); + TQString data = m_reportTags->getData(source, properties[i].section('=', 1, 1)); if (data.isNull()) data = ""; - data = data.replace('<', "<"); - data = data.replace('>', ">"); - data = data.replace('"', """); + data = data.tqreplace('<', "<"); + data = data.tqreplace('>', ">"); + data = data.tqreplace('"', """); s += "\"" + data + "\""; // Property //kdDebug()<<k_funcinfo<<s<<endl; @@ -419,13 +419,13 @@ QString ReportView::setDetail(const QString & source, QStringList &properties, Q } // Most of this is from KoDocument::loadNativeFormat -void ReportView::openTemplateFile(const QString &file) { - if (!QFileInfo(file).isFile()) { +void ReportView::openTemplateFile(const TQString &file) { + if (!TQFileInfo(file).isFile()) { KMessageBox::sorry( this, i18n("Cannot find report template file!"), i18n("Generate Report")); return; } - QFile in; + TQFile in; in.setName(file); if (!in.open(IO_ReadOnly)) { KMessageBox::sorry( this, i18n("Cannot open report template file!"), @@ -470,21 +470,21 @@ void ReportView::openTemplateFile(const QString &file) { store->close(); } -void ReportView::loadTemplate(QIODevice &dev) { - QString errorMsg; +void ReportView::loadTemplate(TQIODevice &dev) { + TQString errorMsg; int errorLine; int errorColumn; if (!templateDoc.setContent( &dev , &errorMsg, &errorLine, &errorColumn)) { - QString msg = "Parsing template file failed with "; + TQString msg = "Parsing template file failed with "; KMessageBox::sorry( this, msg + errorMsg, i18n("Generate Report")); return; } loadTemplate(templateDoc); } -void ReportView::loadTemplate(QDomDocument &doc) { - QDomNode tpl; - QDomNode child; +void ReportView::loadTemplate(TQDomDocument &doc) { + TQDomNode tpl; + TQDomNode child; for (tpl = doc.firstChild(); !tpl.isNull(); tpl = tpl.nextSibling()) if (tpl.nodeName() == "KugarTemplate") break; @@ -494,13 +494,13 @@ void ReportView::loadTemplate(QDomDocument &doc) { m_reportTags->m_project = &(mainView()->getPart()->getProject()); // Get all the child report elements - QDomNodeList children = tpl.childNodes(); - int childCount = children.length(); + TQDomNodeList tqchildren = tpl.childNodes(); + int childCount = tqchildren.length(); for(int j = 0; j < childCount; j++){ - child = children.item(j); - if(child.nodeType() == QDomNode::ElementNode) { - QDomElement e = child.toElement(); + child = tqchildren.item(j); + if(child.nodeType() == TQDomNode::ElementNode) { + TQDomElement e = child.toElement(); //kdDebug()<<child.nodeName()<<endl; // Report Header if(child.nodeName() == "ReportHeader") { @@ -524,50 +524,50 @@ void ReportView::loadTemplate(QDomDocument &doc) { } } -void ReportView::handleHeader(QDomNode &node) { - QDomNode child; - QDomNodeList children = node.childNodes(); - int childCount = children.length(); +void ReportView::handleHeader(TQDomNode &node) { + TQDomNode child; + TQDomNodeList tqchildren = node.childNodes(); + int childCount = tqchildren.length(); for (int j = 0; j < childCount; j++) { - child = children.item(j); + child = tqchildren.item(j); if (child.nodeName() == "Label") { - QDomNode n = child.attributes().namedItem("Text"); - QString s = n.nodeValue(); + TQDomNode n = child.attributes().namedItem("Text"); + TQString s = n.nodeValue(); if (!s.isEmpty()) { // Translate labels s = i18n(n.nodeValue().latin1()); //NOTE: Not sure if latin1 is ok } - QString r = s; + TQString r = s; int i = 0, j = 0; do { i = j; - if ( ((i = s.find('[', i)) != -1) && ((j = s.find(']', i+1)) != -1) ) { - QString tag = s.mid(i, j-i+1); - QString data = m_reportTags->getData(tag.mid(1, tag.length()-2)); - r = r.replace(tag, data); + if ( ((i = s.tqfind('[', i)) != -1) && ((j = s.tqfind(']', i+1)) != -1) ) { + TQString tag = s.mid(i, j-i+1); + TQString data = m_reportTags->getData(tag.mid(1, tag.length()-2)); + r = r.tqreplace(tag, data); } } while (i != -1 && j != -1); n.setNodeValue(r); //kdDebug()<<" new Text="<<n.nodeValue()<<endl; } else if (child.nodeName() == "Field") { - QDomElement e = child.toElement(); + TQDomElement e = child.toElement(); if (!e.isElement()) { continue; // !!!!! } - QString s = e.attribute("Field"); - QString data = m_reportTags->getData(s); + TQString s = e.attribute("Field"); + TQString data = m_reportTags->getData(s); e.setAttribute("Text", data); //kdDebug()<<" new Text="<<e.attribute("Text")<<endl; } } } -QStringList ReportView::getProperties(QDomElement &elem) { - QStringList props; - QDomNodeList list(elem.childNodes()); +TQStringList ReportView::getProperties(TQDomElement &elem) { + TQStringList props; + TQDomNodeList list(elem.childNodes()); int childCount = list.length(); for (int j = 0; j < childCount; j++) { - QDomNode child = list.item(j); + TQDomNode child = list.item(j); if (child.nodeName() == "Field") { props.append(child.attributes().namedItem("Field").nodeValue()+"="+child.attributes().namedItem("Field").nodeValue()); } @@ -575,24 +575,24 @@ QStringList ReportView::getProperties(QDomElement &elem) { return props; } -void ReportView::handleKPlato(QDomElement &elem) { - QDomNodeList list(elem.childNodes()); +void ReportView::handleKPlato(TQDomElement &elem) { + TQDomNodeList list(elem.childNodes()); int childCount = list.length(); for (int j = 0; j < childCount; j++) { - QDomNode child = list.item(j); + TQDomNode child = list.item(j); if (child.nodeName() == "Detail") { - QDomElement e = child.toElement(); + TQDomElement e = child.toElement(); if (!e.isElement()) { continue; // !!!!! } - QString source = e.attribute("SelectFrom"); - QString level = e.attribute("Level", "-1"); + TQString source = e.attribute("SelectFrom"); + TQString level = e.attribute("Level", "-1"); //kdDebug()<<k_funcinfo<<"SelectFrom="<<source<<" Level="<<level<<endl; if (source.isNull() || level == "-1") continue; - QStringList list = QStringList::split(" ", source); - QStringList::iterator it = list.begin(); + TQStringList list = TQStringList::split(" ", source); + TQStringList::iterator it = list.begin(); for (; it != list.end(); ++it) { //kdDebug()<<k_funcinfo<<(*it)<<endl; if ((*it) == "alltasks") { @@ -618,9 +618,9 @@ void ReportView::handleKPlato(QDomElement &elem) { } } -void ReportView::handleDetail(QDomElement &elem) { +void ReportView::handleDetail(TQDomElement &elem) { //kdDebug()<<k_funcinfo<<endl; - QString level = elem.attribute("Level", "-1"); + TQString level = elem.attribute("Level", "-1"); if (level == "-1") { return; } @@ -645,27 +645,27 @@ void ReportView::handleDetail(QDomElement &elem) { } } -void ReportView::replaceTags(QDomNode &node) { +void ReportView::replaceTags(TQDomNode &node) { if (node.isNull()) return; } -void ReportView::getTemplateFile(const QString &tpl) { +void ReportView::getTemplateFile(const TQString &tpl) { KURL url(tpl); - QString localtpl; + TQString localtpl; bool isTemp = false; if (!url.isValid()) { - KMessageBox::sorry(this,i18n("Malformed template filename: %1").arg(url.prettyURL())); + KMessageBox::sorry(this,i18n("Malformed template filename: %1").tqarg(url.prettyURL())); } else { if (KIO::NetAccess::download(url,localtpl,this)) isTemp = true; else - KMessageBox::sorry(this,i18n("Unable to download template file: %1").arg(url.prettyURL())); + KMessageBox::sorry(this,i18n("Unable to download template file: %1").tqarg(url.prettyURL())); } if (!localtpl.isNull()) @@ -714,12 +714,12 @@ void ReportView::getContext(Context::Reportview &context) const { //kdDebug()<<k_funcinfo<<endl; } -void ReportView::slotReportListClicked(QListViewItem* item) { +void ReportView::slotReportListClicked(TQListViewItem* item) { if (item == m_reportList->selectedItem()) slotReportListSelectionChanged(item); } -void ReportView::slotReportListSelectionChanged(QListViewItem* item) { +void ReportView::slotReportListSelectionChanged(TQListViewItem* item) { ReportItem *ri = dynamic_cast<ReportItem*>(item); if (ri == 0) return; diff --git a/kplato/kptreportview.h b/kplato/kptreportview.h index e0e8b8c2..8dd023e2 100644 --- a/kplato/kptreportview.h +++ b/kplato/kptreportview.h @@ -25,8 +25,8 @@ #include "kpttask.h" #include "kptresource.h" #include "kptduration.h" -#include <qsplitter.h> -#include <qstring.h> +#include <tqsplitter.h> +#include <tqstring.h> #include <klistview.h> @@ -38,11 +38,11 @@ namespace Kugar class MReportViewer; } // Kugar namespace -//class QString; -class QStringList; -class QDomDocument; -class QDomNode; -class QIODevice; +//class TQString; +class TQStringList; +class TQDomDocument; +class TQDomNode; +class TQIODevice; namespace KPlato { @@ -52,19 +52,20 @@ class Node; class KugarReportViewer; class ReportTagsPrivate; -class ReportView : public QSplitter +class ReportView : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - ReportView(View *view, QWidget *parent); + ReportView(View *view, TQWidget *tqparent); ~ReportView(); void zoom(double /*zoom*/) {} - void draw(const QString &report); + void draw(const TQString &report); View *mainView() const { return m_mainview; } void setup(KPrinter &printer); @@ -72,24 +73,24 @@ class ReportView : public QSplitter void setReportData(); - void getTemplateFile(const QString &tpl); - void openTemplateFile(const QString &file); - void loadTemplate(QIODevice &dev); - void loadTemplate(QDomDocument &doc); - void handleHeader(QDomNode &node); - void handleDetail(QDomElement &elem); - void handleKPlato(QDomElement &elem); - void replaceTags(QDomNode &node); + void getTemplateFile(const TQString &tpl); + void openTemplateFile(const TQString &file); + void loadTemplate(TQIODevice &dev); + void loadTemplate(TQDomDocument &doc); + void handleHeader(TQDomNode &node); + void handleDetail(TQDomElement &elem); + void handleKPlato(TQDomElement &elem); + void replaceTags(TQDomNode &node); - QString setReportDetail(); - QString setTaskChildren(Node *node); - QString setTaskDetail(Node *node); - QStringList getProperties(QDomElement &elem); + TQString setReportDetail(); + TQString setTaskChildren(Node *node); + TQString setTaskDetail(Node *node); + TQStringList getProperties(TQDomElement &elem); - QString setResourceDetail(Resource *res); - QString setResourceGroupDetail(ResourceGroup *group); + TQString setResourceDetail(Resource *res); + TQString setResourceGroupDetail(ResourceGroup *group); - QString setDetail(const QString &source, QStringList &properties, QString &level); + TQString setDetail(const TQString &source, TQStringList &properties, TQString &level); virtual bool setContext(Context::Reportview &context); virtual void getContext(Context::Reportview &context) const; @@ -109,17 +110,17 @@ public slots: void slotLastPage(); protected slots: - void slotReportListClicked(QListViewItem* item); - void slotReportListSelectionChanged(QListViewItem* item); + void slotReportListClicked(TQListViewItem* item); + void slotReportListSelectionChanged(TQListViewItem* item); private: class ReportItem : public KListViewItem { public: - ReportItem(KListView *p, QString name, QString _url) + ReportItem(KListView *p, TQString name, TQString _url) : KListViewItem(p, name), url(_url) {} - QString url; + TQString url; }; void initReportList(); @@ -129,7 +130,7 @@ private: KugarReportViewer *m_reportview; int m_defaultFontSize; - QDomDocument templateDoc; + TQDomDocument templateDoc; ReportTagsPrivate *m_reportTags; }; diff --git a/kplato/kptrequestresourcespanel.cc b/kplato/kptrequestresourcespanel.cc index 1996549f..df6b4e2b 100644 --- a/kplato/kptrequestresourcespanel.cc +++ b/kplato/kptrequestresourcespanel.cc @@ -28,15 +28,15 @@ #include <klocale.h> #include <kptcommand.h> -#include <qlistbox.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qstring.h> -#include <qspinbox.h> -#include <qvalidator.h> -#include <qcombobox.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqstring.h> +#include <tqspinbox.h> +#include <tqvalidator.h> +#include <tqcombobox.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> namespace KPlato { @@ -62,17 +62,17 @@ void ResourceTableItem::update() { //kdDebug()<<k_funcinfo<<m_resource->name()<<" checked="<<m_checked<<endl; } -void ResourceTableItem::insert(QTable *table, int row) { +void ResourceTableItem::insert(TQTable *table, int row) { //kdDebug()<<k_funcinfo<<endl; - m_checkitem = new QCheckTableItem(table, m_resource->name()); + m_checkitem = new TQCheckTableItem(table, m_resource->name()); m_checkitem->setChecked(m_checked); table->setItem(row, 0, m_checkitem); //kdDebug()<<k_funcinfo<<"Added: '"<<m_resource->name()<<"' checked="<<m_checked<<endl; } -GroupLVItem::GroupLVItem(QListView *parent, ResourceGroup *group, Task &task) - : QListViewItem(parent, group->name(), QString("%1").arg(group->units())), +GroupLVItem::GroupLVItem(TQListView *tqparent, ResourceGroup *group, Task &task) + : TQListViewItem(tqparent, group->name(), TQString("%1").tqarg(group->units())), m_group(group), m_units(0) { @@ -81,12 +81,12 @@ GroupLVItem::GroupLVItem(QListView *parent, ResourceGroup *group, Task &task) if (m_request) { m_units = m_request->units(); } - QPtrListIterator<Resource> it(group->resources()); + TQPtrListIterator<Resource> it(group->resources()); for (; it.current(); ++it) { //kdDebug()<<k_funcinfo<<"resource="<<it.current()->name()<<endl; ResourceRequest *req=0; if (m_request) { - req = m_request->find(it.current()); + req = m_request->tqfind(it.current()); } m_resources.append(new ResourceTableItem(it.current(), req, (bool)req)); } @@ -99,13 +99,13 @@ GroupLVItem::~GroupLVItem() { } void GroupLVItem::update() { - QPtrListIterator<ResourceTableItem> it(m_resources); + TQPtrListIterator<ResourceTableItem> it(m_resources); for (; it.current(); ++it) { it.current()->update(); } } -void GroupLVItem::insert(QTable *table) { +void GroupLVItem::insert(TQTable *table) { // clear the table, must be a better way! for (int i = table->numRows(); i > 0; --i) @@ -113,11 +113,11 @@ void GroupLVItem::insert(QTable *table) { if (m_group->numResources() == 0) { table->setNumRows(1); - table->setItem(0, 0, new QCheckTableItem(table,i18n("None"))); - table->setItem(0, 1, new QComboTableItem(table,i18n("None"))); + table->setItem(0, 0, new TQCheckTableItem(table,i18n("None"))); + table->setItem(0, 1, new TQComboTableItem(table,i18n("None"))); } else { table->setNumRows(m_group->numResources()); - QPtrListIterator<ResourceTableItem> it(m_resources); + TQPtrListIterator<ResourceTableItem> it(m_resources); for (int i = 0; it.current(); ++it, ++i) { it.current()->insert(table, i); } @@ -128,7 +128,7 @@ void GroupLVItem::insert(QTable *table) { int GroupLVItem::numRequests() { //kdDebug()<<k_funcinfo<<endl; int value = m_units; - QPtrListIterator<ResourceTableItem> it(m_resources); + TQPtrListIterator<ResourceTableItem> it(m_resources); for (; it.current(); ++it) { value += it.current()->numRequests(); } @@ -137,7 +137,7 @@ int GroupLVItem::numRequests() { bool GroupLVItem::isNull() const { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<ResourceTableItem> it(m_resources); + TQPtrListIterator<ResourceTableItem> it(m_resources); for (; it.current(); ++it) { if (it.current()->isChecked()) return false; @@ -147,8 +147,8 @@ bool GroupLVItem::isNull() const { return true; } -RequestResourcesPanel::RequestResourcesPanel(QWidget *parent, Task &task, bool baseline) - : TaskResourcesPanelBase(parent), +RequestResourcesPanel::RequestResourcesPanel(TQWidget *tqparent, Task &task, bool baseline) + : TaskResourcesPanelBase(tqparent), m_task(task), m_worktime(0), selectedGroup(0), @@ -158,7 +158,7 @@ RequestResourcesPanel::RequestResourcesPanel(QWidget *parent, Task &task, bool b if (p) { m_worktime = p->standardWorktime(); - QPtrListIterator<ResourceGroup> git(p->resourceGroups()); + TQPtrListIterator<ResourceGroup> git(p->resourceGroups()); for(int i=0; git.current(); ++git, ++i) { ResourceGroup *grp = git.current(); GroupLVItem *grpitem = new GroupLVItem(groupList, grp, task); @@ -166,7 +166,7 @@ RequestResourcesPanel::RequestResourcesPanel(QWidget *parent, Task &task, bool b //kdDebug()<<k_funcinfo<<" Added group: "<<grp->name()<<endl; } } - QListViewItem *item = groupList->firstChild(); + TQListViewItem *item = groupList->firstChild(); if (item) { groupList->setSelected(item, true); groupChanged(item); @@ -174,13 +174,13 @@ RequestResourcesPanel::RequestResourcesPanel(QWidget *parent, Task &task, bool b resourceTable->setReadOnly(baseline); - connect(groupList, SIGNAL(selectionChanged(QListViewItem*)), SLOT(groupChanged(QListViewItem*))); - connect(resourceTable, SIGNAL(valueChanged(int, int)), SLOT(resourceChanged(int, int))); -// connect(numUnits, SIGNAL(valueChanged(int)), SLOT(unitsChanged(int))); + connect(groupList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(groupChanged(TQListViewItem*))); + connect(resourceTable, TQT_SIGNAL(valueChanged(int, int)), TQT_SLOT(resourceChanged(int, int))); +// connect(numUnits, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(unitsChanged(int))); } -void RequestResourcesPanel::groupChanged(QListViewItem *item) { +void RequestResourcesPanel::groupChanged(TQListViewItem *item) { //kdDebug()<<k_funcinfo<<endl; GroupLVItem *grp = dynamic_cast<GroupLVItem *>(item); if (grp == 0) @@ -217,10 +217,10 @@ KCommand *RequestResourcesPanel::buildCommand(Part *part) { if (selectedGroup) { selectedGroup->update(); } - QListViewItem *item = groupList->firstChild(); + TQListViewItem *item = groupList->firstChild(); for (; item; item = item->nextSibling()) { GroupLVItem *grp = static_cast<GroupLVItem*>(item); - QPtrListIterator<ResourceTableItem> it = grp->resources(); + TQPtrListIterator<ResourceTableItem> it = grp->resources(); for (; it.current(); ++it) { if (it.current()->isChecked() != it.current()->isOrigChecked()) { if (!cmd) cmd = new KMacroCommand(""); diff --git a/kplato/kptrequestresourcespanel.h b/kplato/kptrequestresourcespanel.h index e7d1f11c..ada8ef10 100644 --- a/kplato/kptrequestresourcespanel.h +++ b/kplato/kptrequestresourcespanel.h @@ -23,10 +23,10 @@ #include "kpttaskresourcespanelbase.h" #include "kptduration.h" -#include <qlistview.h> -#include <qstring.h> -#include <qtable.h> -//class QCheckTableItem; +#include <tqlistview.h> +#include <tqstring.h> +#include <tqtable.h> +//class TQCheckTableItem; class KCommand; class KMacroCommand; @@ -51,7 +51,7 @@ public: ~ResourceTableItem() ; void update(); - void insert(QTable *table, int row); + void insert(TQTable *table, int row); void ok(ResourceGroupRequest *group); bool isChecked() const { return m_checked; } @@ -64,20 +64,20 @@ public: Resource *m_resource; int m_units, m_origUnits; bool m_checked, m_origChecked; - QCheckTableItem *m_checkitem; + TQCheckTableItem *m_checkitem; ResourceRequest *m_request; int m_curAccountItem; - QString m_curAccountText; + TQString m_curAccountText; }; -class GroupLVItem : public QListViewItem { +class GroupLVItem : public TQListViewItem { public: - GroupLVItem(QListView *parent, ResourceGroup *group, Task &task); + GroupLVItem(TQListView *tqparent, ResourceGroup *group, Task &task); ~GroupLVItem(); void update(); - void insert(QTable *table); - const QPtrList<ResourceTableItem> &resources() const { return m_resources; } + void insert(TQTable *table); + const TQPtrList<ResourceTableItem> &resources() const { return m_resources; } void ok(Task &task); int numRequests(); @@ -85,15 +85,16 @@ public: ResourceGroup *m_group; int m_units; - QPtrList<ResourceTableItem> m_resources; + TQPtrList<ResourceTableItem> m_resources; ResourceGroupRequest *m_request; }; class RequestResourcesPanel : public TaskResourcesPanelBase { Q_OBJECT + TQ_OBJECT public: - RequestResourcesPanel(QWidget *parent, Task &task, bool baseline=false); + RequestResourcesPanel(TQWidget *tqparent, Task &task, bool baseline=false); KCommand *buildCommand(Part *part); @@ -102,7 +103,7 @@ public: private slots: void sendChanged(); - void groupChanged(QListViewItem *item); + void groupChanged(TQListViewItem *item); void resourceChanged(int, int); void unitsChanged(int); diff --git a/kplato/kptresource.cc b/kplato/kptresource.cc index 2be8790c..78834b4a 100644 --- a/kplato/kptresource.cc +++ b/kplato/kptresource.cc @@ -49,7 +49,7 @@ ResourceGroup::~ResourceGroup() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; } -bool ResourceGroup::setId(QString id) { +bool ResourceGroup::setId(TQString id) { //kdDebug()<<k_funcinfo<<id<<endl; if (id.isEmpty()) { kdError()<<k_funcinfo<<"id is empty"<<endl; @@ -66,7 +66,7 @@ bool ResourceGroup::setId(QString id) { } if (findId(id)) { kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different group: "<<findId(id)->name()<<endl; - m_id = QString(); // hmmm + m_id = TQString(); // hmmm return false; } m_id = id; @@ -86,7 +86,7 @@ void ResourceGroup::generateId() { return; } } - m_id = QString(); + m_id = TQString(); } void ResourceGroup::addResource(Resource* resource, Risk*) { @@ -106,7 +106,7 @@ void ResourceGroup::removeResource(Resource *resource) { } Resource *ResourceGroup::takeResource(Resource *resource) { - return m_resources.take(m_resources.findRef(resource)); + return m_resources.take(m_resources.tqfindRef(resource)); } void ResourceGroup::removeResource(int) { @@ -122,15 +122,15 @@ ResourceGroup* ResourceGroup::getRequiredResource(int) { void ResourceGroup::removeRequiredResource(int) { } -bool ResourceGroup::load(QDomElement &element) { +bool ResourceGroup::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; setId(element.attribute("id")); m_name = element.attribute("name"); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "resource") { // Load the resource Resource *child = new Resource(m_project); @@ -145,23 +145,23 @@ bool ResourceGroup::load(QDomElement &element) { return true; } -void ResourceGroup::save(QDomElement &element) const { +void ResourceGroup::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("resource-group"); + TQDomElement me = element.ownerDocument().createElement("resource-group"); element.appendChild(me); me.setAttribute("id", m_id); me.setAttribute("name", m_name); - QPtrListIterator<Resource> it(m_resources); + TQPtrListIterator<Resource> it(m_resources); for ( ; it.current(); ++it ) { it.current()->save(me); } } void ResourceGroup::initiateCalculation(Schedule &sch) { - QPtrListIterator<Resource> it(m_resources); + TQPtrListIterator<Resource> it(m_resources); for (; it.current(); ++it) { it.current()->initiateCalculation(sch); } @@ -170,29 +170,29 @@ void ResourceGroup::initiateCalculation(Schedule &sch) { int ResourceGroup::units() { int u = 0; - QPtrListIterator<Resource> it = m_resources; + TQPtrListIterator<Resource> it = m_resources; for (; it.current(); ++it) { u += it.current()->units(); } return u; } -ResourceGroup *ResourceGroup::findId(const QString &id) const { +ResourceGroup *ResourceGroup::findId(const TQString &id) const { return m_project ? m_project->findResourceGroup(id) : 0; } -bool ResourceGroup::removeId(const QString &id) { +bool ResourceGroup::removeId(const TQString &id) { return m_project ? m_project->removeResourceGroupId(id): false; } -void ResourceGroup::insertId(const QString &id) { +void ResourceGroup::insertId(const TQString &id) { if (m_project) m_project->insertResourceGroupId(id, this); } Appointment ResourceGroup::appointmentIntervals() const { Appointment a; - QPtrListIterator<Resource> it = m_resources; + TQPtrListIterator<Resource> it = m_resources; for (; it.current(); ++it) { a += it.current()->appointmentIntervals(); } @@ -203,8 +203,8 @@ Resource::Resource(Project *project) : m_project(project), m_schedules(), m_work m_type = Type_Work; m_units = 100; // % - m_availableFrom = DateTime(QDate::currentDate()); - m_availableUntil = m_availableFrom.addYears(2); + m_availableFrom = DateTime(TQDate::tqcurrentDate()); + m_availableUntil = TQDateTime(m_availableFrom.addYears(2)); cost.normalRate = 100; cost.overtimeRate = 200; @@ -225,17 +225,17 @@ Resource::~Resource() { if (findId() == this) { removeId(); // only remove myself (I may be just a working copy) } - QPtrListIterator<ResourceRequest> it = m_requests; + TQPtrListIterator<ResourceRequest> it = m_requests; for (; it.current(); ++it) { it.current()->setResource(0); // avoid the request to mess with my list } m_requests.first(); for (; m_requests.current(); m_requests.next()) { - m_requests.current()->parent()->removeResourceRequest(m_requests.current()); // deletes the request + m_requests.current()->tqparent()->removeResourceRequest(m_requests.current()); // deletes the request } } -bool Resource::setId(QString id) { +bool Resource::setId(TQString id) { //kdDebug()<<k_funcinfo<<id<<endl; if (id.isEmpty()) { kdError()<<k_funcinfo<<"id is empty"<<endl; @@ -252,7 +252,7 @@ bool Resource::setId(QString id) { } if (findId(id)) { kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different resource: "<<findId(id)->name()<<endl; - m_id = QString(); // hmmm + m_id = TQString(); // hmmm return false; } m_id = id; @@ -273,23 +273,23 @@ void Resource::generateId() { return; } } - m_id = QString(); + m_id = TQString(); } -void Resource::setType(const QString &type) { +void Resource::setType(const TQString &type) { if (type == "Work") m_type = Type_Work; else if (type == "Material") m_type = Type_Material; } -QString Resource::typeToString() const { +TQString Resource::typeToString() const { if (m_type == Type_Work) - return QString("Work"); + return TQString("Work"); else if (m_type == Type_Material) - return QString("Material"); + return TQString("Material"); - return QString(); + return TQString(); } void Resource::copy(Resource *resource) { @@ -315,10 +315,10 @@ void Resource::copy(Resource *resource) { m_calendar = resource->m_calendar; } -void Resource::addWorkingHour(QTime from, QTime until) { +void Resource::addWorkingHour(TQTime from, TQTime until) { //kdDebug()<<k_funcinfo<<endl; - m_workingHours.append(new QTime(from)); - m_workingHours.append(new QTime(until)); + m_workingHours.append(new TQTime(from)); + m_workingHours.append(new TQTime(until)); } Calendar *Resource::calendar(bool local) const { @@ -343,9 +343,9 @@ DateTime Resource::getBestAvailableTime(const DateTime /*after*/, const Duration return DateTime(); } -bool Resource::load(QDomElement &element) { +bool Resource::load(TQDomElement &element) { //kdDebug()<<k_funcinfo<<endl; - QString s; + TQString s; setId(element.attribute("id")); m_name = element.attribute("name"); m_initials = element.attribute("initials"); @@ -365,9 +365,9 @@ bool Resource::load(QDomElement &element) { return true; } -void Resource::save(QDomElement &element) const { +void Resource::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("resource"); + TQDomElement me = element.ownerDocument().createElement("resource"); element.appendChild(me); if (calendar(true)) @@ -386,7 +386,7 @@ void Resource::save(QDomElement &element) const { bool Resource::isAvailable(Task */*task*/) { bool busy = false; -/* QPtrListIterator<Appointment> it(m_appointments); +/* TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { if (it.current()->isBusy(task->startTime(), task->endTime())) { busy = true; @@ -396,8 +396,8 @@ bool Resource::isAvailable(Task */*task*/) { return !busy; } -QPtrList<Appointment> Resource::appointments() { - QPtrList<Appointment> lst; +TQPtrList<Appointment> Resource::appointments() { + TQPtrList<Appointment> lst; if (m_currentSchedule) lst = m_currentSchedule->appointments(); //kdDebug()<<k_funcinfo<<lst.count()<<endl; @@ -405,7 +405,7 @@ QPtrList<Appointment> Resource::appointments() { } Appointment *Resource::findAppointment(Node */*node*/) { -/* QPtrListIterator<Appointment> it = m_appointments; +/* TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { if (it.current()->node() == node) return it.current(); @@ -432,7 +432,7 @@ void Resource::addAppointment(Schedule *node, DateTime &start, DateTime &end, do //kdDebug()<<k_funcinfo<<endl; Schedule *s = findSchedule(node->id()); if (s == 0) { - s = createSchedule(node->parent()); + s = createSchedule(node->tqparent()); } s->addAppointment(node, start, end, load); } @@ -457,17 +457,17 @@ void Resource::takeSchedule(const Schedule *schedule) { void Resource::addSchedule(Schedule *schedule) { if (schedule == 0) return; - m_schedules.replace(schedule->id(), schedule); + m_schedules.tqreplace(schedule->id(), schedule); } -ResourceSchedule *Resource::createSchedule(QString name, int type, long id) { +ResourceSchedule *Resource::createSchedule(TQString name, int type, long id) { ResourceSchedule *sch = new ResourceSchedule(this, name, (Schedule::Type)type, id); addSchedule(sch); return sch; } -ResourceSchedule *Resource::createSchedule(Schedule *parent) { - ResourceSchedule *sch = new ResourceSchedule(parent, this); +ResourceSchedule *Resource::createSchedule(Schedule *tqparent) { + ResourceSchedule *sch = new ResourceSchedule(tqparent, this); addSchedule(sch); return sch; } @@ -494,7 +494,7 @@ void Resource::makeAppointment(Schedule *node, const DateTime &from, const DateT //node->resourceNotAvailable = true; return; // nothing more to do } - QPair<DateTime, DateTime> i = cal->firstInterval(time, end); + TQPair<DateTime, DateTime> i = cal->firstInterval(time, end); if (!i.second.isValid()) { kdWarning()<<k_funcinfo<<"Invalid interval: "<<time<<", "<<end<<endl; return; @@ -660,20 +660,20 @@ DateTime Resource::availableBefore(const DateTime &time, const DateTime limit, b return t; } -Resource *Resource::findId(const QString &id) const { +Resource *Resource::findId(const TQString &id) const { return m_project ? m_project->findResource(id) : 0; } -bool Resource::removeId(const QString &id) { +bool Resource::removeId(const TQString &id) { return m_project ? m_project->removeResourceId(id) : false; } -void Resource::insertId(const QString &id) { +void Resource::insertId(const TQString &id) { if (m_project) m_project->insertResourceId(id, this); } -Calendar *Resource::findCalendar(const QString &id) const { +Calendar *Resource::findCalendar(const TQString &id) const { return (m_project ? m_project->findCalendar(id) : 0); } @@ -681,7 +681,7 @@ bool Resource::isOverbooked() const { return isOverbooked(DateTime(), DateTime()); } -bool Resource::isOverbooked(const QDate &date) const { +bool Resource::isOverbooked(const TQDate &date) const { return isOverbooked(DateTime(date), DateTime(date.addDays(1))); } @@ -694,14 +694,14 @@ Appointment Resource::appointmentIntervals() const { Appointment a; if (m_currentSchedule == 0) return a; - QPtrListIterator<Appointment> it = m_currentSchedule->appointments(); + TQPtrListIterator<Appointment> it = m_currentSchedule->appointments(); for (; it.current(); ++it) { a += *(it.current()); } return a; } -Duration Resource::plannedEffort(const QDate &date) const { +Duration Resource::plannedEffort(const TQDate &date) const { return m_currentSchedule ? m_currentSchedule->plannedEffort(date) : Duration::zeroDuration; } @@ -719,17 +719,17 @@ ResourceRequest::ResourceRequest(Resource *resource, int units) : m_resource(resource), m_units(units), m_parent(0) { - //kdDebug()<<k_funcinfo<<"("<<this<<") Request to: "<<(resource ? resource->name() : QString("None"))<<endl; + //kdDebug()<<k_funcinfo<<"("<<this<<") Request to: "<<(resource ? resource->name() : TQString("None"))<<endl; } ResourceRequest::~ResourceRequest() { - //kdDebug()<<k_funcinfo<<"("<<this<<") resource: "<<(m_resource ? m_resource->name() : QString("None"))<<endl; + //kdDebug()<<k_funcinfo<<"("<<this<<") resource: "<<(m_resource ? m_resource->name() : TQString("None"))<<endl; if (m_resource) m_resource->unregisterRequest(this); m_resource = 0; } -bool ResourceRequest::load(QDomElement &element, Project &project) { +bool ResourceRequest::load(TQDomElement &element, Project &project) { //kdDebug()<<k_funcinfo<<endl; m_resource = project.resource(element.attribute("resource-id")); if (m_resource == 0) { @@ -740,8 +740,8 @@ bool ResourceRequest::load(QDomElement &element, Project &project) { return true; } -void ResourceRequest::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("resource-request"); +void ResourceRequest::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("resource-request"); element.appendChild(me); me.setAttribute("resource-id", m_resource->id()); me.setAttribute("units", m_units); @@ -768,7 +768,7 @@ Task *ResourceRequest::task() const { ResourceGroupRequest::ResourceGroupRequest(ResourceGroup *group, int units) : m_group(group), m_units(units) { - //kdDebug()<<k_funcinfo<<"Request to: "<<(group ? group->name() : QString("None"))<<endl; + //kdDebug()<<k_funcinfo<<"Request to: "<<(group ? group->name() : TQString("None"))<<endl; if (group) group->registerRequest(this); m_resourceRequests.setAutoDelete(true); @@ -791,11 +791,11 @@ void ResourceGroupRequest::addResourceRequest(ResourceRequest *request) { ResourceRequest *ResourceGroupRequest::takeResourceRequest(ResourceRequest *request) { if (request) request->unregisterRequest(); - return m_resourceRequests.take(m_resourceRequests.findRef(request)); + return m_resourceRequests.take(m_resourceRequests.tqfindRef(request)); } -ResourceRequest *ResourceGroupRequest::find(Resource *resource) const { - QPtrListIterator<ResourceRequest> it(m_resourceRequests); +ResourceRequest *ResourceGroupRequest::tqfind(Resource *resource) const { + TQPtrListIterator<ResourceRequest> it(m_resourceRequests); for (; it.current(); ++it) if (it.current()->resource() == resource) return it.current(); @@ -803,7 +803,7 @@ ResourceRequest *ResourceGroupRequest::find(Resource *resource) const { return 0; } -bool ResourceGroupRequest::load(QDomElement &element, Project &project) { +bool ResourceGroupRequest::load(TQDomElement &element, Project &project) { //kdDebug()<<k_funcinfo<<endl; m_group = project.findResourceGroup(element.attribute("group-id")); if (m_group == 0) { @@ -814,10 +814,10 @@ bool ResourceGroupRequest::load(QDomElement &element, Project &project) { m_units = element.attribute("units").toInt(); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "resource-request") { ResourceRequest *r = new ResourceRequest(); if (r->load(e, project)) @@ -832,21 +832,21 @@ bool ResourceGroupRequest::load(QDomElement &element, Project &project) { return true; } -void ResourceGroupRequest::save(QDomElement &element) const { +void ResourceGroupRequest::save(TQDomElement &element) const { if (units() == 0) return; - QDomElement me = element.ownerDocument().createElement("resourcegroup-request"); + TQDomElement me = element.ownerDocument().createElement("resourcegroup-request"); element.appendChild(me); me.setAttribute("group-id", m_group->id()); me.setAttribute("units", m_units); - QPtrListIterator<ResourceRequest> it(m_resourceRequests); + TQPtrListIterator<ResourceRequest> it(m_resourceRequests); for (; it.current(); ++it) it.current()->save(me); } int ResourceGroupRequest::units() const { int units = m_units; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { units += it.current()->units(); } @@ -858,7 +858,7 @@ int ResourceGroupRequest::workUnits() const { int units = 0; if (m_group->type() == ResourceGroup::Type_Work) units = m_units; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { units += it.current()->workUnits(); } @@ -871,7 +871,7 @@ Duration ResourceGroupRequest::effort(const DateTime &time, const Duration &dura Duration e; bool sts=false; if (ok) *ok = sts; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { e += it.current()->resource()->effort(time, duration, backward, &sts); if (sts && ok) *ok = sts; @@ -884,7 +884,7 @@ Duration ResourceGroupRequest::effort(const DateTime &time, const Duration &dura int ResourceGroupRequest::numDays(const DateTime &time, bool backward) const { DateTime t1, t2 = time; if (backward) { - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { t1 = it.current()->resource()->availableFrom(); if (!t2.isValid() || t2 > t1) @@ -893,7 +893,7 @@ int ResourceGroupRequest::numDays(const DateTime &time, bool backward) const { //kdDebug()<<k_funcinfo<<"bw "<<time.toString()<<": "<<t2.daysTo(time)<<endl; return t2.daysTo(time); } - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { t1 = it.current()->resource()->availableUntil(); if (!t2.isValid() || t2 < t1) @@ -919,7 +919,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e int nDays = numDays(time, backward) + 1; for (int i=0; !match && i <= nDays; ++i) { // days - end = end.addDays(inc); + end = TQDateTime(end.addDays(inc)); e1 = effort(start, d, backward, &sts); //kdDebug()<<"["<<i<<"of"<<nDays<<"] "<<(backward?"(B)":"(F):")<<" start="<<start<<" e+e1="<<(e+e1).toString()<<" match "<<_effort.toString()<<endl; if (e + e1 < _effort) { @@ -937,7 +937,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e d = Duration(0, 1, 0); // 1 hour for (int i=0; !match && i < 24; ++i) { // hours - end = end.addSecs(inc*60*60); + end = TQDateTime(end.addSecs(inc*60*60)); e1 = effort(start, d, backward, &sts); if (e + e1 < _effort) { e += e1; @@ -955,7 +955,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e d = Duration(0, 0, 1); // 1 minute for (int i=0; !match && i < 60; ++i) { //minutes - end = end.addSecs(inc*60); + end = TQDateTime(end.addSecs(inc*60)); e1 = effort(start, d, backward, &sts); if (e + e1 < _effort) { e += e1; @@ -973,7 +973,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e d = Duration(0, 0, 0, 1); // 1 second for (int i=0; !match && i < 60 && sts; ++i) { //seconds - end = end.addSecs(inc); + end = TQDateTime(end.addSecs(inc)); e1 = effort(start, d, backward, &sts); if (e + e1 < _effort) { e += e1; @@ -1017,7 +1017,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e DateTime ResourceGroupRequest::availableAfter(const DateTime &time) { DateTime start; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { DateTime t = it.current()->resource()->availableAfter(time); if (t.isValid() && (!start.isValid() || t < start)) @@ -1031,7 +1031,7 @@ DateTime ResourceGroupRequest::availableAfter(const DateTime &time) { DateTime ResourceGroupRequest::availableBefore(const DateTime &time) { DateTime end; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { DateTime t = it.current()->resource()->availableBefore(time); if (t.isValid() && (!end.isValid() || t > end)) @@ -1045,7 +1045,7 @@ DateTime ResourceGroupRequest::availableBefore(const DateTime &time) { void ResourceGroupRequest::makeAppointments(Schedule *schedule) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<ResourceRequest> it = m_resourceRequests; + TQPtrListIterator<ResourceRequest> it = m_resourceRequests; for (; it.current(); ++it) { it.current()->makeAppointment(schedule); } @@ -1075,8 +1075,8 @@ ResourceRequestCollection::~ResourceRequestCollection() { m_requests.clear(); } -ResourceGroupRequest *ResourceRequestCollection::find(ResourceGroup *group) const { - QPtrListIterator<ResourceGroupRequest> it(m_requests); +ResourceGroupRequest *ResourceRequestCollection::tqfind(ResourceGroup *group) const { + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { if (it.current()->group() == group) return it.current(); // we assume only one request to the same group @@ -1085,23 +1085,23 @@ ResourceGroupRequest *ResourceRequestCollection::find(ResourceGroup *group) cons } -ResourceRequest *ResourceRequestCollection::find(Resource *resource) const { +ResourceRequest *ResourceRequestCollection::tqfind(Resource *resource) const { ResourceRequest *req = 0; - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; !req && it.current(); ++it) { - req = it.current()->find(resource); + req = it.current()->tqfind(resource); } return req; } -// bool ResourceRequestCollection::load(QDomElement &element, Project &project) { +// bool ResourceRequestCollection::load(TQDomElement &element, Project &project) { // //kdDebug()<<k_funcinfo<<endl; // return true; // } -void ResourceRequestCollection::save(QDomElement &element) const { +void ResourceRequestCollection::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for ( ; it.current(); ++it ) { it.current()->save(element); } @@ -1110,7 +1110,7 @@ void ResourceRequestCollection::save(QDomElement &element) const { int ResourceRequestCollection::units() const { //kdDebug()<<k_funcinfo<<endl; int units = 0; - QPtrListIterator<ResourceGroupRequest> it = m_requests; + TQPtrListIterator<ResourceGroupRequest> it = m_requests; for (; it.current(); ++it) { units += it.current()->units(); //kdDebug()<<k_funcinfo<<" Group: "<<it.current()->group()->name()<<" now="<<units<<endl; @@ -1121,7 +1121,7 @@ int ResourceRequestCollection::units() const { int ResourceRequestCollection::workUnits() const { //kdDebug()<<k_funcinfo<<endl; int units = 0; - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { units += it.current()->workUnits(); } @@ -1142,7 +1142,7 @@ Duration ResourceRequestCollection::duration(const DateTime &time, const Duratio int units = workUnits(); if (units == 0) units = 100; //hmmmm - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { if (it.current()->isEmpty()) continue; @@ -1161,7 +1161,7 @@ Duration ResourceRequestCollection::duration(const DateTime &time, const Duratio DateTime ResourceRequestCollection::availableAfter(const DateTime &time) { DateTime start; - QPtrListIterator<ResourceGroupRequest> it = m_requests; + TQPtrListIterator<ResourceGroupRequest> it = m_requests; for (; it.current(); ++it) { DateTime t = it.current()->availableAfter(time); if (t.isValid() && (!start.isValid() || t < start)) @@ -1175,7 +1175,7 @@ DateTime ResourceRequestCollection::availableAfter(const DateTime &time) { DateTime ResourceRequestCollection::availableBefore(const DateTime &time) { DateTime end; - QPtrListIterator<ResourceGroupRequest> it = m_requests; + TQPtrListIterator<ResourceGroupRequest> it = m_requests; for (; it.current(); ++it) { DateTime t = it.current()->availableBefore(time); if (t.isValid() && (!end.isValid() ||t > end)) @@ -1189,7 +1189,7 @@ DateTime ResourceRequestCollection::availableBefore(const DateTime &time) { void ResourceRequestCollection::makeAppointments(Schedule *schedule) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { it.current()->makeAppointments(schedule); } @@ -1197,14 +1197,14 @@ void ResourceRequestCollection::makeAppointments(Schedule *schedule) { void ResourceRequestCollection::reserve(const DateTime &start, const Duration &duration) { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { it.current()->reserve(start, duration); } } bool ResourceRequestCollection::isEmpty() const { - QPtrListIterator<ResourceGroupRequest> it(m_requests); + TQPtrListIterator<ResourceGroupRequest> it(m_requests); for (; it.current(); ++it) { if (!it.current()->isEmpty()) return false; @@ -1213,18 +1213,18 @@ bool ResourceRequestCollection::isEmpty() const { } #ifndef NDEBUG -void ResourceGroup::printDebug(QString indent) +void ResourceGroup::printDebug(TQString indent) { kdDebug()<<indent<<" + Resource group: "<<m_name<<" id="<<m_id<<endl; indent += " !"; - QPtrListIterator<Resource> it(m_resources); + TQPtrListIterator<Resource> it(m_resources); for ( ; it.current(); ++it) it.current()->printDebug(indent); } -void Resource::printDebug(QString indent) +void Resource::printDebug(TQString indent) { kdDebug()<<indent<<" + Resource: "<<m_name<<" id="<<m_id/*<<" Overbooked="<<isOverbooked()*/<<endl; - QIntDictIterator<Schedule> it(m_schedules); + TQIntDictIterator<Schedule> it(m_schedules); indent += " "; for (; it.current(); ++it) { it.current()->printDebug(indent); @@ -1232,25 +1232,25 @@ void Resource::printDebug(QString indent) indent += " !"; } -void ResourceGroupRequest::printDebug(QString indent) +void ResourceGroupRequest::printDebug(TQString indent) { kdDebug()<<indent<<" + Request to group: "<<(m_group ? m_group->name() : "None")<<" units="<<m_units<<"%"<<endl; indent += " !"; - QPtrListIterator<ResourceRequest> it(m_resourceRequests); + TQPtrListIterator<ResourceRequest> it(m_resourceRequests); for (; it.current(); ++it) { it.current()->printDebug(indent); } } -void ResourceRequest::printDebug(QString indent) +void ResourceRequest::printDebug(TQString indent) { kdDebug()<<indent<<" + Request to resource: "<<(m_resource ? m_resource->name() : "None")<<" units="<<m_units<<"%"<<endl; } -void ResourceRequestCollection::printDebug(QString indent) +void ResourceRequestCollection::printDebug(TQString indent) { kdDebug()<<indent<<" + Resource requests:"<<endl; - QPtrListIterator<ResourceGroupRequest> it = m_requests; + TQPtrListIterator<ResourceGroupRequest> it = m_requests; for (; it.current(); ++it) { it.current()->printDebug(indent+" "); } diff --git a/kplato/kptresource.h b/kplato/kptresource.h index 4d160321..be558d93 100644 --- a/kplato/kptresource.h +++ b/kplato/kptresource.h @@ -24,14 +24,14 @@ #include "kptduration.h" #include "kptdatetime.h" -#include <qdom.h> -#include <qintdict.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqintdict.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kdebug.h> -class QTime; +class TQTime; namespace KPlato { @@ -70,16 +70,16 @@ class ResourceGroup { enum Type { Type_Work, Type_Material }; - QString id() const { return m_id; } - bool setId(QString id); + TQString id() const { return m_id; } + bool setId(TQString id); void generateId(); Project *project() { return m_project; } - void setName(QString n) {m_name=n;} - const QString &name() const {return m_name;} + void setName(TQString n) {m_name=n;} + const TQString &name() const {return m_name;} void setType(Type type) { m_type = type; } - //void setType(const QString &type); + //void setType(const TQString &type); Type type() const { return m_type; } /** Manage the resources in this list @@ -104,7 +104,7 @@ class ResourceGroup { * @param duration todo * @param num todo */ - QPtrList<Resource> availableResources(const DateTime start, const Duration duration, int num); + TQPtrList<Resource> availableResources(const DateTime start, const Duration duration, int num); /** Manage the dependent resources. This is a list of the resource * groups that must have available resources for this resource to * perform the work @@ -124,10 +124,10 @@ class ResourceGroup { */ void removeRequiredResource(int); int numResources() const { return m_resources.count(); } - QPtrList<Resource> &resources() { return m_resources; } + TQPtrList<Resource> &resources() { return m_resources; } - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; void initiateCalculation(Schedule &sch); @@ -142,35 +142,35 @@ class ResourceGroup { { m_requests.append(request); } void unregisterRequest(ResourceGroupRequest *request) { m_requests.removeRef(request); } - const QPtrList<ResourceGroupRequest> &requests() const + const TQPtrList<ResourceGroupRequest> &requests() const { return m_requests; } ResourceGroup *findId() const { return findId(m_id); } - ResourceGroup *findId(const QString &id) const; + ResourceGroup *findId(const TQString &id) const; bool removeId() { return removeId(m_id); } - bool removeId(const QString &id); - void insertId(const QString &id); + bool removeId(const TQString &id); + void insertId(const TQString &id); Appointment appointmentIntervals() const; #ifndef NDEBUG - void printDebug(QString ident); + void printDebug(TQString ident); #endif private: Project *m_project; - QString m_id; // unique id - QString m_name; - QPtrList<Resource> m_resources; - QPtrList<Risk> m_risks; - QPtrList<ResourceGroup> m_requires; + TQString m_id; // unique id + TQString m_name; + TQPtrList<Resource> m_resources; + TQPtrList<Risk> m_risks; + TQPtrList<ResourceGroup> m_requires; - QPtrList<Node> m_nodes; //The nodes that want resources from us + TQPtrList<Node> m_nodes; //The nodes that want resources from us Calendar *m_defaultCalendar; Type m_type; - QPtrList<ResourceGroupRequest> m_requests; + TQPtrList<ResourceGroupRequest> m_requests; }; @@ -191,48 +191,48 @@ public: Resource(Resource *resource); virtual ~Resource(); - QString id() const { return m_id; } - bool setId(QString id); + TQString id() const { return m_id; } + bool setId(TQString id); void generateId(); enum Type { Type_Work, Type_Material }; void setType(Type type) { m_type = type; } - void setType(const QString &type); + void setType(const TQString &type); Type type() const { return m_type; } - QString typeToString() const; + TQString typeToString() const; - void setName(QString n) {m_name=n;} - const QString &name() const {return m_name;} + void setName(TQString n) {m_name=n;} + const TQString &name() const {return m_name;} - void setInitials(QString initials) {m_initials=initials;} - const QString &initials() const {return m_initials;} + void setInitials(TQString initials) {m_initials=initials;} + const TQString &initials() const {return m_initials;} - void setEmail(QString email) {m_email=email;} - const QString &email() const {return m_email;} + void setEmail(TQString email) {m_email=email;} + const TQString &email() const {return m_email;} void copy(Resource *resource); /// Set the time from when the resource is available to this project - void setAvailableFrom(const QDateTime &af) {m_availableFrom=af;} + void setAvailableFrom(const TQDateTime &af) {m_availableFrom=af;} /// Return the time when the resource is available to this project const DateTime &availableFrom() const {return m_availableFrom;} /// Set the time when the resource is no longer available to this project - void setAvailableUntil(const QDateTime au) {m_availableUntil=au;} + void setAvailableUntil(const TQDateTime au) {m_availableUntil=au;} /// Return the time when the resource is no longer available to this project. const DateTime &availableUntil() const {return m_availableUntil;} - void addWorkingHour(QTime from, QTime until); - QPtrList<QTime> workingHours() { return m_workingHours; } + void addWorkingHour(TQTime from, TQTime until); + TQPtrList<TQTime> workingHours() { return m_workingHours; } DateTime getFirstAvailableTime(DateTime after = DateTime()); DateTime getBestAvailableTime(Duration duration); DateTime getBestAvailableTime(const DateTime after, const Duration duration); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; ///Return the list of appointments for current schedule. - QPtrList<Appointment> appointments(); + TQPtrList<Appointment> appointments(); Appointment *findAppointment(Node *node); /// Adds appointment to current schedule @@ -247,7 +247,7 @@ public: void makeAppointment(Schedule *schedule); bool isOverbooked() const; - bool isOverbooked(const QDate &date) const; + bool isOverbooked(const TQDate &date) const; bool isOverbooked(const DateTime &start, const DateTime &end) const; double normalRate() const { return cost.normalRate; } @@ -273,7 +273,7 @@ public: * If local=false, check if there is a default calendar. */ Calendar *calendar(bool local=false) const; - Calendar *calendar(const QString id) const; + Calendar *calendar(const TQString id) const; void setCalendar(Calendar *calendar) { m_calendar = calendar; } /** @@ -283,7 +283,7 @@ public: { m_requests.append(request); } void unregisterRequest(const ResourceRequest *request) { m_requests.removeRef(request); } - const QPtrList<ResourceRequest> &requests() const + const TQPtrList<ResourceRequest> &requests() const { return m_requests; } Duration effort(const DateTime &start, const Duration &duration, bool backward, bool *ok=0) const; @@ -300,43 +300,43 @@ public: DateTime availableBefore(const DateTime &time, const DateTime limit=DateTime(), bool checkAppointments=false) const; Resource *findId() const { return findId(m_id); } - Resource *findId(const QString &id) const; + Resource *findId(const TQString &id) const; bool removeId() { return removeId(m_id); } - bool removeId(const QString &id); - void insertId(const QString &id); + bool removeId(const TQString &id); + void insertId(const TQString &id); - Calendar *findCalendar(const QString &id) const; + Calendar *findCalendar(const TQString &id) const; Appointment appointmentIntervals() const; - Duration plannedEffort(const QDate &date) const; + Duration plannedEffort(const TQDate &date) const; void setCurrentSchedule(Schedule *schedule) { m_currentSchedule = schedule; } void setCurrentSchedule(long id) { m_currentSchedule = findSchedule(id); } Schedule *currentSchedule() const { return m_currentSchedule; } - QIntDict<Schedule> &schedules() { return m_schedules; } + TQIntDict<Schedule> &schedules() { return m_schedules; } Schedule *findSchedule(long id) { return m_schedules[id]; } /// Take, and delete. void removeSchedule(Schedule *schedule); /// Take, don't delete. void takeSchedule(const Schedule *schedule); void addSchedule(Schedule *schedule); - ResourceSchedule *createSchedule(QString name, int type, long id); - ResourceSchedule *createSchedule(Schedule *parent); + ResourceSchedule *createSchedule(TQString name, int type, long id); + ResourceSchedule *createSchedule(Schedule *tqparent); protected: void makeAppointment(Schedule *node, const DateTime &from, const DateTime &end); private: Project *m_project; - QIntDict<Schedule> m_schedules; - QString m_id; // unique id - QString m_name; - QString m_initials; - QString m_email; + TQIntDict<Schedule> m_schedules; + TQString m_id; // unique id + TQString m_name; + TQString m_initials; + TQString m_email; DateTime m_availableFrom; DateTime m_availableUntil; - QPtrList<QTime> m_workingHours; + TQPtrList<TQTime> m_workingHours; int m_units; // avalable units in percent @@ -349,13 +349,13 @@ private: } cost; Calendar *m_calendar; - QPtrList<ResourceRequest> m_requests; + TQPtrList<ResourceRequest> m_requests; Schedule *m_currentSchedule; public: #ifndef NDEBUG - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -394,14 +394,14 @@ class ResourceRequest { ~ResourceRequest(); - ResourceGroupRequest *parent() const { return m_parent; } - void setParent(ResourceGroupRequest *parent) { m_parent = parent; } + ResourceGroupRequest *tqparent() const { return m_parent; } + void setParent(ResourceGroupRequest *tqparent) { m_parent = tqparent; } Resource *resource() const { return m_resource; } void setResource(Resource* resource) { m_resource = resource; } - bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; /** * Get amount of requested resource units in percent @@ -429,7 +429,7 @@ class ResourceRequest { #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -438,18 +438,18 @@ class ResourceGroupRequest { ResourceGroupRequest(ResourceGroup *group=0, int units=0); ~ResourceGroupRequest(); - void setParent(ResourceRequestCollection *parent) { m_parent = parent;} - ResourceRequestCollection *parent() const { return m_parent; } + void setParent(ResourceRequestCollection *tqparent) { m_parent = tqparent;} + ResourceRequestCollection *tqparent() const { return m_parent; } ResourceGroup *group() const { return m_group; } - QPtrList<ResourceRequest> &resourceRequests() { return m_resourceRequests; } + TQPtrList<ResourceRequest> &resourceRequests() { return m_resourceRequests; } void addResourceRequest(ResourceRequest *request); void removeResourceRequest(ResourceRequest *request) { m_resourceRequests.removeRef(request); } ResourceRequest *takeResourceRequest(ResourceRequest *request); - ResourceRequest *find(Resource *resource) const; + ResourceRequest *tqfind(Resource *resource) const; - bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; /** * Get total amount of resource units in percent @@ -494,13 +494,13 @@ class ResourceGroupRequest { int m_units; ResourceRequestCollection *m_parent; - QPtrList<ResourceRequest> m_resourceRequests; + TQPtrList<ResourceRequest> m_resourceRequests; DateTime m_start; Duration m_duration; #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -509,19 +509,19 @@ public: ResourceRequestCollection(Task &task); ~ResourceRequestCollection(); - const QPtrList<ResourceGroupRequest> &requests() const { return m_requests; } + const TQPtrList<ResourceGroupRequest> &requests() const { return m_requests; } void addRequest(ResourceGroupRequest *request) { m_requests.append(request); request->setParent(this); } void removeRequest(ResourceGroupRequest *request) { m_requests.removeRef(request); } - void takeRequest(ResourceGroupRequest *request) { m_requests.take(m_requests.findRef(request)); } - ResourceGroupRequest *find(ResourceGroup *resource) const; - ResourceRequest *find(Resource *resource) const; + void takeRequest(ResourceGroupRequest *request) { m_requests.take(m_requests.tqfindRef(request)); } + ResourceGroupRequest *tqfind(ResourceGroup *resource) const; + ResourceRequest *tqfind(Resource *resource) const; bool isEmpty() const; - //bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + //bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; void clear() { m_requests.clear(); } @@ -566,11 +566,11 @@ protected: private: Task &m_task; - QPtrList<ResourceGroupRequest> m_requests; + TQPtrList<ResourceGroupRequest> m_requests; #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; diff --git a/kplato/kptresourceappointmentsview.cc b/kplato/kptresourceappointmentsview.cc index b94e9de6..3768ebef 100644 --- a/kplato/kptresourceappointmentsview.cc +++ b/kplato/kptresourceappointmentsview.cc @@ -25,25 +25,25 @@ #include "kptresource.h" #include "kptview.h" -#include <qapplication.h> +#include <tqapplication.h> #include <kcalendarsystem.h> #include <kglobal.h> #include <klocale.h> -#include <qdatetime.h> -#include <qheader.h> +#include <tqdatetime.h> +#include <tqheader.h> namespace KPlato { -ResourceAppointmentsView::NodeItem::NodeItem(Node *t, QListView *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, t->name(), highlight), +ResourceAppointmentsView::NodeItem::NodeItem(Node *t, TQListView *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, t->name(), highlight), node(t) { setFormat(0, 'f', 1); //kdDebug()<<k_funcinfo<<endl; } -ResourceAppointmentsView::NodeItem::NodeItem(Node *t, QListViewItem *p, bool highlight) +ResourceAppointmentsView::NodeItem::NodeItem(Node *t, TQListViewItem *p, bool highlight) : DoubleListViewBase::MasterListItem(p, t->name(), highlight), node(t) { @@ -51,16 +51,16 @@ ResourceAppointmentsView::NodeItem::NodeItem(Node *t, QListViewItem *p, bool hig //kdDebug()<<k_funcinfo<<endl; } -ResourceAppointmentsView::NodeItem::NodeItem(QString text, QListViewItem *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, text, highlight), +ResourceAppointmentsView::NodeItem::NodeItem(TQString text, TQListViewItem *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, text, highlight), node(0) { setFormat(0, 'f', 1); //kdDebug()<<k_funcinfo<<endl; } -ResourceAppointmentsView::NodeItem::NodeItem(QString text, QListView *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, text, highlight), +ResourceAppointmentsView::NodeItem::NodeItem(TQString text, TQListView *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, text, highlight), node(0) { setFormat(0, 'f', 1); @@ -68,8 +68,8 @@ ResourceAppointmentsView::NodeItem::NodeItem(QString text, QListView *parent, bo } //------------------------------------------- -ResourceAppointmentsView::ResourceAppointmentsView(View *view, QWidget *parent) - : DoubleListViewBase(parent), +ResourceAppointmentsView::ResourceAppointmentsView(View *view, TQWidget *tqparent) + : DoubleListViewBase(tqparent), m_mainview(view), m_resource(0), m_availItem(0), @@ -78,9 +78,9 @@ ResourceAppointmentsView::ResourceAppointmentsView(View *view, QWidget *parent) setNameHeader(i18n("Task")); - QValueList<int> list = sizes(); + TQValueList<int> list = sizes(); int tot = list[0] + list[1]; - list[0] = QMIN(35, tot); + list[0] = TQMIN(35, tot); list[1] = tot-list[0]; setSizes(list); } @@ -90,7 +90,7 @@ void ResourceAppointmentsView::zoom(double zoom) { } -void ResourceAppointmentsView::draw(Resource *resource, const QDate &start, const QDate &end) { +void ResourceAppointmentsView::draw(Resource *resource, const TQDate &start, const TQDate &end) { m_resource = resource; m_start = start; m_end = end; @@ -107,9 +107,9 @@ void ResourceAppointmentsView::draw() { m_totalItem->setExpandable(true); m_totalItem->setOpen(true); m_availItem = new ResourceAppointmentsView::NodeItem(i18n("Available"), masterListView()); - QPtrList<Appointment> lst = m_resource->appointments(); + TQPtrList<Appointment> lst = m_resource->appointments(); //kdDebug()<<k_funcinfo<<lst.count()<<endl; - QPtrListIterator<Appointment> it(lst); + TQPtrListIterator<Appointment> it(lst); for (; it.current(); ++it) { //kdDebug()<<k_funcinfo<<endl; Node *n = it.current()->node()->node(); @@ -124,25 +124,25 @@ void ResourceAppointmentsView::slotUpdate() { //kdDebug()<<k_funcinfo<<endl; if (!m_resource) return; - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); createSlaveItems(); KLocale *locale = KGlobal::locale(); const KCalendarSystem *cal = locale->calendar(); const Calendar *resCal = m_resource->calendar(); - const QDateTime availFrom = m_resource->availableFrom(); - const QDateTime availUntil = m_resource->availableUntil(); + const TQDateTime availFrom = m_resource->availableFrom(); + const TQDateTime availUntil = m_resource->availableUntil(); // Add columns for selected period/periods //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; int c=0; - for (QDate dt = m_start; dt <= m_end; dt = cal->addDays(dt, 1), ++c) { - QString df = locale->formatDate(dt, true); + for (TQDate dt = m_start; dt <= m_end; dt = cal->addDays(dt, 1), ++c) { + TQString df = locale->formatDate(dt, true); addSlaveColumn(df); } if (m_totalItem) { m_totalItem->setHighlight(true); m_totalItem->setSlaveHighlight(true); } - QListViewItemIterator it(masterListView()); + TQListViewItemIterator it(masterListView()); for (;it.current(); ++it) { ResourceAppointmentsView::NodeItem *item = static_cast<ResourceAppointmentsView::NodeItem*>(it.current()); if (!item || item->firstChild()) { @@ -151,10 +151,10 @@ void ResourceAppointmentsView::slotUpdate() { double eff; double avail; int col=0; - for (QDate d=m_start; d <= m_end; d = cal->addDays(d, 1), ++col) { + for (TQDate d=m_start; d <= m_end; d = cal->addDays(d, 1), ++col) { if (item == m_availItem && resCal) { - QDateTime f(d); - QDateTime u(d, QTime(23, 59, 59, 999)); + TQDateTime f(d); + TQDateTime u(d, TQTime(23, 59, 59, 999)); if (f >= availUntil || u <= availFrom) { avail = 0.0; } else { @@ -184,7 +184,7 @@ void ResourceAppointmentsView::slotUpdate() { //kdDebug()<<k_funcinfo<<"avail="<<m_availItem->value()<<endl; } calculate(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } @@ -195,12 +195,12 @@ void ResourceAppointmentsView::print(KPrinter &/*printer*/) { // bool ResourceAppointmentsView::setContext(Context::ResourceAppointmentsView &context) { // //kdDebug()<<k_funcinfo<<endl; // -// QValueList<int> list; +// TQValueList<int> list; // list << context.accountsviewsize << context.periodviewsize; // m_dlv->setSizes(list); // m_date = context.date; // if (!m_date.isValid()) -// m_date = QDate::currentDate(); +// m_date = TQDate::tqcurrentDate(); // m_period = context.period; // m_cumulative = context.cumulative; // diff --git a/kplato/kptresourceappointmentsview.h b/kplato/kptresourceappointmentsview.h index 76bb9073..c3ddcbb6 100644 --- a/kplato/kptresourceappointmentsview.h +++ b/kplato/kptresourceappointmentsview.h @@ -24,14 +24,14 @@ #include "kptdoublelistviewbase.h" #include "kpteffortcostmap.h" -class QComboBox; -class QDateEdit; -class QPushButton; -class QSplitter; -class QListView; -class QListViewItem; -class QLabel; -class QPushButton; +class TQComboBox; +class TQDateEdit; +class TQPushButton; +class TQSplitter; +class TQListView; +class TQListViewItem; +class TQLabel; +class TQPushButton; class KListView; class KListViewItem; @@ -51,16 +51,17 @@ class Resource; class ResourceAppointmentsView : public DoubleListViewBase { Q_OBJECT + TQ_OBJECT public: - ResourceAppointmentsView(View *view, QWidget *parent); + ResourceAppointmentsView(View *view, TQWidget *tqparent); //~ResourceAppointmentsView(); void zoom(double zoom); View *mainView() const { return m_mainview; } - void draw(Resource *resource, const QDate &start, const QDate &end); + void draw(Resource *resource, const TQDate &start, const TQDate &end); void draw(); void print(KPrinter &printer); void clear(); @@ -76,10 +77,10 @@ protected slots: private: class NodeItem : public DoubleListViewBase::MasterListItem { public: - NodeItem(Node *n, QListView *parent, bool highlight=false); - NodeItem(Node *n, QListViewItem *parent, bool highlight=false); - NodeItem(QString text, QListView *parent, bool highlight=false); - NodeItem(QString text, QListViewItem *parent, bool highlight=false); + NodeItem(Node *n, TQListView *tqparent, bool highlight=false); + NodeItem(Node *n, TQListViewItem *tqparent, bool highlight=false); + NodeItem(TQString text, TQListView *tqparent, bool highlight=false); + NodeItem(TQString text, TQListViewItem *tqparent, bool highlight=false); Node *node; EffortCostMap effortMap; @@ -90,8 +91,8 @@ private: int m_defaultFontSize; Resource *m_resource; - QDate m_start; - QDate m_end; + TQDate m_start; + TQDate m_end; NodeItem *m_availItem; NodeItem *m_totalItem; }; diff --git a/kplato/kptresourcedialog.cc b/kplato/kptresourcedialog.cc index 56d79482..b67116a1 100644 --- a/kplato/kptresourcedialog.cc +++ b/kplato/kptresourcedialog.cc @@ -24,17 +24,17 @@ #include "kptresource.h" #include "kptcalendar.h" -#include <qpushbutton.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include <kabc/addressee.h> #include <kabc/addresseedialog.h> @@ -49,27 +49,27 @@ namespace KPlato { -ResourceDialogImpl::ResourceDialogImpl (QWidget *parent) - : ResourceDialogBase(parent) +ResourceDialogImpl::ResourceDialogImpl (TQWidget *tqparent) + : ResourceDialogBase(tqparent) { - connect(type, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(units, SIGNAL(valueChanged(int)), SLOT(slotChanged())); - connect(nameEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); - connect(initialsEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); - connect(emailEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); + connect(type, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(units, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChanged())); + connect(nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); + connect(initialsEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); + connect(emailEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); - connect(calendarList, SIGNAL(activated(int)), SLOT(slotChanged())); + connect(calendarList, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); - connect(rateEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); - connect(overtimeEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); + connect(rateEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); + connect(overtimeEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); - connect(chooseBtn, SIGNAL(clicked()), SLOT(slotChooseResource())); + connect(chooseBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotChooseResource())); - connect(availableFrom, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotChanged())); - connect(availableUntil, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotChanged())); - connect(availableFrom, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotAvailableFromChanged(const QDateTime&))); - connect(availableUntil, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotAvailableUntilChanged(const QDateTime&))); + connect(availableFrom, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotChanged())); + connect(availableUntil, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotChanged())); + connect(availableFrom, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotAvailableFromChanged(const TQDateTime&))); + connect(availableUntil, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotAvailableUntilChanged(const TQDateTime&))); } @@ -77,25 +77,25 @@ void ResourceDialogImpl::slotChanged() { emit changed(); } -void ResourceDialogImpl::slotAvailableFromChanged(const QDateTime&) { +void ResourceDialogImpl::slotAvailableFromChanged(const TQDateTime&) { if (availableUntil->dateTime() < availableFrom->dateTime()) { - disconnect(availableUntil, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(slotAvailableUntilChanged(const QDateTime&))); + disconnect(availableUntil, TQT_SIGNAL(valueChanged(const TQDateTime&)), this, TQT_SLOT(slotAvailableUntilChanged(const TQDateTime&))); //kdDebug()<<"From: "<<availableFrom->dateTime().toString()<<" until="<<availableUntil->dateTime().toString()<<endl; availableUntil->setDateTime(availableFrom->dateTime()); - connect(availableUntil, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotAvailableUntilChanged(const QDateTime&))); + connect(availableUntil, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotAvailableUntilChanged(const TQDateTime&))); } } -void ResourceDialogImpl::slotAvailableUntilChanged(const QDateTime&) { +void ResourceDialogImpl::slotAvailableUntilChanged(const TQDateTime&) { if (availableFrom->dateTime() > availableUntil->dateTime()) { - disconnect(availableFrom, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(slotAvailableFromChanged(const QDateTime&))); + disconnect(availableFrom, TQT_SIGNAL(valueChanged(const TQDateTime&)), this, TQT_SLOT(slotAvailableFromChanged(const TQDateTime&))); //kdDebug()<<"Until: "<<availableUntil->dateTime().toString()<<" from="<<availableFrom->dateTime().toString()<<endl; availableFrom->setDateTime(availableUntil->dateTime()); - connect(availableFrom, SIGNAL(valueChanged(const QDateTime&)), SLOT(slotAvailableFromChanged(const QDateTime&))); + connect(availableFrom, TQT_SIGNAL(valueChanged(const TQDateTime&)), TQT_SLOT(slotAvailableFromChanged(const TQDateTime&))); } } -void ResourceDialogImpl::slotCalculationNeeded(const QString&) { +void ResourceDialogImpl::slotCalculationNeeded(const TQString&) { emit calculate(); emit changed(); } @@ -106,9 +106,9 @@ void ResourceDialogImpl::slotChooseResource() if (!a.isEmpty()) { nameEdit->setText(a.assembledName()); emailEdit->setText(a.preferredEmail()); - QStringList l = QStringList::split(' ', a.assembledName()); - QString in; - QStringList::Iterator it = l.begin(); + TQStringList l = TQStringList::split(' ', a.assembledName()); + TQString in; + TQStringList::Iterator it = l.begin(); for (/*int i = 0*/; it != l.end(); ++it) { in += (*it)[0]; } @@ -118,8 +118,8 @@ void ResourceDialogImpl::slotChooseResource() ////////////////// ResourceDialog //////////////////////// -ResourceDialog::ResourceDialog(Project &project, Resource *resource, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Resource Settings"), Ok|Cancel, Ok, parent, name, true, true), +ResourceDialog::ResourceDialog(Project &project, Resource *resource, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Resource Settings"), Ok|Cancel, Ok, tqparent, name, true, true), m_original(resource), m_resource(resource), m_calculationNeeded(false) @@ -141,8 +141,8 @@ ResourceDialog::ResourceDialog(Project &project, Resource *resource, QWidget *pa int cal = 0; dia->calendarList->insertItem(i18n("None")); m_calendars.insert(0, 0); - QPtrList<Calendar> list = project.calendars(); - QPtrListIterator<Calendar> cit = list; + TQPtrList<Calendar> list = project.calendars(); + TQPtrListIterator<Calendar> cit = list; for(int i=1; cit.current(); ++cit, ++i) { dia->calendarList->insertItem(cit.current()->name(), i); m_calendars.insert(i, cit.current()); @@ -151,9 +151,9 @@ ResourceDialog::ResourceDialog(Project &project, Resource *resource, QWidget *pa } dia->calendarList->setCurrentItem(cal); - connect(dia, SIGNAL(changed()), SLOT(enableButtonOk())); - connect(dia, SIGNAL(calculate()), SLOT(slotCalculationNeeded())); - connect(dia->calendarList, SIGNAL(activated(int)), SLOT(slotCalendarChanged(int))); + connect(dia, TQT_SIGNAL(changed()), TQT_SLOT(enableButtonOk())); + connect(dia, TQT_SIGNAL(calculate()), TQT_SLOT(slotCalculationNeeded())); + connect(dia->calendarList, TQT_SIGNAL(activated(int)), TQT_SLOT(slotCalendarChanged(int))); } @@ -192,7 +192,7 @@ KCommand *ResourceDialog::buildCommand(Part *part) { // static KCommand *ResourceDialog::buildCommand(Resource *original, Resource &resource, Part *part) { KMacroCommand *m=0; - QString n = i18n("Modify Resource"); + TQString n = i18n("Modify Resource"); if (resource.name() != original->name()) { if (!m) m = new KMacroCommand(n); m->addCommand(new ModifyResourceNameCmd(part, original, resource.name())); diff --git a/kplato/kptresourcedialog.h b/kplato/kptresourcedialog.h index bfa0da7d..ef4b8d12 100644 --- a/kplato/kptresourcedialog.h +++ b/kplato/kptresourcedialog.h @@ -25,13 +25,13 @@ #include <kdialogbase.h> -#include <qmap.h> -#include <qcombobox.h> +#include <tqmap.h> +#include <tqcombobox.h> class KCommand; -class QTime; -class QString; +class TQTime; +class TQString; namespace KPlato { @@ -43,12 +43,13 @@ class Calendar; class ResourceDialogImpl : public ResourceDialogBase { Q_OBJECT + TQ_OBJECT public: - ResourceDialogImpl (QWidget *parent); + ResourceDialogImpl (TQWidget *tqparent); public slots: void slotChanged(); - void slotCalculationNeeded(const QString&); + void slotCalculationNeeded(const TQString&); void slotChooseResource(); signals: @@ -56,14 +57,15 @@ signals: void calculate(); protected slots: - void slotAvailableFromChanged(const QDateTime& dt); - void slotAvailableUntilChanged(const QDateTime& dt); + void slotAvailableFromChanged(const TQDateTime& dt); + void slotAvailableUntilChanged(const TQDateTime& dt); }; class ResourceDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ResourceDialog(Project &project, Resource *resource, QWidget *parent=0, const char *name=0); + ResourceDialog(Project &project, Resource *resource, TQWidget *tqparent=0, const char *name=0); bool calculationNeeded() { return m_calculationNeeded; } @@ -84,7 +86,7 @@ private: ResourceDialogImpl *dia; bool m_calculationNeeded; - QMap<int, Calendar*> m_calendars; + TQMap<int, Calendar*> m_calendars; }; } //KPlato namespace diff --git a/kplato/kptresourcesdialog.cc b/kplato/kptresourcesdialog.cc index 967c2f2e..784f8e4e 100644 --- a/kplato/kptresourcesdialog.cc +++ b/kplato/kptresourcesdialog.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qvbox.h> +#include <tqvbox.h> #include <klocale.h> #include <kcommand.h> @@ -32,8 +32,8 @@ namespace KPlato { -ResourcesDialog::ResourcesDialog(Project &p, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Resources"), Ok|Cancel, Ok, parent, name, true, true), +ResourcesDialog::ResourcesDialog(Project &p, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Resources"), Ok|Cancel, Ok, tqparent, name, true, true), project(p) { panel = new ResourcesPanel(this, &project); @@ -41,7 +41,7 @@ ResourcesDialog::ResourcesDialog(Project &p, QWidget *parent, const char *name) setMainWidget(panel); enableButtonOK(false); - connect(panel, SIGNAL(changed()), SLOT(slotChanged())); + connect(panel, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged())); } @@ -57,7 +57,7 @@ void ResourcesDialog::slotOk() { KCommand *ResourcesDialog::buildCommand(Part *part) { KMacroCommand *m = 0; - QString c = i18n("Modify resources"); + TQString c = i18n("Modify resources"); KCommand *cmd = panel->buildCommand(part); if (cmd) { if (!m) m = new KMacroCommand(c); diff --git a/kplato/kptresourcesdialog.h b/kplato/kptresourcesdialog.h index 65c4acd9..2f7c43d7 100644 --- a/kplato/kptresourcesdialog.h +++ b/kplato/kptresourcesdialog.h @@ -34,8 +34,9 @@ class Part; class ResourcesDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ResourcesDialog(Project &project, QWidget *parent=0, const char *name=0); + ResourcesDialog(Project &project, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptresourcespanel.cc b/kplato/kptresourcespanel.cc index 71a6f919..cc645d42 100644 --- a/kplato/kptresourcespanel.cc +++ b/kplato/kptresourcespanel.cc @@ -30,12 +30,12 @@ #include <kabc/addressee.h> #include <kabc/addresseedialog.h> -#include <qgroupbox.h> -#include <qheader.h> -#include <qlistbox.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qpushbutton.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqlistbox.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqpushbutton.h> //////////////////////////// Private classes ////////////////////////////////// @@ -71,8 +71,8 @@ public: return; // A new is allways new m_state = s; } - QString name() { return m_resource->name(); } - void setName(const QString &newName) { + TQString name() { return m_resource->name(); } + void setName(const TQString &newName) { m_resource->setName(newName); setState(Modified); } @@ -104,13 +104,13 @@ KCommand *ResourcesPanelResourceItem::saveResource(Part *part, ResourceGroup *gr return m; } -class ResourceLBItem : public QListBoxText { +class ResourceLBItem : public TQListBoxText { public: ResourceLBItem(ResourcesPanelResourceItem *item) { m_resourceItem = item; setText(item->name()); } - QString name() { return m_resourceItem->name(); } - void setName(const QString &newName) { + TQString name() { return m_resourceItem->name(); } + void setName(const TQString &newName) { setText(newName); m_resourceItem->setName(newName); } @@ -139,7 +139,7 @@ public: } } void setState(State s) { m_state |= s; } - void setName(const QString &newName) { + void setName(const TQString &newName) { m_name = newName; if (m_state & New) m_group->setName(newName); @@ -152,7 +152,7 @@ public: } void deleteResource(ResourcesPanelResourceItem *item) { //kdDebug()<<k_funcinfo<<" Deleted: "<<item->m_name<<" ("<<item<<")"<<endl; - m_resourceItems.take(m_resourceItems.findRef(item)); + m_resourceItems.take(m_resourceItems.tqfindRef(item)); if (item->m_state == ResourcesPanelResourceItem::New) delete item; else @@ -174,9 +174,9 @@ public: } } ResourceGroup *m_group; - QString m_name; - QPtrList<ResourcesPanelResourceItem> m_resourceItems; - QPtrList<ResourcesPanelResourceItem> m_deletedItems; + TQString m_name; + TQPtrList<ResourcesPanelResourceItem> m_resourceItems; + TQPtrList<ResourcesPanelResourceItem> m_deletedItems; int m_state; }; @@ -193,7 +193,7 @@ public: ~ResourcesPanelGroupLVItem() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; } - void setName(const QString &newName) { + void setName(const TQString &newName) { setText(0, newName); m_group->setName(newName); } @@ -209,7 +209,7 @@ public: } GroupItem *m_group; ResourcesPanel &panel; - QString oldText; + TQString oldText; protected: virtual void cancelRename(int col) { @@ -225,7 +225,7 @@ protected: //////////////////// ResourcesPanel ////////////////////// -ResourcesPanel::ResourcesPanel(QWidget *parent, Project *p) : ResourcesPanelBase(parent) { +ResourcesPanel::ResourcesPanel(TQWidget *tqparent, Project *p) : ResourcesPanelBase(tqparent) { project = p; m_groupItem = 0; m_blockResourceRename = false; @@ -238,18 +238,18 @@ ResourcesPanel::ResourcesPanel(QWidget *parent, Project *p) : ResourcesPanelBase listOfGroups->header()->setStretchEnabled(true, 0); listOfGroups->setSorting(0); listOfGroups->setShowSortIndicator(true); - listOfGroups->setDefaultRenameAction (QListView::Accept); + listOfGroups->setDefaultRenameAction (TQListView::Accept); bAdd->setEnabled(true); m_groupItems.setAutoDelete(true); m_deletedGroupItems.setAutoDelete(true); - QPtrListIterator<ResourceGroup> git(project->resourceGroups()); + TQPtrListIterator<ResourceGroup> git(project->resourceGroups()); for(; git.current(); ++git) { ResourceGroup *grp = git.current(); GroupItem *groupItem = new GroupItem(grp); //kdDebug()<<k_funcinfo<<" Added group: "<<groupItem->m_name<<" ("<<groupItem<<")"<<endl; - QPtrListIterator<Resource> rit(grp->resources()); + TQPtrListIterator<Resource> rit(grp->resources()); for(; rit.current(); ++rit) { Resource *res = rit.current(); ResourcesPanelResourceItem *ritem = new ResourcesPanelResourceItem(res); @@ -262,25 +262,25 @@ ResourcesPanel::ResourcesPanel(QWidget *parent, Project *p) : ResourcesPanelBase listOfGroups->setSelected(listOfGroups->firstChild(), true); slotGroupChanged(); - connect(bAdd, SIGNAL(clicked()), SLOT(slotAddGroup())); - connect(bRemove, SIGNAL(clicked()), SLOT(slotDeleteGroup())); - connect(listOfGroups, SIGNAL(selectionChanged()), SLOT(slotGroupChanged())); - connect(listOfGroups, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(slotListDoubleClicked(QListViewItem*, const QPoint&, int))); - connect(listOfGroups, SIGNAL(itemRenamed(QListViewItem*, int)), SLOT(slotItemRenamed(QListViewItem*, int))); + connect(bAdd, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddGroup())); + connect(bRemove, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteGroup())); + connect(listOfGroups, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotGroupChanged())); + connect(listOfGroups, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), TQT_SLOT(slotListDoubleClicked(TQListViewItem*, const TQPoint&, int))); + connect(listOfGroups, TQT_SIGNAL(itemRenamed(TQListViewItem*, int)), TQT_SLOT(slotItemRenamed(TQListViewItem*, int))); - connect(bAddResource, SIGNAL( clicked() ), this, SLOT ( slotAddResource() )); - connect(bEditResource, SIGNAL( clicked() ), this, SLOT ( slotEditResource() )); - connect(bRemoveResource, SIGNAL( clicked() ), this, SLOT ( slotDeleteResource() )); - connect(listOfResources, SIGNAL(selectionChanged(QListBoxItem*)), SLOT(slotResourceChanged(QListBoxItem*))); - connect(listOfResources, SIGNAL(currentChanged(QListBoxItem*)), SLOT(slotCurrentChanged(QListBoxItem*))); - connect(resourceName, SIGNAL(textChanged(const QString&)), SLOT(slotResourceRename(const QString&))); + connect(bAddResource, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( slotAddResource() )); + connect(bEditResource, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( slotEditResource() )); + connect(bRemoveResource, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( slotDeleteResource() )); + connect(listOfResources, TQT_SIGNAL(selectionChanged(TQListBoxItem*)), TQT_SLOT(slotResourceChanged(TQListBoxItem*))); + connect(listOfResources, TQT_SIGNAL(currentChanged(TQListBoxItem*)), TQT_SLOT(slotCurrentChanged(TQListBoxItem*))); + connect(resourceName, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotResourceRename(const TQString&))); // Internal hacks, to get renaming to behave - // Uses signals to not get in the way of QListView - connect(this, SIGNAL(renameStarted(QListViewItem*, int)), SLOT(slotRenameStarted(QListViewItem*, int))); - connect(this, SIGNAL(startRename(QListViewItem*, int)), SLOT(slotStartRename(QListViewItem*, int))); - connect(this, SIGNAL(selectionChanged()), SLOT(slotGroupChanged())); + // Uses signals to not get in the way of TQListView + connect(this, TQT_SIGNAL(renameStarted(TQListViewItem*, int)), TQT_SLOT(slotRenameStarted(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(startRename(TQListViewItem*, int)), TQT_SLOT(slotStartRename(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotGroupChanged())); } void ResourcesPanel::slotAddGroup() { @@ -290,7 +290,7 @@ void ResourcesPanel::slotAddGroup() { m_groupItems.append(gitem); ResourcesPanelGroupLVItem *groupItem = new ResourcesPanelGroupLVItem(*this, listOfGroups, gitem); - slotListDoubleClicked(groupItem, QPoint(), 0); + slotListDoubleClicked(groupItem, TQPoint(), 0); } void ResourcesPanel::slotDeleteGroup() { @@ -302,7 +302,7 @@ void ResourcesPanel::slotDeleteGroup() { listOfResources->clear(); listOfGroups->takeItem(groupLVItem); // remove from listbox - m_groupItems.take(m_groupItems.findRef(groupLVItem->m_group)); // remove GroupItem from active list + m_groupItems.take(m_groupItems.tqfindRef(groupLVItem->m_group)); // remove GroupItem from active list m_deletedGroupItems.append(groupLVItem->takeGroup()); // remove GroupItem from GroupLVItem and add to deleted list //kdDebug()<<k_funcinfo<<" No of deleted groups="<<m_deletedGroupItems.count()<<", now "<<m_groupItems.count()<<" groups left"<<endl; @@ -375,7 +375,7 @@ void ResourcesPanel::slotDeleteResource() { } /* Select another resource */ -void ResourcesPanel::slotResourceChanged( QListBoxItem *item) { +void ResourcesPanel::slotResourceChanged( TQListBoxItem *item) { if (!item) { resourceName->setEnabled(false); bEditResource->setEnabled(false); @@ -389,14 +389,14 @@ void ResourcesPanel::slotResourceChanged( QListBoxItem *item) { } /* Select another resource */ -void ResourcesPanel::slotCurrentChanged( QListBoxItem *item) { +void ResourcesPanel::slotCurrentChanged( TQListBoxItem *item) { if (item && !item->isSelected()) { listOfResources->setSelected(item, true); } } -void ResourcesPanel::slotResourceRename( const QString &newName) { - QListBoxItem *item = listOfResources->selectedItem(); +void ResourcesPanel::slotResourceRename( const TQString &newName) { + TQListBoxItem *item = listOfResources->selectedItem(); if(!item || m_blockResourceRename) return; ResourceLBItem *i = dynamic_cast<ResourceLBItem *>(item); @@ -416,8 +416,8 @@ KCommand *ResourcesPanel::buildCommand(Part *part) { KMacroCommand *m=0; GroupItem *gitem; - QString cmdName = "Modify resourcegroups"; - QPtrListIterator<GroupItem> dgit(m_deletedGroupItems); + TQString cmdName = "Modify resourcegroups"; + TQPtrListIterator<GroupItem> dgit(m_deletedGroupItems); for (; (gitem = dgit.current()) != 0; ++dgit) { if (!(gitem->m_state & GroupItem::New)) { if (!m) m = new KMacroCommand(cmdName); @@ -426,11 +426,11 @@ KCommand *ResourcesPanel::buildCommand(Part *part) { } } - QPtrListIterator<GroupItem> git(m_groupItems); + TQPtrListIterator<GroupItem> git(m_groupItems); for (; (gitem = git.current()) != 0; ++git) { //kdDebug()<<k_funcinfo<<"Group: "<<gitem->m_name<<" has "<<gitem->m_resourceItems.count()<<" resources"<<" and "<<gitem->m_deletedItems.count()<<" deleted resources"<<endl; //First remove deleted resources from group - QPtrListIterator<ResourcesPanelResourceItem> dit(gitem->m_deletedItems); + TQPtrListIterator<ResourcesPanelResourceItem> dit(gitem->m_deletedItems); ResourcesPanelResourceItem *ditem; for (; (ditem = dit.current()) != 0; ++dit) { if (!m) m = new KMacroCommand(cmdName); @@ -453,7 +453,7 @@ KCommand *ResourcesPanel::buildCommand(Part *part) { m->addCommand(new ModifyResourceGroupNameCmd(part, rg, gitem->m_name)); } } - QPtrListIterator<ResourcesPanelResourceItem> it(gitem->m_resourceItems); + TQPtrListIterator<ResourcesPanelResourceItem> it(gitem->m_resourceItems); for (; it.current() != 0; ++it) { KCommand *cmd = it.current()->saveResource(part, rg); if (cmd) { @@ -469,7 +469,7 @@ void ResourcesPanel::slotGroupChanged() { slotGroupChanged(listOfGroups->selectedItem()); } -void ResourcesPanel::slotGroupChanged(QListViewItem *itm) { +void ResourcesPanel::slotGroupChanged(TQListViewItem *itm) { ResourcesPanelGroupLVItem *item = static_cast<ResourcesPanelGroupLVItem*>(itm); if (!item) { bAdd->setEnabled(true); @@ -487,7 +487,7 @@ void ResourcesPanel::slotGroupChanged(QListViewItem *itm) { m_groupItem = item; listOfResources->clear(); - QPtrListIterator<ResourcesPanelResourceItem> it(m_groupItem->m_group->m_resourceItems); + TQPtrListIterator<ResourcesPanelResourceItem> it(m_groupItem->m_group->m_resourceItems); for ( ; it.current(); ++it ) { listOfResources->insertItem(new ResourceLBItem(it.current())); //kdDebug()<<k_funcinfo<<"Insert resource item: "<<it.current()->name()<<endl; @@ -498,14 +498,14 @@ void ResourcesPanel::slotGroupChanged(QListViewItem *itm) { resourceGroupBox->setEnabled(true); } -void ResourcesPanel::slotListDoubleClicked(QListViewItem* item, const QPoint&, int col) { +void ResourcesPanel::slotListDoubleClicked(TQListViewItem* item, const TQPoint&, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (m_renameItem) return; slotStartRename(item, col); } -void ResourcesPanel::slotItemRenamed(QListViewItem *item, int col) { +void ResourcesPanel::slotItemRenamed(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<item->text(0)<<endl; item->setRenameEnabled(col, false); m_renameItem = 0; @@ -530,7 +530,7 @@ void ResourcesPanel::slotItemRenamed(QListViewItem *item, int col) { emit changed(); } -void ResourcesPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { +void ResourcesPanel::slotRenameStarted(TQListViewItem */*item*/, int /*col*/) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (listOfGroups->isRenaming()) { bRemove->setEnabled(false); @@ -538,7 +538,7 @@ void ResourcesPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { } } -void ResourcesPanel::slotStartRename(QListViewItem *item, int col) { +void ResourcesPanel::slotStartRename(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; static_cast<ResourcesPanelGroupLVItem*>(item)->oldText = item->text(col); item->setRenameEnabled(col, true); @@ -549,7 +549,7 @@ void ResourcesPanel::slotStartRename(QListViewItem *item, int col) { } // We don't get notified when rename is cancelled, this is called from the item -void ResourcesPanel::renameStopped(QListViewItem *) { +void ResourcesPanel::renameStopped(TQListViewItem *) { //kdDebug()<<k_funcinfo<<endl; m_renameItem = 0; emit selectionChanged(); diff --git a/kplato/kptresourcespanel.h b/kplato/kptresourcespanel.h index a5e1a46a..9324fd9b 100644 --- a/kplato/kptresourcespanel.h +++ b/kplato/kptresourcespanel.h @@ -23,10 +23,10 @@ #include "kptresource.h" #include "resourcespanelbase.h" -#include <qlistbox.h> -#include <qstring.h> +#include <tqlistbox.h> +#include <tqstring.h> -class QListViewItem; +class TQListViewItem; class KCommand; namespace KPlato @@ -40,15 +40,16 @@ class Part; class ResourcesPanel : public ResourcesPanelBase { Q_OBJECT + TQ_OBJECT public: - ResourcesPanel (QWidget *parent, Project *project); + ResourcesPanel (TQWidget *tqparent, Project *project); bool ok(); KCommand *buildCommand(Part *part); void sendChanged(); - void renameStopped(QListViewItem* item); + void renameStopped(TQListViewItem* item); protected slots: void slotAddGroup(); @@ -58,31 +59,31 @@ protected slots: void slotEditResource(); void slotDeleteResource(); - void slotGroupChanged(QListViewItem *item); + void slotGroupChanged(TQListViewItem *item); void slotGroupChanged(); - void slotResourceRename(const QString &newName); - void slotResourceChanged( QListBoxItem*); - void slotCurrentChanged( QListBoxItem*); - - void slotListDoubleClicked(QListViewItem*, const QPoint&, int); - void slotItemRenamed(QListViewItem *item, int col); - void slotRenameStarted(QListViewItem *item, int col); - void slotStartRename(QListViewItem *item, int col); + void slotResourceRename(const TQString &newName); + void slotResourceChanged( TQListBoxItem*); + void slotCurrentChanged( TQListBoxItem*); + + void slotListDoubleClicked(TQListViewItem*, const TQPoint&, int); + void slotItemRenamed(TQListViewItem *item, int col); + void slotRenameStarted(TQListViewItem *item, int col); + void slotStartRename(TQListViewItem *item, int col); signals: void changed(); void selectionChanged(); - void startRename(QListViewItem *item, int col); - void renameStarted(QListViewItem *item, int col); + void startRename(TQListViewItem *item, int col); + void renameStarted(TQListViewItem *item, int col); private: Project *project; ResourcesPanelGroupLVItem *m_groupItem; - QPtrList<GroupItem> m_groupItems; - QPtrList<GroupItem> m_deletedGroupItems; + TQPtrList<GroupItem> m_groupItems; + TQPtrList<GroupItem> m_deletedGroupItems; bool m_blockResourceRename; - QListViewItem *m_renameItem; + TQListViewItem *m_renameItem; }; } //KPlato namespace diff --git a/kplato/kptresourceview.cc b/kplato/kptresourceview.cc index 7744392d..a0cdb552 100644 --- a/kplato/kptresourceview.cc +++ b/kplato/kptresourceview.cc @@ -30,11 +30,11 @@ #include "kptdatetime.h" #include "kptcontext.h" -#include <qheader.h> -#include <qpopupmenu.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qstyle.h> +#include <tqheader.h> +#include <tqpopupmenu.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqstyle.h> #include <klistview.h> #include <klocale.h> @@ -48,22 +48,22 @@ namespace KPlato class ResListView : public KListView { public: - ResListView(QWidget * parent = 0, const char* name=0) - : KListView(parent, name) + ResListView(TQWidget * tqparent = 0, const char* name=0) + : KListView(tqparent, name) {} int headerHeight() const { return header()->count() > 0 ? header()->sectionRect(0).height() : 0; } - virtual void paintToPrinter(QPainter *p, int x, int y, int w, int h) { + virtual void paintToPrinter(TQPainter *p, int x, int y, int w, int h) { p->save(); - QColor bgc(193, 223, 255); - QBrush bg(bgc); + TQColor bgc(193, 223, 255); + TQBrush bg(bgc); p->setBackgroundMode(Qt::OpaqueMode); p->setBackgroundColor(bgc); - QHeader *head = header(); + TQHeader *head = header(); int offset = 0; - QRect sr; + TQRect sr; // Header shall always be at top/left on page for (int s = 0; s < head->count(); ++s) { sr = head->sectionRect(s); @@ -73,20 +73,20 @@ public: for (int s = 0; s < head->count(); ++s) { sr = head->sectionRect(s); if (offset != 0) { - sr = QRect(sr.x()-offset, sr.y(), sr.width(), sr.height()); + sr = TQRect(sr.x()-offset, sr.y(), sr.width(), sr.height()); } //kdDebug()<<s<<": "<<head->label(s)<<" "<<sr<<endl; if (sr.x()+sr.width() <= x || sr.x() >= x+w) { //kdDebug()<<s<<": "<<h->label(s)<<" "<<sr<<": continue"<<endl; continue; } - QRect tr = sr; + TQRect tr = sr; if (sr.x() < x) { tr.setX(x); //kdDebug()<<s<<": "<<head->label(s)<<" "<<tr<<endl; } p->eraseRect(tr); - p->drawText(tr, columnAlignment(s)|Qt::AlignVCenter, head->label(s), -1); + p->drawText(tr, columnAlignment(s)|TQt::AlignVCenter, head->label(s), -1); } p->restore(); p->save(); @@ -95,9 +95,9 @@ public: p->restore(); } int calculateY(int ymin, int ymax) const { - QPtrList<ResListView::DrawableItem> drawables; + TQPtrList<ResListView::DrawableItem> drawables; drawables.setAutoDelete(true); - QListViewItem *child = firstChild(); + TQListViewItem *child = firstChild(); int level = 0; int ypos = 0; for (; child; child = child->nextSibling()) { @@ -113,13 +113,13 @@ public: } class DrawableItem { public: - DrawableItem(int level, int ypos, QListViewItem *item ) { y = ypos; l = level; i = item; }; + DrawableItem(int level, int ypos, TQListViewItem *item ) { y = ypos; l = level; i = item; }; int y; int l; - QListViewItem * i; + TQListViewItem * i; }; protected: - int buildDrawables(QPtrList<ResListView::DrawableItem> &lst, int level, int ypos, QListViewItem *item, int ymin, int ymax) const { + int buildDrawables(TQPtrList<ResListView::DrawableItem> &lst, int level, int ypos, TQListViewItem *item, int ymin, int ymax) const { int y = ypos; int ih = item->height(); if (y < ymin && y+ih > ymin) { @@ -132,26 +132,26 @@ protected: } y += ih; if (item->isOpen()) { - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); for (; child; child = child->nextSibling()) { y = buildDrawables(lst, level+1, y, child, ymin, ymax); } } return y; } - // This is a copy of QListView::drawContentsOffset(), with a few changes + // This is a copy of TQListView::drawContentsOffset(), with a few changes // because drawContentsOffset() only draws *visible* items, // we want to draw *all* items. // FIXME: Haven't got paintBraches() to work, atm live without it. - virtual void drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) { + virtual void drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch) { if ( columns() == 0 ) { - paintEmptyArea( p, QRect( cx, cy, cw, ch ) ); + paintEmptyArea( p, TQRect( cx, cy, cw, ch ) ); return; } - //kdDebug()<<k_funcinfo<<QRect(cx, cy, cw, ch)<<endl; - QPtrList<ResListView::DrawableItem> drawables; + //kdDebug()<<k_funcinfo<<TQRect(cx, cy, cw, ch)<<endl; + TQPtrList<ResListView::DrawableItem> drawables; drawables.setAutoDelete(true); - QListViewItem *child = firstChild(); + TQListViewItem *child = firstChild(); int level = 0; int ypos = 0; for (; child; child = child->nextSibling()) { @@ -160,9 +160,9 @@ protected: p->setFont( font() ); - QPtrListIterator<ResListView::DrawableItem> it(drawables); + TQPtrListIterator<ResListView::DrawableItem> it(drawables); - QRect r; + TQRect r; int fx = -1, x, fc = 0, lc = 0; int tx = -1; ResListView::DrawableItem * current; @@ -203,7 +203,7 @@ protected: c = fc; // draw to last interesting column - const QColorGroup &cg = ( palette().inactive() ); + const TQColorGroup &cg = ( tqpalette().inactive() ); while ( c < lc && !drawables.isEmpty() ) { int i = header()->mapToLogical( c ); @@ -240,7 +240,7 @@ protected: if ( tx < 0 ) tx = header()->cellPos( cell ); - // do any children of current need to be painted? + // do any tqchildren of current need to be painted? /* FIXME: painting branches doesn't work for some reason... if ( ih != ith && rootIsDecorated() && @@ -255,10 +255,10 @@ protected: int rleft = tx + current->l*treeStepSize(); int rright = rleft + treeStepSize(); - int crtop = QMAX( rtop, cy ); - int crbottom = QMIN( rbottom, cy+ch ); - int crleft = QMAX( rleft, cx ); - int crright = QMIN( rright, cx+cw ); + int crtop = TQMAX( rtop, cy ); + int crbottom = TQMIN( rbottom, cy+ch ); + int crleft = TQMAX( rleft, cx ); + int crright = TQMIN( rright, cx+cw ); r.setRect( crleft, crtop, crright-crleft, crbottom-crtop ); @@ -268,7 +268,7 @@ protected: p->translate( rleft, crtop ); //kdDebug()<<k_funcinfo<<"paintBranches: "<<current->i->text(0)<<endl; - current->i->paintBranches( p, colorGroup(), treeStepSize(), + current->i->paintBranches( p, tqcolorGroup(), treeStepSize(), rtop - crtop, r.height() ); p->restore(); } @@ -280,17 +280,17 @@ protected: class ResourceItemPrivate : public KListViewItem { public: - ResourceItemPrivate(Resource *r, QListViewItem *parent) - : KListViewItem(parent, r->name()), + ResourceItemPrivate(Resource *r, TQListViewItem *tqparent) + : KListViewItem(tqparent, r->name()), resource(r) {} Resource *resource; - virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align) { - QColorGroup g = cg; + virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { + TQColorGroup g = cg; if (m_columns[column] == 1) { - g.setColor(QColorGroup::Text, QColor(red)); - g.setColor(QColorGroup::HighlightedText, QColor(red)); + g.setColor(TQColorGroup::Text, TQColor(red)); + g.setColor(TQColorGroup::HighlightedText, TQColor(red)); } KListViewItem::paintCell(p, g, column, width, align); @@ -299,42 +299,42 @@ public: m_columns[c] = state; } private: - QMap<int, int> m_columns; + TQMap<int, int> m_columns; }; class NodeItemPrivate : public KListViewItem { public: - NodeItemPrivate(Task *n, QListView *parent) - : KListViewItem(parent, n->name()), + NodeItemPrivate(Task *n, TQListView *tqparent) + : KListViewItem(tqparent, n->name()), node(n) { init(); } - NodeItemPrivate(QString name, QListView *parent) - : KListViewItem(parent, name), + NodeItemPrivate(TQString name, TQListView *tqparent) + : KListViewItem(tqparent, name), node(0) { init(); } void setPriority(int col, int prio) { - if (prioColors.contains(prio)) { + if (prioColors.tqcontains(prio)) { columnPrio.insert(col, prio); } else { columnPrio.remove(col); } } int priority(int col) { - if (columnPrio.contains(col)) { + if (columnPrio.tqcontains(col)) { return columnPrio[col]; } return 0; } - virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) { - //kdDebug()<<k_funcinfo<<"c="<<column<<" prio="<<(columnPrio.contains(column)?columnPrio[column]:0)<<endl; - QColorGroup g = cg; - if (columnPrio.contains(column)) { - g.setColor(QColorGroup::Base, prioColors[columnPrio[column]]); + virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { + //kdDebug()<<k_funcinfo<<"c="<<column<<" prio="<<(columnPrio.tqcontains(column)?columnPrio[column]:0)<<endl; + TQColorGroup g = cg; + if (columnPrio.tqcontains(column)) { + g.setColor(TQColorGroup::Base, prioColors[columnPrio[column]]); } KListViewItem::paintCell(p, g, column, width, align); } @@ -342,37 +342,37 @@ public: Task *node; private: void init() { - prioColors.insert(1, QColor(gray)); - prioColors.insert(2, QColor(green)); - prioColors.insert(3, QColor(yellow)); - prioColors.insert(4, QColor(red)); + prioColors.insert(1, TQColor(gray)); + prioColors.insert(2, TQColor(green)); + prioColors.insert(3, TQColor(yellow)); + prioColors.insert(4, TQColor(red)); } - QMap<int, QColor> prioColors; - QMap<int, int> columnPrio; + TQMap<int, TQColor> prioColors; + TQMap<int, int> columnPrio; }; class AppointmentItem : public KListViewItem { public: - AppointmentItem(Appointment *a, QDate &d, QListViewItem *parent) - : KListViewItem(parent), + AppointmentItem(Appointment *a, TQDate &d, TQListViewItem *tqparent) + : KListViewItem(tqparent), appointment(a), date(d) {} Appointment *appointment; - QDate date; + TQDate date; }; -QSize ResourceView::sizeHint() const { - return minimumSizeHint(); // HACK: koshell splitter minimumSize problem +TQSize ResourceView::tqsizeHint() const { + return tqminimumSizeHint(); // HACK: koshell splitter tqminimumSize problem } -ResourceView::ResourceView(View *view, QWidget *parent) - : QSplitter(parent, "Resource view"), +ResourceView::ResourceView(View *view, TQWidget *tqparent) + : TQSplitter(tqparent, "Resource view"), m_mainview(view), m_selectedItem(0), m_currentNode(0) { - setOrientation(QSplitter::Vertical); + setOrientation(Qt::Vertical); resList = new ResListView(this, "Resource list"); resList->setItemMargin(2); @@ -405,11 +405,11 @@ ResourceView::ResourceView(View *view, QWidget *parent) m_appview->hide(); draw(view->getProject()); - //connect(resList, SIGNAL(selectionChanged(QListViewItem*)), SLOT(resSelectionChanged(QListViewItem*))); - connect(resList, SIGNAL(selectionChanged()), SLOT(resSelectionChanged())); - connect(resList, SIGNAL( contextMenuRequested(QListViewItem*, const QPoint&, int)), SLOT(popupMenuRequested(QListViewItem*, const QPoint&, int))); + //connect(resList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(resSelectionChanged(TQListViewItem*))); + connect(resList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(resSelectionChanged())); + connect(resList, TQT_SIGNAL( contextMenuRequested(TQListViewItem*, const TQPoint&, int)), TQT_SLOT(popupMenuRequested(TQListViewItem*, const TQPoint&, int))); //NOTE: using doubleClicked, not executed() to be consistent with ganttview - connect(resList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(slotItemDoubleClicked(QListViewItem*))); + connect(resList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), TQT_SLOT(slotItemDoubleClicked(TQListViewItem*))); } @@ -430,7 +430,7 @@ void ResourceView::draw(Project &project) m_appview->clear(); m_selectedItem = 0; - QPtrListIterator<ResourceGroup> it(project.resourceGroups()); + TQPtrListIterator<ResourceGroup> it(project.resourceGroups()); for (; it.current(); ++it) { KListViewItem *item = new KListViewItem(resList, it.current()->name()); item->setOpen(true); @@ -444,13 +444,13 @@ void ResourceView::draw(Project &project) } -void ResourceView::drawResources(const Project &proj, QListViewItem *parent, ResourceGroup *group) +void ResourceView::drawResources(const Project &proj, TQListViewItem *tqparent, ResourceGroup *group) { //kdDebug()<<k_funcinfo<<"group: "<<group->name()<<" ("<<group<<")"<<endl; - QPtrListIterator<Resource> it(group->resources()); + TQPtrListIterator<Resource> it(group->resources()); for (; it.current(); ++it) { Resource *r = it.current(); - ResourceItemPrivate *item = new ResourceItemPrivate(r, parent); + ResourceItemPrivate *item = new ResourceItemPrivate(r, tqparent); // set column colors item->setColumnState(0, 0); item->setColumnState(4, 0); @@ -494,7 +494,7 @@ void ResourceView::drawResources(const Project &proj, QListViewItem *parent, Res item->setText(4, r->calendar() ? r->calendar()->name() : i18n("None")); item->setText(5, KGlobal::locale()->formatDateTime(r->availableFrom())); item->setText(6, KGlobal::locale()->formatDateTime(r->availableUntil())); - item->setText(7, QString().setNum(r->units())); + item->setText(7, TQString().setNum(r->units())); item->setText(8, KGlobal::locale()->formatMoney(r->normalRate())); item->setText(9, KGlobal::locale()->formatMoney(r->overtimeRate())); if (!m_selectedItem) { @@ -509,7 +509,7 @@ void ResourceView::resSelectionChanged() { resSelectionChanged(resList->selectedItem()); } -void ResourceView::resSelectionChanged(QListViewItem *item) { +void ResourceView::resSelectionChanged(TQListViewItem *item) { //kdDebug()<<k_funcinfo<<item<<endl; ResourceItemPrivate *ritem = dynamic_cast<ResourceItemPrivate *>(item); if (ritem) { @@ -527,17 +527,17 @@ void ResourceView::resSelectionChanged(QListViewItem *item) { } -void ResourceView::slotItemDoubleClicked(QListViewItem*) { +void ResourceView::slotItemDoubleClicked(TQListViewItem*) { emit itemDoubleClicked(); } -void ResourceView::popupMenuRequested(QListViewItem* item, const QPoint & pos, int) +void ResourceView::popupMenuRequested(TQListViewItem* item, const TQPoint & pos, int) { ResourceItemPrivate *ritem = dynamic_cast<ResourceItemPrivate *>(item); if (ritem) { if (ritem != m_selectedItem) resSelectionChanged(ritem); - QPopupMenu *menu = m_mainview->popupMenu("resource_popup"); + TQPopupMenu *menu = m_mainview->popupMenu("resource_popup"); if (menu) { menu->exec(pos); @@ -548,8 +548,8 @@ void ResourceView::popupMenuRequested(QListViewItem* item, const QPoint & pos, i } } -QValueList<int> ResourceView::listOffsets(int pageHeight) const { - QValueList<int> lst; +TQValueList<int> ResourceView::listOffsets(int pageHeight) const { + TQValueList<int> lst; int hh = resList->headerHeight(); int ph = pageHeight-hh; int lh = resList->contentsHeight() - hh; // list height ex header. @@ -565,15 +565,15 @@ QValueList<int> ResourceView::listOffsets(int pageHeight) const { void ResourceView::print(KPrinter &printer) { //kdDebug()<<k_funcinfo<<endl; - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + TQPaintDeviceMetrics m = TQPaintDeviceMetrics ( &printer ); uint top, left, bottom, right; printer.margins(&top, &left, &bottom, &right); //kdDebug()<<m.width()<<"x"<<m.height()<<" : "<<top<<", "<<left<<", "<<bottom<<", "<<right<<" : "<<size()<<endl; - QPainter p; + TQPainter p; p.begin(&printer); p.setViewport(left, top, m.width()-left-right, m.height()-top-bottom); p.setClipRect(left, top, m.width()-left-right, m.height()-top-bottom); - QRect preg = p.clipRegion(QPainter::CoordPainter).boundingRect(); + TQRect preg = p.clipRegion(TQPainter::CoordPainter).boundingRect(); //kdDebug()<<"p="<<preg<<endl; //p.drawRect(preg.x(), preg.y(), preg.width()-1, preg.height()-1); int ch = resList->contentsHeight(); @@ -584,7 +584,7 @@ void ResourceView::print(KPrinter &printer) { p.scale(scale, scale); } int ph = preg.height()-resList->headerHeight(); - QValueList<int> lst = listOffsets(preg.height()); + TQValueList<int> lst = listOffsets(preg.height()); for (int i=0; i < lst.count(); ++i) { //kdDebug()<<"Page "<<i+1<<": "<<"scale="<<scale<<" "<<lst[i]<<" : "<<cw<<"x"<<ch<<endl; if (i > 0) { diff --git a/kplato/kptresourceview.h b/kplato/kptresourceview.h index 391653af..5fb3d98a 100644 --- a/kplato/kptresourceview.h +++ b/kplato/kptresourceview.h @@ -20,14 +20,14 @@ #ifndef KPTRESOURCEVIEW_H #define KPTRESOURCEVIEW_H -#include <qsplitter.h> -#include <qdatetime.h> -#include <qvaluelist.h> +#include <tqsplitter.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> #include "kptcontext.h" -class QPoint; -class QListViewItem; +class TQPoint; +class TQListViewItem; class KPrinter; @@ -46,12 +46,13 @@ class Resource; class ResourceItemPrivate; - class ResourceView : public QSplitter + class ResourceView : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - ResourceView(View *view, QWidget *parent); + ResourceView(View *view, TQWidget *tqparent); //~ResourceView(); @@ -62,7 +63,7 @@ class ResourceItemPrivate; Resource *currentResource(); - QValueList<int> listOffsets(int pageHeight) const; + TQValueList<int> listOffsets(int pageHeight) const; void print(KPrinter &printer); Node *currentNode() const { return m_currentNode; } @@ -70,7 +71,7 @@ class ResourceItemPrivate; virtual bool setContext(Context::Resourceview &context); virtual void getContext(Context::Resourceview &context) const; - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; public slots: void setShowAppointments(bool on) { m_showAppointments = on; } @@ -80,12 +81,12 @@ signals: protected slots: void resSelectionChanged(); - void resSelectionChanged(QListViewItem *item); - void slotItemDoubleClicked(QListViewItem*); - void popupMenuRequested(QListViewItem * item, const QPoint & pos, int); + void resSelectionChanged(TQListViewItem *item); + void slotItemDoubleClicked(TQListViewItem*); + void popupMenuRequested(TQListViewItem * item, const TQPoint & pos, int); private: - void drawResources(const Project &proj, QListViewItem *parent, ResourceGroup *group); + void drawResources(const Project &proj, TQListViewItem *tqparent, ResourceGroup *group); private: View *m_mainview; @@ -95,8 +96,8 @@ private: ResListView *resList; ResourceAppointmentsView *m_appview; Node *m_currentNode; - QDate m_start; - QDate m_end; + TQDate m_start; + TQDate m_end; bool m_showAppointments; diff --git a/kplato/kptschedule.cc b/kplato/kptschedule.cc index e3f23f07..84b2ddd3 100644 --- a/kplato/kptschedule.cc +++ b/kplato/kptschedule.cc @@ -24,9 +24,9 @@ #include "kptduration.h" #include "kptnode.h" -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <klocale.h> #include <kdebug.h> @@ -41,23 +41,23 @@ Schedule::Schedule() m_parent(0) { } -Schedule::Schedule(Schedule *parent) +Schedule::Schedule(Schedule *tqparent) : m_type(Expected), m_id(0), m_deleted(false), m_appointments(), - m_parent(parent) { + m_parent(tqparent) { - if (parent) { - m_name = parent->name(); - m_type = parent->type(); - m_id = parent->id(); + if (tqparent) { + m_name = tqparent->name(); + m_type = tqparent->type(); + m_id = tqparent->id(); } m_appointments.setAutoDelete(true); //kdDebug()<<k_funcinfo<<"("<<this<<") Name: '"<<name<<"' Type="<<type<<" id="<<id<<endl; } -Schedule::Schedule(QString name, Type type, long id) +Schedule::Schedule(TQString name, Type type, long id) : m_name(name), m_type(type), m_id(id), @@ -72,8 +72,8 @@ Schedule::Schedule(QString name, Type type, long id) Schedule::~Schedule() { } -void Schedule::setParent(Schedule *parent) { - m_parent = parent; +void Schedule::setParent(Schedule *tqparent) { + m_parent = tqparent; } void Schedule::setDeleted(bool on) { @@ -85,7 +85,7 @@ bool Schedule::isDeleted() const { return m_parent == 0 ? m_deleted : m_parent->isDeleted(); } -void Schedule::setType(const QString type) { +void Schedule::setType(const TQString type) { m_type = Expected; if (type == "Expected") m_type = Expected; @@ -95,7 +95,7 @@ void Schedule::setType(const QString type) { m_type = Pessimistic; } -QString Schedule::typeToString(bool translate) const { +TQString Schedule::typeToString(bool translate) const { if (translate) { if (m_type == Expected) return i18n("Expected"); @@ -126,7 +126,7 @@ void Schedule::initiateCalculation() { void Schedule::calcResourceOverbooked() { resourceOverbooked = false; - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { if (it.current()->resource()->isOverbooked(startTime, endTime)) { resourceOverbooked = true; @@ -135,9 +135,9 @@ void Schedule::calcResourceOverbooked() { } } -QStringList Schedule::overbookedResources() const { - QStringList rl; - QPtrListIterator<Appointment> it = m_appointments; +TQStringList Schedule::overbookedResources() const { + TQStringList rl; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { if (it.current()->resource()->isOverbooked(it.current()->startTime(), it.current()->endTime())) { rl += it.current()->resource()->resource()->name(); @@ -146,36 +146,36 @@ QStringList Schedule::overbookedResources() const { return rl; } -bool Schedule::loadXML(const QDomElement &sch) { +bool Schedule::loadXML(const TQDomElement &sch) { m_name = sch.attribute("name"); setType(sch.attribute("type")); m_id = sch.attribute("id").toLong(); return true; } -void Schedule::saveXML(QDomElement &element) const { - QDomElement sch = element.ownerDocument().createElement("schedule"); +void Schedule::saveXML(TQDomElement &element) const { + TQDomElement sch = element.ownerDocument().createElement("schedule"); element.appendChild(sch); saveCommonXML(sch); } -void Schedule::saveCommonXML(QDomElement &element) const { +void Schedule::saveCommonXML(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<m_name<<" save schedule"<<endl; element.setAttribute("name", m_name); element.setAttribute("type", typeToString()); element.setAttribute("id", m_id); } -void Schedule::saveAppointments(QDomElement &element) const { +void Schedule::saveAppointments(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { it.current()->saveXML(element); } } bool Schedule::add(Appointment *appointment) { - if (m_appointments.findRef(appointment) != -1) { + if (m_appointments.tqfindRef(appointment) != -1) { kdError()<<k_funcinfo<<"Appointment allready exists"<<endl; return false; } @@ -191,7 +191,7 @@ void Schedule::removeAppointment(Appointment *appointment) { } void Schedule::takeAppointment(Appointment *appointment) { - int i = m_appointments.findRef(appointment); + int i = m_appointments.tqfindRef(appointment); if (i != -1) { m_appointments.take(i); //kdDebug()<<k_funcinfo<<"Taken: "<<appointment<<endl; @@ -203,7 +203,7 @@ void Schedule::takeAppointment(Appointment *appointment) { } Appointment *Schedule::findAppointment(Schedule *resource, Schedule *node) { - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { if (it.current()->node() == node && it.current()->resource() == resource) return it.current(); @@ -211,10 +211,10 @@ Appointment *Schedule::findAppointment(Schedule *resource, Schedule *node) { return 0; } -EffortCostMap Schedule::plannedEffortCostPrDay(const QDate &start, const QDate &end) const { +EffortCostMap Schedule::plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const { //kdDebug()<<k_funcinfo<<m_name<<endl; EffortCostMap ec; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { //kdDebug()<<k_funcinfo<<m_name<<endl; ec += it.current()->plannedPrDay(start, end); @@ -225,27 +225,27 @@ EffortCostMap Schedule::plannedEffortCostPrDay(const QDate &start, const QDate & Duration Schedule::plannedEffort() const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->plannedEffort(); } return eff; } -Duration Schedule::plannedEffort(const QDate &date) const { +Duration Schedule::plannedEffort(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->plannedEffort(date); } return eff; } -Duration Schedule::plannedEffortTo(const QDate &date) const { +Duration Schedule::plannedEffortTo(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->plannedEffortTo(date); } @@ -255,27 +255,27 @@ Duration Schedule::plannedEffortTo(const QDate &date) const { Duration Schedule::actualEffort() const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->actualEffort(); } return eff; } -Duration Schedule::actualEffort(const QDate &date) const { +Duration Schedule::actualEffort(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->actualEffort(date); } return eff; } -Duration Schedule::actualEffortTo(const QDate &date) const { +Duration Schedule::actualEffortTo(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; Duration eff; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { eff += it.current()->actualEffortTo(date); } @@ -285,27 +285,27 @@ Duration Schedule::actualEffortTo(const QDate &date) const { double Schedule::plannedCost() const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->plannedCost(); } return c; } -double Schedule::plannedCost(const QDate &date) const { +double Schedule::plannedCost(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->plannedCost(date); } return c; } -double Schedule::plannedCostTo(const QDate &date) const { +double Schedule::plannedCostTo(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->plannedCostTo(date); } @@ -315,27 +315,27 @@ double Schedule::plannedCostTo(const QDate &date) const { double Schedule::actualCost() const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->actualCost(); } return c; } -double Schedule::actualCost(const QDate &date) const { +double Schedule::actualCost(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->actualCost(date); } return c; } -double Schedule::actualCostTo(const QDate &date) const { +double Schedule::actualCostTo(const TQDate &date) const { //kdDebug()<<k_funcinfo<<endl; double c = 0; - QPtrListIterator<Appointment> it(m_appointments); + TQPtrListIterator<Appointment> it(m_appointments); for (; it.current(); ++it) { c += it.current()->actualCostTo(date); } @@ -350,15 +350,15 @@ NodeSchedule::NodeSchedule() init(); } -NodeSchedule::NodeSchedule(Node *node, QString name, Schedule::Type type, long id) +NodeSchedule::NodeSchedule(Node *node, TQString name, Schedule::Type type, long id) : Schedule(name, type, id), m_node(node) { //kdDebug()<<k_funcinfo<<"node name: "<<node->name()<<endl; init(); } -NodeSchedule::NodeSchedule(Schedule *parent, Node *node) - : Schedule(parent), +NodeSchedule::NodeSchedule(Schedule *tqparent, Node *node) + : Schedule(tqparent), m_node(node) { //kdDebug()<<k_funcinfo<<"node name: "<<node->name()<<endl; @@ -382,7 +382,7 @@ void NodeSchedule::setDeleted(bool on) { //kdDebug()<<k_funcinfo<<"deleted="<<on<<endl; m_deleted = on; // set deleted also for possible resource schedules - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { if (it.current()->resource()) { it.current()->resource()->setDeleted(on); @@ -390,9 +390,9 @@ void NodeSchedule::setDeleted(bool on) { } } -bool NodeSchedule::loadXML(const QDomElement &sch) { +bool NodeSchedule::loadXML(const TQDomElement &sch) { //kdDebug()<<k_funcinfo<<endl; - QString s; + TQString s; Schedule::loadXML(sch); s = sch.attribute("earlieststart"); if (s != "") @@ -424,9 +424,9 @@ bool NodeSchedule::loadXML(const QDomElement &sch) { return true; } -void NodeSchedule::saveXML(QDomElement &element) const { +void NodeSchedule::saveXML(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement sch = element.ownerDocument().createElement("schedule"); + TQDomElement sch = element.ownerDocument().createElement("schedule"); element.appendChild(sch); saveCommonXML(sch); @@ -477,17 +477,17 @@ ResourceSchedule::ResourceSchedule() //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; } -ResourceSchedule::ResourceSchedule(Resource *resource, QString name, Schedule::Type type, long id) +ResourceSchedule::ResourceSchedule(Resource *resource, TQString name, Schedule::Type type, long id) : Schedule(name, type, id), m_resource(resource), m_parent(0) { //kdDebug()<<k_funcinfo<<"resource: "<<resource->name()<<endl; } -ResourceSchedule::ResourceSchedule(Schedule *parent, Resource *resource) - : Schedule(parent), +ResourceSchedule::ResourceSchedule(Schedule *tqparent, Resource *resource) + : Schedule(tqparent), m_resource(resource), - m_parent(parent) { + m_parent(tqparent) { //kdDebug()<<k_funcinfo<<"resource: "<<resource->name()<<endl; } @@ -521,7 +521,7 @@ bool ResourceSchedule::isOverbooked(const DateTime &start, const DateTime &end) return false; //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; Appointment a = appointmentIntervals(); - QPtrListIterator<AppointmentInterval> it = a.intervals(); + TQPtrListIterator<AppointmentInterval> it = a.intervals(); for (; it.current(); ++it) { if ((!end.isValid() || it.current()->startTime() < end) && (!start.isValid() || it.current()->endTime() > start)) @@ -540,7 +540,7 @@ bool ResourceSchedule::isOverbooked(const DateTime &start, const DateTime &end) Appointment ResourceSchedule::appointmentIntervals() const { Appointment a; - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { a += *(it.current()); } @@ -558,7 +558,7 @@ MainSchedule::MainSchedule() init(); } -MainSchedule::MainSchedule(Node *node, QString name, Schedule::Type type, long id) +MainSchedule::MainSchedule(Node *node, TQString name, Schedule::Type type, long id) : NodeSchedule(node, name, type, id) { //kdDebug()<<k_funcinfo<<"node name: "<<node->name()<<endl; init(); @@ -568,9 +568,9 @@ MainSchedule::~MainSchedule() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; } -bool MainSchedule::loadXML(const QDomElement &sch, Project &project) { +bool MainSchedule::loadXML(const TQDomElement &sch, Project &project) { kdDebug()<<k_funcinfo<<endl; - QString s; + TQString s; Schedule::loadXML(sch); s = sch.attribute("start"); @@ -580,11 +580,11 @@ bool MainSchedule::loadXML(const QDomElement &sch, Project &project) { if (s != "") endTime = DateTime::fromString(s); - QDomNodeList al = sch.childNodes(); + TQDomNodeList al = sch.childNodes(); kdDebug()<<k_funcinfo<<"No of appointments: "<<al.count()<<endl; for (unsigned int i=0; i<al.count(); ++i) { if (al.item(i).isElement()) { - QDomElement app = al.item(i).toElement(); + TQDomElement app = al.item(i).toElement(); if (app.tagName() == "appointment") { // Load the appointments. // Resources and tasks must allready loaded @@ -600,7 +600,7 @@ bool MainSchedule::loadXML(const QDomElement &sch, Project &project) { return true; } -void MainSchedule::saveXML(QDomElement &element) const { +void MainSchedule::saveXML(TQDomElement &element) const { saveCommonXML(element); element.setAttribute("start",startTime.toString(Qt::ISODate)); @@ -608,22 +608,22 @@ void MainSchedule::saveXML(QDomElement &element) const { } #ifndef NDEBUG -void Schedule::printDebug(QString indent) { +void Schedule::printDebug(TQString indent) { kdDebug()<<indent<<"Schedule["<<m_id<<"] '"<<m_name<<"' type: "<<typeToString()<<" ("<<m_type<<")"<<(isDeleted()?" Deleted":"")<<endl; } -void NodeSchedule::printDebug(QString indent) { +void NodeSchedule::printDebug(TQString indent) { Schedule::printDebug(indent); indent += "! "; if (m_parent == 0) - kdDebug()<<indent<<"No parent schedule!"<<endl; + kdDebug()<<indent<<"No tqparent schedule!"<<endl; if (!notScheduled) { if (node()) kdDebug()<<indent<<"Node: "<<node()->name()<<endl; - else kdDebug()<<indent<<"No parent node!"<<endl; + else kdDebug()<<indent<<"No tqparent node!"<<endl; } kdDebug()<<indent<<"Not scheduled="<<notScheduled<<endl; kdDebug()<<indent<<"Start time: "<<startTime.toString()<<endl; kdDebug()<<indent<<"End time: " <<endTime.toString()<<endl; - kdDebug()<<indent<<"Duration: "<<duration.seconds()<<QCString(" secs")<<" ("<<duration.toString()<<")"<<endl; + kdDebug()<<indent<<"Duration: "<<duration.seconds()<<TQCString(" secs")<<" ("<<duration.toString()<<")"<<endl; kdDebug()<<indent<<"Earliest start: "<<earliestStart.toString()<<endl; kdDebug()<<indent<<"Latest finish: " <<latestFinish.toString()<<endl; @@ -639,38 +639,38 @@ void NodeSchedule::printDebug(QString indent) { kdDebug()<<indent<<"workEndTime="<<workEndTime.toString()<<endl; kdDebug()<<indent<<endl; kdDebug()<<indent<<"Appointments: "<<m_appointments.count()<<endl; - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { it.current()->printDebug(indent + " "); } } -void ResourceSchedule::printDebug(QString indent) { +void ResourceSchedule::printDebug(TQString indent) { Schedule::printDebug(indent); indent += "! "; if (m_parent == 0) - kdDebug()<<indent<<"No parent schedule!"<<endl; + kdDebug()<<indent<<"No tqparent schedule!"<<endl; if (resource()) kdDebug()<<indent<<"Resource: "<<resource()->name()<<endl; - else kdDebug()<<indent<<"No parent resource!"<<endl; + else kdDebug()<<indent<<"No tqparent resource!"<<endl; kdDebug()<<indent<<endl; kdDebug()<<indent<<"Appointments: "<<m_appointments.count()<<endl; } -void MainSchedule::printDebug(QString indent) { +void MainSchedule::printDebug(TQString indent) { Schedule::printDebug(indent); indent += "! "; if (node()) kdDebug()<<indent<<"Node: "<<node()->name()<<endl; - else kdDebug()<<indent<<"No parent node!"<<endl; + else kdDebug()<<indent<<"No tqparent node!"<<endl; kdDebug()<<indent<<"Not scheduled="<<notScheduled<<endl; kdDebug()<<indent<<"Start time: "<<startTime.toString()<<endl; kdDebug()<<indent<<"End time: " <<endTime.toString()<<endl; - kdDebug()<<indent<<"Duration: "<<duration.seconds()<<QCString(" secs")<<" ("<<duration.toString()<<")"<<endl; + kdDebug()<<indent<<"Duration: "<<duration.seconds()<<TQCString(" secs")<<" ("<<duration.toString()<<")"<<endl; kdDebug()<<indent<<"Earliest start: "<<earliestStart.toString()<<endl; kdDebug()<<indent<<"Latest finish: " <<latestFinish.toString()<<endl; kdDebug()<<indent<<endl; kdDebug()<<indent<<"Appointments: "<<m_appointments.count()<<endl; - QPtrListIterator<Appointment> it = m_appointments; + TQPtrListIterator<Appointment> it = m_appointments; for (; it.current(); ++it) { it.current()->printDebug(indent + " "); } diff --git a/kplato/kptschedule.h b/kplato/kptschedule.h index 29cb135d..e1525c79 100644 --- a/kplato/kptschedule.h +++ b/kplato/kptschedule.h @@ -23,12 +23,12 @@ #include "kpteffortcostmap.h" #include "kptresource.h" -#include <qintdict.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqintdict.h> +#include <tqptrlist.h> +#include <tqstring.h> -class QDomElement; -class QStringList; +class TQDomElement; +class TQStringList; namespace KPlato { @@ -61,33 +61,33 @@ public: }; Schedule(); - Schedule(Schedule *parent); - Schedule(QString name, Type type, long id); + Schedule(Schedule *tqparent); + Schedule(TQString name, Type type, long id); ~Schedule(); - QString name() const { return m_name; } - void setName(QString name) { m_name = name; } + TQString name() const { return m_name; } + void setName(TQString name) { m_name = name; } Type type() const { return m_type; } void setType(Type type) { m_type = type; } - void setType(QString type); - QString typeToString(bool translate=false) const; + void setType(TQString type); + TQString typeToString(bool translate=false) const; long id() const { return m_id; } void setId(long id) { m_id = id; } - void setParent(Schedule *parent); - Schedule *parent() const { return m_parent; } + void setParent(Schedule *tqparent); + Schedule *tqparent() const { return m_parent; } virtual bool isDeleted() const; virtual void setDeleted(bool on); virtual Resource *resource() const { return 0; } virtual Node *node() const { return 0; } - virtual bool loadXML(const QDomElement &element); - virtual void saveXML(QDomElement &element) const; - void saveCommonXML(QDomElement &element) const; - void saveAppointments(QDomElement &element) const; + virtual bool loadXML(const TQDomElement &element); + virtual void saveXML(TQDomElement &element) const; + void saveCommonXML(TQDomElement &element) const; + void saveAppointments(TQDomElement &element) const; /// Return the list of appointments - QPtrList<Appointment> &appointments() { return m_appointments; } + TQPtrList<Appointment> &appointments() { return m_appointments; } /// Adds appointment to this schedule only virtual bool add(Appointment *appointment); /// Adds appointment to both this resource schedule and node schedule @@ -102,23 +102,23 @@ public: virtual bool isOverbooked() const { return false; } virtual bool isOverbooked(const DateTime &/*start*/, const DateTime &/*end*/) const { return false; } - virtual QStringList overbookedResources() const; + virtual TQStringList overbookedResources() const; - virtual EffortCostMap plannedEffortCostPrDay(const QDate &start, const QDate &end) const; + virtual EffortCostMap plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const; /// Returns the total planned effort for this task (or subtasks) virtual Duration plannedEffort() const; /// Returns the total planned effort for this task (or subtasks) on date - virtual Duration plannedEffort(const QDate &date) const; + virtual Duration plannedEffort(const TQDate &date) const; /// Returns the planned effort up to and including date - virtual Duration plannedEffortTo(const QDate &date) const; + virtual Duration plannedEffortTo(const TQDate &date) const; /// Returns the total actual effort for this task (or subtasks) virtual Duration actualEffort() const; /// Returns the total actual effort for this task (or subtasks) on date - virtual Duration actualEffort(const QDate &date) const; + virtual Duration actualEffort(const TQDate &date) const; /// Returns the total actual effort for this task (or subtasks) up to and including date - virtual Duration actualEffortTo(const QDate &date) const; + virtual Duration actualEffortTo(const TQDate &date) const; /** * Planned cost is the sum total of all resources and other costs @@ -127,26 +127,26 @@ public: virtual double plannedCost() const; /// Planned cost on date - virtual double plannedCost(const QDate &date) const; + virtual double plannedCost(const TQDate &date) const; /** * Planned cost from start of activity up to and including date * is the sum of all resource costs and other costs planned for this node. */ - virtual double plannedCostTo(const QDate &date) const; + virtual double plannedCostTo(const TQDate &date) const; /** * Actual cost is the sum total of the reported costs actually used * for this node. */ virtual double actualCost() const; /// Actual cost on date - virtual double actualCost(const QDate &date) const; + virtual double actualCost(const TQDate &date) const; /// Actual cost up to and including date - virtual double actualCostTo(const QDate &date) const; + virtual double actualCostTo(const TQDate &date) const; /// Effort based performance index - double effortPerformanceIndex(const QDate &/*date*/, bool */*error=0*/) { return 0.0; } + double effortPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; } /// Cost performance index - double costPerformanceIndex(const QDate &/*date*/, bool */*error=0*/) { return 0.0; } + double costPerformanceIndex(const TQDate &/*date*/, bool */*error=0*/) { return 0.0; } virtual double normalRatePrHour() const { return 0.0; } @@ -163,12 +163,12 @@ public: DateTime end() const { return endTime; } protected: - QString m_name; + TQString m_name; Type m_type; long m_id; bool m_deleted; - QPtrList<Appointment> m_appointments; + TQPtrList<Appointment> m_appointments; Schedule *m_parent; friend class Node; @@ -222,7 +222,7 @@ protected: #ifndef NDEBUG public: - virtual void printDebug(QString ident); + virtual void printDebug(TQString ident); #endif }; @@ -234,16 +234,16 @@ class NodeSchedule : public Schedule { public: NodeSchedule(); - NodeSchedule(Node *node, QString name, Schedule::Type type, long id); - NodeSchedule(Schedule *parent, Node *node); + NodeSchedule(Node *node, TQString name, Schedule::Type type, long id); + NodeSchedule(Schedule *tqparent, Node *node); ~NodeSchedule(); virtual bool isDeleted() const { return m_parent == 0 ? true : m_parent->isDeleted(); } void setDeleted(bool on); - virtual bool loadXML(const QDomElement &element); - virtual void saveXML(QDomElement &element) const; + virtual bool loadXML(const TQDomElement &element); + virtual void saveXML(TQDomElement &element) const; // tasks------------> virtual void addAppointment(Schedule *resource, DateTime &start, DateTime &end, double load=100); @@ -259,7 +259,7 @@ private: #ifndef NDEBUG public: - virtual void printDebug(QString ident); + virtual void printDebug(TQString ident); #endif }; @@ -271,8 +271,8 @@ class ResourceSchedule : public Schedule { public: ResourceSchedule(); - ResourceSchedule(Resource *Resource, QString name, Schedule::Type type, long id); - ResourceSchedule(Schedule *parent, Resource *Resource); + ResourceSchedule(Resource *Resource, TQString name, Schedule::Type type, long id); + ResourceSchedule(Schedule *tqparent, Resource *Resource); ~ResourceSchedule(); virtual bool isDeleted() const @@ -292,7 +292,7 @@ private: #ifndef NDEBUG public: - virtual void printDebug(QString ident); + virtual void printDebug(TQString ident); #endif }; @@ -304,18 +304,18 @@ class MainSchedule : public NodeSchedule { public: MainSchedule(); - MainSchedule(Node *node, QString name, Schedule::Type type, long id); + MainSchedule(Node *node, TQString name, Schedule::Type type, long id); ~MainSchedule(); virtual bool isDeleted() const { return m_deleted; } - virtual bool loadXML(const QDomElement &element, Project &project); - virtual void saveXML(QDomElement &element) const; + virtual bool loadXML(const TQDomElement &element, Project &project); + virtual void saveXML(TQDomElement &element) const; private: #ifndef NDEBUG public: - virtual void printDebug(QString ident); + virtual void printDebug(TQString ident); #endif }; diff --git a/kplato/kptstandardworktimedialog.cc b/kplato/kptstandardworktimedialog.cc index 936c3c38..3e7fb267 100644 --- a/kplato/kptstandardworktimedialog.cc +++ b/kplato/kptstandardworktimedialog.cc @@ -25,16 +25,16 @@ #include "kptintervaledit.h" #include "kptpart.h" -#include <qgroupbox.h> -#include <qheader.h> -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qdatetimeedit.h> -#include <qdatetime.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqdatetimeedit.h> +#include <tqdatetime.h> #include <kdebug.h> #include <kcombobox.h> @@ -49,8 +49,8 @@ namespace KPlato class WeekdayListItem : public KListViewItem { public: - WeekdayListItem(Calendar *cal, int wd, KListView *parent, QString name, KListViewItem *after) - : KListViewItem(parent, after), + WeekdayListItem(Calendar *cal, int wd, KListView *tqparent, TQString name, KListViewItem *after) + : KListViewItem(tqparent, after), original(cal->weekday(wd)), calendar(cal), weekday(wd) @@ -70,7 +70,7 @@ public: setText(1, "-"); day->clearIntervals(); } - void setIntervals(QPtrList<QPair<QTime, QTime> > intervals) { + void setIntervals(TQPtrList<TQPair<TQTime, TQTime> > intervals) { day->setIntervals(intervals); setText(1, KGlobal::locale()->formatNumber(day->duration().toDouble(Duration::Unit_h))); } @@ -92,8 +92,8 @@ public: int weekday; }; -StandardWorktimeDialog::StandardWorktimeDialog(Project &p, QWidget *parent, const char *name) - : KDialogBase( Swallow, i18n("Standard Worktime"), Ok|Cancel, Ok, parent, name, true, true), +StandardWorktimeDialog::StandardWorktimeDialog(Project &p, TQWidget *tqparent, const char *name) + : KDialogBase( Swallow, i18n("Standard Worktime"), Ok|Cancel, Ok, tqparent, name, true, true), project(p) { //kdDebug()<<k_funcinfo<<&p<<endl; @@ -103,13 +103,13 @@ StandardWorktimeDialog::StandardWorktimeDialog(Project &p, QWidget *parent, cons setMainWidget(dia); enableButtonOK(false); - connect(dia, SIGNAL(obligatedFieldsFilled(bool) ), SLOT(enableButtonOK(bool))); - connect(dia, SIGNAL(enableButtonOk(bool)), SLOT(enableButtonOK(bool))); + connect(dia, TQT_SIGNAL(obligatedFieldsFilled(bool) ), TQT_SLOT(enableButtonOK(bool))); + connect(dia, TQT_SIGNAL(enableButtonOk(bool)), TQT_SLOT(enableButtonOK(bool))); } KMacroCommand *StandardWorktimeDialog::buildCommand(Part *part) { //kdDebug()<<k_funcinfo<<endl; - QString n = i18n("Modify Standard Worktime"); + TQString n = i18n("Modify Standard Worktime"); KMacroCommand *cmd = 0; if (m_original->year() != dia->inYear()) { if (cmd == 0) cmd = new KMacroCommand(n); @@ -127,7 +127,7 @@ KMacroCommand *StandardWorktimeDialog::buildCommand(Part *part) { if (cmd == 0) cmd = new KMacroCommand(n); cmd->addCommand(new ModifyStandardWorktimeDayCmd(part, m_original, m_original->day(), dia->inDay())); } - QListViewItem *item = dia->weekdayList->firstChild(); + TQListViewItem *item = dia->weekdayList->firstChild(); for (; item; item = item->nextSibling()) { KCommand *c = static_cast<WeekdayListItem*>(item)->save(part); if (c) { @@ -144,13 +144,13 @@ void StandardWorktimeDialog::slotOk() { } -StandardWorktimeDialogImpl::StandardWorktimeDialogImpl(StandardWorktime *std, QWidget *parent) - : StandardWorktimeDialogBase(parent), +StandardWorktimeDialogImpl::StandardWorktimeDialogImpl(StandardWorktime *std, TQWidget *tqparent) + : StandardWorktimeDialogBase(tqparent), m_std(std) { if (!std) { m_std = new StandardWorktime(); } - QBoxLayout *l = new QVBoxLayout(intervalBox); + TQBoxLayout *l = new TQVBoxLayout(intervalBox); m_intervalEdit = new IntervalEdit(intervalBox); l->addWidget(m_intervalEdit); @@ -179,15 +179,15 @@ StandardWorktimeDialogImpl::StandardWorktimeDialogImpl(StandardWorktime *std, QW weekdayList->insertItem(item); } } - connect(year, SIGNAL(valueChanged(double)), SLOT(slotYearChanged(double))); - connect(month, SIGNAL(valueChanged(double)), SLOT(slotMonthChanged(double))); - connect(week, SIGNAL(valueChanged(double)), SLOT(slotWeekChanged(double))); - connect(day, SIGNAL(valueChanged(double)), SLOT(slotDayChanged(double))); + connect(year, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(slotYearChanged(double))); + connect(month, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(slotMonthChanged(double))); + connect(week, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(slotWeekChanged(double))); + connect(day, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(slotDayChanged(double))); - connect(m_intervalEdit, SIGNAL(changed()), SLOT(slotIntervalChanged())); - connect(bApply, SIGNAL(clicked()), SLOT(slotApplyClicked())); - connect(weekdayList, SIGNAL(selectionChanged()), SLOT(slotWeekdaySelected())); - connect(state, SIGNAL(activated(int)), SLOT(slotStateChanged(int))); + connect(m_intervalEdit, TQT_SIGNAL(changed()), TQT_SLOT(slotIntervalChanged())); + connect(bApply, TQT_SIGNAL(clicked()), TQT_SLOT(slotApplyClicked())); + connect(weekdayList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotWeekdaySelected())); + connect(state, TQT_SIGNAL(activated(int)), TQT_SLOT(slotStateChanged(int))); if (weekdayList->firstChild()) { weekdayList->setSelected(weekdayList->firstChild(), true); @@ -248,7 +248,7 @@ void StandardWorktimeDialogImpl::slotIntervalChanged() { void StandardWorktimeDialogImpl::slotApplyClicked() { //kdDebug()<<k_funcinfo<<"state="<<state->currentItem()<<endl; - QListViewItem *item = weekdayList->firstChild(); + TQListViewItem *item = weekdayList->firstChild(); for (; item; item = item->nextSibling()) { if (item->isSelected()) { //kdDebug()<<k_funcinfo<<item->text(0)<<" selected"<<endl; @@ -267,7 +267,7 @@ void StandardWorktimeDialogImpl::slotApplyClicked() { void StandardWorktimeDialogImpl::slotWeekdaySelected() { //kdDebug()<<k_funcinfo<<"state="<<state->currentItem()<<endl; - QListViewItem *item = weekdayList->firstChild(); + TQListViewItem *item = weekdayList->firstChild(); for (; item; item = item->nextSibling()) { if (item->isSelected()) { //kdDebug()<<k_funcinfo<<item->text(0)<<" selected"<<endl; diff --git a/kplato/kptstandardworktimedialog.h b/kplato/kptstandardworktimedialog.h index 34424f00..81bc2ce7 100644 --- a/kplato/kptstandardworktimedialog.h +++ b/kplato/kptstandardworktimedialog.h @@ -25,7 +25,7 @@ #include <kdialogbase.h> -#include <qstring.h> +#include <tqstring.h> class KMacroCommand; @@ -38,8 +38,9 @@ class IntervalEditImpl; class StandardWorktimeDialogImpl : public StandardWorktimeDialogBase { Q_OBJECT + TQ_OBJECT public: - StandardWorktimeDialogImpl ( StandardWorktime *std, QWidget *parent); + StandardWorktimeDialogImpl ( StandardWorktime *std, TQWidget *tqparent); StandardWorktime *standardWorktime() { return m_std; } double inYear() const { return m_year; } @@ -75,8 +76,9 @@ private: class StandardWorktimeDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - StandardWorktimeDialog(Project &project, QWidget *parent=0, const char *name=0); + StandardWorktimeDialog(Project &project, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kptsummarytaskdialog.cc b/kplato/kptsummarytaskdialog.cc index 25ec7227..26a62cdf 100644 --- a/kplato/kptsummarytaskdialog.cc +++ b/kplato/kptsummarytaskdialog.cc @@ -24,20 +24,20 @@ #include <klocale.h> #include <kcommand.h> -#include <qvbox.h> +#include <tqvbox.h> #include <kdebug.h> namespace KPlato { -SummaryTaskDialog::SummaryTaskDialog(Task &task, QWidget *p) +SummaryTaskDialog::SummaryTaskDialog(Task &task, TQWidget *p) : KDialogBase(Swallow, i18n("Summary Task Settings"), Ok|Cancel, Ok, p, "Summary Task Settings Dialog", true, true) { m_generalTab = new SummaryTaskGeneralPanel(task, this); setMainWidget(m_generalTab); enableButtonOK(false); - connect(m_generalTab, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOK(bool))); + connect(m_generalTab, TQT_SIGNAL(obligatedFieldsFilled(bool)), TQT_SLOT(enableButtonOK(bool))); } diff --git a/kplato/kptsummarytaskdialog.h b/kplato/kptsummarytaskdialog.h index e307fea9..d1607783 100644 --- a/kplato/kptsummarytaskdialog.h +++ b/kplato/kptsummarytaskdialog.h @@ -31,12 +31,12 @@ class KTextEdit; class KComboBox; class KDoubleNumInput; -class QDateTimeEdit; -class QSpinBox; -class QButtonGroup; -class QListBox; -class QTable; -class QDateTime; +class TQDateTimeEdit; +class TQSpinBox; +class TQButtonGroup; +class TQListBox; +class TQTable; +class TQDateTime; namespace KPlato { @@ -50,13 +50,14 @@ class Task; */ class SummaryTaskDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** * The constructor for the summary task settings dialog. * @param task the task to edit - * @param parent parent widget + * @param tqparent tqparent widget */ - SummaryTaskDialog(Task &task, QWidget *parent=0); + SummaryTaskDialog(Task &task, TQWidget *tqparent=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kptsummarytaskgeneralpanel.cc b/kplato/kptsummarytaskgeneralpanel.cc index 3b7f80a9..73ba4f95 100644 --- a/kplato/kptsummarytaskgeneralpanel.cc +++ b/kplato/kptsummarytaskgeneralpanel.cc @@ -34,29 +34,29 @@ #include <kabc/addressee.h> #include <kabc/addresseedialog.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> -#include <qgroupbox.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> +#include <tqgroupbox.h> #include <kdebug.h> namespace KPlato { -SummaryTaskGeneralPanel::SummaryTaskGeneralPanel(Task &task, QWidget *p, const char *n) +SummaryTaskGeneralPanel::SummaryTaskGeneralPanel(Task &task, TQWidget *p, const char *n) : SummaryTaskGeneralPanelBase(p, n), m_task(task) { setStartValues(task); - connect(namefield, SIGNAL(textChanged(const QString&)), SLOT(slotObligatedFieldsFilled())); - connect(leaderfield, SIGNAL(textChanged(const QString&)), SLOT(slotObligatedFieldsFilled())); - connect(idfield, SIGNAL(textChanged(const QString&)), SLOT(slotObligatedFieldsFilled())); - connect(descriptionfield, SIGNAL(textChanged()), SLOT(slotObligatedFieldsFilled())); + connect(namefield, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotObligatedFieldsFilled())); + connect(leaderfield, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotObligatedFieldsFilled())); + connect(idfield, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotObligatedFieldsFilled())); + connect(descriptionfield, TQT_SIGNAL(textChanged()), TQT_SLOT(slotObligatedFieldsFilled())); - connect(chooseLeader, SIGNAL(clicked()), SLOT(slotChooseResponsible())); + connect(chooseLeader, TQT_SIGNAL(clicked()), TQT_SLOT(slotChooseResponsible())); } diff --git a/kplato/kptsummarytaskgeneralpanel.h b/kplato/kptsummarytaskgeneralpanel.h index 0bcf02fa..615556c4 100644 --- a/kplato/kptsummarytaskgeneralpanel.h +++ b/kplato/kptsummarytaskgeneralpanel.h @@ -33,8 +33,9 @@ class Task; class SummaryTaskGeneralPanel : public SummaryTaskGeneralPanelBase { Q_OBJECT + TQ_OBJECT public: - SummaryTaskGeneralPanel(Task &task, QWidget *parent=0, const char *name=0); + SummaryTaskGeneralPanel(Task &task, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kptsummarytaskgeneralpanelbase.ui b/kplato/kptsummarytaskgeneralpanelbase.ui index 4405773f..715770c6 100644 --- a/kplato/kptsummarytaskgeneralpanelbase.ui +++ b/kplato/kptsummarytaskgeneralpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::SummaryTaskGeneralPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SummaryTaskGeneralPanelBase</cstring> </property> @@ -13,7 +13,7 @@ <height>250</height> </rect> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>400</width> <height>0</height> @@ -29,23 +29,23 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>wbslabel</cstring> </property> @@ -61,7 +61,7 @@ The WBS code is auto-generated; simply choose Generate WBS Code from the Tools menu to generate the WBS code for the project.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>namelabel</cstring> </property> @@ -75,7 +75,7 @@ The WBS code is auto-generated; simply choose Generate WBS Code from the Tools m <string>The name of the Task.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>leaderlabel</cstring> </property> @@ -93,23 +93,23 @@ This is not limited to persons available in a resource group but can be anyone. </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>wbsfield</cstring> </property> @@ -127,14 +127,14 @@ This is not limited to persons available in a resource group but can be anyone. <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>idlabel</cstring> </property> @@ -169,9 +169,9 @@ This is not limited to persons available in a resource group but can be anyone. <string>The name of the Task.</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> @@ -190,7 +190,7 @@ This is not limited to persons available in a resource group but can be anyone. This is not limited to persons available in a resource group but can be anyone. You can even directly access your address book with the Choose button.</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>chooseLeader</cstring> </property> @@ -210,7 +210,7 @@ This is not limited to persons available in a resource group but can be anyone. </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>descriptionlabell6</cstring> </property> @@ -240,7 +240,7 @@ This is not limited to persons available in a resource group but can be anyone. <tabstop>idfield</tabstop> <tabstop>wbsfield</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>ktextedit.h</includehint> diff --git a/kplato/kpttask.cc b/kplato/kpttask.cc index 255bf948..f4b29f79 100644 --- a/kplato/kpttask.cc +++ b/kplato/kpttask.cc @@ -28,14 +28,14 @@ #include "kpteffortcostmap.h" #include "kptschedule.h" -#include <qdom.h> -#include <qbrush.h> +#include <tqdom.h> +#include <tqbrush.h> #include <kdebug.h> namespace KPlato { -Task::Task(Node *parent) : Node(parent), m_resource() { +Task::Task(Node *tqparent) : Node(tqparent), m_resource() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; m_resource.setAutoDelete(true); Duration d(1, 0, 0); @@ -52,8 +52,8 @@ Task::Task(Node *parent) : Node(parent), m_resource() { m_childProxyRelations.setAutoDelete(true); } -Task::Task(Task &task, Node *parent) - : Node(task, parent), +Task::Task(Task &task, Node *tqparent) + : Node(task, tqparent), m_resource() { //kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl; m_resource.setAutoDelete(true); @@ -97,7 +97,7 @@ Duration *Task::getRandomDuration() { ResourceGroupRequest *Task::resourceGroupRequest(ResourceGroup *group) const { if (m_requests) - return m_requests->find(group); + return m_requests->tqfind(group); return 0; } @@ -148,7 +148,7 @@ void Task::makeAppointments() { //kdDebug()<<k_funcinfo<<m_name<<": "<<m_currentSchedule->startTime<<", "<<m_currentSchedule->endTime<<"; "<<m_currentSchedule->duration.toString()<<endl; } } else if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> nit(m_nodes); + TQPtrListIterator<Node> nit(m_nodes); for ( ; nit.current(); ++nit ) { nit.current()->makeAppointments(); } @@ -169,9 +169,9 @@ void Task::setConstraint(Node::ConstraintType type) { } -bool Task::load(QDomElement &element, Project &project) { +bool Task::load(TQDomElement &element, Project &project) { // Load attributes (TODO: Handle different types of tasks, milestone, summary...) - QString s; + TQString s; bool ok = false; m_id = element.attribute("id"); @@ -181,7 +181,7 @@ bool Task::load(QDomElement &element, Project &project) { //kdDebug()<<k_funcinfo<<m_name<<": id="<<m_id<<endl; // Allow for both numeric and text - QString constraint = element.attribute("scheduling","0"); + TQString constraint = element.attribute("scheduling","0"); m_constraint = (Node::ConstraintType)constraint.toInt(&ok); if (!ok) Node::setConstraint(constraint); // hmmm, why do I need Node::? @@ -198,11 +198,11 @@ bool Task::load(QDomElement &element, Project &project) { m_wbs = element.attribute("wbs", ""); - // Load the project children - QDomNodeList list = element.childNodes(); + // Load the project tqchildren + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "project") { // Load the subproject @@ -254,10 +254,10 @@ bool Task::load(QDomElement &element, Project &project) { m_progress.remainingEffort = Duration::fromString(e.attribute("remaining-effort")); m_progress.totalPerformed = Duration::fromString(e.attribute("performed-effort")); } else if (e.tagName() == "schedules") { - QDomNodeList lst = e.childNodes(); + TQDomNodeList lst = e.childNodes(); for (unsigned int i=0; i<lst.count(); ++i) { if (lst.item(i).isElement()) { - QDomElement el = lst.item(i).toElement(); + TQDomElement el = lst.item(i).toElement(); if (el.tagName() == "schedule") { NodeSchedule *sch = new NodeSchedule(); if (sch->loadXML(el)) { @@ -278,8 +278,8 @@ bool Task::load(QDomElement &element, Project &project) { } -void Task::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("task"); +void Task::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("task"); element.appendChild(me); //TODO: Handle different types of tasks, milestone, summary... @@ -299,7 +299,7 @@ void Task::save(QDomElement &element) const { m_effort->save(me); - QDomElement el = me.ownerDocument().createElement("progress"); + TQDomElement el = me.ownerDocument().createElement("progress"); me.appendChild(el); el.setAttribute("started", m_progress.started); el.setAttribute("finished", m_progress.finished); @@ -310,9 +310,9 @@ void Task::save(QDomElement &element) const { el.setAttribute("performed-effort", m_progress.totalPerformed.toString()); if (!m_schedules.isEmpty()) { - QDomElement schs = me.ownerDocument().createElement("schedules"); + TQDomElement schs = me.ownerDocument().createElement("schedules"); me.appendChild(schs); - QIntDictIterator<Schedule> it = m_schedules; + TQIntDictIterator<Schedule> it = m_schedules; for (; it.current(); ++it) { if (!it.current()->isDeleted()) { it.current()->saveXML(schs); @@ -327,19 +327,19 @@ void Task::save(QDomElement &element) const { } } -void Task::saveAppointments(QDomElement &element, long id) const { +void Task::saveAppointments(TQDomElement &element, long id) const { //kdDebug()<<k_funcinfo<<m_name<<" id="<<id<<endl; Schedule *sch = findSchedule(id); if (sch) { sch->saveAppointments(element); } - QPtrListIterator<Node> it(m_nodes); + TQPtrListIterator<Node> it(m_nodes); for (; it.current(); ++it ) { it.current()->saveAppointments(element, id); } } -EffortCostMap Task::plannedEffortCostPrDay(const QDate &start, const QDate &end) const { +EffortCostMap Task::plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const { //kdDebug()<<k_funcinfo<<m_name<<endl; if (m_currentSchedule) { return m_currentSchedule->plannedEffortCostPrDay(start, end); @@ -352,7 +352,7 @@ Duration Task::plannedEffort() { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffort(); } @@ -363,11 +363,11 @@ Duration Task::plannedEffort() { } // Returns the total planned effort for this task (or subtasks) on date -Duration Task::plannedEffort(const QDate &date) { +Duration Task::plannedEffort(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffort(date); } @@ -378,11 +378,11 @@ Duration Task::plannedEffort(const QDate &date) { } // Returns the total planned effort for this task (or subtasks) upto and including date -Duration Task::plannedEffortTo(const QDate &date) { +Duration Task::plannedEffortTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->plannedEffortTo(date); } @@ -397,7 +397,7 @@ Duration Task::actualEffort() { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffort(); } @@ -412,11 +412,11 @@ Duration Task::actualEffort() { } // Returns the total planned effort for this task (or subtasks) on date -Duration Task::actualEffort(const QDate &date) { +Duration Task::actualEffort(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffort(date); } @@ -427,11 +427,11 @@ Duration Task::actualEffort(const QDate &date) { } // Returns the total planned effort for this task (or subtasks) on date -Duration Task::actualEffortTo(const QDate &date) { +Duration Task::actualEffortTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; Duration eff; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { eff += it.current()->actualEffortTo(date); } @@ -445,7 +445,7 @@ double Task::plannedCost() { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCost(); } @@ -455,11 +455,11 @@ double Task::plannedCost() { return c; } -double Task::plannedCost(const QDate &date) { +double Task::plannedCost(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCost(date); } @@ -469,11 +469,11 @@ double Task::plannedCost(const QDate &date) { return c; } -double Task::plannedCostTo(const QDate &date) { +double Task::plannedCostTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->plannedCostTo(date); } @@ -487,7 +487,7 @@ double Task::actualCost() { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCost(); } @@ -497,11 +497,11 @@ double Task::actualCost() { return c; } -double Task::actualCost(const QDate &date) { +double Task::actualCost(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCost(date); } @@ -511,11 +511,11 @@ double Task::actualCost(const QDate &date) { return c; } -double Task::actualCostTo(const QDate &date) { +double Task::actualCostTo(const TQDate &date) { //kdDebug()<<k_funcinfo<<endl; double c = 0; if (type() == Node::Type_Summarytask) { - QPtrListIterator<Node> it(childNodeIterator()); + TQPtrListIterator<Node> it(childNodeIterator()); for (; it.current(); ++it) { c += it.current()->actualCostTo(date); } @@ -526,7 +526,7 @@ double Task::actualCostTo(const QDate &date) { } //FIXME Handle summarytasks -double Task::effortPerformanceIndex(const QDate &date, bool *error) { +double Task::effortPerformanceIndex(const TQDate &date, bool *error) { double res = 0.0; Duration ae = actualEffortTo(date); @@ -541,9 +541,9 @@ double Task::effortPerformanceIndex(const QDate &date, bool *error) { } //FIXME Handle summarytasks -double Task::costPerformanceIndex(const QDate &date, bool *error) { +double Task::costPerformanceIndex(const TQDate &date, bool *error) { double res = 0.0; - Duration ac = Q_INT64(actualCostTo(date)); + Duration ac = TQ_INT64(actualCostTo(date)); bool e = (ac == Duration::zeroDuration || m_progress.percentFinished == 0); if (error) { @@ -566,13 +566,13 @@ void Task::initiateCalculation(Schedule &sch) { } -void Task::initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> &endnodes, QPtrList<Node> &summarytasks/*, QPtrList<Node> &milestones*/) { +void Task::initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks/*, TQPtrList<Node> &milestones*/) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Node::Type_Summarytask) { summarytasks.append(this); - // propagate my relations to my children and dependent nodes + // propagate my relations to my tqchildren and dependent nodes - QPtrListIterator<Node> nodes = m_nodes; + TQPtrListIterator<Node> nodes = m_nodes; for (; nodes.current(); ++nodes) { if (!dependParentNodes().isEmpty()) nodes.current()->addParentProxyRelations(dependParentNodes()); @@ -592,19 +592,19 @@ void Task::initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> & } } -DateTime Task::calculatePredeccessors(const QPtrList<Relation> &list, int use) { +DateTime Task::calculatePredeccessors(const TQPtrList<Relation> &list, int use) { DateTime time; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { - if (it.current()->parent()->type() == Type_Summarytask) { - //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->parent()->name()<<endl; + if (it.current()->tqparent()->type() == Type_Summarytask) { + //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->tqparent()->name()<<endl; continue; // skip summarytasks } - DateTime t = it.current()->parent()->calculateForward(use); // early finish + DateTime t = it.current()->tqparent()->calculateForward(use); // early finish switch (it.current()->type()) { case Relation::StartStart: // I can't start earlier than my predesseccor - t = it.current()->parent()->getEarliestStart() + it.current()->lag(); + t = it.current()->tqparent()->getEarliestStart() + it.current()->lag(); break; case Relation::FinishFinish: // I can't finish earlier than my predeccessor, so @@ -718,12 +718,12 @@ DateTime Task::calculateForward(int use) { return cs->earliestStart + m_durationForward; } -DateTime Task::calculateSuccessors(const QPtrList<Relation> &list, int use) { +DateTime Task::calculateSuccessors(const TQPtrList<Relation> &list, int use) { DateTime time; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { if (it.current()->child()->type() == Type_Summarytask) { - //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->parent()->name()<<endl; + //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->tqparent()->name()<<endl; continue; // skip summarytasks } DateTime t = it.current()->child()->calculateBackward(use); @@ -844,21 +844,21 @@ DateTime Task::calculateBackward(int use) { return cs->latestFinish - m_durationBackward; } -DateTime Task::schedulePredeccessors(const QPtrList<Relation> &list, int use) { +DateTime Task::schedulePredeccessors(const TQPtrList<Relation> &list, int use) { DateTime time; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { - if (it.current()->parent()->type() == Type_Summarytask) { - //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->parent()->name()<<endl; + if (it.current()->tqparent()->type() == Type_Summarytask) { + //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->tqparent()->name()<<endl; continue; // skip summarytasks } // schedule the predecessors - DateTime earliest = it.current()->parent()->getEarliestStart(); - DateTime t = it.current()->parent()->scheduleForward(earliest, use); + DateTime earliest = it.current()->tqparent()->getEarliestStart(); + DateTime t = it.current()->tqparent()->scheduleForward(earliest, use); switch (it.current()->type()) { case Relation::StartStart: // I can't start before my predesseccor - t = it.current()->parent()->startTime() + it.current()->lag(); + t = it.current()->tqparent()->startTime() + it.current()->lag(); break; case Relation::FinishFinish: // I can't end before my predecessor, so @@ -893,7 +893,7 @@ DateTime Task::scheduleForward(const DateTime &earliest, int use) { cs->startTime = time; //kdDebug()<<k_funcinfo<<m_name<<" new startime="<<cs->startTime<<endl; } - // Then my parents + // Then my tqparents time = schedulePredeccessors(m_parentProxyRelations, use); if (time.isValid() && time > cs->startTime) { cs->startTime = time; @@ -1042,9 +1042,9 @@ DateTime Task::scheduleForward(const DateTime &earliest, int use) { return cs->endTime; } -DateTime Task::scheduleSuccessors(const QPtrList<Relation> &list, int use) { +DateTime Task::scheduleSuccessors(const TQPtrList<Relation> &list, int use) { DateTime time; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { if (it.current()->child()->type() == Type_Summarytask) { //kdDebug()<<k_funcinfo<<"Skip summarytask: "<<it.current()->child()->name()<<endl; @@ -1087,7 +1087,7 @@ DateTime Task::scheduleBackward(const DateTime &latest, int use) { if (time.isValid() && time < cs->endTime) { cs->endTime = time; } - // Then my parents + // Then my tqparents time = scheduleSuccessors(m_childProxyRelations, use); if (time.isValid() && time < cs->endTime) { cs->endTime = time; @@ -1243,7 +1243,7 @@ void Task::adjustSummarytask() { if (type() == Type_Summarytask) { DateTime start = m_currentSchedule->latestFinish; DateTime end = m_currentSchedule->earliestStart; - QPtrListIterator<Node> it(m_nodes); + TQPtrListIterator<Node> it(m_nodes); for (; it.current(); ++it) { it.current()->adjustSummarytask(); if (it.current()->startTime() < start) @@ -1290,42 +1290,42 @@ void Task::clearProxyRelations() { m_childProxyRelations.clear(); } -void Task::addParentProxyRelations(QPtrList<Relation> &list) { +void Task::addParentProxyRelations(TQPtrList<Relation> &list) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Type_Summarytask) { - // propagate to my children + // propagate to my tqchildren //kdDebug()<<k_funcinfo<<m_name<<" is summary task"<<endl; - QPtrListIterator<Node> nodes = m_nodes; + TQPtrListIterator<Node> nodes = m_nodes; for (; nodes.current(); ++nodes) { nodes.current()->addParentProxyRelations(list); nodes.current()->addParentProxyRelations(dependParentNodes()); } } else { - // add 'this' as child relation to the relations parent + // add 'this' as child relation to the relations tqparent //kdDebug()<<k_funcinfo<<m_name<<" is not summary task"<<endl; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { - it.current()->parent()->addChildProxyRelation(this, it.current()); - // add a parent relation to myself - addParentProxyRelation(it.current()->parent(), it.current()); + it.current()->tqparent()->addChildProxyRelation(this, it.current()); + // add a tqparent relation to myself + addParentProxyRelation(it.current()->tqparent(), it.current()); } } } -void Task::addChildProxyRelations(QPtrList<Relation> &list) { +void Task::addChildProxyRelations(TQPtrList<Relation> &list) { //kdDebug()<<k_funcinfo<<m_name<<endl; if (type() == Type_Summarytask) { - // propagate to my children + // propagate to my tqchildren //kdDebug()<<k_funcinfo<<m_name<<" is summary task"<<endl; - QPtrListIterator<Node> nodes = m_nodes; + TQPtrListIterator<Node> nodes = m_nodes; for (; nodes.current(); ++nodes) { nodes.current()->addChildProxyRelations(list); nodes.current()->addChildProxyRelations(dependChildNodes()); } } else { - // add 'this' as parent relation to the relations child + // add 'this' as tqparent relation to the relations child //kdDebug()<<k_funcinfo<<m_name<<" is not summary task"<<endl; - QPtrListIterator<Relation> it = list; + TQPtrListIterator<Relation> it = list; for (; it.current(); ++it) { it.current()->child()->addParentProxyRelation(this, it.current()); // add a child relation to myself @@ -1337,13 +1337,13 @@ void Task::addChildProxyRelations(QPtrList<Relation> &list) { void Task::addParentProxyRelation(Node *node, const Relation *rel) { if (node->type() != Type_Summarytask) { if (type() == Type_Summarytask) { - //kdDebug()<<"Add parent proxy from my children "<<m_name<<" to "<<node->name()<<endl; - QPtrListIterator<Node> nodes = m_nodes; + //kdDebug()<<"Add tqparent proxy from my tqchildren "<<m_name<<" to "<<node->name()<<endl; + TQPtrListIterator<Node> nodes = m_nodes; for (; nodes.current(); ++nodes) { nodes.current()->addParentProxyRelation(node, rel); } } else { - //kdDebug()<<"Add parent proxy from "<<node->name()<<" to (me) "<<m_name<<endl; + //kdDebug()<<"Add tqparent proxy from "<<node->name()<<" to (me) "<<m_name<<endl; m_parentProxyRelations.append(new ProxyRelation(node, this, rel->type(), rel->lag())); } } @@ -1352,8 +1352,8 @@ void Task::addParentProxyRelation(Node *node, const Relation *rel) { void Task::addChildProxyRelation(Node *node, const Relation *rel) { if (node->type() != Type_Summarytask) { if (type() == Type_Summarytask) { - //kdDebug()<<"Add child proxy from my children "<<m_name<<" to "<<node->name()<<endl; - QPtrListIterator<Node> nodes = m_nodes; + //kdDebug()<<"Add child proxy from my tqchildren "<<m_name<<" to "<<node->name()<<endl; + TQPtrListIterator<Node> nodes = m_nodes; for (; nodes.current(); ++nodes) { nodes.current()->addChildProxyRelation(node, rel); } @@ -1365,12 +1365,12 @@ void Task::addChildProxyRelation(Node *node, const Relation *rel) { } bool Task::isEndNode() const { - QPtrListIterator<Relation> it = m_dependChildNodes; + TQPtrListIterator<Relation> it = m_dependChildNodes; for (; it.current(); ++it) { if (it.current()->type() == Relation::FinishStart) return false; } - QPtrListIterator<Relation> pit = m_childProxyRelations; + TQPtrListIterator<Relation> pit = m_childProxyRelations; for (; pit.current(); ++pit) { if (pit.current()->type() == Relation::FinishStart) return false; @@ -1378,13 +1378,13 @@ bool Task::isEndNode() const { return true; } bool Task::isStartNode() const { - QPtrListIterator<Relation> it = m_dependParentNodes; + TQPtrListIterator<Relation> it = m_dependParentNodes; for (; it.current(); ++it) { if (it.current()->type() == Relation::FinishStart || it.current()->type() == Relation::StartStart) return false; } - QPtrListIterator<Relation> pit = m_parentProxyRelations; + TQPtrListIterator<Relation> pit = m_parentProxyRelations; for (; pit.current(); ++pit) { if (pit.current()->type() == Relation::FinishStart || pit.current()->type() == Relation::StartStart) @@ -1477,13 +1477,13 @@ bool Task::calcCriticalPath(bool fromEnd) { //kdDebug()<<k_funcinfo<<m_name<<" end node"<<endl; return true; } - QPtrListIterator<Relation> it(m_childProxyRelations); + TQPtrListIterator<Relation> it(m_childProxyRelations); for (; it.current(); ++it) { if (it.current()->child()->calcCriticalPath(fromEnd)) { m_currentSchedule->inCriticalPath = true; } } - QPtrListIterator<Relation> pit(m_dependChildNodes); + TQPtrListIterator<Relation> pit(m_dependChildNodes); for (; pit.current(); ++pit) { if (pit.current()->child()->calcCriticalPath(fromEnd)) { m_currentSchedule->inCriticalPath = true; @@ -1495,15 +1495,15 @@ bool Task::calcCriticalPath(bool fromEnd) { //kdDebug()<<k_funcinfo<<m_name<<" start node"<<endl; return true; } - QPtrListIterator<Relation> it(m_parentProxyRelations); + TQPtrListIterator<Relation> it(m_parentProxyRelations); for (; it.current(); ++it) { - if (it.current()->parent()->calcCriticalPath(fromEnd)) { + if (it.current()->tqparent()->calcCriticalPath(fromEnd)) { m_currentSchedule->inCriticalPath = true; } } - QPtrListIterator<Relation> pit(m_dependParentNodes); + TQPtrListIterator<Relation> pit(m_dependParentNodes); for (; pit.current(); ++pit) { - if (pit.current()->parent()->calcCriticalPath(fromEnd)) { + if (pit.current()->tqparent()->calcCriticalPath(fromEnd)) { m_currentSchedule->inCriticalPath = true; } } @@ -1525,7 +1525,7 @@ bool Task::effortMetError() const { } #ifndef NDEBUG -void Task::printDebug(bool children, QCString indent) { +void Task::printDebug(bool tqchildren, TQCString indent) { kdDebug()<<indent<<"+ Task node: "<<name()<<" type="<<type()<<endl; indent += "! "; kdDebug()<<indent<<"Requested resources (total): "<<units()<<"%"<<endl; @@ -1533,7 +1533,7 @@ void Task::printDebug(bool children, QCString indent) { if (m_requests) m_requests->printDebug(indent); - Node::printDebug(children, indent); + Node::printDebug(tqchildren, indent); } diff --git a/kplato/kpttask.h b/kplato/kpttask.h index 17972ee7..cace7dcb 100644 --- a/kplato/kpttask.h +++ b/kplato/kpttask.h @@ -25,7 +25,7 @@ #include "kptduration.h" #include "kptresource.h" -#include <qptrlist.h> +#include <tqptrlist.h> namespace KPlato { @@ -39,8 +39,8 @@ class DateTime; */ class Task : public Node { public: - Task(Node *parent = 0); - Task(Task &task, Node *parent = 0); + Task(Node *tqparent = 0); + Task(Task &task, Node *tqparent = 0); ~Task(); /// Return task type. Can be Type_Task, Type_Summarytask ot Type_Milestone. @@ -80,53 +80,53 @@ public: void setConstraint(Node::ConstraintType type); /// Load from document - virtual bool load(QDomElement &element, Project &project); + virtual bool load(TQDomElement &element, Project &project); /// Save to document - virtual void save(QDomElement &element) const; + virtual void save(TQDomElement &element) const; /// Save appointments for schedule with id - virtual void saveAppointments(QDomElement &element, long id) const; + virtual void saveAppointments(TQDomElement &element, long id) const; /** * Returns a list of planned effort and cost for this task * for the interval start, end inclusive */ - virtual EffortCostMap plannedEffortCostPrDay(const QDate &start, const QDate &end) const; + virtual EffortCostMap plannedEffortCostPrDay(const TQDate &start, const TQDate &end) const; /// Returns the total planned effort for this task (or subtasks) virtual Duration plannedEffort(); /// Returns the total planned effort for this task (or subtasks) on date - virtual Duration plannedEffort(const QDate &date); + virtual Duration plannedEffort(const TQDate &date); /// Returns the planned effort up to and including date - virtual Duration plannedEffortTo(const QDate &date); + virtual Duration plannedEffortTo(const TQDate &date); /// Returns the total actual effort for this task (or subtasks) virtual Duration actualEffort(); /// Returns the total actual effort for this task (or subtasks) on date - virtual Duration actualEffort(const QDate &date); + virtual Duration actualEffort(const TQDate &date); /// Returns the actual effort up to and including date - virtual Duration actualEffortTo(const QDate &date); + virtual Duration actualEffortTo(const TQDate &date); /** * Returns the total planned cost for this task (or subtasks) */ virtual double plannedCost(); /// Planned cost on date - virtual double plannedCost(const QDate &/*date*/); + virtual double plannedCost(const TQDate &/*date*/); /// Planned cost up to and including date - virtual double plannedCostTo(const QDate &/*date*/); + virtual double plannedCostTo(const TQDate &/*date*/); /** * Returns the actaually reported cost for this task (or subtasks) */ virtual double actualCost(); /// Actual cost on date - virtual double actualCost(const QDate &/*date*/); + virtual double actualCost(const TQDate &/*date*/); /// Actual cost up to and including date - virtual double actualCostTo(const QDate &/*date*/); + virtual double actualCostTo(const TQDate &/*date*/); /// Effort based performance index - double effortPerformanceIndex(const QDate &date, bool *error=0); + double effortPerformanceIndex(const TQDate &date, bool *error=0); /// Cost performance index - double costPerformanceIndex(const QDate &date, bool *error=0); + double costPerformanceIndex(const TQDate &date, bool *error=0); void initiateCalculation(Schedule &sch); /** @@ -134,7 +134,7 @@ public: * This includes adding summarytasks relations to subtasks * and lists for start- and endnodes. */ - void initiateCalculationLists(QPtrList<Node> &startnodes, QPtrList<Node> &endnodes, QPtrList<Node> &summarytasks); + void initiateCalculationLists(TQPtrList<Node> &startnodes, TQPtrList<Node> &endnodes, TQPtrList<Node> &summarytasks); /** * Calculates ref m_durationForward from ref earliestStart and * returns the resulting end time, @@ -186,14 +186,14 @@ public: // Proxy relations are relations to/from summarytasks. // These relations are distrubuted to the relevant tasks before calculation. void clearProxyRelations(); - void addParentProxyRelations(QPtrList<Relation> &list); - void addChildProxyRelations(QPtrList<Relation> &list); + void addParentProxyRelations(TQPtrList<Relation> &list); + void addChildProxyRelations(TQPtrList<Relation> &list); void addParentProxyRelation(Node *node, const Relation *rel); void addChildProxyRelation(Node *node, const Relation *rel); /// Check if this node has any dependent child nodes. bool isEndNode() const; - /// Check if this node has any dependent parent nodes + /// Check if this node has any dependent tqparent nodes bool isStartNode() const; /** @@ -244,7 +244,7 @@ public: /// Calculate critical path virtual bool calcCriticalPath(bool fromEnd); - /// Set current schedule to schedule with identity id, for me nd my children + /// Set current schedule to schedule with identity id, for me nd my tqchildren virtual void setCurrentSchedule(long id); virtual bool effortMetError() const; @@ -276,27 +276,27 @@ public: struct Progress &progress() { return m_progress; } private: - DateTime calculateSuccessors(const QPtrList<Relation> &list, int use); - DateTime calculatePredeccessors(const QPtrList<Relation> &list, int use); - DateTime scheduleSuccessors(const QPtrList<Relation> &list, int use); - DateTime schedulePredeccessors(const QPtrList<Relation> &list, int use); + DateTime calculateSuccessors(const TQPtrList<Relation> &list, int use); + DateTime calculatePredeccessors(const TQPtrList<Relation> &list, int use); + DateTime scheduleSuccessors(const TQPtrList<Relation> &list, int use); + DateTime schedulePredeccessors(const TQPtrList<Relation> &list, int use); DateTime workStartAfter(const DateTime &dt); DateTime workFinishBefore(const DateTime &dt); private: - QPtrList<ResourceGroup> m_resource; + TQPtrList<ResourceGroup> m_resource; ResourceRequestCollection *m_requests; - QPtrList<Relation> m_parentProxyRelations; - QPtrList<Relation> m_childProxyRelations; + TQPtrList<Relation> m_parentProxyRelations; + TQPtrList<Relation> m_childProxyRelations; struct Progress m_progress; #ifndef NDEBUG public: - void printDebug(bool children, QCString indent); + void printDebug(bool tqchildren, TQCString indent); #endif }; diff --git a/kplato/kpttaskappointmentsview.cc b/kplato/kpttaskappointmentsview.cc index a686f108..81ad4242 100644 --- a/kplato/kpttaskappointmentsview.cc +++ b/kplato/kpttaskappointmentsview.cc @@ -22,24 +22,24 @@ #include "kptappointment.h" #include "kpttask.h" -#include <qapplication.h> +#include <tqapplication.h> #include <kcalendarsystem.h> #include <kglobal.h> #include <klocale.h> -#include <qheader.h> +#include <tqheader.h> namespace KPlato { -TaskAppointmentsView::ResourceItem::ResourceItem(Resource *r, QListView *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, r->name(), highlight), +TaskAppointmentsView::ResourceItem::ResourceItem(Resource *r, TQListView *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, r->name(), highlight), resource(r) { setFormat(0, 'f', 1); //kdDebug()<<k_funcinfo<<endl; } -TaskAppointmentsView::ResourceItem::ResourceItem(Resource *r, QListViewItem *p, bool highlight) +TaskAppointmentsView::ResourceItem::ResourceItem(Resource *r, TQListViewItem *p, bool highlight) : DoubleListViewBase::MasterListItem(p, r->name(), highlight), resource(r) { @@ -47,8 +47,8 @@ TaskAppointmentsView::ResourceItem::ResourceItem(Resource *r, QListViewItem *p, //kdDebug()<<k_funcinfo<<endl; } -TaskAppointmentsView::ResourceItem::ResourceItem(QString text, QListViewItem *parent, bool highlight) - : DoubleListViewBase::MasterListItem(parent, text, highlight), +TaskAppointmentsView::ResourceItem::ResourceItem(TQString text, TQListViewItem *tqparent, bool highlight) + : DoubleListViewBase::MasterListItem(tqparent, text, highlight), resource(0) { setFormat(0, 'f', 1); @@ -56,16 +56,16 @@ TaskAppointmentsView::ResourceItem::ResourceItem(QString text, QListViewItem *pa } //------------------------------------------- -TaskAppointmentsView::TaskAppointmentsView(QWidget *parent) - : DoubleListViewBase(parent), +TaskAppointmentsView::TaskAppointmentsView(TQWidget *tqparent) + : DoubleListViewBase(tqparent), m_task(0) { setNameHeader(i18n("Resource")); - QValueList<int> list = sizes(); + TQValueList<int> list = sizes(); int tot = list[0] + list[1]; - list[0] = QMIN(35, tot); + list[0] = TQMIN(35, tot); list[1] = tot-list[0]; setSizes(list); } @@ -86,8 +86,8 @@ void TaskAppointmentsView::draw() { if (!m_task) return; - QPtrList<Appointment> lst = m_task->appointments(); - QPtrListIterator<Appointment> it(lst); + TQPtrList<Appointment> lst = m_task->appointments(); + TQPtrListIterator<Appointment> it(lst); for (; it.current(); ++it) { Resource *r = it.current()->resource()->resource(); TaskAppointmentsView::ResourceItem *item = new TaskAppointmentsView::ResourceItem(r, masterListView()); @@ -97,7 +97,7 @@ void TaskAppointmentsView::draw() { slotUpdate(); } -void TaskAppointmentsView::drawContents(QPainter* painter) +void TaskAppointmentsView::drawContents(TQPainter* painter) { this->DoubleListViewBase::drawContents(painter); } @@ -106,21 +106,21 @@ void TaskAppointmentsView::slotUpdate() { //kdDebug()<<k_funcinfo<<endl; if (!m_task) return; - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); createSlaveItems(); KLocale *locale = KGlobal::locale(); const KCalendarSystem *cal = locale->calendar(); // Add columns for selected period/periods - QDate start = m_task->startTime().date(); - QDate end = m_task->endTime().date(); + TQDate start = m_task->startTime().date(); + TQDate end = m_task->endTime().date(); //kdDebug()<<k_funcinfo<<start.toString()<<" - "<<end.toString()<<endl; int c=0; - for (QDate dt = start; dt <= end; dt = cal->addDays(dt, 1), ++c) { - QString df = locale->formatDate(dt, true); + for (TQDate dt = start; dt <= end; dt = cal->addDays(dt, 1), ++c) { + TQString df = locale->formatDate(dt, true); addSlaveColumn(df); } - QListViewItemIterator it(masterListView()); + TQListViewItemIterator it(masterListView()); for (;it.current(); ++it) { TaskAppointmentsView::ResourceItem *item = static_cast<TaskAppointmentsView::ResourceItem*>(it.current()); if (!item) { @@ -128,14 +128,14 @@ void TaskAppointmentsView::slotUpdate() { } double eff; int col=0; - for (QDate d=start; d <= end; d = cal->addDays(d, 1), ++col) { + for (TQDate d=start; d <= end; d = cal->addDays(d, 1), ++col) { eff = (double)(item->effortMap.effortOnDate(d).minutes())/60.0; item->setSlaveItem(col, eff); item->addToTotal(eff); } } calculate(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } @@ -146,12 +146,12 @@ void TaskAppointmentsView::print(KPrinter &/*printer*/) { // bool TaskAppointmentsView::setContext(Context::TaskAppointmentsView &context) { // //kdDebug()<<k_funcinfo<<endl; // -// QValueList<int> list; +// TQValueList<int> list; // list << context.accountsviewsize << context.periodviewsize; // m_dlv->setSizes(list); // m_date = context.date; // if (!m_date.isValid()) -// m_date = QDate::currentDate(); +// m_date = TQDate::tqcurrentDate(); // m_period = context.period; // m_cumulative = context.cumulative; // diff --git a/kplato/kpttaskappointmentsview.h b/kplato/kpttaskappointmentsview.h index b2c75f37..d4d8e101 100644 --- a/kplato/kpttaskappointmentsview.h +++ b/kplato/kpttaskappointmentsview.h @@ -24,13 +24,13 @@ #include "kptdoublelistviewbase.h" #include "kpteffortcostmap.h" -class QComboBox; -class QDateEdit; -class QPushButton; -class QSplitter; -class QListViewItem; -class QLabel; -class QPushButton; +class TQComboBox; +class TQDateEdit; +class TQPushButton; +class TQSplitter; +class TQListViewItem; +class TQLabel; +class TQPushButton; class KListView; class KListViewItem; @@ -50,9 +50,10 @@ class ResourceItemPrivate; class TaskAppointmentsView : public DoubleListViewBase { Q_OBJECT + TQ_OBJECT public: - TaskAppointmentsView(QWidget *parent); + TaskAppointmentsView(TQWidget *tqparent); //~TaskAppointmentsView(); @@ -60,7 +61,7 @@ public: void draw(); void draw(Task *task); - virtual void drawContents(QPainter* painter); + virtual void drawContents(TQPainter* painter); void print(KPrinter &printer); void clear(); @@ -75,9 +76,9 @@ protected slots: private: class ResourceItem : public DoubleListViewBase::MasterListItem { public: - ResourceItem(Resource *r, QListView *parent, bool highlight=false); - ResourceItem(Resource *r, QListViewItem *parent, bool highlight=false); - ResourceItem(QString text, QListViewItem *parent, bool highlight=false); + ResourceItem(Resource *r, TQListView *tqparent, bool highlight=false); + ResourceItem(Resource *r, TQListViewItem *tqparent, bool highlight=false); + ResourceItem(TQString text, TQListViewItem *tqparent, bool highlight=false); Resource *resource; EffortCostMap effortMap; diff --git a/kplato/kpttaskappointmentsview.ui.h b/kplato/kpttaskappointmentsview.ui.h index 5fb80e1a..7e090fb7 100644 --- a/kplato/kpttaskappointmentsview.ui.h +++ b/kplato/kpttaskappointmentsview.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ @@ -54,10 +54,10 @@ void TaskAppointmentsView::draw(Task *task) return; m_taskName->setText(task->name()); - QPtrListIterator<Appointment> it(task->appointments()); + TQPtrListIterator<Appointment> it(task->appointments()); for (; it.current(); ++it) { Resource *r = it.current()->resource(); - QListViewItem *item = new QListViewItem(m_appList, r->name()); + TQListViewItem *item = new TQListViewItem(m_appList, r->name()); int i = 1; item->setText(i++, r->typeToString()); item->setText(i++, it.current()->startTime().date().toString(ISODate)); @@ -66,9 +66,9 @@ void TaskAppointmentsView::draw(Task *task) item->setText(i++, KGlobal::locale()->formatMoney(r->normalRate())); item->setText(i++, KGlobal::locale()->formatMoney(r->overtimeRate())); item->setText(i++, KGlobal::locale()->formatMoney(r->fixedCost())); - QPtrListIterator<AppointmentInterval> ait = it.current()->intervals(); + TQPtrListIterator<AppointmentInterval> ait = it.current()->intervals(); for (; ait.current(); ++ait) { - QListViewItem *sub = new QListViewItem(item, ""); + TQListViewItem *sub = new TQListViewItem(item, ""); i = 1; sub->setText(i++, ""); sub->setText(i++, ait.current()->startTime().date().toString(ISODate)); @@ -90,7 +90,7 @@ void TaskAppointmentsView::init() m_appList->setColumnAlignment(6, AlignRight); m_task = 0; - m_date->setDate(QDate::currentDate()); + m_date->setDate(TQDate::tqcurrentDate()); } @@ -106,8 +106,8 @@ void TaskAppointmentsView::drawCostEffort() m_plannedEffort->setText(m_task->plannedEffortTo(m_date->date()).toString(Duration::Format_HourFraction)); m_plannedEffortTotal->setText(m_task->plannedEffort().toString(Duration::Format_HourFraction)); - m_epi->setText(QString("%1").arg(m_task->effortPerformanceIndex(m_date->date()),3,'f',2)); - m_cpi->setText(QString("%1").arg(m_task->costPerformanceIndex(m_date->date()),3,'f',2)); + m_epi->setText(TQString("%1").tqarg(m_task->effortPerformanceIndex(m_date->date()),3,'f',2)); + m_cpi->setText(TQString("%1").tqarg(m_task->costPerformanceIndex(m_date->date()),3,'f',2)); } diff --git a/kplato/kpttaskcostpanel.cc b/kplato/kpttaskcostpanel.cc index 742ae2e4..8e1ce0d0 100644 --- a/kplato/kpttaskcostpanel.cc +++ b/kplato/kpttaskcostpanel.cc @@ -34,7 +34,7 @@ namespace KPlato { -TaskCostPanel::TaskCostPanel(Task &task, Accounts &accounts, QWidget *p, const char *n) +TaskCostPanel::TaskCostPanel(Task &task, Accounts &accounts, TQWidget *p, const char *n) : TaskCostPanelImpl(p, n), m_task(task), m_accounts(accounts) { @@ -66,7 +66,7 @@ void TaskCostPanel::setStartValues(Task &task) { } } -void TaskCostPanel::setCurrentItem(QComboBox *box, QString name) { +void TaskCostPanel::setCurrentItem(TQComboBox *box, TQString name) { box->setCurrentItem(0); for (int i = 0; i < box->count(); ++i) { if (name == box->text(i)) { @@ -132,14 +132,14 @@ bool TaskCostPanel::ok() { } -TaskCostPanelImpl::TaskCostPanelImpl(QWidget *p, const char *n) +TaskCostPanelImpl::TaskCostPanelImpl(TQWidget *p, const char *n) : TaskCostPanelBase(p, n) { - connect(runningAccount, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(startupAccount, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(shutdownAccount, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(startupCost, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); - connect(shutdownCost, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); + connect(runningAccount, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(startupAccount, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(shutdownAccount, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(startupCost, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); + connect(shutdownCost, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); } void TaskCostPanelImpl::slotChanged() { diff --git a/kplato/kpttaskcostpanel.h b/kplato/kpttaskcostpanel.h index 0f4cc051..55fc121e 100644 --- a/kplato/kpttaskcostpanel.h +++ b/kplato/kpttaskcostpanel.h @@ -35,8 +35,9 @@ class Task; class TaskCostPanelImpl : public TaskCostPanelBase { Q_OBJECT + TQ_OBJECT public: - TaskCostPanelImpl(QWidget *parent=0, const char *name=0); + TaskCostPanelImpl(TQWidget *tqparent=0, const char *name=0); signals: void changed(); @@ -47,8 +48,9 @@ public slots: class TaskCostPanel : public TaskCostPanelImpl { Q_OBJECT + TQ_OBJECT public: - TaskCostPanel(Task &task, Accounts &accounts, QWidget *parent=0, const char *name=0); + TaskCostPanel(Task &task, Accounts &accounts, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); @@ -57,12 +59,12 @@ public: void setStartValues(Task &task); protected: - void setCurrentItem(QComboBox *box, QString name); + void setCurrentItem(TQComboBox *box, TQString name); private: Task &m_task; Accounts &m_accounts; - QStringList m_accountList; + TQStringList m_accountList; Account *m_oldrunning; Account *m_oldstartup; Account *m_oldshutdown; diff --git a/kplato/kpttaskcostpanelbase.ui b/kplato/kpttaskcostpanelbase.ui index 5c1303aa..cc5c6e08 100644 --- a/kplato/kpttaskcostpanelbase.ui +++ b/kplato/kpttaskcostpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::TaskCostPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TaskCostPanelBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -34,7 +34,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3_2_2</cstring> </property> @@ -42,7 +42,7 @@ <string>Account:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>runningAccount</cstring> </property> @@ -65,7 +65,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -74,7 +74,7 @@ </spacer> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -90,7 +90,7 @@ <cstring>startupCost</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -98,7 +98,7 @@ <string>Cost:</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -106,7 +106,7 @@ <string>Account:</string> </property> </widget> - <widget class="QComboBox" row="1" column="1"> + <widget class="TQComboBox" row="1" column="1"> <property name="name"> <cstring>startupAccount</cstring> </property> @@ -129,7 +129,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -138,7 +138,7 @@ </spacer> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -149,7 +149,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel3_3</cstring> </property> @@ -157,7 +157,7 @@ <string>Account:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -165,7 +165,7 @@ <string>Cost:</string> </property> </widget> - <widget class="QComboBox" row="1" column="1"> + <widget class="TQComboBox" row="1" column="1"> <property name="name"> <cstring>shutdownAccount</cstring> </property> @@ -193,7 +193,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -212,7 +212,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -223,7 +223,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kplato/kpttaskdefaultpanel.cc b/kplato/kpttaskdefaultpanel.cc index a76249d3..dc116897 100644 --- a/kplato/kpttaskdefaultpanel.cc +++ b/kplato/kpttaskdefaultpanel.cc @@ -38,21 +38,21 @@ #include <kabc/addresseedialog.h> #include <kdatewidget.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> -#include <qgroupbox.h> -#include <qpushbutton.h> -#include <qspinbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> +#include <tqgroupbox.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> #include <kdebug.h> namespace KPlato { -TaskDefaultPanel::TaskDefaultPanel(Task &task, StandardWorktime *workTime, QWidget *parent, const char *n) - : ConfigTaskPanelImpl(parent, n), +TaskDefaultPanel::TaskDefaultPanel(Task &task, StandardWorktime *workTime, TQWidget *tqparent, const char *n) + : ConfigTaskPanelImpl(tqparent, n), m_task(task), m_dayLength(24) { @@ -81,13 +81,13 @@ void TaskDefaultPanel::setStartValues(Task &task, StandardWorktime *workTime) { if (task.constraintStartTime().isValid()) { setStartDateTime(task.constraintStartTime()); } else { - QDate date = QDate::currentDate(); - setStartDateTime(QDateTime(date, QTime())); + TQDate date = TQDate::tqcurrentDate(); + setStartDateTime(TQDateTime(date, TQTime())); } if (task.constraintEndTime().isValid()) { setEndDateTime(task.constraintEndTime()); } else { - setEndDateTime(QDateTime(startDate().addDays(1), QTime())); + setEndDateTime(TQDateTime(startDate().addDays(1), TQTime())); } //kdDebug()<<k_funcinfo<<"Effort: "<<task.effort()->expected().toString()<<endl; setEstimate(task.effort()->expected()); @@ -189,21 +189,21 @@ void TaskDefaultPanel::scheduleTypeChanged(int value) //----------------------------- -ConfigTaskPanelImpl::ConfigTaskPanelImpl(QWidget *p, const char *n) +ConfigTaskPanelImpl::ConfigTaskPanelImpl(TQWidget *p, const char *n) : ConfigTaskPanelBase(p, n) { - connect(leaderfield, SIGNAL(textChanged(const QString &)), SLOT(checkAllFieldsFilled())); - connect(chooseLeader, SIGNAL(clicked()), SLOT(changeLeader())); - connect(estimateType, SIGNAL(activated(int)), SLOT(estimationTypeChanged(int))); - connect(scheduleType, SIGNAL(activated(int)), SLOT(scheduleTypeChanged(int))); - connect(scheduleStartDate, SIGNAL(changed(QDate)), SLOT(startDateChanged())); - connect(scheduleStartTime, SIGNAL(valueChanged(const QTime&)), SLOT(startTimeChanged(const QTime&))); - connect(scheduleEndDate, SIGNAL(changed(QDate)), SLOT(endDateChanged())); - connect(scheduleEndTime, SIGNAL(valueChanged(const QTime&)), SLOT(endTimeChanged(const QTime&))); - connect(estimate, SIGNAL(valueChanged()), SLOT(checkAllFieldsFilled())); - connect(optimisticValue, SIGNAL(valueChanged(int)), SLOT(checkAllFieldsFilled())); - connect(pessimisticValue, SIGNAL(valueChanged(int)), SLOT(checkAllFieldsFilled())); - connect(descriptionfield, SIGNAL(textChanged()), SLOT(checkAllFieldsFilled())); + connect(leaderfield, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(checkAllFieldsFilled())); + connect(chooseLeader, TQT_SIGNAL(clicked()), TQT_SLOT(changeLeader())); + connect(estimateType, TQT_SIGNAL(activated(int)), TQT_SLOT(estimationTypeChanged(int))); + connect(scheduleType, TQT_SIGNAL(activated(int)), TQT_SLOT(scheduleTypeChanged(int))); + connect(scheduleStartDate, TQT_SIGNAL(changed(TQDate)), TQT_SLOT(startDateChanged())); + connect(scheduleStartTime, TQT_SIGNAL(valueChanged(const TQTime&)), TQT_SLOT(startTimeChanged(const TQTime&))); + connect(scheduleEndDate, TQT_SIGNAL(changed(TQDate)), TQT_SLOT(endDateChanged())); + connect(scheduleEndTime, TQT_SIGNAL(valueChanged(const TQTime&)), TQT_SLOT(endTimeChanged(const TQTime&))); + connect(estimate, TQT_SIGNAL(valueChanged()), TQT_SLOT(checkAllFieldsFilled())); + connect(optimisticValue, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(checkAllFieldsFilled())); + connect(pessimisticValue, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(checkAllFieldsFilled())); + connect(descriptionfield, TQT_SIGNAL(textChanged()), TQT_SLOT(checkAllFieldsFilled())); } void ConfigTaskPanelImpl::setSchedulingType(int type) @@ -332,9 +332,9 @@ Duration ConfigTaskPanelImpl::estimationValue() } -void ConfigTaskPanelImpl::setEstimateFields( int mask ) +void ConfigTaskPanelImpl::setEstimateFields( int tqmask ) { - estimate->setVisibleFields(mask); + estimate->setVisibleFields(tqmask); } @@ -347,7 +347,7 @@ void ConfigTaskPanelImpl::setEstimateScales( double day ) } -void ConfigTaskPanelImpl::setEstimateFieldUnit( int field, QString unit ) +void ConfigTaskPanelImpl::setEstimateFieldUnit( int field, TQString unit ) { estimate->setFieldUnit(field, unit); } @@ -357,7 +357,7 @@ void ConfigTaskPanelImpl::startDateChanged() if (!scheduleStartDate->isEnabled()) { return; } - QDate date = startDate(); + TQDate date = startDate(); if (startDateTime() > endDateTime()) { scheduleEndTime->blockSignals(true); @@ -374,7 +374,7 @@ void ConfigTaskPanelImpl::startDateChanged() checkAllFieldsFilled(); } -void ConfigTaskPanelImpl::startTimeChanged( const QTime &time ) +void ConfigTaskPanelImpl::startTimeChanged( const TQTime &time ) { if (!scheduleStartTime->isEnabled()) { return; @@ -398,7 +398,7 @@ void ConfigTaskPanelImpl::endDateChanged() if (!scheduleEndDate->isEnabled()) { return; } - QDate date = endDate(); + TQDate date = endDate(); if (endDateTime() < startDateTime()) { scheduleStartTime->blockSignals(true); @@ -416,7 +416,7 @@ void ConfigTaskPanelImpl::endDateChanged() checkAllFieldsFilled(); } -void ConfigTaskPanelImpl::endTimeChanged( const QTime &time ) +void ConfigTaskPanelImpl::endTimeChanged( const TQTime &time ) { if (!scheduleEndTime->isEnabled()) { return; @@ -443,68 +443,68 @@ void ConfigTaskPanelImpl::scheduleTypeChanged( int value ) } -QDateTime ConfigTaskPanelImpl::startDateTime() +TQDateTime ConfigTaskPanelImpl::startDateTime() { - return QDateTime(startDate(), startTime()); + return TQDateTime(startDate(), startTime()); } -QDateTime ConfigTaskPanelImpl::endDateTime() +TQDateTime ConfigTaskPanelImpl::endDateTime() { - return QDateTime(endDate(), endTime()); + return TQDateTime(endDate(), endTime()); } -void ConfigTaskPanelImpl::setStartTime( const QTime &time ) +void ConfigTaskPanelImpl::setStartTime( const TQTime &time ) { scheduleStartTime->setTime(time); } -void ConfigTaskPanelImpl::setEndTime( const QTime &time ) +void ConfigTaskPanelImpl::setEndTime( const TQTime &time ) { scheduleEndTime->setTime(time); } -QTime ConfigTaskPanelImpl::startTime() const +TQTime ConfigTaskPanelImpl::startTime() const { return scheduleStartTime->time(); } -QTime ConfigTaskPanelImpl::endTime() +TQTime ConfigTaskPanelImpl::endTime() { return scheduleEndTime->time(); } -QDate ConfigTaskPanelImpl::startDate() +TQDate ConfigTaskPanelImpl::startDate() { return scheduleStartDate->date(); } -QDate ConfigTaskPanelImpl::endDate() +TQDate ConfigTaskPanelImpl::endDate() { return scheduleEndDate->date(); } -void ConfigTaskPanelImpl::setStartDateTime( const QDateTime &dt ) +void ConfigTaskPanelImpl::setStartDateTime( const TQDateTime &dt ) { setStartDate(dt.date()); setStartTime(dt.time()); } -void ConfigTaskPanelImpl::setEndDateTime( const QDateTime &dt ) +void ConfigTaskPanelImpl::setEndDateTime( const TQDateTime &dt ) { setEndDate(dt.date()); setEndTime(dt.time()); } -void ConfigTaskPanelImpl::setStartDate( const QDate &date ) +void ConfigTaskPanelImpl::setStartDate( const TQDate &date ) { scheduleStartDate->setDate(date); } -void ConfigTaskPanelImpl::setEndDate( const QDate &date ) +void ConfigTaskPanelImpl::setEndDate( const TQDate &date ) { scheduleEndDate->setDate(date); } diff --git a/kplato/kpttaskdefaultpanel.h b/kplato/kpttaskdefaultpanel.h index 087f1e01..8ab532e5 100644 --- a/kplato/kpttaskdefaultpanel.h +++ b/kplato/kpttaskdefaultpanel.h @@ -35,20 +35,21 @@ class StandardWorktime; class ConfigTaskPanelImpl : public ConfigTaskPanelBase { Q_OBJECT + TQ_OBJECT public: - ConfigTaskPanelImpl(QWidget *parent, const char *name); + ConfigTaskPanelImpl(TQWidget *tqparent, const char *name); virtual int schedulingType() const; virtual int estimationType() const; virtual int optimistic() const; virtual int pessimistic(); virtual Duration estimationValue(); - virtual QDateTime startDateTime(); - virtual QDateTime endDateTime(); - virtual QTime startTime() const; - virtual QTime endTime(); - virtual QDate startDate(); - virtual QDate endDate(); + virtual TQDateTime startDateTime(); + virtual TQDateTime endDateTime(); + virtual TQTime startTime() const; + virtual TQTime endTime(); + virtual TQDate startDate(); + virtual TQDate endDate(); public slots: virtual void setSchedulingType( int type ); @@ -61,20 +62,20 @@ public slots: virtual void setEstimate( const Duration & duration ); virtual void setEstimateType( int type ); virtual void checkAllFieldsFilled(); - virtual void setEstimateFields( int mask ); + virtual void setEstimateFields( int tqmask ); virtual void setEstimateScales( double day ); - virtual void setEstimateFieldUnit( int field, QString unit ); + virtual void setEstimateFieldUnit( int field, TQString unit ); virtual void startDateChanged(); - virtual void startTimeChanged( const QTime & time ); + virtual void startTimeChanged( const TQTime & time ); virtual void endDateChanged(); - virtual void endTimeChanged( const QTime & time ); + virtual void endTimeChanged( const TQTime & time ); virtual void scheduleTypeChanged( int value ); - virtual void setStartTime( const QTime & time ); - virtual void setEndTime( const QTime & time ); - virtual void setStartDateTime( const QDateTime & dt ); - virtual void setEndDateTime( const QDateTime & dt ); - virtual void setStartDate( const QDate & date ); - virtual void setEndDate( const QDate & date ); + virtual void setStartTime( const TQTime & time ); + virtual void setEndTime( const TQTime & time ); + virtual void setStartDateTime( const TQDateTime & dt ); + virtual void setEndDateTime( const TQDateTime & dt ); + virtual void setStartDate( const TQDate & date ); + virtual void setEndDate( const TQDate & date ); signals: void obligatedFieldsFilled( bool ); @@ -87,8 +88,9 @@ protected: class TaskDefaultPanel : public ConfigTaskPanelImpl { Q_OBJECT + TQ_OBJECT public: - TaskDefaultPanel(Task &task, StandardWorktime *workTime=0, QWidget *parent=0, const char *name=0); + TaskDefaultPanel(Task &task, StandardWorktime *workTime=0, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kpttaskdialog.cc b/kplato/kpttaskdialog.cc index 36ab2022..1db88030 100644 --- a/kplato/kpttaskdialog.cc +++ b/kplato/kpttaskdialog.cc @@ -26,16 +26,16 @@ #include <klocale.h> #include <kcommand.h> -#include <qvbox.h> +#include <tqvbox.h> #include <kdebug.h> namespace KPlato { -TaskDialog::TaskDialog(Task &task, Accounts &accounts, StandardWorktime *workTime, bool baseline, QWidget *p) +TaskDialog::TaskDialog(Task &task, Accounts &accounts, StandardWorktime *workTime, bool baseline, TQWidget *p) : KDialogBase(Tabbed, i18n("Task Settings"), Ok|Cancel, Ok, p, "Task Settings Dialog", true, true) { - QVBox *page; + TQVBox *page; // Create all the tabs. page = addVBoxPage(i18n("&General")); @@ -50,9 +50,9 @@ TaskDialog::TaskDialog(Task &task, Accounts &accounts, StandardWorktime *workTim // Set the state of all the child widgets. enableButtonOK(false); - connect(m_generalTab, SIGNAL( obligatedFieldsFilled(bool) ), this, SLOT( enableButtonOK(bool) )); - connect(m_resourcesTab, SIGNAL( changed() ), m_generalTab, SLOT( checkAllFieldsFilled() )); - connect(m_costTab, SIGNAL( changed() ), m_generalTab, SLOT( checkAllFieldsFilled() )); + connect(m_generalTab, TQT_SIGNAL( obligatedFieldsFilled(bool) ), this, TQT_SLOT( enableButtonOK(bool) )); + connect(m_resourcesTab, TQT_SIGNAL( changed() ), m_generalTab, TQT_SLOT( checkAllFieldsFilled() )); + connect(m_costTab, TQT_SIGNAL( changed() ), m_generalTab, TQT_SLOT( checkAllFieldsFilled() )); } diff --git a/kplato/kpttaskdialog.h b/kplato/kpttaskdialog.h index 26a08caa..169aec6b 100644 --- a/kplato/kpttaskdialog.h +++ b/kplato/kpttaskdialog.h @@ -31,12 +31,12 @@ class KTextEdit; class KComboBox; class KDoubleNumInput; -class QDateTimeEdit; -class QSpinBox; -class QButtonGroup; -class QListBox; -class QTable; -class QDateTime; +class TQDateTimeEdit; +class TQSpinBox; +class TQButtonGroup; +class TQListBox; +class TQTable; +class TQDateTime; //TODO ui files are not in the KPlato namespace!! @@ -56,6 +56,7 @@ class StandardWorktime; */ class TaskDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** * The constructor for the task settings dialog. @@ -63,9 +64,9 @@ public: * @param accounts all defined accounts * @param workTime defines the number of hours pr day and week * @param baseline if true, project is baselined - * @param parent parent widget + * @param tqparent tqparent widget */ - TaskDialog(Task &task, Accounts &accounts, StandardWorktime *workTime=0, bool baseline=false, QWidget *parent=0); + TaskDialog(Task &task, Accounts &accounts, StandardWorktime *workTime=0, bool baseline=false, TQWidget *tqparent=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kpttaskgeneralpanel.cc b/kplato/kpttaskgeneralpanel.cc index 53b7e60b..7664a89f 100644 --- a/kplato/kpttaskgeneralpanel.cc +++ b/kplato/kpttaskgeneralpanel.cc @@ -39,27 +39,27 @@ #include <kabc/addresseedialog.h> #include <kdatewidget.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qdatetime.h> -#include <qdatetimeedit.h> -#include <qgroupbox.h> -#include <qpushbutton.h> -#include <qspinbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqdatetimeedit.h> +#include <tqgroupbox.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> #include <kdebug.h> namespace KPlato { -TaskGeneralPanel::TaskGeneralPanel(Task &task, StandardWorktime *workTime, bool /*baseline*/, QWidget *p, const char *n) +TaskGeneralPanel::TaskGeneralPanel(Task &task, StandardWorktime *workTime, bool /*baseline*/, TQWidget *p, const char *n) : TaskGeneralPanelImpl(p, n), m_task(task), m_dayLength(24) { useTime = true; setStartValues(task, workTime); -/* Why is this done? Its useless (its not actually read only, but that may be a Qt thing) and I have to +/* Why is this done? Its useless (its not actually read only, but that may be a TQt thing) and I have to edit these to actually be able to OK the dialog. TZ-8-2005 namefield->setReadOnly(baseline); leaderfield->setReadOnly(baseline); @@ -93,13 +93,13 @@ void TaskGeneralPanel::setStartValues(Task &task, StandardWorktime *workTime) { if (task.constraintStartTime().isValid()) { setStartDateTime(task.constraintStartTime()); } else { - QDate date = QDate::currentDate(); - setStartDateTime(QDateTime(date, QTime())); + TQDate date = TQDate::tqcurrentDate(); + setStartDateTime(TQDateTime(date, TQTime())); } if (task.constraintEndTime().isValid()) { setEndDateTime(task.constraintEndTime()); } else { - setEndDateTime(QDateTime(startDate().addDays(1), QTime())); + setEndDateTime(TQDateTime(startDate().addDays(1), TQTime())); } //kdDebug()<<k_funcinfo<<"Effort: "<<task.effort()->expected().toString()<<endl; setEstimate(task.effort()->expected()); @@ -226,24 +226,24 @@ void TaskGeneralPanel::scheduleTypeChanged(int value) } //----------------------------- -TaskGeneralPanelImpl::TaskGeneralPanelImpl(QWidget *p, const char *n) +TaskGeneralPanelImpl::TaskGeneralPanelImpl(TQWidget *p, const char *n) : TaskGeneralPanelBase(p, n) { - connect(idfield, SIGNAL(textChanged(const QString &)), SLOT(checkAllFieldsFilled())); - connect(namefield, SIGNAL(textChanged(const QString &)), SLOT(checkAllFieldsFilled())); - connect(leaderfield, SIGNAL(textChanged(const QString &)), SLOT(checkAllFieldsFilled())); - connect(chooseLeader, SIGNAL(clicked()), SLOT(changeLeader())); - connect(estimateType, SIGNAL(activated(int)), SLOT(estimationTypeChanged(int))); - connect(scheduleType, SIGNAL(activated(int)), SLOT(scheduleTypeChanged(int))); - connect(scheduleStartDate, SIGNAL(changed(QDate)), SLOT(startDateChanged())); - connect(scheduleStartTime, SIGNAL(valueChanged(const QTime&)), SLOT(startTimeChanged(const QTime&))); - connect(scheduleEndDate, SIGNAL(changed(QDate)), SLOT(endDateChanged())); - connect(scheduleEndTime, SIGNAL(valueChanged(const QTime&)), SLOT(endTimeChanged(const QTime&))); - connect(estimate, SIGNAL(valueChanged()), SLOT(checkAllFieldsFilled())); - connect(optimisticValue, SIGNAL(valueChanged(int)), SLOT(checkAllFieldsFilled())); - connect(pessimisticValue, SIGNAL(valueChanged(int)), SLOT(checkAllFieldsFilled())); - connect(descriptionfield, SIGNAL(textChanged()), SLOT(checkAllFieldsFilled())); - connect(risk, SIGNAL(activated(int)), SLOT(checkAllFieldsFilled())); + connect(idfield, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(checkAllFieldsFilled())); + connect(namefield, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(checkAllFieldsFilled())); + connect(leaderfield, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(checkAllFieldsFilled())); + connect(chooseLeader, TQT_SIGNAL(clicked()), TQT_SLOT(changeLeader())); + connect(estimateType, TQT_SIGNAL(activated(int)), TQT_SLOT(estimationTypeChanged(int))); + connect(scheduleType, TQT_SIGNAL(activated(int)), TQT_SLOT(scheduleTypeChanged(int))); + connect(scheduleStartDate, TQT_SIGNAL(changed(TQDate)), TQT_SLOT(startDateChanged())); + connect(scheduleStartTime, TQT_SIGNAL(valueChanged(const TQTime&)), TQT_SLOT(startTimeChanged(const TQTime&))); + connect(scheduleEndDate, TQT_SIGNAL(changed(TQDate)), TQT_SLOT(endDateChanged())); + connect(scheduleEndTime, TQT_SIGNAL(valueChanged(const TQTime&)), TQT_SLOT(endTimeChanged(const TQTime&))); + connect(estimate, TQT_SIGNAL(valueChanged()), TQT_SLOT(checkAllFieldsFilled())); + connect(optimisticValue, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(checkAllFieldsFilled())); + connect(pessimisticValue, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(checkAllFieldsFilled())); + connect(descriptionfield, TQT_SIGNAL(textChanged()), TQT_SLOT(checkAllFieldsFilled())); + connect(risk, TQT_SIGNAL(activated(int)), TQT_SLOT(checkAllFieldsFilled())); } void TaskGeneralPanelImpl::setSchedulingType(int type) @@ -372,9 +372,9 @@ Duration TaskGeneralPanelImpl::estimationValue() } -void TaskGeneralPanelImpl::setEstimateFields( int mask ) +void TaskGeneralPanelImpl::setEstimateFields( int tqmask ) { - estimate->setVisibleFields(mask); + estimate->setVisibleFields(tqmask); } @@ -387,7 +387,7 @@ void TaskGeneralPanelImpl::setEstimateScales( double day ) } -void TaskGeneralPanelImpl::setEstimateFieldUnit( int field, QString unit ) +void TaskGeneralPanelImpl::setEstimateFieldUnit( int field, TQString unit ) { estimate->setFieldUnit(field, unit); } @@ -397,7 +397,7 @@ void TaskGeneralPanelImpl::startDateChanged() if (!scheduleStartDate->isEnabled()) { return; } - QDate date = startDate(); + TQDate date = startDate(); if (startDateTime() > endDateTime()) { scheduleEndTime->blockSignals(true); @@ -414,7 +414,7 @@ void TaskGeneralPanelImpl::startDateChanged() checkAllFieldsFilled(); } -void TaskGeneralPanelImpl::startTimeChanged( const QTime &time ) +void TaskGeneralPanelImpl::startTimeChanged( const TQTime &time ) { if (!scheduleStartTime->isEnabled()) { return; @@ -438,7 +438,7 @@ void TaskGeneralPanelImpl::endDateChanged() if (!scheduleEndDate->isEnabled()) { return; } - QDate date = endDate(); + TQDate date = endDate(); if (endDateTime() < startDateTime()) { scheduleStartTime->blockSignals(true); @@ -456,7 +456,7 @@ void TaskGeneralPanelImpl::endDateChanged() checkAllFieldsFilled(); } -void TaskGeneralPanelImpl::endTimeChanged( const QTime &time ) +void TaskGeneralPanelImpl::endTimeChanged( const TQTime &time ) { if (!scheduleEndTime->isEnabled()) { return; @@ -483,68 +483,68 @@ void TaskGeneralPanelImpl::scheduleTypeChanged( int value ) } -QDateTime TaskGeneralPanelImpl::startDateTime() +TQDateTime TaskGeneralPanelImpl::startDateTime() { - return QDateTime(startDate(), startTime()); + return TQDateTime(startDate(), startTime()); } -QDateTime TaskGeneralPanelImpl::endDateTime() +TQDateTime TaskGeneralPanelImpl::endDateTime() { - return QDateTime(endDate(), endTime()); + return TQDateTime(endDate(), endTime()); } -void TaskGeneralPanelImpl::setStartTime( const QTime &time ) +void TaskGeneralPanelImpl::setStartTime( const TQTime &time ) { scheduleStartTime->setTime(time); } -void TaskGeneralPanelImpl::setEndTime( const QTime &time ) +void TaskGeneralPanelImpl::setEndTime( const TQTime &time ) { scheduleEndTime->setTime(time); } -QTime TaskGeneralPanelImpl::startTime() const +TQTime TaskGeneralPanelImpl::startTime() const { return scheduleStartTime->time(); } -QTime TaskGeneralPanelImpl::endTime() +TQTime TaskGeneralPanelImpl::endTime() { return scheduleEndTime->time(); } -QDate TaskGeneralPanelImpl::startDate() +TQDate TaskGeneralPanelImpl::startDate() { return scheduleStartDate->date(); } -QDate TaskGeneralPanelImpl::endDate() +TQDate TaskGeneralPanelImpl::endDate() { return scheduleEndDate->date(); } -void TaskGeneralPanelImpl::setStartDateTime( const QDateTime &dt ) +void TaskGeneralPanelImpl::setStartDateTime( const TQDateTime &dt ) { setStartDate(dt.date()); setStartTime(dt.time()); } -void TaskGeneralPanelImpl::setEndDateTime( const QDateTime &dt ) +void TaskGeneralPanelImpl::setEndDateTime( const TQDateTime &dt ) { setEndDate(dt.date()); setEndTime(dt.time()); } -void TaskGeneralPanelImpl::setStartDate( const QDate &date ) +void TaskGeneralPanelImpl::setStartDate( const TQDate &date ) { scheduleStartDate->setDate(date); } -void TaskGeneralPanelImpl::setEndDate( const QDate &date ) +void TaskGeneralPanelImpl::setEndDate( const TQDate &date ) { scheduleEndDate->setDate(date); } diff --git a/kplato/kpttaskgeneralpanel.h b/kplato/kpttaskgeneralpanel.h index fd3f539f..29634d27 100644 --- a/kplato/kpttaskgeneralpanel.h +++ b/kplato/kpttaskgeneralpanel.h @@ -37,20 +37,21 @@ class StandardWorktime; class TaskGeneralPanelImpl : public TaskGeneralPanelBase { Q_OBJECT + TQ_OBJECT public: - TaskGeneralPanelImpl(QWidget *parent, const char *name); + TaskGeneralPanelImpl(TQWidget *tqparent, const char *name); virtual int schedulingType() const; virtual int estimationType() const; virtual int optimistic() const; virtual int pessimistic(); virtual Duration estimationValue(); - virtual QDateTime startDateTime(); - virtual QDateTime endDateTime(); - virtual QTime startTime() const; - virtual QTime endTime(); - virtual QDate startDate(); - virtual QDate endDate(); + virtual TQDateTime startDateTime(); + virtual TQDateTime endDateTime(); + virtual TQTime startTime() const; + virtual TQTime endTime(); + virtual TQDate startDate(); + virtual TQDate endDate(); virtual int risktype() const; public slots: virtual void setSchedulingType( int type ); @@ -63,20 +64,20 @@ public slots: virtual void setEstimate( const Duration & duration ); virtual void setEstimateType( int type ); virtual void checkAllFieldsFilled(); - virtual void setEstimateFields( int mask ); + virtual void setEstimateFields( int tqmask ); virtual void setEstimateScales( double day ); - virtual void setEstimateFieldUnit( int field, QString unit ); + virtual void setEstimateFieldUnit( int field, TQString unit ); virtual void startDateChanged(); - virtual void startTimeChanged( const QTime & time ); + virtual void startTimeChanged( const TQTime & time ); virtual void endDateChanged(); - virtual void endTimeChanged( const QTime & time ); + virtual void endTimeChanged( const TQTime & time ); virtual void scheduleTypeChanged( int value ); - virtual void setStartTime( const QTime & time ); - virtual void setEndTime( const QTime & time ); - virtual void setStartDateTime( const QDateTime & dt ); - virtual void setEndDateTime( const QDateTime & dt ); - virtual void setStartDate( const QDate & date ); - virtual void setEndDate( const QDate & date ); + virtual void setStartTime( const TQTime & time ); + virtual void setEndTime( const TQTime & time ); + virtual void setStartDateTime( const TQDateTime & dt ); + virtual void setEndDateTime( const TQDateTime & dt ); + virtual void setStartDate( const TQDate & date ); + virtual void setEndDate( const TQDate & date ); virtual void setRisktype( int r ); signals: @@ -90,8 +91,9 @@ protected: class TaskGeneralPanel : public TaskGeneralPanelImpl { Q_OBJECT + TQ_OBJECT public: - TaskGeneralPanel(Task &task, StandardWorktime *workTime=0, bool baseline=false, QWidget *parent=0, const char *name=0); + TaskGeneralPanel(Task &task, StandardWorktime *workTime=0, bool baseline=false, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kpttaskgeneralpanelbase.ui b/kplato/kpttaskgeneralpanelbase.ui index ffb7acd6..2d047b50 100644 --- a/kplato/kpttaskgeneralpanelbase.ui +++ b/kplato/kpttaskgeneralpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::TaskGeneralPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TaskGeneralPanelBase</cstring> </property> @@ -23,23 +23,23 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>wbslabel</cstring> </property> @@ -55,7 +55,7 @@ The WBS code is auto-generated; simply choose Generate WBS Code from the Tools menu to generate the WBS code for the project.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>namelabel</cstring> </property> @@ -69,7 +69,7 @@ The WBS code is auto-generated; simply choose Generate WBS Code from the Tools m <string>The name of the Task.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>leaderlabel</cstring> </property> @@ -87,23 +87,23 @@ This is not limited to persons available in a resource group but can be anyone. </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>wbsfield</cstring> </property> @@ -121,14 +121,14 @@ This is not limited to persons available in a resource group but can be anyone. <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>idlabel</cstring> </property> @@ -157,9 +157,9 @@ This is not limited to persons available in a resource group but can be anyone. <string>The name of the Task.</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> @@ -175,7 +175,7 @@ This is not limited to persons available in a resource group but can be anyone. This is not limited to persons available in a resource group but can be anyone. You can even directly access your address book with the Choose button.</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>chooseLeader</cstring> </property> @@ -198,7 +198,7 @@ This is not limited to persons available in a resource group but can be anyone. </widget> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>schedulingGroup</cstring> </property> @@ -254,7 +254,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>scheduleType</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -288,7 +288,7 @@ The estimation can be either effort based or duration based. If it is effort bas </date> </property> </widget> - <widget class="QTimeEdit" row="0" column="3"> + <widget class="TQTimeEdit" row="0" column="3"> <property name="name"> <cstring>scheduleStartTime</cstring> </property> @@ -301,7 +301,7 @@ The estimation can be either effort based or duration based. If it is effort bas <enum>WheelFocus</enum> </property> </widget> - <widget class="QTimeEdit" row="1" column="3"> + <widget class="TQTimeEdit" row="1" column="3"> <property name="name"> <cstring>scheduleEndTime</cstring> </property> @@ -314,15 +314,15 @@ The estimation can be either effort based or duration based. If it is effort bas <enum>WheelFocus</enum> </property> </widget> - <widget class="QLayoutWidget" row="3" column="2" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="3" column="2" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout41</cstring> + <cstring>tqlayout41</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -333,7 +333,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>optimisticValueoptimisticValue</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>optimisticValue</cstring> </property> @@ -347,7 +347,7 @@ The estimation can be either effort based or duration based. If it is effort bas <number>-99</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -358,7 +358,7 @@ The estimation can be either effort based or duration based. If it is effort bas <cstring>pessimisticValue</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>pessimisticValue</cstring> </property> @@ -371,7 +371,7 @@ The estimation can be either effort based or duration based. If it is effort bas </widget> </hbox> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -443,7 +443,7 @@ The estimation can be either effort based or duration based. If it is effort bas <b>High risk</b> means that the estimate will be slightly pessimistic compared to Low risk.</p></string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel3_2_3</cstring> </property> @@ -473,7 +473,7 @@ The estimation can be either effort based or duration based. If it is effort bas </widget> </grid> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>descriptionlabell6</cstring> </property> @@ -537,7 +537,7 @@ The estimation can be either effort based or duration based. If it is effort bas <tabstop>idfield</tabstop> <tabstop>wbsfield</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>kcombobox.h</includehint> diff --git a/kplato/kpttasknotespanelbase.ui b/kplato/kpttasknotespanelbase.ui index f4f8da8d..ea543d1e 100644 --- a/kplato/kpttasknotespanelbase.ui +++ b/kplato/kpttasknotespanelbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>KPlato::TaskNotesPanelBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TaskNotesPanelBase</cstring> </property> @@ -16,15 +16,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -35,7 +35,7 @@ <cstring>descriptionfield</cstring> </property> </widget> - <widget class="QTextEdit"> + <widget class="TQTextEdit"> <property name="name"> <cstring>descriptionfield</cstring> </property> @@ -44,8 +44,8 @@ </widget> </hbox> </widget> -<slots> +<Q_SLOTS> <slot>scheduling_clicked( int schedulingType )</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kpttaskprogressdialog.cc b/kplato/kpttaskprogressdialog.cc index 33de8bf6..db34f3ee 100644 --- a/kplato/kpttaskprogressdialog.cc +++ b/kplato/kpttaskprogressdialog.cc @@ -28,7 +28,7 @@ namespace KPlato { -TaskProgressDialog::TaskProgressDialog(Task &task, StandardWorktime *workTime, QWidget *p) +TaskProgressDialog::TaskProgressDialog(Task &task, StandardWorktime *workTime, TQWidget *p) : KDialogBase(Swallow, i18n("Task Progress"), Ok|Cancel, Ok, p, "Task Progress Dialog", true, true) { m_panel = new TaskProgressPanel(task, workTime, this); @@ -37,7 +37,7 @@ TaskProgressDialog::TaskProgressDialog(Task &task, StandardWorktime *workTime, Q enableButtonOK(false); - connect(m_panel, SIGNAL( changed() ), SLOT(slotChanged())); + connect(m_panel, TQT_SIGNAL( changed() ), TQT_SLOT(slotChanged())); } void TaskProgressDialog::slotChanged() { diff --git a/kplato/kpttaskprogressdialog.h b/kplato/kpttaskprogressdialog.h index f20e8256..8145062d 100644 --- a/kplato/kpttaskprogressdialog.h +++ b/kplato/kpttaskprogressdialog.h @@ -34,8 +34,9 @@ class StandardWorktime; class TaskProgressDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - TaskProgressDialog(Task &task, StandardWorktime *workTime, QWidget *parent=0); + TaskProgressDialog(Task &task, StandardWorktime *workTime, TQWidget *tqparent=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kpttaskprogresspanel.cc b/kplato/kpttaskprogresspanel.cc index e85c6538..52cab18e 100644 --- a/kplato/kpttaskprogresspanel.cc +++ b/kplato/kpttaskprogresspanel.cc @@ -19,9 +19,9 @@ #include "kpttaskprogresspanel.h" -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qcheckbox.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> #include <klineedit.h> #include <ktextedit.h> @@ -41,8 +41,8 @@ namespace KPlato { -TaskProgressPanel::TaskProgressPanel(Task &task, StandardWorktime *workTime, QWidget *parent, const char *name) - : TaskProgressPanelImpl(parent, name), +TaskProgressPanel::TaskProgressPanel(Task &task, StandardWorktime *workTime, TQWidget *tqparent, const char *name) + : TaskProgressPanelImpl(tqparent, name), m_task(task), m_dayLength(24) { @@ -100,7 +100,7 @@ bool TaskProgressPanel::ok() { KCommand *TaskProgressPanel::buildCommand(Part *part) { KCommand *cmd = 0; - QString c = i18n("Modify progress"); + TQString c = i18n("Modify progress"); if (m_task.progress() != m_progress) { cmd = new TaskModifyProgressCmd(part, m_task, m_progress, c); } @@ -124,20 +124,20 @@ void TaskProgressPanel::setEstimateScales( int day ) //------------------------------------- -TaskProgressPanelImpl::TaskProgressPanelImpl(QWidget *parent, const char *name, WFlags f) - : TaskProgressPanelBase(parent, name, f) { +TaskProgressPanelImpl::TaskProgressPanelImpl(TQWidget *tqparent, const char *name, WFlags f) + : TaskProgressPanelBase(tqparent, name, f) { - connect(started, SIGNAL(toggled(bool)), SLOT(slotStartedChanged(bool))); - connect(finished, SIGNAL(toggled(bool)), SLOT(slotFinishedChanged(bool))); + connect(started, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotStartedChanged(bool))); + connect(finished, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotFinishedChanged(bool))); - connect(percentFinished, SIGNAL(valueChanged(int)), SLOT(slotPercentFinishedChanged(int))); - connect(percentFinished, SIGNAL(valueChanged(int)), SLOT(slotChanged())); + connect(percentFinished, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotPercentFinishedChanged(int))); + connect(percentFinished, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChanged())); - connect(startTime, SIGNAL(valueChanged(const QDateTime &)), SLOT(slotChanged())); - connect(finishTime, SIGNAL(valueChanged(const QDateTime &)), SLOT(slotChanged())); + connect(startTime, TQT_SIGNAL(valueChanged(const TQDateTime &)), TQT_SLOT(slotChanged())); + connect(finishTime, TQT_SIGNAL(valueChanged(const TQDateTime &)), TQT_SLOT(slotChanged())); - connect(remainingEffort, SIGNAL(valueChanged()), SLOT(slotChanged())); - connect(actualEffort, SIGNAL(valueChanged()), SLOT(slotChanged())); + connect(remainingEffort, TQT_SIGNAL(valueChanged()), TQT_SLOT(slotChanged())); + connect(actualEffort, TQT_SIGNAL(valueChanged()), TQT_SLOT(slotChanged())); } @@ -147,7 +147,7 @@ void TaskProgressPanelImpl::slotChanged() { void TaskProgressPanelImpl::slotStartedChanged(bool state) { if (state) { - startTime->setDateTime(QDateTime::currentDateTime()); + startTime->setDateTime(TQDateTime::tqcurrentDateTime()); percentFinished->setValue(0); } enableWidgets(); @@ -158,7 +158,7 @@ void TaskProgressPanelImpl::slotFinishedChanged(bool state) { if (state) { percentFinished->setValue(100); if (!finishTime->dateTime().isValid()) { - finishTime->setDateTime(QDateTime::currentDateTime()); + finishTime->setDateTime(TQDateTime::tqcurrentDateTime()); } } enableWidgets(); diff --git a/kplato/kpttaskprogresspanel.h b/kplato/kpttaskprogresspanel.h index 24f4c9c2..fe22441f 100644 --- a/kplato/kpttaskprogresspanel.h +++ b/kplato/kpttaskprogresspanel.h @@ -33,8 +33,9 @@ class StandardWorktime; class TaskProgressPanelImpl : public TaskProgressPanelBase { Q_OBJECT + TQ_OBJECT public: - TaskProgressPanelImpl(QWidget *parent=0, const char *name=0, WFlags f=0); + TaskProgressPanelImpl(TQWidget *tqparent=0, const char *name=0, WFlags f=0); void enableWidgets(); @@ -50,8 +51,9 @@ public slots: class TaskProgressPanel : public TaskProgressPanelImpl { Q_OBJECT + TQ_OBJECT public: - TaskProgressPanel(Task &task, StandardWorktime *workTime=0, QWidget *parent=0, const char *name=0); + TaskProgressPanel(Task &task, StandardWorktime *workTime=0, TQWidget *tqparent=0, const char *name=0); KCommand *buildCommand(Part *part); diff --git a/kplato/kpttaskprogresspanelbase.ui b/kplato/kpttaskprogresspanelbase.ui index 40c03dd9..1acf3556 100644 --- a/kplato/kpttaskprogresspanelbase.ui +++ b/kplato/kpttaskprogresspanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::TaskProgressPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TaskProgressPanelBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>frame5</cstring> </property> @@ -53,7 +53,7 @@ <enum>NoFocus</enum> </property> </widget> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>started</cstring> </property> @@ -64,7 +64,7 @@ <string></string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>finished</cstring> </property> @@ -85,7 +85,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>61</width> <height>41</height> @@ -94,7 +94,7 @@ </spacer> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>performedGroup</cstring> </property> @@ -108,7 +108,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -119,7 +119,7 @@ <cstring>percentFinished</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -130,7 +130,7 @@ <cstring>remainingEffort</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -187,7 +187,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>200</width> <height>20</height> @@ -204,7 +204,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>41</width> <height>70</height> @@ -213,7 +213,7 @@ </spacer> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -224,9 +224,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> @@ -247,7 +247,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -256,9 +256,9 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget" row="1" column="1"> + <widget class="TQLayoutWidget" row="1" column="1"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> @@ -279,7 +279,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -288,9 +288,9 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget" row="2" column="1"> + <widget class="TQLayoutWidget" row="2" column="1"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> @@ -303,7 +303,7 @@ <property name="enabled"> <bool>true</bool> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>320</width> <height>0</height> @@ -320,7 +320,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>59</width> <height>20</height> @@ -329,7 +329,7 @@ </spacer> </hbox> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -337,7 +337,7 @@ <string>Start:</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_4_2</cstring> </property> @@ -345,7 +345,7 @@ <string>Finish:</string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel1_4_3</cstring> </property> @@ -365,7 +365,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -411,7 +411,7 @@ <tabstop>finishTime</tabstop> <tabstop>startTime</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatetimewidget.h</includehint> <includehint>kdatewidget.h</includehint> diff --git a/kplato/kpttaskresourcespanelbase.ui b/kplato/kpttaskresourcespanelbase.ui index a7b308a3..5183181c 100644 --- a/kplato/kpttaskresourcespanelbase.ui +++ b/kplato/kpttaskresourcespanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::TaskResourcesPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TaskResourcesPanelBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Group</string> @@ -49,22 +49,22 @@ <property name="name"> <cstring>groupList</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>200</width> <height>0</height> </size> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -75,7 +75,7 @@ <cstring>resourceTable</cstring> </property> </widget> - <widget class="QTable"> + <widget class="TQTable"> <column> <property name="text"> <string>Resource</string> @@ -107,5 +107,5 @@ <includes> <include location="local" impldecl="in implementation">kpttaskresourcespanelbase.ui.h</include> </includes> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kpttaskresourcespanelbase.ui.h b/kplato/kpttaskresourcespanelbase.ui.h index 765723cd..ae9e8a50 100644 --- a/kplato/kpttaskresourcespanelbase.ui.h +++ b/kplato/kpttaskresourcespanelbase.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ diff --git a/kplato/kptview.cc b/kplato/kptview.cc index 321bff42..a5b9f6b0 100644 --- a/kplato/kptview.cc +++ b/kplato/kptview.cc @@ -23,26 +23,26 @@ #include <KoMainWindow.h> -#include <qapplication.h> -#include <qpainter.h> -#include <qiconset.h> -#include <qlayout.h> -#include <qsplitter.h> -#include <qcanvas.h> -#include <qscrollview.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvbox.h> -#include <qgrid.h> -#include <qsize.h> -#include <qheader.h> -#include <qtabwidget.h> -#include <qwidgetstack.h> -#include <qtimer.h> -#include <qpopupmenu.h> -#include <qpair.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqiconset.h> +#include <tqlayout.h> +#include <tqsplitter.h> +#include <tqcanvas.h> +#include <tqscrollview.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvbox.h> +#include <tqgrid.h> +#include <tqsize.h> +#include <tqheader.h> +#include <tqtabwidget.h> +#include <tqwidgetstack.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> +#include <tqpair.h> #include <kiconloader.h> #include <kaction.h> @@ -99,12 +99,12 @@ namespace KPlato { -View::View(Part* part, QWidget* parent, const char* /*name*/) - : KoView(part, parent, "Main View"), +View::View(Part* part, TQWidget* tqparent, const char* /*name*/) + : KoView(part, tqparent, "Main View"), m_ganttview(0), - m_ganttlayout(0), + m_gantttqlayout(0), m_pertview(0), - m_pertlayout(0), + m_perttqlayout(0), // m_reportview(0), m_baselineMode(false), m_currentEstimateType(Effort::Use_Expected) @@ -121,16 +121,16 @@ View::View(Part* part, QWidget* parent, const char* /*name*/) // build the DCOP object dcopObject(); - m_tab = new QWidgetStack(this); - QVBoxLayout *layout = new QVBoxLayout(this); - layout->add(m_tab); + m_tab = new TQWidgetStack(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); + tqlayout->add(m_tab); m_ganttview = new GanttView(m_tab, part->isReadWrite()); m_tab->addWidget(m_ganttview); m_updateGanttview = false; m_ganttview->draw(getPart()->getProject()); - m_pertview = new PertView( this, m_tab, layout ); + m_pertview = new PertView( this, m_tab, tqlayout ); m_tab->addWidget(m_pertview); m_resourceview = new ResourceView( this, m_tab ); @@ -144,150 +144,150 @@ View::View(Part* part, QWidget* parent, const char* /*name*/) //m_reportview = new ReportView(this, m_tab); //m_tab->addWidget(m_reportview); - connect(m_tab, SIGNAL(aboutToShow(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); + connect(m_tab, TQT_SIGNAL(aboutToShow(TQWidget *)), TQT_TQOBJECT(this), TQT_SLOT(slotAboutToShow(TQWidget *))); - connect(m_pertview, SIGNAL(addRelation(Node*, Node*)), SLOT(slotAddRelation(Node*, Node*))); - connect(m_pertview, SIGNAL(modifyRelation(Relation*)), SLOT(slotModifyRelation(Relation*))); - - connect(m_ganttview, SIGNAL(enableActions(bool)), SLOT(setTaskActionsEnabled(bool))); - connect(m_ganttview, SIGNAL(addRelation(Node*, Node*, int)), SLOT(slotAddRelation(Node*, Node*, int))); - connect(m_ganttview, SIGNAL(modifyRelation(Relation*, int)), SLOT(slotModifyRelation(Relation*, int))); - connect(m_ganttview, SIGNAL(modifyRelation(Relation*)), SLOT(slotModifyRelation(Relation*))); - connect(m_ganttview, SIGNAL(itemDoubleClicked()), SLOT(slotOpenNode())); - connect(m_ganttview, SIGNAL(itemRenamed(Node*, const QString&)),this,SLOT(slotRenameNode(Node*, const QString&))); - connect(m_ganttview, SIGNAL(requestPopupMenu(const QString&, const QPoint &)),this,SLOT(slotPopupMenu(const QString&, const QPoint&))); - connect(m_resourceview, SIGNAL(itemDoubleClicked()), SLOT(slotEditResource())); + connect(m_pertview, TQT_SIGNAL(addRelation(Node*, Node*)), TQT_SLOT(slotAddRelation(Node*, Node*))); + connect(m_pertview, TQT_SIGNAL(modifyRelation(Relation*)), TQT_SLOT(slotModifyRelation(Relation*))); + + connect(m_ganttview, TQT_SIGNAL(enableActions(bool)), TQT_SLOT(setTaskActionsEnabled(bool))); + connect(m_ganttview, TQT_SIGNAL(addRelation(Node*, Node*, int)), TQT_SLOT(slotAddRelation(Node*, Node*, int))); + connect(m_ganttview, TQT_SIGNAL(modifyRelation(Relation*, int)), TQT_SLOT(slotModifyRelation(Relation*, int))); + connect(m_ganttview, TQT_SIGNAL(modifyRelation(Relation*)), TQT_SLOT(slotModifyRelation(Relation*))); + connect(m_ganttview, TQT_SIGNAL(itemDoubleClicked()), TQT_SLOT(slotOpenNode())); + connect(m_ganttview, TQT_SIGNAL(itemRenamed(Node*, const TQString&)),TQT_TQOBJECT(this), TQT_SLOT(slotRenameNode(Node*, const TQString&))); + connect(m_ganttview, TQT_SIGNAL(requestPopupMenu(const TQString&, const TQPoint &)),TQT_TQOBJECT(this), TQT_SLOT(slotPopupMenu(const TQString&, const TQPoint&))); + connect(m_resourceview, TQT_SIGNAL(itemDoubleClicked()), TQT_SLOT(slotEditResource())); // The menu items // ------ Edit - actionCut = KStdAction::cut( this, SLOT( slotEditCut() ), actionCollection(), "edit_cut" ); - actionCopy = KStdAction::copy( this, SLOT( slotEditCopy() ), actionCollection(), "edit_copy" ); - actionPaste = KStdAction::paste( this, SLOT( slotEditPaste() ), actionCollection(), "edit_paste" ); - - actionIndentTask = new KAction(i18n("Indent Task"), "indent_task", 0, this, - SLOT(slotIndentTask()), actionCollection(), "indent_task"); - actionUnindentTask = new KAction(i18n("Unindent Task"), "unindent_task", 0, this, - SLOT(slotUnindentTask()), actionCollection(), "unindent_task"); - actionMoveTaskUp = new KAction(i18n("Move Up"), "move_task_up", 0, this, - SLOT(slotMoveTaskUp()), actionCollection(), "move_task_up"); - actionMoveTaskDown = new KAction(i18n("Move Down"), "move_task_down", 0, this, - SLOT(slotMoveTaskDown()), actionCollection(), "move_task_down"); + actionCut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( slotEditCut() ), actionCollection(), "edit_cut" ); + actionCopy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( slotEditCopy() ), actionCollection(), "edit_copy" ); + actionPaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotEditPaste() ), actionCollection(), "edit_paste" ); + + actionIndentTask = new KAction(i18n("Indent Task"), "indent_task", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotIndentTask()), actionCollection(), "indent_task"); + actionUnindentTask = new KAction(i18n("Unindent Task"), "unindent_task", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotUnindentTask()), actionCollection(), "unindent_task"); + actionMoveTaskUp = new KAction(i18n("Move Up"), "move_task_up", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotMoveTaskUp()), actionCollection(), "move_task_up"); + actionMoveTaskDown = new KAction(i18n("Move Down"), "move_task_down", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotMoveTaskDown()), actionCollection(), "move_task_down"); // ------ View - actionViewGantt = new KAction(i18n("Gantt"), "gantt_chart", 0, this, SLOT(slotViewGantt()), actionCollection(), "view_gantt"); + actionViewGantt = new KAction(i18n("Gantt"), "gantt_chart", 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGantt()), actionCollection(), "view_gantt"); - QString group = "EstimationType"; - actionViewExpected = new KRadioAction(i18n("Expected"), 0, 0, this, SLOT(slotViewExpected()), actionCollection(), "view_expected"); + TQString group = "EstimationType"; + actionViewExpected = new KRadioAction(i18n("Expected"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewExpected()), actionCollection(), "view_expected"); actionViewExpected->setExclusiveGroup(group); - actionViewOptimistic = new KRadioAction(i18n("Optimistic"), 0, 0, this, SLOT(slotViewOptimistic()), actionCollection(), "view_optimistic"); + actionViewOptimistic = new KRadioAction(i18n("Optimistic"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewOptimistic()), actionCollection(), "view_optimistic"); actionViewOptimistic->setExclusiveGroup(group); - actionViewPessimistic = new KRadioAction(i18n("Pessimistic"), 0, 0, this, SLOT(slotViewPessimistic()), actionCollection(), "view_pessimistic"); + actionViewPessimistic = new KRadioAction(i18n("Pessimistic"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewPessimistic()), actionCollection(), "view_pessimistic"); actionViewPessimistic->setExclusiveGroup(group); - actionViewGanttResources = new KToggleAction(i18n("Resources"), 0, 0, this, SLOT(slotViewGanttResources()), actionCollection(), "view_gantt_showResources"); - actionViewGanttTaskName = new KToggleAction(i18n("Task Name"), 0, 0, this, SLOT(slotViewGanttTaskName()), actionCollection(), "view_gantt_showTaskName"); - actionViewGanttTaskLinks = new KToggleAction(i18n("Task Links"), 0, 0, this, SLOT(slotViewGanttTaskLinks()), actionCollection(), "view_gantt_showTaskLinks"); - actionViewGanttProgress = new KToggleAction(i18n("Progress"), 0, 0, this, SLOT(slotViewGanttProgress()), actionCollection(), "view_gantt_showProgress"); - actionViewGanttFloat = new KToggleAction(i18n("Float"), 0, 0, this, SLOT(slotViewGanttFloat()), actionCollection(), "view_gantt_showFloat"); - actionViewGanttCriticalTasks = new KToggleAction(i18n("Critical Tasks"), 0, 0, this, SLOT(slotViewGanttCriticalTasks()), actionCollection(), "view_gantt_showCriticalTasks"); - actionViewGanttCriticalPath = new KToggleAction(i18n("Critical Path"), 0, 0, this, SLOT(slotViewGanttCriticalPath()), actionCollection(), "view_gantt_showCriticalPath"); + actionViewGanttResources = new KToggleAction(i18n("Resources"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttResources()), actionCollection(), "view_gantt_showResources"); + actionViewGanttTaskName = new KToggleAction(i18n("Task Name"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttTaskName()), actionCollection(), "view_gantt_showTaskName"); + actionViewGanttTaskLinks = new KToggleAction(i18n("Task Links"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttTaskLinks()), actionCollection(), "view_gantt_showTaskLinks"); + actionViewGanttProgress = new KToggleAction(i18n("Progress"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttProgress()), actionCollection(), "view_gantt_showProgress"); + actionViewGanttFloat = new KToggleAction(i18n("Float"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttFloat()), actionCollection(), "view_gantt_showFloat"); + actionViewGanttCriticalTasks = new KToggleAction(i18n("Critical Tasks"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttCriticalTasks()), actionCollection(), "view_gantt_showCriticalTasks"); + actionViewGanttCriticalPath = new KToggleAction(i18n("Critical Path"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttCriticalPath()), actionCollection(), "view_gantt_showCriticalPath"); -// actionViewGanttNotScheduled = new KToggleAction(i18n("Not Scheduled"), 0, 0, this, SLOT(slotViewGanttNotScheduled()), actionCollection(), "view_gantt_showNotScheduled"); +// actionViewGanttNotScheduled = new KToggleAction(i18n("Not Scheduled"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttNotScheduled()), actionCollection(), "view_gantt_showNotScheduled"); - actionViewTaskAppointments = new KToggleAction(i18n("Show Allocations"), 0, 0, this, SLOT(slotViewTaskAppointments()), actionCollection(), "view_task_appointments"); + actionViewTaskAppointments = new KToggleAction(i18n("Show Allocations"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewTaskAppointments()), actionCollection(), "view_task_appointments"); - actionViewPert = new KAction(i18n("Network"), "pert_chart", 0, this, SLOT(slotViewPert()), actionCollection(), "view_pert"); + actionViewPert = new KAction(i18n("Network"), "pert_chart", 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewPert()), actionCollection(), "view_pert"); - actionViewResources = new KAction(i18n("Resources"), "resources", 0, this, SLOT(slotViewResources()), actionCollection(), "view_resources"); + actionViewResources = new KAction(i18n("Resources"), "resources", 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewResources()), actionCollection(), "view_resources"); - actionViewResourceAppointments = new KToggleAction(i18n("Show Allocations"), 0, 0, this, SLOT(slotViewResourceAppointments()), actionCollection(), "view_resource_appointments"); + actionViewResourceAppointments = new KToggleAction(i18n("Show Allocations"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewResourceAppointments()), actionCollection(), "view_resource_appointments"); - actionViewAccounts = new KAction(i18n("Accounts"), "accounts", 0, this, SLOT(slotViewAccounts()), actionCollection(), "view_accounts"); + actionViewAccounts = new KAction(i18n("Accounts"), "accounts", 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewAccounts()), actionCollection(), "view_accounts"); - //actionViewReports = new KAction(i18n("Reports"), "reports", 0, this, SLOT(slotViewReports()), actionCollection(), "view_reports"); + //actionViewReports = new KAction(i18n("Reports"), "reports", 0, TQT_TQOBJECT(this), TQT_SLOT(slotViewReports()), actionCollection(), "view_reports"); // ------ Insert - actionAddTask = new KAction(i18n("Task..."), "add_task", 0, this, - SLOT(slotAddTask()), actionCollection(), "add_task"); - actionAddSubtask = new KAction(i18n("Sub-Task..."), "add_sub_task", 0, this, - SLOT(slotAddSubTask()), actionCollection(), "add_sub_task"); - actionAddMilestone = new KAction(i18n("Milestone..."), "add_milestone", 0, this, - SLOT(slotAddMilestone()), actionCollection(), "add_milestone"); + actionAddTask = new KAction(i18n("Task..."), "add_task", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotAddTask()), actionCollection(), "add_task"); + actionAddSubtask = new KAction(i18n("Sub-Task..."), "add_sub_task", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotAddSubTask()), actionCollection(), "add_sub_task"); + actionAddMilestone = new KAction(i18n("Milestone..."), "add_milestone", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotAddMilestone()), actionCollection(), "add_milestone"); // ------ Project - actionEditMainProject = new KAction(i18n("Edit Main Project..."), "edit", 0, this, SLOT(slotProjectEdit()), actionCollection(), "project_edit"); - actionEditStandardWorktime = new KAction(i18n("Edit Standard Worktime..."), "edit", 0, this, SLOT(slotProjectWorktime()), actionCollection(), "project_worktime"); - actionEditCalendar = new KAction(i18n("Edit Calendar..."), "edit", 0, this, SLOT(slotProjectCalendar()), actionCollection(), "project_calendar"); - actionEditAccounts = new KAction(i18n("Edit Accounts..."), "edit", 0, this, SLOT(slotProjectAccounts()), actionCollection(), "project_accounts"); - actionEditResources = new KAction(i18n("Edit Resources..."), "edit", 0, this, SLOT(slotProjectResources()), actionCollection(), "project_resources"); + actionEditMainProject = new KAction(i18n("Edit Main Project..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectEdit()), actionCollection(), "project_edit"); + actionEditStandardWorktime = new KAction(i18n("Edit Standard Worktime..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectWorktime()), actionCollection(), "project_worktime"); + actionEditCalendar = new KAction(i18n("Edit Calendar..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectCalendar()), actionCollection(), "project_calendar"); + actionEditAccounts = new KAction(i18n("Edit Accounts..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectAccounts()), actionCollection(), "project_accounts"); + actionEditResources = new KAction(i18n("Edit Resources..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectResources()), actionCollection(), "project_resources"); actionCalculate = new KActionMenu(i18n("Calculate"), "project_calculate", actionCollection(), "project_calculate"); - connect(actionCalculate, SIGNAL(activated()), SLOT(slotProjectCalculate())); + connect(actionCalculate, TQT_SIGNAL(activated()), TQT_SLOT(slotProjectCalculate())); - actionCalculateExpected = new KAction(i18n("Expected"), 0, 0, this, SLOT(slotProjectCalculateExpected()), actionCollection(), "project_calculate_expected"); + actionCalculateExpected = new KAction(i18n("Expected"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectCalculateExpected()), actionCollection(), "project_calculate_expected"); actionCalculate->insert(actionCalculateExpected); - actionCalculateOptimistic = new KAction(i18n("Optimistic"), 0, 0, this, SLOT(slotProjectCalculateOptimistic()), actionCollection(), "project_calculate_optimistic"); + actionCalculateOptimistic = new KAction(i18n("Optimistic"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectCalculateOptimistic()), actionCollection(), "project_calculate_optimistic"); actionCalculate->insert(actionCalculateOptimistic); - actionCalculatePessimistic = new KAction(i18n("Pessimistic"), 0, 0, this, SLOT(slotProjectCalculatePessimistic()), actionCollection(), "project_calculate_pessimistic"); + actionCalculatePessimistic = new KAction(i18n("Pessimistic"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotProjectCalculatePessimistic()), actionCollection(), "project_calculate_pessimistic"); actionCalculate->insert(actionCalculatePessimistic); /* // ------ Reports - actionFirstpage = KStdAction::firstPage(m_reportview,SLOT(slotPrevPage()),actionCollection(),"go_firstpage"); - connect(m_reportview, SIGNAL(setFirstPageActionEnabled(bool)), actionFirstpage, SLOT(setEnabled(bool))); - actionPriorpage = KStdAction::prior(m_reportview,SLOT(slotPrevPage()),actionCollection(),"go_prevpage"); - connect(m_reportview, SIGNAL(setPriorPageActionEnabled(bool)), actionPriorpage, SLOT(setEnabled(bool))); - actionNextpage = KStdAction::next(m_reportview,SLOT(slotNextPage()),actionCollection(), "go_nextpage"); - connect(m_reportview, SIGNAL(setNextPageActionEnabled(bool)), actionNextpage, SLOT(setEnabled(bool))); - actionLastpage = KStdAction::lastPage(m_reportview,SLOT(slotLastPage()),actionCollection(), "go_lastpage"); - connect(m_reportview, SIGNAL(setLastPageActionEnabled(bool)), actionLastpage, SLOT(setEnabled(bool))); + actionFirstpage = KStdAction::firstPage(m_reportview,TQT_SLOT(slotPrevPage()),actionCollection(),"go_firstpage"); + connect(m_reportview, TQT_SIGNAL(setFirstPageActionEnabled(bool)), actionFirstpage, TQT_SLOT(setEnabled(bool))); + actionPriorpage = KStdAction::prior(m_reportview,TQT_SLOT(slotPrevPage()),actionCollection(),"go_prevpage"); + connect(m_reportview, TQT_SIGNAL(setPriorPageActionEnabled(bool)), actionPriorpage, TQT_SLOT(setEnabled(bool))); + actionNextpage = KStdAction::next(m_reportview,TQT_SLOT(slotNextPage()),actionCollection(), "go_nextpage"); + connect(m_reportview, TQT_SIGNAL(setNextPageActionEnabled(bool)), actionNextpage, TQT_SLOT(setEnabled(bool))); + actionLastpage = KStdAction::lastPage(m_reportview,TQT_SLOT(slotLastPage()),actionCollection(), "go_lastpage"); + connect(m_reportview, TQT_SIGNAL(setLastPageActionEnabled(bool)), actionLastpage, TQT_SLOT(setEnabled(bool))); m_reportview->enableNavigationBtn();*/ mainWindow()->toolBar("report")->hide(); -// new KAction(i18n("Design..."), "report_design", 0, this, -// SLOT(slotReportDesign()), actionCollection(), "report_design"); +// new KAction(i18n("Design..."), "report_design", 0, TQT_TQOBJECT(this), +// TQT_SLOT(slotReportDesign()), actionCollection(), "report_design"); // ------ Tools actionDefineWBS = - new KAction(i18n("Define WBS Pattern..."), "tools_define_wbs", 0, this, - SLOT(slotDefineWBS()), actionCollection(), "tools_generate_wbs"); + new KAction(i18n("Define WBS Pattern..."), "tools_define_wbs", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotDefineWBS()), actionCollection(), "tools_generate_wbs"); actionGenerateWBS = - new KAction(i18n("Generate WBS Code"), "tools_generate_wbs", 0, this, - SLOT(slotGenerateWBS()), actionCollection(), "tools_define_wbs"); + new KAction(i18n("Generate WBS Code"), "tools_generate_wbs", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotGenerateWBS()), actionCollection(), "tools_define_wbs"); // ------ Export (testing) - //actionExportGantt = new KAction(i18n("Export Ganttview"), "export_gantt", 0, this, - // SLOT(slotExportGantt()), actionCollection(), "export_gantt"); + //actionExportGantt = new KAction(i18n("Export Ganttview"), "export_gantt", 0, TQT_TQOBJECT(this), + // TQT_SLOT(slotExportGantt()), actionCollection(), "export_gantt"); // ------ Settings - actionConfigure = new KAction(i18n("Configure KPlato..."), "configure", 0, this, - SLOT(slotConfigure()), actionCollection(), "configure"); + actionConfigure = new KAction(i18n("Configure KPlato..."), "configure", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotConfigure()), actionCollection(), "configure"); // ------ Popup - actionOpenNode = new KAction(i18n("Edit..."), "edit", 0, this, - SLOT(slotOpenNode()), actionCollection(), "node_properties"); - actionTaskProgress = new KAction(i18n("Progress..."), "edit", 0, this, - SLOT(slotTaskProgress()), actionCollection(), "task_progress"); - actionDeleteTask = new KAction(i18n("Delete Task"), "editdelete", 0, this, - SLOT(slotDeleteTask()), actionCollection(), "delete_task"); + actionOpenNode = new KAction(i18n("Edit..."), "edit", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotOpenNode()), actionCollection(), "node_properties"); + actionTaskProgress = new KAction(i18n("Progress..."), "edit", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotTaskProgress()), actionCollection(), "task_progress"); + actionDeleteTask = new KAction(i18n("Delete Task"), "editdelete", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotDeleteTask()), actionCollection(), "delete_task"); - actionEditResource = new KAction(i18n("Edit Resource..."), "edit", 0, this, - SLOT(slotEditResource()), actionCollection(), "edit_resource"); + actionEditResource = new KAction(i18n("Edit Resource..."), "edit", 0, TQT_TQOBJECT(this), + TQT_SLOT(slotEditResource()), actionCollection(), "edit_resource"); // ------------------- Actions with a key binding and no GUI item // Temporary, till we get a menu entry - actNoInformation = new KAction("Toggle no information", CTRL+SHIFT+Key_T, this, SLOT(slotViewGanttNoInformation()), actionCollection(), "show_noinformation"); + actNoInformation = new KAction("Toggle no information", CTRL+SHIFT+Key_T, TQT_TQOBJECT(this), TQT_SLOT(slotViewGanttNoInformation()), actionCollection(), "show_noinformation"); #ifndef NDEBUG - //new KAction("Print Debug", CTRL+SHIFT+Key_P, this, SLOT( slotPrintDebug()), actionCollection(), "print_debug"); - new KAction("Print Debug", CTRL+SHIFT+Key_P, this, SLOT(slotPrintSelectedDebug()), actionCollection(), "print_debug"); - new KAction("Print Calendar Debug", CTRL+SHIFT+Key_C, this, SLOT(slotPrintCalendarDebug()), actionCollection(), "print_calendar_debug"); -// new KAction("Print Test Debug", CTRL+SHIFT+Key_T, this, SLOT(slotPrintTestDebug()), actionCollection(), "print_test_debug"); + //new KAction("Print Debug", CTRL+SHIFT+Key_P, TQT_TQOBJECT(this), TQT_SLOT( slotPrintDebug()), actionCollection(), "print_debug"); + new KAction("Print Debug", CTRL+SHIFT+Key_P, TQT_TQOBJECT(this), TQT_SLOT(slotPrintSelectedDebug()), actionCollection(), "print_debug"); + new KAction("Print Calendar Debug", CTRL+SHIFT+Key_C, TQT_TQOBJECT(this), TQT_SLOT(slotPrintCalendarDebug()), actionCollection(), "print_calendar_debug"); +// new KAction("Print Test Debug", CTRL+SHIFT+Key_T, TQT_TQOBJECT(this), TQT_SLOT(slotPrintTestDebug()), actionCollection(), "print_test_debug"); KAction* actExportGantt = new KAction( i18n( "Export Gantt" ), CTRL+SHIFT+Key_G, - this, SLOT( slotExportGantt() ), actionCollection(), "export_gantt" ); + TQT_TQOBJECT(this), TQT_SLOT( slotExportGantt() ), actionCollection(), "export_gantt" ); #endif // Stupid compilers ;) @@ -587,7 +587,7 @@ void View::projectCalculate() { return; } } - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); Schedule *ns = getProject().findSchedule((Schedule::Type)m_currentEstimateType); KCommand *cmd; if (ns) { @@ -596,7 +596,7 @@ void View::projectCalculate() { cmd = new CalculateProjectCmd(getPart(), getProject(), i18n("Standard"), (Effort::Use)m_currentEstimateType, i18n("Calculate")); } getPart()->addCommand(cmd); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void View::slotViewReportDesign() { @@ -839,7 +839,7 @@ void View::slotDeleteTask() } KMacroCommand *cmd = new KMacroCommand(i18n("Delete Task")); cmd->addCommand(new NodeDeleteCmd(getPart(), node)); - QPtrListIterator<Relation> it = node->dependChildNodes(); + TQPtrListIterator<Relation> it = node->dependChildNodes(); for (; it.current(); ++it) { cmd->addCommand(new DeleteRelationCmd(getPart(), it.current())); } @@ -982,10 +982,10 @@ void View::slotExportGantt() { if (!m_ganttview) { return; } - QString fn = KFileDialog::getSaveFileName( QString::null, QString::null, this ); + TQString fn = KFileDialog::getSaveFileName( TQString(), TQString(), this ); if (!fn.isEmpty()) { - QFile f(fn); - m_ganttview->exportGantt(&f); + TQFile f(fn); + m_ganttview->exportGantt(TQT_TQIODEVICE(&f)); } } @@ -1018,16 +1018,16 @@ void View::slotConnectNode() { }*/ } -QPopupMenu * View::popupMenu( const QString& name ) +TQPopupMenu * View::popupMenu( const TQString& name ) { //kdDebug()<<k_funcinfo<<endl; Q_ASSERT(factory()); if ( factory() ) - return ((QPopupMenu*)factory()->container( name, this )); + return ((TQPopupMenu*)factory()->container( name, this )); return 0L; } -void View::slotChanged(QWidget *) +void View::slotChanged(TQWidget *) { //kdDebug()<<k_funcinfo<<endl; slotUpdate(false); @@ -1052,13 +1052,13 @@ void View::slotUpdate(bool calculate) updateView(m_tab->visibleWidget()); } -void View::slotAboutToShow(QWidget *widget) { +void View::slotAboutToShow(TQWidget *widget) { updateView(widget); } -void View::updateView(QWidget *widget) +void View::updateView(TQWidget *widget) { - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); setScheduleActionsEnabled(); setTaskActionsEnabled(false); mainWindow()->toolBar("report")->hide(); @@ -1097,10 +1097,10 @@ void View::updateView(QWidget *widget) mainWindow()->toolBar("report")->show(); m_reportview->enableNavigationBtn(); }*/ - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } -void View::slotRenameNode(Node *node, const QString& name) { +void View::slotRenameNode(Node *node, const TQString& name) { //kdDebug()<<k_funcinfo<<name<<endl; if (node) { NodeModifyNameCmd *cmd = new NodeModifyNameCmd(getPart(), *node, name, i18n("Modify Name")); @@ -1108,9 +1108,9 @@ void View::slotRenameNode(Node *node, const QString& name) { } } -void View::slotPopupMenu(const QString& menuname, const QPoint & pos) +void View::slotPopupMenu(const TQString& menuname, const TQPoint & pos) { - QPopupMenu* menu = this->popupMenu(menuname); + TQPopupMenu* menu = this->popupMenu(menuname); if (menu) menu->exec(pos); } @@ -1214,7 +1214,7 @@ void View::setBaselineMode(bool /*on*/) { } // called when widget w is about to be shown -void View::setTaskActionsEnabled(QWidget *w, bool on) { +void View::setTaskActionsEnabled(TQWidget *w, bool on) { Node *n = 0; if (w == m_ganttview) { n = m_ganttview->currentNode(); @@ -1284,14 +1284,14 @@ void View::slotPrintCalendarDebug() { getPart()->getProject().printCalendarDebug(""); } void View::slotPrintTestDebug() { - const QStringList &lst = getPart()->xmlLoader().log(); + const TQStringList &lst = getPart()->xmlLoader().log(); - for ( QStringList::ConstIterator it = lst.constBegin(); it != lst.constEnd(); ++it ) { + for ( TQStringList::ConstIterator it = lst.constBegin(); it != lst.constEnd(); ++it ) { kdDebug()<<*it<<endl; } // kdDebug()<<"------------Test 1---------------------"<<endl; // { -// DateTime d1(QDate(2006,1,2), QTime(8,0,0)); +// DateTime d1(TQDate(2006,1,2), TQTime(8,0,0)); // DateTime d2 = d1.addSecs(3600); // Duration d = d2 - d1; // bool b = d==Duration(0,0,0,3600); @@ -1316,15 +1316,15 @@ void View::slotPrintTestDebug() { // kdDebug()<<"------------Test 2 Single calendar-----------------"<<endl; // { // Calendar *t = new Calendar("Test 2"); -// QDate wdate(2006,1,2); +// TQDate wdate(2006,1,2); // DateTime before = DateTime(wdate.addDays(-1)); // DateTime after = DateTime(wdate.addDays(1)); -// QTime t1(8,0,0); -// QTime t2(10,0,0); +// TQTime t1(8,0,0); +// TQTime t2(10,0,0); // DateTime wdt1(wdate, t1); // DateTime wdt2(wdate, t2); -// CalendarDay *day = new CalendarDay(QDate(2006,1,2), Map::Working); -// day->addInterval(QPair<QTime, QTime>(t1, t2)); +// CalendarDay *day = new CalendarDay(TQDate(2006,1,2), Map::Working); +// day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); // if (!t->addDay(day)) { // kdDebug()<<"Failed to add day"<<endl; // delete day; @@ -1375,17 +1375,17 @@ void View::slotPrintTestDebug() { // kdDebug()<<"------------Test 3 Parent calendar-----------------"<<endl; // { // Calendar *t = new Calendar("Test 3"); -// Calendar *p = new Calendar("Test 3 parent"); +// Calendar *p = new Calendar("Test 3 tqparent"); // t->setParent(p); -// QDate wdate(2006,1,2); +// TQDate wdate(2006,1,2); // DateTime before = DateTime(wdate.addDays(-1)); // DateTime after = DateTime(wdate.addDays(1)); -// QTime t1(8,0,0); -// QTime t2(10,0,0); +// TQTime t1(8,0,0); +// TQTime t2(10,0,0); // DateTime wdt1(wdate, t1); // DateTime wdt2(wdate, t2); -// CalendarDay *day = new CalendarDay(QDate(2006,1,2), Map::Working); -// day->addInterval(QPair<QTime, QTime>(t1, t2)); +// CalendarDay *day = new CalendarDay(TQDate(2006,1,2), Map::Working); +// day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); // if (!p->addDay(day)) { // kdDebug()<<"Failed to add day"<<endl; // delete day; @@ -1434,9 +1434,9 @@ void View::slotPrintTestDebug() { // kdDebug()<<endl; // kdDebug()<<"------------Test 4 Parent calendar/weekdays-------------"<<endl; // { -// QTime t1(8,0,0); -// QTime t2(10,0,0); -// Calendar *p = new Calendar("Test 4 parent"); +// TQTime t1(8,0,0); +// TQTime t2(10,0,0); +// Calendar *p = new Calendar("Test 4 tqparent"); // CalendarDay *wd1 = p->weekday(0); // monday // if (wd1 == 0) { // kdDebug()<<"Failed to get weekday"<<endl; @@ -1447,18 +1447,18 @@ void View::slotPrintTestDebug() { // if (wd2 == 0) { // kdDebug()<<"Failed to get weekday"<<endl; // } -// wd2->addInterval(QPair<QTime, QTime>(t1, t2)); +// wd2->addInterval(TQPair<TQTime, TQTime>(t1, t2)); // wd2->setState(Map::Working); // // Calendar *t = new Calendar("Test 4"); // t->setParent(p); -// QDate wdate(2006,1,2); // monday jan 2 +// TQDate wdate(2006,1,2); // monday jan 2 // DateTime before = DateTime(wdate.addDays(-4)); //Thursday dec 29 // DateTime after = DateTime(wdate.addDays(4)); // Friday jan 6 // DateTime wdt1(wdate, t1); -// DateTime wdt2(QDate(2006, 1, 4), t2); // Wednesday -// CalendarDay *day = new CalendarDay(QDate(2006,1,2), Map::Working); -// day->addInterval(QPair<QTime, QTime>(t1, t2)); +// DateTime wdt2(TQDate(2006, 1, 4), t2); // Wednesday +// CalendarDay *day = new CalendarDay(TQDate(2006,1,2), Map::Working); +// day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); // if (!p->addDay(day)) { // kdDebug()<<"Failed to add day"<<endl; // delete day; @@ -1473,11 +1473,11 @@ void View::slotPrintTestDebug() { // kdDebug()<<"1: Success="<<b<<" Find same day"<<endl; // // DateTime dt = t->firstAvailableAfter(after, after.addDays(10)); -// b = (dt.isValid() && dt == DateTime(QDate(2006,1,11), t1)); +// b = (dt.isValid() && dt == DateTime(TQDate(2006,1,11), t1)); // kdDebug()<<"2: Success="<<b<<" firstAvailableAfter("<<after<<"): ="<<dt<<endl; // // dt = t->firstAvailableBefore(before, before.addDays(-10)); -// b = (dt.isValid() && dt == DateTime(QDate(2005, 12, 28), t2)); +// b = (dt.isValid() && dt == DateTime(TQDate(2005, 12, 28), t2)); // kdDebug()<<"3: Success="<<b<<" firstAvailableBefore("<<before.toString()<<"): ="<<dt<<endl; // // dt = t->firstAvailableAfter(before, after); @@ -1501,11 +1501,11 @@ void View::slotPrintTestDebug() { // b = e1==e2; // kdDebug()<<"9: Success="<<b<<" effort "<<e1.toString()<<"="<<e2.toString()<<endl; // -// QPair<DateTime, DateTime> r = t->firstInterval(before, after); +// TQPair<DateTime, DateTime> r = t->firstInterval(before, after); // b = r.first == wdt1; // We find the monday jan 2 // kdDebug()<<"10: Success="<<b<<" firstInterval("<<before<<"): ="<<r.first<<", "<<r.second<<endl; // r = t->firstInterval(r.second, after); -// b = r.first == DateTime(QDate(2006, 1, 4),t1); // We find the wednesday jan 4 +// b = r.first == DateTime(TQDate(2006, 1, 4),t1); // We find the wednesday jan 4 // kdDebug()<<"11: Success="<<b<<" firstInterval("<<r.second<<"): ="<<r.first<<", "<<r.second<<endl; // // delete t; diff --git a/kplato/kptview.h b/kplato/kptview.h index 174a93d2..099895e1 100644 --- a/kplato/kptview.h +++ b/kplato/kptview.h @@ -24,11 +24,11 @@ #include <KoView.h> #include "kptcontext.h" -class QListViewItem; -class QPopupMenu; -class QHBoxLayout; -class QTabWidget; -class QWidgetStack; +class TQListViewItem; +class TQPopupMenu; +class TQHBoxLayout; +class TQTabWidget; +class TQWidgetStack; class KListView; class KPrinter; @@ -57,9 +57,10 @@ class Context; class View : public KoView { Q_OBJECT + TQ_OBJECT public: - View(Part* part, QWidget* parent=0, const char* name=0); + View(Part* part, TQWidget* tqparent=0, const char* name=0); ~View(); /** * Support zooming. @@ -73,7 +74,7 @@ public: virtual void setupPrinter(KPrinter &printer); virtual void print(KPrinter &printer); - QPopupMenu *popupMenu(const QString& name); + TQPopupMenu *popupMenu(const TQString& name); void projectCalculate(); @@ -82,7 +83,7 @@ public: virtual bool setContext(Context &context); virtual void getContext(Context &context) const; - void setTaskActionsEnabled(QWidget *w, bool on); + void setTaskActionsEnabled(TQWidget *w, bool on); void setScheduleActionsEnabled(); public slots: @@ -126,9 +127,9 @@ public slots: void slotExportGantt(); // testing void setTaskActionsEnabled(bool on); - void slotRenameNode(Node *node, const QString& name); + void slotRenameNode(Node *node, const TQString& name); - void slotPopupMenu(const QString& menuname, const QPoint & pos); + void slotPopupMenu(const TQString& menuname, const TQPoint & pos); protected slots: void slotProjectCalendar(); @@ -151,10 +152,10 @@ protected slots: void slotMoveTaskDown(); void slotConnectNode(); - void slotChanged(QWidget *); + void slotChanged(TQWidget *); void slotChanged(); - void slotAboutToShow(QWidget *widget); + void slotAboutToShow(TQWidget *widget); #ifndef NDEBUG void slotPrintDebug(); @@ -171,18 +172,18 @@ protected slots: protected: virtual void updateReadWrite(bool readwrite); Node *currentTask(); - void updateView(QWidget *widget); + void updateView(TQWidget *widget); private: GanttView *m_ganttview; - QHBoxLayout *m_ganttlayout; + TQHBoxLayout *m_gantttqlayout; PertView *m_pertview; - QHBoxLayout *m_pertlayout; - QWidgetStack *m_tab; + TQHBoxLayout *m_perttqlayout; + TQWidgetStack *m_tab; ResourceView *m_resourceview; AccountsView *m_accountsview; // ReportView *m_reportview; - QPtrList<QString> m_reportTemplateFiles; + TQPtrList<TQString> m_reportTemplateFiles; bool m_baselineMode; diff --git a/kplato/kptwbsdefinition.cc b/kplato/kptwbsdefinition.cc index 115c8779..d05b61d8 100644 --- a/kplato/kptwbsdefinition.cc +++ b/kplato/kptwbsdefinition.cc @@ -23,9 +23,9 @@ #include <klocale.h> #include <kdebug.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qpair.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqpair.h> namespace KPlato { @@ -37,11 +37,11 @@ WBSDefinition::WBSDefinition() { m_defaultDef.code = "Number"; m_defaultDef.separator = "."; - m_codeLists.append(qMakePair(QString("Number"), i18n("Number"))); - m_codeLists.append(qMakePair(QString("Roman, upper case"), i18n("Roman, Upper Case"))); - m_codeLists.append(qMakePair(QString("Roman, lower case"), i18n("Roman, Lower Case"))); - m_codeLists.append(qMakePair(QString("Letter, upper case"), i18n("Letter, Upper Case"))); - m_codeLists.append(qMakePair(QString("Letter, lower case"), i18n("Letter, Lower Case"))); + m_codeLists.append(tqMakePair(TQString("Number"), i18n("Number"))); + m_codeLists.append(tqMakePair(TQString("Roman, upper case"), i18n("Roman, Upper Case"))); + m_codeLists.append(tqMakePair(TQString("Roman, lower case"), i18n("Roman, Lower Case"))); + m_codeLists.append(tqMakePair(TQString("Letter, upper case"), i18n("Letter, Upper Case"))); + m_codeLists.append(tqMakePair(TQString("Letter, lower case"), i18n("Letter, Lower Case"))); } WBSDefinition::~WBSDefinition() { @@ -52,7 +52,7 @@ void WBSDefinition::clear() { m_levelsDef.clear(); } -QString WBSDefinition::wbs(uint index, int level) { +TQString WBSDefinition::wbs(uint index, int level) { if (isLevelsDefEnabled()) { CodeDef def = levelsDef(level); if (!def.isEmpty()) { @@ -63,7 +63,7 @@ QString WBSDefinition::wbs(uint index, int level) { } -QString WBSDefinition::code(uint index, int level) { +TQString WBSDefinition::code(uint index, int level) { if (isLevelsDefEnabled()) { CodeDef def = levelsDef(level); if (!def.isEmpty()) { @@ -73,7 +73,7 @@ QString WBSDefinition::code(uint index, int level) { return code(m_defaultDef, index); } -QString WBSDefinition::separator(int level) { +TQString WBSDefinition::separator(int level) { if (isLevelsDefEnabled()) { CodeDef def = levelsDef(level); if (!def.isEmpty()) { @@ -83,20 +83,20 @@ QString WBSDefinition::separator(int level) { return m_defaultDef.separator; } -void WBSDefinition::setLevelsDef(QMap<int, CodeDef> def) { +void WBSDefinition::setLevelsDef(TQMap<int, CodeDef> def) { m_levelsDef.clear(); m_levelsDef = def; } WBSDefinition::CodeDef WBSDefinition::levelsDef(int level) const { - return m_levelsDef.contains(level) ? m_levelsDef[level] : CodeDef(); + return m_levelsDef.tqcontains(level) ? m_levelsDef[level] : CodeDef(); } void WBSDefinition::setLevelsDef(int level, CodeDef def) { m_levelsDef.insert(level, def); } -void WBSDefinition::setLevelsDef(int level, QString c, QString s) { +void WBSDefinition::setLevelsDef(int level, TQString c, TQString s) { m_levelsDef.insert(level, CodeDef(c, s)); } @@ -104,43 +104,43 @@ bool WBSDefinition::level0Enabled() { return m_levelsEnabled && !levelsDef(0).isEmpty(); } -const QChar Letters[] = { '?','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' }; +const TQChar Letters[] = { '?','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' }; -QString WBSDefinition::code(CodeDef &def, uint index) { +TQString WBSDefinition::code(CodeDef &def, uint index) { if (def.code == "Number") { - return QString("%1").arg(index); + return TQString("%1").tqarg(index); } if (def.code == "Roman, lower case") { - return QString("%1").arg(toRoman(index)); + return TQString("%1").tqarg(toRoman(index)); } if (def.code == "Roman, upper case") { - return QString("%1").arg(toRoman(index, true)); + return TQString("%1").tqarg(toRoman(index, true)); } if (def.code == "Letter, lower case") { if (index > 26) { index = 0; } - return QString("%1").arg(Letters[index]); + return TQString("%1").tqarg(Letters[index]); } if (def.code == "Letter, upper case") { if (index > 26) { index = 0; } - return QString("%1").arg(Letters[index].upper()); + return TQString("%1").tqarg(Letters[index].upper()); } - return QString(); + return TQString(); } // Nicked from koparagcounter.cc -const QCString RNUnits[] = {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"}; -const QCString RNTens[] = {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"}; -const QCString RNHundreds[] = {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"}; -const QCString RNThousands[] = {"", "m", "mm", "mmm"}; +const TQCString RNUnits[] = {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"}; +const TQCString RNTens[] = {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"}; +const TQCString RNHundreds[] = {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"}; +const TQCString RNThousands[] = {"", "m", "mm", "mmm"}; -QString WBSDefinition::toRoman( int n, bool upper ) +TQString WBSDefinition::toRoman( int n, bool upper ) { if ( n >= 0 ) { - QString s = QString::fromLatin1( RNThousands[ ( n / 1000 ) ] + + TQString s = TQString::tqfromLatin1( RNThousands[ ( n / 1000 ) ] + RNHundreds[ ( n / 100 ) % 10 ] + RNTens[ ( n / 10 ) % 10 ] + RNUnits[ ( n ) % 10 ] ); @@ -148,13 +148,13 @@ QString WBSDefinition::toRoman( int n, bool upper ) } else { // should never happen, but better not crash if it does kdWarning()<< k_funcinfo << " n=" << n << endl; - return QString::number( n ); + return TQString::number( n ); } } -QStringList WBSDefinition::codeList() { - QStringList cl; - QValueList<QPair<QString, QString> >::Iterator it; +TQStringList WBSDefinition::codeList() { + TQStringList cl; + TQValueList<TQPair<TQString, TQString> >::Iterator it; for (it = m_codeLists.begin(); it != m_codeLists.end(); ++it) { cl.append((*it).second); } @@ -162,7 +162,7 @@ QStringList WBSDefinition::codeList() { } int WBSDefinition::defaultCodeIndex() const { - QValueList<QPair<QString, QString> >::const_iterator it; + TQValueList<TQPair<TQString, TQString> >::const_iterator it; int i = -1; for(it = m_codeLists.begin(); it != m_codeLists.end(); ++it) { ++i; @@ -173,7 +173,7 @@ int WBSDefinition::defaultCodeIndex() const { } bool WBSDefinition::setDefaultCode(uint index) { - QValueList<QPair<QString, QString> >::const_iterator it = m_codeLists.at(index); + TQValueList<TQPair<TQString, TQString> >::const_iterator it = m_codeLists.at(index); if (it == m_codeLists.end()) { return false; } @@ -181,7 +181,7 @@ bool WBSDefinition::setDefaultCode(uint index) { return true; } -void WBSDefinition::setDefaultSeparator(QString s) { +void WBSDefinition::setDefaultSeparator(TQString s) { m_defaultDef.separator = s; } diff --git a/kplato/kptwbsdefinition.h b/kplato/kptwbsdefinition.h index f27c4d7c..d4a3ccab 100644 --- a/kplato/kptwbsdefinition.h +++ b/kplato/kptwbsdefinition.h @@ -20,12 +20,12 @@ #ifndef KPTWBSDEFINITION_H #define KPTWBSDEFINITION_H -#include <qstring.h> -#include <qmap.h> -#include <qpair.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqpair.h> +#include <tqvaluelist.h> -class QStringList; +class TQStringList; namespace KPlato { @@ -41,22 +41,22 @@ public: class CodeDef { public: CodeDef() {} - CodeDef(QString c, QString s) { code = c; separator = s; } + CodeDef(TQString c, TQString s) { code = c; separator = s; } ~CodeDef() {} - void clear() { code = separator = QString(); } + void clear() { code = separator = TQString(); } bool isEmpty() { return code.isEmpty(); } - QString code; - QString separator; + TQString code; + TQString separator; }; void clear(); /// Return wbs string. - QString wbs(uint index, int level); + TQString wbs(uint index, int level); /// Return wbs code. - QString code(uint index, int level); + TQString code(uint index, int level); /// Return wbs separator. - QString separator(int level); + TQString separator(int level); CodeDef &defaultDef() { return m_defaultDef; } void setDefaultDef(CodeDef def) { m_defaultDef = def; } @@ -65,29 +65,29 @@ public: bool level0Enabled(); void setLevelsDefEnabled(bool on) { m_levelsEnabled = on; } void clearLevelsDef() { m_levelsDef.clear(); } - const QMap<int, CodeDef> &levelsDef() const { return m_levelsDef; } - void setLevelsDef(QMap<int, CodeDef> def); + const TQMap<int, CodeDef> &levelsDef() const { return m_levelsDef; } + void setLevelsDef(TQMap<int, CodeDef> def); CodeDef levelsDef(int level) const; void setLevelsDef(int level, CodeDef def); - void setLevelsDef(int level, QString c, QString s); + void setLevelsDef(int level, TQString c, TQString s); - QStringList codeList(); + TQStringList codeList(); int defaultCodeIndex() const; bool setDefaultCode(uint index); - QString defaultSeparator() const { return m_defaultDef.separator; } - void setDefaultSeparator(QString s); + TQString defaultSeparator() const { return m_defaultDef.separator; } + void setDefaultSeparator(TQString s); protected: - QString code(CodeDef &def, uint index); - QString toRoman(int n, bool upper = false); + TQString code(CodeDef &def, uint index); + TQString toRoman(int n, bool upper = false); private: CodeDef m_defaultDef; bool m_levelsEnabled; - QMap<int, CodeDef> m_levelsDef; + TQMap<int, CodeDef> m_levelsDef; - QValueList<QPair<QString, QString> > m_codeLists; + TQValueList<TQPair<TQString, TQString> > m_codeLists; }; } //namespace KPlato diff --git a/kplato/kptwbsdefinitiondialog.cc b/kplato/kptwbsdefinitiondialog.cc index 687ddda7..6dae8389 100644 --- a/kplato/kptwbsdefinitiondialog.cc +++ b/kplato/kptwbsdefinitiondialog.cc @@ -29,7 +29,7 @@ namespace KPlato { -WBSDefinitionDialog::WBSDefinitionDialog(WBSDefinition &def, QWidget *p, const char *n) +WBSDefinitionDialog::WBSDefinitionDialog(WBSDefinition &def, TQWidget *p, const char *n) : KDialogBase(Swallow, i18n("WBS Definition"), Ok|Cancel, Ok, p, n, true, true) { @@ -37,7 +37,7 @@ WBSDefinitionDialog::WBSDefinitionDialog(WBSDefinition &def, QWidget *p, const c setMainWidget(m_panel); enableButtonOK(false); - connect(m_panel, SIGNAL(changed(bool)), SLOT(enableButtonOK(bool))); + connect(m_panel, TQT_SIGNAL(changed(bool)), TQT_SLOT(enableButtonOK(bool))); } diff --git a/kplato/kptwbsdefinitiondialog.h b/kplato/kptwbsdefinitiondialog.h index 50997c48..eefb2c7d 100644 --- a/kplato/kptwbsdefinitiondialog.h +++ b/kplato/kptwbsdefinitiondialog.h @@ -33,8 +33,9 @@ class Part; class WBSDefinitionDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - WBSDefinitionDialog(WBSDefinition &def, QWidget *parent=0, const char *name=0); + WBSDefinitionDialog(WBSDefinition &def, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kptwbsdefinitionpanel.cc b/kplato/kptwbsdefinitionpanel.cc index 7b08b14f..8dcfe891 100644 --- a/kplato/kptwbsdefinitionpanel.cc +++ b/kplato/kptwbsdefinitionpanel.cc @@ -25,26 +25,26 @@ #include <klocale.h> #include <kdebug.h> -#include <qcombobox.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qmemarray.h> -#include <qpushbutton.h> -#include <qstringlist.h> -#include <qspinbox.h> -#include <qtable.h> +#include <tqcombobox.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqmemarray.h> +#include <tqpushbutton.h> +#include <tqstringlist.h> +#include <tqspinbox.h> +#include <tqtable.h> namespace KPlato { -WBSDefinitionPanel::WBSDefinitionPanel(WBSDefinition &def, QWidget *p, const char *n) +WBSDefinitionPanel::WBSDefinitionPanel(WBSDefinition &def, TQWidget *p, const char *n) : WBSDefinitionPanelBase(p, n), m_def(def) { removeBtn->setEnabled(false); - QStringList codeList = def.codeList(); + TQStringList codeList = def.codeList(); defaultSeparator->setText(def.defaultSeparator()); defaultCode->insertStringList(codeList); defaultCode->setCurrentItem(def.defaultCodeIndex()); @@ -52,13 +52,13 @@ WBSDefinitionPanel::WBSDefinitionPanel(WBSDefinition &def, QWidget *p, const cha levelsGroup->setChecked(def.isLevelsDefEnabled()); int i = 0; - const QMap<int, WBSDefinition::CodeDef> &lev = def.levelsDef(); + const TQMap<int, WBSDefinition::CodeDef> &lev = def.levelsDef(); levelsTable->setNumRows(lev.count()); kdDebug()<<"Map size="<<lev.count()<<endl; - QMap<int, WBSDefinition::CodeDef>::const_iterator it; + TQMap<int, WBSDefinition::CodeDef>::const_iterator it; for (it = lev.begin(); it != lev.end(); ++it) { - levelsTable->verticalHeader()->setLabel(i, QString("%1").arg(it.key())); - QComboTableItem *item = new QComboTableItem(levelsTable, codeList, true); + levelsTable->verticalHeader()->setLabel(i, TQString("%1").tqarg(it.key())); + TQComboTableItem *item = new TQComboTableItem(levelsTable, codeList, true); item->setCurrentItem(it.data().code); levelsTable->setItem(i, 0, item); levelsTable->setText(i, 1, it.data().separator); @@ -67,14 +67,14 @@ WBSDefinitionPanel::WBSDefinitionPanel(WBSDefinition &def, QWidget *p, const cha levelsTable->setColumnStretchable(0, true); slotLevelChanged(level->value()); - connect(defaultCode, SIGNAL(activated(int)), SLOT(slotChanged())); - connect(defaultSeparator, SIGNAL(textChanged(const QString&)), SLOT(slotChanged())); - connect(levelsGroup, SIGNAL(toggled(bool)), SLOT(slotLevelsGroupToggled(bool))); - connect(levelsTable, SIGNAL(valueChanged(int, int)), SLOT(slotChanged())); - connect(levelsTable, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); - connect(level, SIGNAL(valueChanged(int)), SLOT(slotLevelChanged(int))); - connect(removeBtn, SIGNAL(clicked()), SLOT(slotRemoveBtnClicked())); - connect(addBtn, SIGNAL(clicked()), SLOT(slotAddBtnClicked())); + connect(defaultCode, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + connect(defaultSeparator, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged())); + connect(levelsGroup, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotLevelsGroupToggled(bool))); + connect(levelsTable, TQT_SIGNAL(valueChanged(int, int)), TQT_SLOT(slotChanged())); + connect(levelsTable, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); + connect(level, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotLevelChanged(int))); + connect(removeBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveBtnClicked())); + connect(addBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddBtnClicked())); } void WBSDefinitionPanel::setStartValues(Part */*part*/) { @@ -104,11 +104,11 @@ void WBSDefinitionPanel::slotChanged() { } void WBSDefinitionPanel::slotSelectionChanged() { - QString s; + TQString s; bool rowSelected = false; for (int i=0; i < levelsTable->numRows(); ++i) { if (levelsTable->isRowSelected(i, true)) { - s += QString("Row[%1]=selected ").arg(i); + s += TQString("Row[%1]=selected ").tqarg(i); rowSelected = true; } } @@ -118,7 +118,7 @@ void WBSDefinitionPanel::slotSelectionChanged() { } void WBSDefinitionPanel::slotRemoveBtnClicked() { - QMemArray<int> rows; + TQMemArray<int> rows; for (int i=0; i < levelsTable->numRows(); ++i) { if (levelsTable->isRowSelected(i)) { rows.resize(rows.size()+1); @@ -141,8 +141,8 @@ void WBSDefinitionPanel::slotAddBtnClicked() { } i++; levelsTable->insertRows(i); - levelsTable->verticalHeader()->setLabel(i, QString("%1").arg(level->value())); - QComboTableItem *item = new QComboTableItem(levelsTable, m_def.codeList(), true); + levelsTable->verticalHeader()->setLabel(i, TQString("%1").tqarg(level->value())); + TQComboTableItem *item = new TQComboTableItem(levelsTable, m_def.codeList(), true); levelsTable->setItem(i, 0, item); levelsTable->clearSelection(); levelsTable->selectCells(i, 0, i, 0); diff --git a/kplato/kptwbsdefinitionpanel.h b/kplato/kptwbsdefinitionpanel.h index abbdc91a..13c29bcd 100644 --- a/kplato/kptwbsdefinitionpanel.h +++ b/kplato/kptwbsdefinitionpanel.h @@ -32,8 +32,9 @@ class WBSDefinition; class WBSDefinitionPanel : public WBSDefinitionPanelBase { Q_OBJECT + TQ_OBJECT public: - WBSDefinitionPanel(WBSDefinition &def, QWidget *parent=0, const char *name=0); + WBSDefinitionPanel(WBSDefinition &def, TQWidget *tqparent=0, const char *name=0); KMacroCommand *buildCommand(Part *part); diff --git a/kplato/kptwbsdefinitionpanelbase.ui b/kplato/kptwbsdefinitionpanelbase.ui index 0ab8661d..5180c73b 100644 --- a/kplato/kptwbsdefinitionpanelbase.ui +++ b/kplato/kptwbsdefinitionpanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::WBSDefinitionPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>WBSDefinitionPanelBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>groupBox4</cstring> </property> @@ -37,15 +37,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -53,12 +53,12 @@ <string>Code:</string> </property> </widget> - <widget class="QComboBox" row="1" column="0"> + <widget class="TQComboBox" row="1" column="0"> <property name="name"> <cstring>defaultCode</cstring> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -66,7 +66,7 @@ <string>Separator:</string> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>defaultSeparator</cstring> </property> @@ -75,7 +75,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>levelsGroup</cstring> </property> @@ -95,7 +95,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTable"> + <widget class="TQTable"> <column> <property name="text"> <string>Code</string> @@ -119,15 +119,15 @@ <number>2</number> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>removeBtn</cstring> </property> @@ -145,22 +145,22 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>140</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>addBtn</cstring> </property> @@ -168,7 +168,7 @@ <string>Add Level</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>level</cstring> </property> @@ -181,5 +181,5 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/kplato/kptxmlloaderobject.h b/kplato/kptxmlloaderobject.h index d049d6b0..814af40b 100644 --- a/kplato/kptxmlloaderobject.h +++ b/kplato/kptxmlloaderobject.h @@ -22,9 +22,9 @@ #include "kptproject.h" -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> namespace KPlato { @@ -46,33 +46,33 @@ public: void startLoad() { m_timer.start(); - m_starttime = QDateTime::currentDateTime(); + m_starttime = TQDateTime::tqcurrentDateTime(); m_errors = m_warnings = 0; m_log.clear(); - addMsg(QString("Loading started at %1").arg(m_starttime.toString())); + addMsg(TQString("Loading started at %1").tqarg(m_starttime.toString())); } void stopLoad() { m_elapsed = m_timer.elapsed(); - addMsg(QString("Loading finished at %1, took %2").arg(QDateTime::currentDateTime().toString()).arg(formatElapsed())); + addMsg(TQString("Loading finished at %1, took %2").tqarg(TQDateTime::tqcurrentDateTime().toString()).tqarg(formatElapsed())); } - QDateTime lastLoaded() const { return m_starttime; } + TQDateTime lastLoaded() const { return m_starttime; } int elapsed() const { return m_elapsed; } - QString formatElapsed() { return QString("%1 seconds").arg((double)m_elapsed/1000); } + TQString formatElapsed() { return TQString("%1 seconds").tqarg((double)m_elapsed/1000); } void setLogLevel(Severity sev) { m_logLevel = sev; } - const QStringList &log() const { return m_log; } - void addMsg(int sev, QString msg) { + const TQStringList &log() const { return m_log; } + void addMsg(int sev, TQString msg) { increment(sev); if (m_logLevel < sev) return; - QString s; + TQString s; if (sev == Errors) s = "ERROR"; else if (sev == Warnings) s = "WARNING"; else if (sev == Diagnostics) s = "Diagnostic"; else if (sev == Debug) s = "Debug"; else s = "Message"; - m_log<<QString("%1: %2").arg(s, 13).arg(msg); + m_log<<TQString("%1: %2").tqarg(s, 13).tqarg(msg); } - void addMsg(QString msg) { m_log<<msg; } + void addMsg(TQString msg) { m_log<<msg; } void increment(int sev) { if (sev == Errors) { incErrors(); return; } if (sev == Warnings) { incWarnings(); return; } @@ -89,9 +89,9 @@ protected: int m_errors; int m_warnings; int m_logLevel; - QStringList m_log; - QDateTime m_starttime; - QTime m_timer; + TQStringList m_log; + TQDateTime m_starttime; + TQTime m_timer; int m_elapsed; }; diff --git a/kplato/relationpanel.ui b/kplato/relationpanel.ui index b9c886d7..73d3c491 100644 --- a/kplato/relationpanel.ui +++ b/kplato/relationpanel.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>KPlato::RelationPanel</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>RelationPanel</cstring> </property> @@ -24,7 +24,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>0</height> @@ -43,11 +43,11 @@ <property name="resizeMode"> <enum>FreeResize</enum> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>300</width> <height>0</height> @@ -84,7 +84,7 @@ <property name="spacing"> <number>2</number> </property> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>frame3</cstring> </property> @@ -106,7 +106,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -121,11 +121,11 @@ <property name="text"> <string>From:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignTop</set> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -140,35 +140,35 @@ <property name="text"> <string>To:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignTop</set> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>fromName</cstring> </property> <property name="text"> <string>Task 1</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignTop</set> </property> </widget> - <widget class="QLabel" row="1" column="1"> + <widget class="TQLabel" row="1" column="1"> <property name="name"> <cstring>toName</cstring> </property> <property name="text"> <string>Task 2</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignTop</set> </property> </widget> </grid> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>relationType</cstring> </property> @@ -179,7 +179,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioButton1</cstring> </property> @@ -187,7 +187,7 @@ <string>Finish-Start</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioButton1_2</cstring> </property> @@ -195,7 +195,7 @@ <string>Finish-Finish</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioButton1_3</cstring> </property> @@ -205,22 +205,22 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> <property name="text"> <string>Lag:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignBottom</set> </property> </widget> @@ -236,7 +236,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>0</height> @@ -277,7 +277,7 @@ <data format="PNG" length="1002">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154789cad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a19017a725d8c60000000049454e44ae426082</data> </image> </images> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kptdurationwidget.h</includehint> </includehints> diff --git a/kplato/reports/resourcelist.ktf b/kplato/reports/resourcelist.ktf index 925dde6e..186ae56a 100644 --- a/kplato/reports/resourcelist.ktf +++ b/kplato/reports/resourcelist.ktf @@ -2,7 +2,7 @@ <!DOCTYPE KugarTemplate SYSTEM "kugartemplate.dtd"> -<KugarTemplate PageOrientation="1" TopMargin="40" RightMargin="48" BottomMargin="40" LeftMargin="48" PageSize="0" PageWidth="947" PageHeight="669"> +<KugarTemplate PageQt::Orientation="1" TopMargin="40" RightMargin="48" BottomMargin="40" LeftMargin="48" PageSize="0" PageWidth="947" PageHeight="669"> <KPlato> <Detail Level="0" SelectFrom="resourcegroups" /> <Detail Level="1" SelectFrom="resources" /> diff --git a/kplato/reports/tasklist.ktf b/kplato/reports/tasklist.ktf index 1d58fcc8..ecfceb57 100644 --- a/kplato/reports/tasklist.ktf +++ b/kplato/reports/tasklist.ktf @@ -2,7 +2,7 @@ <!DOCTYPE KugarTemplate SYSTEM "kugartemplate.dtd"> -<KugarTemplate PageOrientation="1" TopMargin="40" RightMargin="48" BottomMargin="40" LeftMargin="48" PageSize="0" PageWidth="947" PageHeight="669"> +<KugarTemplate PageQt::Orientation="1" TopMargin="40" RightMargin="48" BottomMargin="40" LeftMargin="48" PageSize="0" PageWidth="947" PageHeight="669"> <KPlato> <Detail Level="0" SelectFrom="alltasks" /> </KPlato> diff --git a/kplato/resourcedialogbase.ui b/kplato/resourcedialogbase.ui index 1427744f..ecf68c35 100644 --- a/kplato/resourcedialogbase.ui +++ b/kplato/resourcedialogbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::ResourceDialogBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ResourceDialogBase</cstring> </property> @@ -23,7 +23,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>frame3</cstring> </property> @@ -37,7 +37,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -48,7 +48,7 @@ <cstring>nameEdit</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -59,15 +59,15 @@ <cstring>initialsEdit</cstring> </property> </widget> - <widget class="QLayoutWidget" row="1" column="1"> + <widget class="TQLayoutWidget" row="1" column="1"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>initialsEdit</cstring> </property> @@ -79,7 +79,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>100</width> <height>32767</height> @@ -89,7 +89,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_2</cstring> </property> @@ -100,7 +100,7 @@ <cstring>emailEdit</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>emailEdit</cstring> </property> @@ -110,15 +110,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout12</cstring> + <cstring>tqlayout12</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>nameEdit</cstring> </property> @@ -129,7 +129,7 @@ <string></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>chooseBtn</cstring> </property> @@ -144,15 +144,15 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel7</cstring> </property> @@ -163,7 +163,7 @@ <cstring>type</cstring> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Work</string> @@ -178,7 +178,7 @@ <cstring>type</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -189,22 +189,22 @@ <cstring>calendarList</cstring> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>calendarList</cstring> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -223,7 +223,7 @@ <enum>WheelFocus</enum> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -234,7 +234,7 @@ <cstring>availableFrom</cstring> </property> </widget> - <widget class="QSpinBox" row="0" column="1"> + <widget class="TQSpinBox" row="0" column="1"> <property name="name"> <cstring>units</cstring> </property> @@ -261,14 +261,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -289,7 +289,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3_2</cstring> </property> @@ -308,7 +308,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -319,7 +319,7 @@ <cstring>rateEdit</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel4_2</cstring> </property> @@ -330,7 +330,7 @@ <cstring>overtimeEdit</cstring> </property> </widget> - <widget class="QLineEdit" row="0" column="1"> + <widget class="TQLineEdit" row="0" column="1"> <property name="name"> <cstring>rateEdit</cstring> </property> @@ -338,7 +338,7 @@ <enum>WheelFocus</enum> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>overtimeEdit</cstring> </property> @@ -359,7 +359,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -385,7 +385,7 @@ <tabstop>rateEdit</tabstop> <tabstop>overtimeEdit</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatetimewidget.h</includehint> <includehint>kdatewidget.h</includehint> diff --git a/kplato/resourcespanelbase.ui b/kplato/resourcespanelbase.ui index dd5ecb72..e169b156 100644 --- a/kplato/resourcespanelbase.ui +++ b/kplato/resourcespanelbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::ResourcesPanelBase</class> <author>Dag Andersen <danders@get2net.dk></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ResourcesPanelBase</cstring> </property> @@ -13,7 +13,7 @@ <height>227</height> </rect> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>500</width> <height>200</height> @@ -26,9 +26,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <vbox> <property name="name"> @@ -50,15 +50,15 @@ <cstring>listOfGroups</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bAdd</cstring> </property> @@ -66,7 +66,7 @@ <string>&New</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bRemove</cstring> </property> @@ -78,7 +78,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>resourceGroupBox</cstring> </property> @@ -97,20 +97,20 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout51</cstring> + <cstring>tqlayout51</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>resourceName</cstring> </property> </widget> - <widget class="QListBox"> + <widget class="TQListBox"> <property name="name"> <cstring>listOfResources</cstring> </property> @@ -125,15 +125,15 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bAddResource</cstring> </property> @@ -141,7 +141,7 @@ <string>New...</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bEditResource</cstring> </property> @@ -152,7 +152,7 @@ <string></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>bRemoveResource</cstring> </property> @@ -173,7 +173,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>220</height> @@ -188,7 +188,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> </includehints> diff --git a/kplato/standardworktimedialogbase.ui b/kplato/standardworktimedialogbase.ui index adf39c2c..4119f46f 100644 --- a/kplato/standardworktimedialogbase.ui +++ b/kplato/standardworktimedialogbase.ui @@ -1,7 +1,7 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KPlato::StandardWorktimeDialogBase</class> <author>Dag Andersen </author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>StandardWorktimeDialogBase</cstring> </property> @@ -26,15 +26,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -45,7 +45,7 @@ <cstring>day</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -56,7 +56,7 @@ <cstring>month</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabe3</cstring> </property> @@ -135,7 +135,7 @@ <string>Number of working hours in a normal week.</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -148,7 +148,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -200,7 +200,7 @@ when there is no calendar defined for a resource.</string> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>160</width> <height>210</height> @@ -213,7 +213,7 @@ when there is no calendar defined for a resource.</string> <number>4</number> </property> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>editBox</cstring> </property> @@ -239,7 +239,7 @@ when there is no calendar defined for a resource.</string> <cstring>state</cstring> </property> </widget> - <widget class="QPushButton" row="0" column="1"> + <widget class="TQPushButton" row="0" column="1"> <property name="name"> <cstring>bApply</cstring> </property> @@ -247,7 +247,7 @@ when there is no calendar defined for a resource.</string> <string>Apply</string> </property> </widget> - <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>intervalBox</cstring> </property> @@ -281,7 +281,7 @@ when there is no calendar defined for a resource.</string> <tabstop>month</tabstop> <tabstop>week</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>klistview.h</includehint> diff --git a/kplato/tests/CalendarTester.cpp b/kplato/tests/CalendarTester.cpp index 1afcce6d..460679ec 100644 --- a/kplato/tests/CalendarTester.cpp +++ b/kplato/tests/CalendarTester.cpp @@ -23,7 +23,7 @@ #include <kptmap.h> #include <kunittest/runner.h> #include <kunittest/module.h> -#include <qstring.h> +#include <tqstring.h> using namespace KUnitTest; @@ -38,15 +38,15 @@ void CalendarTester::allTests() { void CalendarTester::testSingleDay() { KPlato::Calendar t("Test"); - QDate wdate(2006,1,2); + TQDate wdate(2006,1,2); KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-1)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(1)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::DateTime wdt1(wdate, t1); KPlato::DateTime wdt2(wdate, t2); - KPlato::CalendarDay *day = new KPlato::CalendarDay(QDate(2006,1,2), KPlato::Map::Working); - day->addInterval(QPair<QTime, QTime>(t1, t2)); + KPlato::CalendarDay *day = new KPlato::CalendarDay(TQDate(2006,1,2), KPlato::Map::Working); + day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); VERIFY(t.addDay(day)); COMPARE(t.findDay(wdate), day); VERIFY((t.firstAvailableAfter(after, after.addDays(10))).isValid() == false); @@ -68,40 +68,40 @@ void CalendarTester::testSingleDay() { void CalendarTester::testWeekdays() { KPlato::Calendar t("Test"); - QDate wdate(2006,1,4); // wednesday + TQDate wdate(2006,1,4); // wednesday KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-2)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(2)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::CalendarDay *wd1 = t.weekday(2); // wednesday VERIFY(wd1 != 0); wd1->setState(KPlato::Map::Working); - wd1->addInterval(QPair<QTime, QTime>(t1, t2)); + wd1->addInterval(TQPair<TQTime, TQTime>(t1, t2)); - COMPARE(t.firstAvailableAfter(before, after).toString(), QDateTime(QDate(2006, 1, 4), QTime(8,0,0)).toString()); - COMPARE((t.firstAvailableBefore(after, before)).toString(), QDateTime(QDate(2006, 1, 4), QTime(10,0,0)).toString()); + COMPARE(t.firstAvailableAfter(before, after).toString(), TQDateTime(TQDate(2006, 1, 4), TQTime(8,0,0)).toString()); + COMPARE((t.firstAvailableBefore(after, before)).toString(), TQDateTime(TQDate(2006, 1, 4), TQTime(10,0,0)).toString()); - COMPARE(t.firstAvailableAfter(after, KPlato::DateTime(QDate(2006,1,14))).toString(), QDateTime(QDate(2006, 1, 11), QTime(8,0,0)).toString()); - COMPARE(t.firstAvailableBefore(before, KPlato::DateTime(QDate(2005,12,25))).toString(), QDateTime(QDate(2005, 12, 28), QTime(10,0,0)).toString()); + COMPARE(t.firstAvailableAfter(after, KPlato::DateTime(TQDate(2006,1,14))).toString(), TQDateTime(TQDate(2006, 1, 11), TQTime(8,0,0)).toString()); + COMPARE(t.firstAvailableBefore(before, KPlato::DateTime(TQDate(2005,12,25))).toString(), TQDateTime(TQDate(2005, 12, 28), TQTime(10,0,0)).toString()); } void CalendarTester::testCalendarWithParent() { KPlato::Calendar t("Test 3"); - KPlato::Calendar p("Test 3 parent"); + KPlato::Calendar p("Test 3 tqparent"); t.setParent(&p); - QDate wdate(2006,1,2); + TQDate wdate(2006,1,2); KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-1)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(1)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::DateTime wdt1(wdate, t1); KPlato::DateTime wdt2(wdate, t2); - KPlato::CalendarDay *day = new KPlato::CalendarDay(QDate(2006,1,2), KPlato::Map::Working); - day->addInterval(QPair<QTime, QTime>(t1, t2)); + KPlato::CalendarDay *day = new KPlato::CalendarDay(TQDate(2006,1,2), KPlato::Map::Working); + day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); COMPARE(p.addDay(day), true); COMPARE(p.findDay(wdate), day); diff --git a/kplato/tests/DateTimeTester.cpp b/kplato/tests/DateTimeTester.cpp index d7bd2fb8..c1c18de9 100644 --- a/kplato/tests/DateTimeTester.cpp +++ b/kplato/tests/DateTimeTester.cpp @@ -22,7 +22,7 @@ #include <kunittest/runner.h> #include <kunittest/module.h> -#include <qdatetime.h> +#include <tqdatetime.h> using namespace KUnitTest; @@ -36,8 +36,8 @@ void DateTimeTester::allTests() { //FIXME: Define a operator<< for Duration void DateTimeTester::testSubtract() { - KPlato::DateTime dt1(QDate(2006, 1, 1), QTime(8, 0, 0)); - KPlato::DateTime dt2(QDate(2006, 1, 1), QTime(10, 0, 0)); + KPlato::DateTime dt1(TQDate(2006, 1, 1), TQTime(8, 0, 0)); + KPlato::DateTime dt2(TQDate(2006, 1, 1), TQTime(10, 0, 0)); KPlato::Duration d(0, 2, 0); COMPARE((dt2-dt1).toString(), d.toString()); @@ -46,8 +46,8 @@ void DateTimeTester::testSubtract() { } void DateTimeTester::testAdd() { - KPlato::DateTime dt1(QDate(2006, 1, 1), QTime(8, 0, 0)); - KPlato::DateTime dt2(QDate(2006, 1, 1), QTime(10, 0, 0)); + KPlato::DateTime dt1(TQDate(2006, 1, 1), TQTime(8, 0, 0)); + KPlato::DateTime dt2(TQDate(2006, 1, 1), TQTime(10, 0, 0)); KPlato::Duration d(0, 2, 0); COMPARE((dt1+d).toString(), dt2.toString()); } |