summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/resource.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:51:21 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:51:21 -0600
commitb6ba5d642f3fc7d320e3d6f4650eb259a3a52b04 (patch)
tree76f49820693d443128d3720322ff1605e9bcd558 /kdevdesigner/designer/resource.cpp
parent247f828db1b8dcdc9346c1568d81cfa00db99c9e (diff)
downloadtdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.tar.gz
tdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r--kdevdesigner/designer/resource.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp
index 0d83cb1e..12b4e490 100644
--- a/kdevdesigner/designer/resource.cpp
+++ b/kdevdesigner/designer/resource.cpp
@@ -54,7 +54,7 @@
#include <tqheader.h>
#include <tqiconview.h>
#include <tqlabel.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqlistbox.h>
#include <tqlistview.h>
#include <tqmenudata.h>
@@ -69,8 +69,8 @@
#endif
#include <tqtabwidget.h>
#include <tqtabwidget.h>
-#include <tqtextcodec.h>
-#include <tqtextstream.h>
+#include <textcodec.h>
+#include <textstream.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
#include <tqwidget.h>
@@ -225,7 +225,7 @@ static TQString platformNeutralKeySequence(const TQKeySequence &ks)
// represent, but is clearly impossible to trigger...
p = TQChar(basekey & 0xffff);
} else if ( basekey >= TQt::Key_F1 && basekey <= TQt::Key_F35 ) {
- p = TQAccel::tr( "F%1" ).tqarg(basekey - TQt::Key_F1 + 1);
+ p = TQAccel::tr( "F%1" ).arg(basekey - TQt::Key_F1 + 1);
} else if ( basekey > TQt::Key_Space && basekey <= TQt::Key_AsciiTilde ) {
p.sprintf( "%c", basekey );
} else {
@@ -238,7 +238,7 @@ static TQString platformNeutralKeySequence(const TQKeySequence &ks)
++i;
}
// If we can't find the actual translatable keyname,
- // fall back on the tqunicode representation of it...
+ // fall back on the unicode representation of it...
// Or else characters like Key_aring may not get displayed
// ( Really depends on you locale )
if ( !keyname[i].name )
@@ -622,13 +622,13 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject )
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;
@@ -1054,14 +1054,14 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
MetaDataBase::CustomWidget *cw = new MetaDataBase::CustomWidget;
cw->className = className;
cw->includeFile = WidgetDatabase::includeFile( classID );
- TQStrList lst = w->tqmetaObject()->signalNames( TRUE );
+ TQStrList lst = w->metaObject()->signalNames( TRUE );
for ( TQPtrListIterator<char> it(lst); it.current(); ++it )
cw->lstSignals.append(it.current());
int i;
- int total = w->tqmetaObject()->numProperties( TRUE );
+ int total = w->metaObject()->numProperties( TRUE );
for ( i = 0; i < total; i++ ) {
- const TQMetaProperty *p = w->tqmetaObject()->property( i, TRUE );
+ const TQMetaProperty *p = w->metaObject()->property( i, TRUE );
if ( p->designable(w) ) {
MetaDataBase::Property prop;
prop.property = p->name();
@@ -1079,9 +1079,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea
}
}
- total = w->tqmetaObject()->numSlots( TRUE );
+ total = w->metaObject()->numSlots( TRUE );
for ( i = 0; i < total; i++ ) {
- const TQMetaData *md = w->tqmetaObject()->slot( i, TRUE );
+ const TQMetaData *md = w->metaObject()->slot( i, TRUE );
MetaDataBase::Function funky;
// Find out if we have a return type.
if ( md->method->count > 0 ) {
@@ -1344,17 +1344,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 ( !::tqqt_cast<TQSplitter*>(obj) &&
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>";
@@ -1370,15 +1370,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 );
}
@@ -1399,8 +1399,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent )
changed = MetaDataBase::changedProperties( w );
if ( w->isWidgetType() ) {
if ( ::tqqt_cast<Spacer*>(w) ) {
- if ( !changed.contains( "tqsizeHint" ) )
- changed << "tqsizeHint";
+ if ( !changed.contains( "sizeHint" ) )
+ changed << "sizeHint";
if ( !changed.contains( "geometry" ) )
changed << "geometry";
} else {
@@ -1432,15 +1432,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( !::tqqt_cast<Spacer*>(w) );
+ TQStrList lst = w->metaObject()->propertyNames( !::tqqt_cast<Spacer*>(w) );
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 ( ::tqqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 &&
@@ -1496,7 +1496,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 ) {
@@ -1509,7 +1509,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;
}
@@ -1680,7 +1680,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();
@@ -1743,7 +1743,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 );
}
@@ -1756,7 +1756,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();
@@ -1787,7 +1787,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
TQMessageBox::critical( MainWindow::self, i18n( "Loading File" ),
i18n( "Error loading %1.\n"
"The widget %2 could not be created." ).
- tqarg( currFileName ).tqarg( className ) );
+ arg( currFileName ).arg( className ) );
return 0;
}
if ( !mainContainerSet ) {
@@ -1798,16 +1798,16 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
w = (TQWidget*)obj;
if ( ::tqqt_cast<TQMainWindow*>(w) )
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:
@@ -1817,7 +1817,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay
if ( !toplevel )
toplevel = w;
- tqlayout = 0;
+ layout = 0;
if ( w && formwindow ) {
if ( !parent ||
@@ -1848,22 +1848,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 ) {
@@ -2104,7 +2104,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();
@@ -2128,12 +2128,12 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay
spacer->setInteraciveMode( TRUE );
if ( formwindow )
formwindow->insertWidget( spacer, pasting );
- if ( tqlayout ) {
- if ( ::tqqt_cast<TQBoxLayout*>(tqlayout) )
- ( (TQBoxLayout*)tqlayout )->addWidget( spacer, 0, spacer->tqalignment() );
+ if ( layout ) {
+ if ( ::tqqt_cast<TQBoxLayout*>(layout) )
+ ( (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;
}
@@ -2143,7 +2143,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 ( !::tqqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS)
if ( obj->inherits( "CustomWidget" ) ) {
@@ -2591,8 +2591,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;
@@ -2648,9 +2648,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" ) {
@@ -2897,9 +2897,9 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent )
TQString s = "";
TQString m = "";
if ( !formwindow->spacingFunction().isEmpty() )
- s = TQString( " spacing=\"%1\"" ).tqarg( formwindow->spacingFunction() );
+ s = TQString( " spacing=\"%1\"" ).arg( formwindow->spacingFunction() );
if ( !formwindow->marginFunction().isEmpty() )
- m = TQString( " margin=\"%1\"" ).tqarg( formwindow->marginFunction() );
+ m = TQString( " margin=\"%1\"" ).arg( formwindow->marginFunction() );
ts << makeIndent( indent ) << "<layoutfunctions" << s << m << "/>" << endl;
}
}