diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kplato/kptresourcespanel.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/kptresourcespanel.cc')
-rw-r--r-- | kplato/kptresourcespanel.cc | 110 |
1 files changed, 55 insertions, 55 deletions
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(); |