summaryrefslogtreecommitdiffstats
path: root/kommander/editor/resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/resource.cpp')
-rw-r--r--kommander/editor/resource.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp
index 93f6cc9b..81824fc6 100644
--- a/kommander/editor/resource.cpp
+++ b/kommander/editor/resource.cpp
@@ -27,7 +27,7 @@
#include "tqdom.h"
#include "widgetdatabase.h"
#include "widgetfactory.h"
-#include "tqlayout.h"
+#include "layout.h"
#include "domtool.h"
#include "command.h"
#include "pixmapchooser.h"
@@ -43,7 +43,7 @@
#include <tqfeatures.h>
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqobject.h>
#include <tqwidget.h>
#include <tqobjectlist.h>
@@ -52,7 +52,7 @@
#include <tqtabwidget.h>
#include <tqapplication.h>
#include <tqbuffer.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
#include <tqlistbox.h>
@@ -64,7 +64,7 @@
#include <tqiconview.h>
#include <tqlabel.h>
#include <tqwizard.h>
-#include <tqtextcodec.h>
+#include <textcodec.h>
#include <tqregexp.h>
#include <zlib.h>
#include <tqdatetime.h>
@@ -401,13 +401,13 @@ bool Resource::load( FormFile *ff, TQIODevice* dev )
if ( formwindow ) {
formwindow->killAccels( TQT_TQOBJECT(formwindow) );
- if ( formwindow->tqlayout() )
- formwindow->tqlayout()->activate();
+ if ( formwindow->layout() )
+ formwindow->layout()->activate();
if ( hadGeometry )
- formwindow->resize( formwindow->size().expandedTo( formwindow->tqminimumSize().
- expandedTo( formwindow->tqminimumSizeHint() ) ) );
+ formwindow->resize( formwindow->size().expandedTo( formwindow->minimumSize().
+ expandedTo( formwindow->minimumSizeHint() ) ) );
else
- formwindow->resize( formwindow->size().expandedTo( formwindow->tqsizeHint() ) );
+ formwindow->resize( formwindow->size().expandedTo( formwindow->sizeHint() ) );
}
return true;
@@ -931,17 +931,17 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent )
{
const TQObjectList l = obj->childrenListObject();
if ( l.isEmpty() )
- return; // no tqchildren to save
+ return; // no children to save
TQString closeTag;
- // if the widget has a tqlayout we pretend that all widget's childs are childs of the tqlayout - makes the structure nicer
- TQLayout *tqlayout = 0;
+ // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer
+ TQLayout *layout = 0;
QDesignerGridLayout* grid = 0;
if ( !obj->inherits( TQSPLITTER_OBJECT_NAME_STRING ) &&
WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) &&
obj->isWidgetType() &&
- WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) {
- WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, tqlayout );
+ WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) {
+ WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, layout );
switch ( lay ) {
case WidgetFactory::HBox:
closeTag = makeIndent( indent ) + "</hbox>";
@@ -957,15 +957,15 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent )
closeTag = makeIndent( indent ) + "</grid>";
ts << makeIndent( indent ) << "<grid>" << endl;
++indent;
- grid = (QDesignerGridLayout*) tqlayout;
+ grid = (QDesignerGridLayout*) layout;
break;
default:
break;
}
- // save properties of tqlayout
+ // save properties of layout
if ( lay != WidgetFactory::NoLayout )
- saveObjectProperties( TQT_TQOBJECT(tqlayout), ts, indent );
+ saveObjectProperties( TQT_TQOBJECT(layout), ts, indent );
}
@@ -984,8 +984,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
changed = MetaDataBase::changedProperties( w );
if ( w->isWidgetType() ) {
if ( w->inherits( "Spacer" ) ) {
- if ( !changed.contains( "tqsizeHint" ) )
- changed << "tqsizeHint";
+ if ( !changed.contains( "sizeHint" ) )
+ changed << "sizeHint";
if ( !changed.contains( "geometry" ) )
changed << "geometry";
}
@@ -1006,15 +1006,15 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
bool inLayout = TQT_BASE_OBJECT(w) != TQT_BASE_OBJECT(formwindow->mainContainer()) && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() &&
WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
- TQStrList lst = w->tqmetaObject()->propertyNames( !w->inherits( "Spacer" ) );
+ TQStrList lst = w->metaObject()->propertyNames( !w->inherits( "Spacer" ) );
for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) {
- if ( changed.find( TQString::tqfromLatin1( it.current() ) ) == changed.end() )
+ if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() )
continue;
- if ( saved.find( TQString::tqfromLatin1( it.current() ) ) != saved.end() )
+ if ( saved.find( TQString::fromLatin1( it.current() ) ) != saved.end() )
continue;
- saved << TQString::tqfromLatin1( it.current() );
- const TQMetaProperty* p = w->tqmetaObject()->
- property( w->tqmetaObject()->findProperty( it.current(), true ), true );
+ saved << TQString::fromLatin1( it.current() );
+ const TQMetaProperty* p = w->metaObject()->
+ property( w->metaObject()->findProperty( it.current(), true ), true );
if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) )
continue;
if ( w->inherits( TQLABEL_OBJECT_NAME_STRING ) && qstrcmp( p->name(), "pixmap" ) == 0 &&
@@ -1066,7 +1066,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent )
{
- const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true );
+ const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true );
TQStrList l( p->valueToKeys( w->property( name ).toInt() ) );
TQString v;
for ( uint i = 0; i < l.count(); ++i ) {
@@ -1079,7 +1079,7 @@ void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Ty
void Resource::saveEnumProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent )
{
- const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true );
+ const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true );
ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl;
}
@@ -1240,7 +1240,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant
ts << makeIndent( indent ) << "</palette>" << endl;
} break;
case TQVariant::Cursor:
- ts << makeIndent( indent ) << "<cursor>" << value.toCursor().tqshape() << "</cursor>" << endl;
+ ts << makeIndent( indent ) << "<cursor>" << value.toCursor().shape() << "</cursor>" << endl;
break;
case TQVariant::StringList: {
TQStringList lst = value.toStringList();
@@ -1303,7 +1303,7 @@ void Resource::saveColorGroup( TQTextStream &ts, int indent, const TQColorGroup
saveColor( ts, indent, cg.color( (TQColorGroup::ColorRole)r ) );
indent--;
ts << makeIndent( indent ) << "</color>" << endl;
- TQPixmap* pm = cg.tqbrush( (TQColorGroup::ColorRole)r ).pixmap();
+ TQPixmap* pm = cg.brush( (TQColorGroup::ColorRole)r ).pixmap();
if ( pm && !pm->isNull() )
savePixmap( *pm, ts, indent );
}
@@ -1316,7 +1316,7 @@ void Resource::saveColor( TQTextStream &ts, int indent, const TQColor &c )
ts << makeIndent( indent ) << "<blue>" << TQString::number( c.blue() ) << "</blue>" << endl;
}
-TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout )
+TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* layout )
{
lastItem = 0;
TQDomElement n = e.firstChild().toElement();
@@ -1346,16 +1346,16 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
w = (TQWidget*)obj;
if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget();
- if ( tqlayout ) {
- switch ( WidgetFactory::layoutType( tqlayout ) ) {
+ if ( layout ) {
+ switch ( WidgetFactory::layoutType( layout ) ) {
case WidgetFactory::HBox:
- ( (TQHBoxLayout*)tqlayout )->addWidget( w );
+ ( (TQHBoxLayout*)layout )->addWidget( w );
break;
case WidgetFactory::VBox:
- ( (TQVBoxLayout*)tqlayout )->addWidget( w );
+ ( (TQVBoxLayout*)layout )->addWidget( w );
break;
case WidgetFactory::Grid:
- ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ ( (QDesignerGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1,
col, col + colspan - 1 );
break;
default:
@@ -1365,7 +1365,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
if ( !toplevel )
toplevel = w;
- tqlayout = 0;
+ layout = 0;
if ( w && formwindow ) {
if ( !parent || ( !parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) && !parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) )
@@ -1379,22 +1379,22 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
while ( !n.isNull() ) {
if ( n.tagName() == "spacer" ) {
- createSpacer( n, w, tqlayout, Qt::Horizontal );
+ createSpacer( n, w, layout, Qt::Horizontal );
} else if ( n.tagName() == "widget" ) {
- createObject( n, w, tqlayout );
+ createObject( n, w, layout );
} else if ( n.tagName() == "hbox" ) {
- tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::HBox );
- obj = TQT_TQOBJECT(tqlayout);
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox );
+ obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
continue;
} else if ( n.tagName() == "grid" ) {
- tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::Grid );
- obj = TQT_TQOBJECT(tqlayout);
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid );
+ obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
continue;
} else if ( n.tagName() == "vbox" ) {
- tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::VBox );
- obj = TQT_TQOBJECT(tqlayout);
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox );
+ obj = TQT_TQOBJECT(layout);
n = n.firstChild().toElement();
continue;
} else if ( n.tagName() == "property" && obj ) {
@@ -1605,7 +1605,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt
}
}
-TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *tqlayout, Qt::Orientation o )
+TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, Qt::Orientation o )
{
TQDomElement n = e.firstChild().toElement();
int row = e.attribute( "row" ).toInt();
@@ -1629,12 +1629,12 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay
spacer->setInteraciveMode( true );
if ( formwindow )
formwindow->insertWidget( spacer, pasting );
- if ( tqlayout ) {
- if ( tqlayout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
- ( (TQBoxLayout*)tqlayout )->addWidget( spacer, 0, spacer->tqalignment() );
+ if ( layout ) {
+ if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
+ ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() );
else
- ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1,
- spacer->tqalignment() );
+ ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1,
+ spacer->alignment() );
}
return spacer;
}
@@ -1644,7 +1644,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay
*/
void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQDomElement &e )
{
- const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->findProperty( prop, true ), true );
+ const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true );
if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no layouts in metadatabase... (RS)
if ( obj->inherits( "CustomWidget" ) ) {
@@ -2090,8 +2090,8 @@ void Resource::saveCustomWidgets( TQTextStream &ts, int indent )
<< "\">" << w->includeFile << "</header>" << endl;
ts << makeIndent( indent ) << "<sizehint>" << endl;
indent++;
- ts << makeIndent( indent ) << "<width>" << w->tqsizeHint.width() << "</width>" << endl;
- ts << makeIndent( indent ) << "<height>" << w->tqsizeHint.height() << "</height>" << endl;
+ ts << makeIndent( indent ) << "<width>" << w->sizeHint.width() << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << w->sizeHint.height() << "</height>" << endl;
indent--;
ts << makeIndent( indent ) << "</sizehint>" << endl;
ts << makeIndent( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl;
@@ -2147,9 +2147,9 @@ void Resource::loadCustomWidgets( const TQDomElement &e, Resource *r )
TQDomElement n3 = n2.firstChild().toElement();
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
- w->tqsizeHint.setWidth( n3.firstChild().toText().data().toInt() );
+ w->sizeHint.setWidth( n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "height" )
- w->tqsizeHint.setHeight( n3.firstChild().toText().data().toInt() );
+ w->sizeHint.setHeight( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
} else if ( n2.tagName() == "sizepolicy" ) {