From e985f7e545f4739493965aad69bbecb136dc9346 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 16 Jun 2011 19:02:47 +0000 Subject: TQt4 port kdewebdev This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/components/framewizard/areaattributedb.h | 9 +- quanta/components/framewizard/fmfpeditor.h | 1 + quanta/components/framewizard/fmfpeditors.ui | 92 ++++++------- quanta/components/framewizard/fmrceditor.h | 1 + quanta/components/framewizard/fmrceditors.ui | 22 ++-- quanta/components/framewizard/framewizard.cpp | 6 +- quanta/components/framewizard/framewizard.h | 3 +- quanta/components/framewizard/framewizards.ui | 46 +++---- quanta/components/framewizard/selectablearea.cpp | 4 +- quanta/components/framewizard/selectablearea.h | 3 +- quanta/components/framewizard/treenode.cpp | 32 ++--- quanta/components/framewizard/treenode.h | 30 ++--- .../components/framewizard/visualframeeditor.cpp | 142 ++++++++++----------- quanta/components/framewizard/visualframeeditor.h | 9 +- 14 files changed, 203 insertions(+), 197 deletions(-) (limited to 'quanta/components/framewizard') diff --git a/quanta/components/framewizard/areaattributedb.h b/quanta/components/framewizard/areaattributedb.h index 6dbe92d1..528da3ea 100644 --- a/quanta/components/framewizard/areaattributedb.h +++ b/quanta/components/framewizard/areaattributedb.h @@ -24,11 +24,12 @@ *@author gulmini luciano */ -class areaAttribute : public QObject{ +class areaAttribute : public TQObject{ Q_OBJECT + TQ_OBJECT private: - TQRect m_geometry; + TQRect m_tqgeometry; TQMap m_attributeMap; //tag specific attributes public: @@ -37,13 +38,13 @@ class areaAttribute : public QObject{ void setAttribute(const TQString& name, const TQString& value){ m_attributeMap[name] = value; } void setAllAttributes(TQMap map){ m_attributeMap = map; } void resetAttributes(); - TQRect geometry() const { return m_geometry; } + TQRect tqgeometry() const { return m_tqgeometry; } TQString src() const{ return m_attributeMap["src"]; } TQString attributeValue(TQString l) const { return attributeMap()[l];} TQMap attributeMap() const { return m_attributeMap; } public slots: - void setGeometry(TQRect g) { m_geometry = g; } + void setGeometry(TQRect g) { m_tqgeometry = g; } }; #endif diff --git a/quanta/components/framewizard/fmfpeditor.h b/quanta/components/framewizard/fmfpeditor.h index 1a89f0c8..2fc52e64 100644 --- a/quanta/components/framewizard/fmfpeditor.h +++ b/quanta/components/framewizard/fmfpeditor.h @@ -26,6 +26,7 @@ class fmFPeditor : public fmFPeditorS { Q_OBJECT + TQ_OBJECT public: fmFPeditor(); diff --git a/quanta/components/framewizard/fmfpeditors.ui b/quanta/components/framewizard/fmfpeditors.ui index ef8990a9..bcfb43c1 100644 --- a/quanta/components/framewizard/fmfpeditors.ui +++ b/quanta/components/framewizard/fmfpeditors.ui @@ -1,6 +1,6 @@ fmFPeditorS - + fmFPeditorS @@ -19,7 +19,7 @@ unnamed - + Layout8 @@ -43,14 +43,14 @@ Expanding - + 55 0 - + pbOk @@ -58,7 +58,7 @@ &OK - + pbCancel @@ -68,11 +68,11 @@ - + tw - + tab @@ -83,7 +83,7 @@ unnamed - + bgBorder @@ -100,7 +100,7 @@ 6 - + rbBorderYes @@ -111,7 +111,7 @@ true - + rbBorderNo @@ -124,7 +124,7 @@ - + gbMargins @@ -141,7 +141,7 @@ 6 - + Layout8 @@ -155,7 +155,7 @@ 6 - + Layout4 @@ -169,7 +169,7 @@ 6 - + TextLabel2_3 @@ -177,7 +177,7 @@ From left: - + sbLeft @@ -190,7 +190,7 @@ - + Layout3 @@ -204,7 +204,7 @@ 6 - + TextLabel1_3 @@ -212,7 +212,7 @@ From top: - + sbTop @@ -229,7 +229,7 @@ - + bgScrolling @@ -246,7 +246,7 @@ 6 - + rbScrollingYes @@ -254,7 +254,7 @@ Yes - + rbScrollingAuto @@ -265,7 +265,7 @@ true - + rbScrollingNo @@ -275,7 +275,7 @@ - + bgNoresize @@ -295,7 +295,7 @@ 6 - + rbResizeYes @@ -303,7 +303,7 @@ Yes - + rbResizeNo @@ -316,7 +316,7 @@ - + Layout10 @@ -330,7 +330,7 @@ 6 - + Layout9 @@ -344,7 +344,7 @@ 6 - + tlFrameSource @@ -352,7 +352,7 @@ Frame source: - + tlFrameName @@ -362,7 +362,7 @@ - + Layout8 @@ -381,7 +381,7 @@ fc - + leName @@ -392,7 +392,7 @@ - + tab @@ -403,7 +403,7 @@ unnamed - + Layout11 @@ -417,7 +417,7 @@ 6 - + tlId @@ -425,7 +425,7 @@ Id: - + TextLabel2_2 @@ -433,7 +433,7 @@ Class: - + TextLabel3 @@ -441,7 +441,7 @@ Style: - + TextLabel4 @@ -449,7 +449,7 @@ Title: - + TextLabel6 @@ -459,7 +459,7 @@ - + Layout10 @@ -473,27 +473,27 @@ 6 - + leId - + leClass - + leStyle - + leTitle - + leLongdesc @@ -510,7 +510,7 @@ Expanding - + 20 40 @@ -537,5 +537,5 @@ - + diff --git a/quanta/components/framewizard/fmrceditor.h b/quanta/components/framewizard/fmrceditor.h index 254f1cc5..ab33d5b4 100644 --- a/quanta/components/framewizard/fmrceditor.h +++ b/quanta/components/framewizard/fmrceditor.h @@ -26,6 +26,7 @@ class fmRCeditor : public fmRCeditorS { Q_OBJECT + TQ_OBJECT public: fmRCeditor(); ~fmRCeditor(); diff --git a/quanta/components/framewizard/fmrceditors.ui b/quanta/components/framewizard/fmrceditors.ui index 25cd41bd..d85bb0da 100644 --- a/quanta/components/framewizard/fmrceditors.ui +++ b/quanta/components/framewizard/fmrceditors.ui @@ -1,6 +1,6 @@ fmRCeditorS - + fmRCeditorS @@ -20,13 +20,13 @@ 0 - + 300 150 - + 300 150 @@ -45,7 +45,7 @@ 6 - + Layout11 @@ -59,7 +59,7 @@ 6 - + tl @@ -67,7 +67,7 @@ - + sb @@ -80,7 +80,7 @@ - + Layout3 @@ -104,14 +104,14 @@ Expanding - + 31 0 - + pbOk @@ -119,7 +119,7 @@ &OK - + pbCancel @@ -145,5 +145,5 @@ reject() - + diff --git a/quanta/components/framewizard/framewizard.cpp b/quanta/components/framewizard/framewizard.cpp index e0e7d5d9..0eabb061 100644 --- a/quanta/components/framewizard/framewizard.cpp +++ b/quanta/components/framewizard/framewizard.cpp @@ -28,7 +28,7 @@ static const TQString info1=i18n("You must select an area."), info2=i18n("Before editing a frame you must save the file."); -FrameWizard::FrameWizard(TQWidget *parent, const char *name) : FrameWizardS(parent, name), +FrameWizard::FrameWizard(TQWidget *tqparent, const char *name) : FrameWizardS(tqparent, name), m_hasSelected(false),m_saved(false) { m_hasSelected = false; @@ -44,7 +44,7 @@ m_hasSelected(false),m_saved(false) } FrameWizard::~FrameWizard(){ -#define QT_CHECK_NULL +#define TQT_CHECK_NULL Q_CHECK_PTR( vfe ); } @@ -57,7 +57,7 @@ void FrameWizard::split(){ if(m_hasSelected) { int split = 0; TQString currNodeLabel = m_currSA; - TQString senderName=sender()->name(); + TQString senderName=TQT_TQOBJECT(const_cast(sender()))->name(); if(senderName=="pbHorizontal"){ split = showRCeditorDlg(i18n("Enter the desired number of rows:")); if(split>=2) vfe->split(currNodeLabel,split,HORIZONTAL); diff --git a/quanta/components/framewizard/framewizard.h b/quanta/components/framewizard/framewizard.h index 42386982..177c6c6b 100644 --- a/quanta/components/framewizard/framewizard.h +++ b/quanta/components/framewizard/framewizard.h @@ -26,6 +26,7 @@ class TQStringList; class FrameWizard : public FrameWizardS { Q_OBJECT + TQ_OBJECT private: bool m_hasSelected, m_saved; // if saved = false the the file containing the frameset structure @@ -35,7 +36,7 @@ class FrameWizard : public FrameWizardS TQString m_currSA; public: - FrameWizard( TQWidget* parent=0, const char *name=0); + FrameWizard( TQWidget* tqparent=0, const char *name=0); ~FrameWizard(); private slots: diff --git a/quanta/components/framewizard/framewizards.ui b/quanta/components/framewizard/framewizards.ui index a06d321b..6f3d030e 100644 --- a/quanta/components/framewizard/framewizards.ui +++ b/quanta/components/framewizard/framewizards.ui @@ -1,6 +1,6 @@ FrameWizardS - + FrameWizardS @@ -20,13 +20,13 @@ 0 - + 0 0 - + 32767 32767 @@ -45,7 +45,7 @@ 6 - + Layout2 @@ -59,7 +59,7 @@ 6 - + pbHelp @@ -77,14 +77,14 @@ Expanding - + 30 0 - + Layout1 @@ -98,7 +98,7 @@ 6 - + pbOk @@ -106,7 +106,7 @@ &OK - + pbCancel @@ -118,7 +118,7 @@ - + Layout11 @@ -132,7 +132,7 @@ 6 - + Layout9 @@ -146,7 +146,7 @@ 6 - + tl @@ -161,14 +161,14 @@ Expanding - + 0 30 - + ButtonGroup4 @@ -193,7 +193,7 @@ 6 - + pbVertical @@ -201,7 +201,7 @@ Vertical - + pbHorizontal @@ -221,14 +221,14 @@ Expanding - + 0 16 - + ButtonGroup5 @@ -253,7 +253,7 @@ 6 - + pbEditFrame @@ -261,7 +261,7 @@ Edit Frame - + pbDelete @@ -272,7 +272,7 @@ Delete - + pbReset @@ -295,7 +295,7 @@ Expanding - + 0 30 @@ -362,7 +362,7 @@ - + visualframeeditor.h diff --git a/quanta/components/framewizard/selectablearea.cpp b/quanta/components/framewizard/selectablearea.cpp index c168e323..40f76ae2 100644 --- a/quanta/components/framewizard/selectablearea.cpp +++ b/quanta/components/framewizard/selectablearea.cpp @@ -20,7 +20,7 @@ //#include #include "fwglobal.h" -SelectableArea::SelectableArea(TQWidget *parent, const char *name ) : KHTMLPart(parent,name) { +SelectableArea::SelectableArea(TQWidget *tqparent, const char *name ) : KHTMLPart(tqparent,name) { view()->setFrameShape(TQFrame::NoFrame); view()->setMinimumSize(TQSize(1,1)); view()->installEventFilter(this); @@ -44,7 +44,7 @@ bool SelectableArea::eventFilter(TQObject *o, TQEvent *event){ } break; case TQEvent::Resize : { - emit Resized( view()->geometry() ); + emit Resized( view()->tqgeometry() ); view()->hide(); view()->show(); return true; diff --git a/quanta/components/framewizard/selectablearea.h b/quanta/components/framewizard/selectablearea.h index 8de351a9..3df3200a 100644 --- a/quanta/components/framewizard/selectablearea.h +++ b/quanta/components/framewizard/selectablearea.h @@ -29,9 +29,10 @@ class SelectableArea : public KHTMLPart { Q_OBJECT + TQ_OBJECT public : - SelectableArea(TQWidget *parent=0, const char *name=0); + SelectableArea(TQWidget *tqparent=0, const char *name=0); ~SelectableArea(); TQString idLabel() const { return m_idLabel; } void setIdLabel(const TQString &i) { m_idLabel = i; } diff --git a/quanta/components/framewizard/treenode.cpp b/quanta/components/framewizard/treenode.cpp index fd1f187f..0ff7cf74 100644 --- a/quanta/components/framewizard/treenode.cpp +++ b/quanta/components/framewizard/treenode.cpp @@ -20,7 +20,7 @@ static const int SIZE = 101; treeNode::treeNode(const TQString &l, const TQString &pl) : m_label(l), m_parentLabel(pl), m_splitType(NONE){ - m_childrenList.setAutoDelete(true); + m_tqchildrenList.setAutoDelete(true); m_atts = new areaAttribute; } @@ -29,16 +29,16 @@ treeNode::~treeNode(){ } void treeNode::addChildNode(const TQString &l) { - m_childrenList.append( new treeNode(l,m_label) ); + m_tqchildrenList.append( new treeNode(l,m_label) ); } void treeNode::removeChildNode(const TQString &l,bool autoDelete) { - m_childrenList.setAutoDelete(autoDelete); - m_childrenList.remove(findChild(l)); + m_tqchildrenList.setAutoDelete(autoDelete); + m_tqchildrenList.remove(findChild(l)); } treeNode* treeNode::findChild(const TQString &l){ - TQPtrListIterator it( m_childrenList ); + TQPtrListIterator it( m_tqchildrenList ); treeNode *node; while ( (node = it.current()) != 0 ) { ++it; @@ -68,25 +68,25 @@ void tree::refreshGeometries(treeNode *n){ n->nextChild(); } - TQPtrList list = n->childrenList(); + TQPtrList list = n->tqchildrenList(); TQPtrListIterator it( list ); treeNode *node= it.current(); - TQRect newGeometry = n->atts()->geometry(); + TQRect newGeometry = n->atts()->tqgeometry(); if(n->splitType()==VERTICAL){ - newGeometry.setHeight(node->atts()->geometry().height()); + newGeometry.setHeight(node->atts()->tqgeometry().height()); while ( (node = it.current()) != 0 ) { ++it; - dim += node->atts()->geometry().width(); + dim += node->atts()->tqgeometry().width(); dim += 6; } newGeometry.setWidth(dim); } else if(n->splitType()==HORIZONTAL){ - newGeometry.setWidth(node->atts()->geometry().width()); + newGeometry.setWidth(node->atts()->tqgeometry().width()); while ( (node = it.current()) != 0 ) { ++it; - dim += node->atts()->geometry().height(); + dim += node->atts()->tqgeometry().height(); dim += 6; } newGeometry.setHeight(dim); @@ -98,7 +98,7 @@ void tree::refreshGeometries(treeNode *n){ treeNode* tree::findNode(const TQString &l){ if(l==m_root->label()) return m_root; - return m_nodeList.find(l); + return m_nodeList.tqfind(l); } TQString tree::addChildNode(const TQString &l){ @@ -114,13 +114,13 @@ TQString tree::addChildNode(const TQString &l){ } bool tree::insertChildNode(const TQString &l){ - TQString parent = findNode(l)->parentLabel(); - int pos=findNode( parent )->childPosition( findNode(l) ); + TQString tqparent = findNode(l)->tqparentLabel(); + int pos=findNode( tqparent )->childPosition( findNode(l) ); ++nodeId; - treeNode *newNode = new treeNode(TQString::number(nodeId,10),parent); + treeNode *newNode = new treeNode(TQString::number(nodeId,10),tqparent); newNode->atts()->setAttribute( "src",findNode(l)->atts()->src() ); m_nodeList.insert(TQString::number(nodeId,10),newNode); - return findNode( parent )->insertChild(pos,newNode); + return findNode( tqparent )->insertChild(pos,newNode); } void tree::reset(){ diff --git a/quanta/components/framewizard/treenode.h b/quanta/components/framewizard/treenode.h index 0d686630..6680e443 100644 --- a/quanta/components/framewizard/treenode.h +++ b/quanta/components/framewizard/treenode.h @@ -33,36 +33,36 @@ class treeNode { TQString m_label, m_parentLabel; SplitType m_splitType; - TQPtrList m_childrenList; + TQPtrList m_tqchildrenList; areaAttribute *m_atts; public: - treeNode(const TQString &l=TQString::null, const TQString &pl=TQString::null); + treeNode(const TQString &l=TQString(), const TQString &pl=TQString()); ~treeNode(); void addChildNode(const TQString &L); - void addChildNode(treeNode *n){ m_childrenList.append(n); } + void addChildNode(treeNode *n){ m_tqchildrenList.append(n); } void removeChildNode(const TQString &l, bool autoDelete); void setSplitType(SplitType s) { m_splitType = s; } void setLabel(const TQString &l) { m_label = l; } - void removeChildren() { m_childrenList.clear(); } + void removeChildren() { m_tqchildrenList.clear(); } void setParentLabel(const TQString &s){ m_parentLabel = s;} - int childPosition(treeNode* n){ return m_childrenList.find(n); } - bool insertChild(unsigned int pos, treeNode* n) { return m_childrenList.insert( pos, n); } + int childPosition(treeNode* n){ return m_tqchildrenList.tqfind(n); } + bool insertChild(unsigned int pos, treeNode* n) { return m_tqchildrenList.insert( pos, n); } TQString label() const { return m_label; } - TQString parentLabel() const { return m_parentLabel; } + TQString tqparentLabel() const { return m_parentLabel; } SplitType splitType() const { return m_splitType; } - TQPtrList childrenList() { return m_childrenList; } + TQPtrList tqchildrenList() { return m_tqchildrenList; } - treeNode* firstChild() { return m_childrenList.first(); } - treeNode* nextChild() { return m_childrenList.next(); } - treeNode* lastChild() { return m_childrenList.last(); } - treeNode* currentChild() { return m_childrenList.current(); } + treeNode* firstChild() { return m_tqchildrenList.first(); } + treeNode* nextChild() { return m_tqchildrenList.next(); } + treeNode* lastChild() { return m_tqchildrenList.last(); } + treeNode* currentChild() { return m_tqchildrenList.current(); } treeNode* findChild(const TQString &L); areaAttribute* atts() { return m_atts; } - int countChildren() const { return m_childrenList.count(); } - bool hasChildren() const { return !m_childrenList.isEmpty(); } + int countChildren() const { return m_tqchildrenList.count(); } + bool hasChildren() const { return !m_tqchildrenList.isEmpty(); } }; class tree{ @@ -77,7 +77,7 @@ class tree{ treeNode* root() const { return m_root; } TQString addChildNode(const TQString &l); bool insertChildNode(const TQString &L); - void removeChildNode(const TQString &pl,const TQString &l,bool autoDelete);//parent node,child node + void removeChildNode(const TQString &pl,const TQString &l,bool autoDelete);//tqparent node,child node treeNode* findNode(const TQString &L); areaAttribute* findAreaAttribute(const TQString &l){ return findNode(l)->atts(); }; void reset(); diff --git a/quanta/components/framewizard/visualframeeditor.cpp b/quanta/components/framewizard/visualframeeditor.cpp index a11dae84..d75074bd 100644 --- a/quanta/components/framewizard/visualframeeditor.cpp +++ b/quanta/components/framewizard/visualframeeditor.cpp @@ -32,7 +32,7 @@ TQMap > SIZES; static int splitterIdNumber = 0; -VisualFrameEditor::VisualFrameEditor(TQWidget * parent, const char * name) : TQHBox(parent,name){ +VisualFrameEditor::VisualFrameEditor(TQWidget * tqparent, const char * name) : TQHBox(tqparent,name){ m_internalTree = new tree; m_internalTree->root()->atts()->setGeometry(TQRect(0,0,510,422)); m_firstInsertedSA = 0L; @@ -46,12 +46,12 @@ VisualFrameEditor::~VisualFrameEditor(){ void VisualFrameEditor::setGeometries(const TQString &l){ int cP = cancelledPixels(m_internalTree->findNode(l)->countChildren()); - TQRect newGeometry(m_internalTree->findNode(l)->atts()->geometry()); - TQPtrList list=m_internalTree->findNode(l)->childrenList(); + TQRect newGeometry(m_internalTree->findNode(l)->atts()->tqgeometry()); + TQPtrList list=m_internalTree->findNode(l)->tqchildrenList(); TQPtrListIterator it( list ); treeNode *node; if(m_internalTree->findNode(l)->splitType() == VERTICAL){ - int dummyDimension=m_internalTree->findNode(l)->atts()->geometry().width()-cP; + int dummyDimension=m_internalTree->findNode(l)->atts()->tqgeometry().width()-cP; while ( (node = it.current()) != 0 ) { ++it; newGeometry.setWidth( int(dummyDimension/m_internalTree->findNode(l)->countChildren()) ); @@ -60,7 +60,7 @@ void VisualFrameEditor::setGeometries(const TQString &l){ } else if(m_internalTree->findNode(l)->splitType() == HORIZONTAL){ - int dummyDimension=m_internalTree->findNode(l)->atts()->geometry().height()-cP; + int dummyDimension=m_internalTree->findNode(l)->atts()->tqgeometry().height()-cP; while ( (node = it.current()) != 0 ) { ++it; newGeometry.setHeight( int(dummyDimension/m_internalTree->findNode(l)->countChildren()) ); @@ -76,17 +76,17 @@ void VisualFrameEditor::split(const TQString &l, int n, SplitType type) { setGeometries(l); } else { - TQString parentLabel=m_internalTree->findNode(l)->parentLabel(); - SplitType parentSplit=m_internalTree->findNode(parentLabel)->splitType(); - if( parentSplit != type ) { + TQString tqparentLabel=m_internalTree->findNode(l)->tqparentLabel(); + SplitType tqparentSplit=m_internalTree->findNode(tqparentLabel)->splitType(); + if( tqparentSplit != type ) { m_internalTree->findNode(l)->setSplitType(type); for(int i = 1; i<=n; i++) m_internalTree->addChildNode(l); setGeometries(l); } else { for(int i = 1; i<=n; i++) m_internalTree->insertChildNode(l); - m_internalTree->findNode(parentLabel)->removeChildNode(l,true); - setGeometries(m_internalTree->findNode(parentLabel)->label()); + m_internalTree->findNode(tqparentLabel)->removeChildNode(l,true); + setGeometries(m_internalTree->findNode(tqparentLabel)->label()); } } } @@ -109,9 +109,9 @@ TQStringList VisualFrameEditor::convertAsterisks(const TQString &s,int d){ // then every asterisk must be assigned a percentage of 10% so the real percentage // notation is cols="40%,50%,10%" for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - if(!(*it).contains("%") && !(*it).contains("*")) leftPercentage -= ( (*it).toInt()*100 )/d; - if((*it).contains("%")) leftPercentage -= (*it).section("%",0,0).toInt(); - if((*it).contains("*")) { + if(!(*it).tqcontains("%") && !(*it).tqcontains("*")) leftPercentage -= ( (*it).toInt()*100 )/d; + if((*it).tqcontains("%")) leftPercentage -= (*it).section("%",0,0).toInt(); + if((*it).tqcontains("*")) { int weight= (*it).section("*",0,0).toInt(); if( weight==0 ) weight=1; weightAsteriskCounter += weight; @@ -125,7 +125,7 @@ TQStringList VisualFrameEditor::convertAsterisks(const TQString &s,int d){ // a quelli effettivamente generati dal metodo build che opera un'altra normalizzazione. // In genere la differenza �dell' 1% for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - if((*it).contains("*")){ + if((*it).tqcontains("*")){ int weight= (*it).section("*",0,0).toInt(); if(weight==0) weight=1; int newPercentage = weight*leftPercentageDistributedAmongAsterisks; @@ -136,28 +136,28 @@ TQStringList VisualFrameEditor::convertAsterisks(const TQString &s,int d){ return list; } -void VisualFrameEditor::buildInternalTree(const TQString &parent){ +void VisualFrameEditor::buildInternalTree(const TQString &tqparent){ TQString line = m_existingStructure.first(); - if(line.contains("findNode(parent)->atts()->geometry(); + TQRect dummy=m_internalTree->findNode(tqparent)->atts()->tqgeometry(); TQStringList percentages = convertAsterisks(pattern.cap(1),dummy.height()); - int dummyDimension=dummy.height()-cancelledPixels(line.contains(",")+1); + int dummyDimension=dummy.height()-cancelledPixels(line.tqcontains(",")+1); - TQPtrList list=m_internalTree->findNode(parent)->childrenList(); + TQPtrList list=m_internalTree->findNode(tqparent)->tqchildrenList(); TQPtrListIterator it( list ); treeNode *node; while ( (node = it.current()) != 0 ) { ++it; TQRect newGeometry(dummy); double newDimension; - if(percentages.first().contains("%")) + if(percentages.first().tqcontains("%")) newDimension=(dummyDimension*(percentages.first().remove("%").toInt()))/100.0; else newDimension=(double)percentages.first().toInt(); newGeometry.setHeight( proxInt(newDimension) ); @@ -166,24 +166,24 @@ void VisualFrameEditor::buildInternalTree(const TQString &parent){ } } else - if(line.contains("cols")) { - split(parent,(line.contains(",")+1),VERTICAL); + if(line.tqcontains("cols")) { + split(tqparent,(line.tqcontains(",")+1),VERTICAL); TQRegExp pattern("cols\\s*=\"([\\s\\d%,\\*]*)\""); pattern.search(line); - TQRect dummy=m_internalTree->findNode(parent)->atts()->geometry(); + TQRect dummy=m_internalTree->findNode(tqparent)->atts()->tqgeometry(); TQStringList percentages = convertAsterisks(pattern.cap(1),dummy.width()); - int dummyDimension=dummy.width()-cancelledPixels(line.contains(",")+1); + int dummyDimension=dummy.width()-cancelledPixels(line.tqcontains(",")+1); - TQPtrList list=m_internalTree->findNode(parent)->childrenList(); + TQPtrList list=m_internalTree->findNode(tqparent)->tqchildrenList(); TQPtrListIterator it( list ); treeNode *node; while ( (node = it.current()) != 0 ) { ++it; TQRect newGeometry(dummy); double newDimension; - if(percentages.first().contains("%")) + if(percentages.first().tqcontains("%")) newDimension=(dummyDimension*(percentages.first().remove("%").toInt()))/100.0; else newDimension=(double)percentages.first().toInt(); newGeometry.setWidth( proxInt(newDimension) ); @@ -193,23 +193,23 @@ void VisualFrameEditor::buildInternalTree(const TQString &parent){ } m_existingStructure.pop_front(); - m_internalTree->findNode(parent)->firstChild(); - while(m_internalTree->findNode(parent)->currentChild()) { - buildInternalTree(m_internalTree->findNode(parent)->currentChild()->label()); - m_internalTree->findNode(parent)->nextChild(); + m_internalTree->findNode(tqparent)->firstChild(); + while(m_internalTree->findNode(tqparent)->currentChild()) { + buildInternalTree(m_internalTree->findNode(tqparent)->currentChild()->label()); + m_internalTree->findNode(tqparent)->nextChild(); } } else { TQMap attributeMap; - if( line.contains( TQRegExp("\\s+noresize") ) ) attributeMap["noresize"] = "noresize"; - else attributeMap["noresize"] = TQString::null; + if( line.tqcontains( TQRegExp("\\s+noresize") ) ) attributeMap["noresize"] = "noresize"; + else attributeMap["noresize"] = TQString(); TQRegExp srcPattern("\\s+src\\s*=\\s*\"([%-\\w\\s\\./_\\+\\d]*)\""); //search for files if(srcPattern.search(line) !=-1 ) { KURL pathToConvert, basePath; pathToConvert.setPath(srcPattern.cap(1)); basePath.setPath( Project::ref()->projectBaseURL().path() ); - attributeMap["src"] = QExtFileInfo::toAbsolute( pathToConvert, basePath ).path(); + attributeMap["src"] = TQExtFileInfo::toAbsolute( pathToConvert, basePath ).path(); line.remove(srcPattern);//we don't need to operate on this anymore } @@ -221,7 +221,7 @@ void VisualFrameEditor::buildInternalTree(const TQString &parent){ attributeMap[ pattern.cap(1).section( TQRegExp("=\\s*\"") ,0,0) ] = pattern.cap(1).section(TQRegExp("=\\s*\""),1,1).remove("\""); if ( pos >= 0 ) pos += pattern.matchedLength(); } - m_internalTree->findNode(parent)->atts()->setAllAttributes(attributeMap); + m_internalTree->findNode(tqparent)->atts()->setAllAttributes(attributeMap); m_existingStructure.pop_front(); } } @@ -246,23 +246,23 @@ void VisualFrameEditor::paintEvent ( TQPaintEvent * ){ void VisualFrameEditor::removeNode(const TQString &l){ if( l == m_internalTree->root()->label() ) m_internalTree->reset();//trying to remove root node is equivalent to reinitialize else { - TQString parentLabel=m_internalTree->findNode(l)->parentLabel(); - if(m_internalTree->findNode(parentLabel)->countChildren()>=3) - m_internalTree->removeChildNode(parentLabel,l,true); + TQString tqparentLabel=m_internalTree->findNode(l)->tqparentLabel(); + if(m_internalTree->findNode(tqparentLabel)->countChildren()>=3) + m_internalTree->removeChildNode(tqparentLabel,l,true); else { - m_internalTree->removeChildNode(parentLabel,l,true); - if( !m_internalTree->findNode(parentLabel)->firstChild()->hasChildren() ){ //final nodes - TQMap map = m_internalTree->findNode(parentLabel)->firstChild()->atts()->attributeMap(); - m_internalTree->findNode(parentLabel)->removeChildren(); - m_internalTree->findNode(parentLabel)->atts()->setAllAttributes( map ) ; - m_internalTree->findNode(parentLabel)->setSplitType(NONE); + m_internalTree->removeChildNode(tqparentLabel,l,true); + if( !m_internalTree->findNode(tqparentLabel)->firstChild()->hasChildren() ){ //final nodes + TQMap map = m_internalTree->findNode(tqparentLabel)->firstChild()->atts()->attributeMap(); + m_internalTree->findNode(tqparentLabel)->removeChildren(); + m_internalTree->findNode(tqparentLabel)->atts()->setAllAttributes( map ) ; + m_internalTree->findNode(tqparentLabel)->setSplitType(NONE); } else { - TQPtrList list = m_internalTree->findNode(parentLabel)->firstChild()->childrenList(); - if( parentLabel != m_internalTree->root()->label() ) { - TQString grandParentLabel = m_internalTree->findNode(parentLabel)->parentLabel(); - m_internalTree->removeChildNode( parentLabel,m_internalTree->findNode(parentLabel)->firstChild()->label(),false ); - m_internalTree->removeChildNode( grandParentLabel ,parentLabel, true ); + TQPtrList list = m_internalTree->findNode(tqparentLabel)->firstChild()->tqchildrenList(); + if( tqparentLabel != m_internalTree->root()->label() ) { + TQString grandParentLabel = m_internalTree->findNode(tqparentLabel)->tqparentLabel(); + m_internalTree->removeChildNode( tqparentLabel,m_internalTree->findNode(tqparentLabel)->firstChild()->label(),false ); + m_internalTree->removeChildNode( grandParentLabel ,tqparentLabel, true ); treeNode *node; for ( node = list.first(); node; node = list.next() ) { node->setParentLabel(grandParentLabel); @@ -270,12 +270,12 @@ void VisualFrameEditor::removeNode(const TQString &l){ } } else { - m_internalTree->findNode(parentLabel)->setSplitType( m_internalTree->findNode(parentLabel)->firstChild()->splitType() ); - m_internalTree->removeChildNode( parentLabel,m_internalTree->findNode(parentLabel)->firstChild()->label(),false ); + m_internalTree->findNode(tqparentLabel)->setSplitType( m_internalTree->findNode(tqparentLabel)->firstChild()->splitType() ); + m_internalTree->removeChildNode( tqparentLabel,m_internalTree->findNode(tqparentLabel)->firstChild()->label(),false ); treeNode *node; for ( node = list.first(); node; node = list.next() ) { - node->setParentLabel(parentLabel); - m_internalTree->findNode(parentLabel)->addChildNode(node); + node->setParentLabel(tqparentLabel); + m_internalTree->findNode(tqparentLabel)->addChildNode(node); } } } @@ -283,14 +283,14 @@ void VisualFrameEditor::removeNode(const TQString &l){ } } -void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* parent){ +void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* tqparent){ if(n->hasChildren()) { TQString splitterName("splitter"+TQString::number(++splitterIdNumber,10)); - TQSplitter *splitter = new TQSplitter(parent,splitterName.ascii()); - if(SIZES.contains(splitterName)) splitter->setSizes( SIZES[splitterName] ); + TQSplitter *splitter = new TQSplitter(tqparent,splitterName.ascii()); + if(SIZES.tqcontains(splitterName)) splitter->setSizes( SIZES[splitterName] ); switch( n->splitType() ){ - case VERTICAL : splitter->setOrientation(TQSplitter::Horizontal);break; - case HORIZONTAL : splitter->setOrientation(TQSplitter::Vertical);break; + case VERTICAL : splitter->setOrientation(Qt::Horizontal);break; + case HORIZONTAL : splitter->setOrientation(Qt::Vertical);break; default:break; } n->firstChild(); @@ -300,11 +300,11 @@ void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* parent){ } } else { - SelectableArea *sa=new SelectableArea(parent,n->label().ascii()); - if(parent->isA(TQSPLITTER_OBJECT_NAME_STRING)) dynamic_cast(parent)->setResizeMode(sa->view(),TQSplitter::KeepSize ); + SelectableArea *sa=new SelectableArea(tqparent,n->label().ascii()); + if(tqparent->isA(TQSPLITTER_OBJECT_NAME_STRING)) dynamic_cast(tqparent)->setResizeMode(sa->view(),TQSplitter::KeepSize ); else if(!m_firstInsertedSA) m_firstInsertedSA = sa; - sa->view()->setGeometry(n->atts()->geometry()); + sa->view()->setGeometry(n->atts()->tqgeometry()); sa->setIdLabel( n->label() ); sa->setSource( n->atts()->src() ); connect(sa, TQT_SIGNAL(Resized(TQRect)), m_internalTree->findNode(sa->idLabel())->atts(), TQT_SLOT(setGeometry(TQRect))); @@ -335,7 +335,7 @@ TQString VisualFrameEditor::createFrameTag(areaAttribute *a){ base.setPath( Project::ref()->projectBaseURL().path() ); KURL u; u.setPath(Src); - tagMiddle+= (" src=\"" + QExtFileInfo::toRelative( u, base).path() + "\""); + tagMiddle+= (" src=\"" + TQExtFileInfo::toRelative( u, base).path() + "\""); } if( !Longdesc.isEmpty() ) @@ -371,11 +371,11 @@ TQString VisualFrameEditor::RCvalue(treeNode *n) { int lostPixels = (6*(child_number-1)); // 6 pixels are lost every time a splitter is drawn switch( n->splitType() ) { - case VERTICAL: percentage/=n->atts()->geometry().width(); - for(int i=1;i<=child_number;++i) dimMap[i]=n->childrenList().at(i-1)->atts()->geometry().width(); + case VERTICAL: percentage/=n->atts()->tqgeometry().width(); + for(int i=1;i<=child_number;++i) dimMap[i]=n->tqchildrenList().at(i-1)->atts()->tqgeometry().width(); break; - case HORIZONTAL: percentage/=n->atts()->geometry().height(); - for(int i=1;i<=child_number;++i) dimMap[i]=n->childrenList().at(i-1)->atts()->geometry().height(); + case HORIZONTAL: percentage/=n->atts()->tqgeometry().height(); + for(int i=1;i<=child_number;++i) dimMap[i]=n->tqchildrenList().at(i-1)->atts()->tqgeometry().height(); break; default:break; } @@ -421,9 +421,9 @@ TQString VisualFrameEditor::formatStructure(){ TQString s; int tabNum = 0; for ( TQStringList::Iterator it = nonFormattedStructure.begin(); it != nonFormattedStructure.end(); ++it ) { - if((*it).contains("")) { + if((*it).tqcontains("")) { tabNum--; s.truncate(s.length()-1); } @@ -441,9 +441,9 @@ TQString VisualFrameEditor::framesetStructure() { } void VisualFrameEditor::setMarkupLanguage(const TQString& s){ - if( s.contains("xhtml",false)!=0 ) m_markupLanguage = XHTML; + if( s.tqcontains("xhtml",false)!=0 ) m_markupLanguage = XHTML; else - if( s.contains("html",false)!=0 ) m_markupLanguage = HTML; + if( s.tqcontains("html",false)!=0 ) m_markupLanguage = HTML; } #include "visualframeeditor.moc" diff --git a/quanta/components/framewizard/visualframeeditor.h b/quanta/components/framewizard/visualframeeditor.h index 27cef614..c3b28b7b 100644 --- a/quanta/components/framewizard/visualframeeditor.h +++ b/quanta/components/framewizard/visualframeeditor.h @@ -29,6 +29,7 @@ class VisualFrameEditor : public TQHBox { Q_OBJECT + TQ_OBJECT private: enum MarkupLanguage{XHTML,HTML}; tree *m_internalTree; @@ -36,9 +37,9 @@ class VisualFrameEditor : public TQHBox { TQStringList m_existingStructure; MarkupLanguage m_markupLanguage; - void buildInternalTree(const TQString &parent); + void buildInternalTree(const TQString &tqparent); void setGeometries(const TQString &l); - void drawGUI(treeNode *n, TQWidget* parent); + void drawGUI(treeNode *n, TQWidget* tqparent); TQStringList convertAsterisks(const TQString &s, int d); TQString createFrameTag(areaAttribute *a); @@ -47,9 +48,9 @@ class VisualFrameEditor : public TQHBox { void createStructure(treeNode* n); public: - VisualFrameEditor( TQWidget * parent = 0, const char * name = 0); + VisualFrameEditor( TQWidget * tqparent = 0, const char * name = 0); ~VisualFrameEditor(); - void draw() { repaint(); } + void draw() { tqrepaint(); } void loadExistingStructure(const TQStringList &list); TQString framesetStructure(); void removeNode(const TQString &l); -- cgit v1.2.1