summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/KoOpenPane.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kofficecore/KoOpenPane.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kofficecore/KoOpenPane.cpp')
-rw-r--r--lib/kofficecore/KoOpenPane.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/lib/kofficecore/KoOpenPane.cpp b/lib/kofficecore/KoOpenPane.cpp
index 07c9580d..6c7cbb86 100644
--- a/lib/kofficecore/KoOpenPane.cpp
+++ b/lib/kofficecore/KoOpenPane.cpp
@@ -19,15 +19,15 @@
#include "KoOpenPane.h"
-#include <qvbox.h>
-#include <qlayout.h>
-#include <qheader.h>
-#include <qwidgetstack.h>
-#include <qlabel.h>
-#include <qvaluelist.h>
-#include <qimage.h>
-#include <qpainter.h>
-#include <qpen.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqwidgetstack.h>
+#include <tqlabel.h>
+#include <tqvaluelist.h>
+#include <tqimage.h>
+#include <tqpainter.h>
+#include <tqpen.h>
#include <klocale.h>
#include <kfiledialog.h>
@@ -45,15 +45,15 @@
#include <limits.h>
-class KoSectionListItem : public QListViewItem
+class KoSectionListItem : public TQListViewItem
{
public:
- KoSectionListItem(KListView* listView, const QString& name, int sortWeight, int widgetIndex = -1)
- : QListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex)
+ KoSectionListItem(KListView* listView, const TQString& name, int sortWeight, int widgetIndex = -1)
+ : TQListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex)
{
}
- virtual int compare(QListViewItem* i, int, bool) const
+ virtual int compare(TQListViewItem* i, int, bool) const
{
KoSectionListItem* item = dynamic_cast<KoSectionListItem*>(i);
@@ -63,13 +63,13 @@ class KoSectionListItem : public QListViewItem
return sortWeight() - item->sortWeight();
}
- 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)
{
if(widgetIndex() >= 0) {
- QListViewItem::paintCell(p, cg, column, width, align);
+ TQListViewItem::paintCell(p, cg, column, width, align);
} else {
int ypos = (height() - 2) / 2;
- QPen pen(cg.foreground(), 2);
+ TQPen pen(cg.foreground(), 2);
p->setPen(pen);
p->drawLine(0, ypos, width, ypos);
}
@@ -94,8 +94,8 @@ class KoOpenPanePrivate
KInstance* m_instance;
};
-KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType)
- : KoOpenPaneBase(parent, "OpenPane")
+KoOpenPane::KoOpenPane(TQWidget *tqparent, KInstance* instance, const TQString& templateType)
+ : KoOpenPaneBase(tqparent, "OpenPane")
{
d = new KoOpenPanePrivate;
d->m_instance = instance;
@@ -105,18 +105,18 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp
#if KDE_IS_VERSION(3,4,0)
m_sectionList->setShadeSortColumn(false);
#endif
- connect(m_sectionList, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(selectionChanged(QListViewItem*)));
- connect(m_sectionList, SIGNAL(pressed(QListViewItem*)),
- this, SLOT(itemClicked(QListViewItem*)));
- connect(m_sectionList, SIGNAL(spacePressed(QListViewItem*)),
- this, SLOT(itemClicked(QListViewItem*)));
- connect(m_sectionList, SIGNAL(returnPressed(QListViewItem*)),
- this, SLOT(itemClicked(QListViewItem*)));
+ connect(m_sectionList, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(selectionChanged(TQListViewItem*)));
+ connect(m_sectionList, TQT_SIGNAL(pressed(TQListViewItem*)),
+ this, TQT_SLOT(itemClicked(TQListViewItem*)));
+ connect(m_sectionList, TQT_SIGNAL(spacePressed(TQListViewItem*)),
+ this, TQT_SLOT(itemClicked(TQListViewItem*)));
+ connect(m_sectionList, TQT_SIGNAL(returnPressed(TQListViewItem*)),
+ this, TQT_SLOT(itemClicked(TQListViewItem*)));
KGuiItem openExistingGItem(i18n("Open Existing Document..."), "fileopen");
m_openExistingButton->setGuiItem(openExistingGItem);
- connect(m_openExistingButton, SIGNAL(clicked()), this, SLOT(showOpenFileDialog()));
+ connect(m_openExistingButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showOpenFileDialog()));
initRecentDocs();
initTemplates(templateType);
@@ -127,7 +127,7 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp
m_widgetStack->widget(selectedItem->widgetIndex())->setFocus();
}
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes << 20 << width() - 20;
m_splitter->setSizes(sizes);
@@ -136,8 +136,8 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp
sizes = cfgGrp.readIntListEntry("DetailsPaneSplitterSizes");
emit splitterResized(0, sizes);
- connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)),
- this, SLOT(saveSplitterSizes(KoDetailsPaneBase*, const QValueList<int>&)));
+ connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)),
+ this, TQT_SLOT(saveSplitterSizes(KoDetailsPaneBase*, const TQValueList<int>&)));
}
KoOpenPane::~KoOpenPane()
@@ -156,7 +156,7 @@ KoOpenPane::~KoOpenPane()
void KoOpenPane::showOpenFileDialog()
{
- const QStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(),
+ const TQStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(),
KoFilterManager::Import, KoDocument::readExtraNativeMimeTypes());
KURL url = KFileDialog::getOpenURL(":OpenDialog", mimeFilter.join(" "), this);
@@ -171,12 +171,12 @@ void KoOpenPane::showOpenFileDialog()
void KoOpenPane::initRecentDocs()
{
KoRecentDocumentsPane* recentDocPane = new KoRecentDocumentsPane(this, d->m_instance);
- connect(recentDocPane, SIGNAL(openFile(const QString&)), this, SIGNAL(openExistingFile(const QString&)));
- QListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0);
- connect(recentDocPane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)),
- this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)));
- connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)),
- recentDocPane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList<int>&)));
+ connect(recentDocPane, TQT_SIGNAL(openFile(const TQString&)), this, TQT_SIGNAL(openExistingFile(const TQString&)));
+ TQListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0);
+ connect(recentDocPane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)),
+ this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)));
+ connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)),
+ recentDocPane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList<int>&)));
KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", 1);
separator->setEnabled(false);
@@ -186,10 +186,10 @@ void KoOpenPane::initRecentDocs()
}
}
-void KoOpenPane::initTemplates(const QString& templateType)
+void KoOpenPane::initTemplates(const TQString& templateType)
{
- QListViewItem* selectItem = 0;
- QListViewItem* firstItem = 0;
+ TQListViewItem* selectItem = 0;
+ TQListViewItem* firstItem = 0;
const int templateOffset = 1000;
if(!templateType.isEmpty())
@@ -203,16 +203,16 @@ void KoOpenPane::initTemplates(const QString& templateType)
KoTemplatesPane* pane = new KoTemplatesPane(this, d->m_instance,
group, templateTree.defaultTemplate());
- connect(pane, SIGNAL(openTemplate(const QString&)), this, SIGNAL(openTemplate(const QString&)));
- connect(pane, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)),
- this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)));
- connect(this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)),
- pane, SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const QString&)));
- connect(pane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)),
- this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)));
- connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList<int>&)),
- pane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList<int>&)));
- QListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance),
+ connect(pane, TQT_SIGNAL(openTemplate(const TQString&)), this, TQT_SIGNAL(openTemplate(const TQString&)));
+ connect(pane, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)),
+ this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)));
+ connect(this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)),
+ pane, TQT_SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const TQString&)));
+ connect(pane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)),
+ this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)));
+ connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList<int>&)),
+ pane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList<int>&)));
+ TQListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance),
pane, group->sortingWeight() + templateOffset);
if(!firstItem) {
@@ -240,12 +240,12 @@ void KoOpenPane::initTemplates(const QString& templateType)
}
}
-void KoOpenPane::setCustomDocumentWidget(QWidget *widget) {
+void KoOpenPane::setCustomDocumentWidget(TQWidget *widget) {
Q_ASSERT(widget);
KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", INT_MAX-1);
separator->setEnabled(false);
- QListViewItem* item = addPane(i18n("Custom Document"), QString::null, widget, INT_MAX);
+ TQListViewItem* item = addPane(i18n("Custom Document"), TQString(), widget, INT_MAX);
KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog");
@@ -256,13 +256,13 @@ void KoOpenPane::setCustomDocumentWidget(QWidget *widget) {
}
}
-QListViewItem* KoOpenPane::addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight)
+TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQString& icon, TQWidget* widget, int sortWeight)
{
return addPane(title, SmallIcon(icon, KIcon::SizeLarge, KIcon::DefaultState, d->m_instance),
widget, sortWeight);
}
-QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight)
+TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQPixmap& icon, TQWidget* widget, int sortWeight)
{
if(!widget) {
return 0;
@@ -272,21 +272,21 @@ QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QW
KoSectionListItem* listItem = new KoSectionListItem(m_sectionList, title, sortWeight, id);
if(!icon.isNull()) {
- QImage image = icon.convertToImage();
+ TQImage image = icon.convertToImage();
if((image.width() > 48) || (image.height() > 48)) {
- image = image.smoothScale(48, 48, QImage::ScaleMin);
+ image = image.smoothScale(48, 48, TQ_ScaleMin);
}
image.setAlphaBuffer(true);
image = image.copy((image.width() - 48) / 2, (image.height() - 48) / 2, 48, 48);
- listItem->setPixmap(0, QPixmap(image));
+ listItem->setPixmap(0, TQPixmap(image));
}
return listItem;
}
-void KoOpenPane::selectionChanged(QListViewItem* item)
+void KoOpenPane::selectionChanged(TQListViewItem* item)
{
KoSectionListItem* section = dynamic_cast<KoSectionListItem*>(item);
@@ -297,13 +297,13 @@ void KoOpenPane::selectionChanged(QListViewItem* item)
m_widgetStack->raiseWidget(section->widgetIndex());
}
-void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const QValueList<int>& sizes)
+void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const TQValueList<int>& sizes)
{
KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog");
cfgGrp.writeEntry("DetailsPaneSplitterSizes", sizes);
}
-void KoOpenPane::itemClicked(QListViewItem* item)
+void KoOpenPane::itemClicked(TQListViewItem* item)
{
KoSectionListItem* selectedItem = static_cast<KoSectionListItem*>(item);