diff options
Diffstat (limited to 'tools/designer/uilib/tqwidgetfactory.cpp')
| -rw-r--r-- | tools/designer/uilib/tqwidgetfactory.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/tools/designer/uilib/tqwidgetfactory.cpp b/tools/designer/uilib/tqwidgetfactory.cpp index 02ede9a4f..d416a7e64 100644 --- a/tools/designer/uilib/tqwidgetfactory.cpp +++ b/tools/designer/uilib/tqwidgetfactory.cpp @@ -122,8 +122,8 @@ static TQStringList *availableWidgetList = 0; TQ_EXPORT TQMap<TQWidget*, TQString> *qwf_forms = 0; TQString *qwf_language = 0; -TQ_EXPORT bool qwf_execute_code = TRUE; -bool qwf_stays_on_top = FALSE; +TQ_EXPORT bool qwf_execute_code = true; +bool qwf_stays_on_top = false; TQString qwf_currFileName = ""; TQObject *qwf_form_object = 0; TQ_EXPORT TQString *qwf_plugin_dir = 0; @@ -165,7 +165,7 @@ static void setupWidgetListAndMap() availableWidgetMap = new TQMap<TQString, bool>; for ( it = availableWidgetList->begin(); it != availableWidgetList->end(); ++it ) - availableWidgetMap->insert( *it, TRUE ); + availableWidgetMap->insert( *it, true ); } static TQImage loadImageData( const TQString& format, ulong len, TQByteArray data ) @@ -254,10 +254,10 @@ static TQSizePolicy::SizeType stringToSizeType( const TQString& str ) TQWidgetFactory::TQWidgetFactory() : d( new TQWidgetFactoryPrivate() ), dbControls( 0 ), - usePixmapCollection( FALSE ), defMargin( 11 ), defSpacing( 6 ) + usePixmapCollection( false ), defMargin( 11 ), defSpacing( 6 ) { - widgetFactories.setAutoDelete( TRUE ); - d->customWidgets.setAutoDelete( TRUE ); + widgetFactories.setAutoDelete( true ); + d->customWidgets.setAutoDelete( true ); } /*! \fn TQWidgetFactory::~TQWidgetFactory() @@ -293,9 +293,9 @@ TQWidget *TQWidgetFactory::create( const TQString &uiFile, TQObject *connector, { setupPluginDir(); TQFile f( uiFile ); - bool failed = FALSE; + bool failed = false; if ( !f.open( IO_ReadOnly ) ) - failed = TRUE; + failed = true; if ( failed && tqApp->type() == TQApplication::Tty ) { // for TQSA: If we have no GUI, we have no form definition // files, but just the code. So try if only the code exists. @@ -390,10 +390,10 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge c = new TQSqlCursor( (*it)[ 1 ] ); } else { db = TQSqlDatabase::database( conn ); - c = new TQSqlCursor( (*it)[ 1 ], TRUE, db ); + c = new TQSqlCursor( (*it)[ 1 ], true, db ); } if ( db ) { - table->setSqlCursor( c, fieldMap.isEmpty(), TRUE ); + table->setSqlCursor( c, fieldMap.isEmpty(), true ); table->refresh( TQDataTable::RefreshAll ); } } @@ -466,7 +466,7 @@ TQWidget *TQWidgetFactory::createFromUiFile( TQDomDocument doc, TQObject *connec } else if ( e.tagName() == "widget" ) { widget = e; } else if ( e.tagName() == "pixmapinproject" ) { - usePixmapCollection = TRUE; + usePixmapCollection = true; } else if ( e.tagName() == "layoutdefaults" ) { defSpacing = e.attribute( "spacing", TQString::number( defSpacing ) ).toInt(); defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt(); @@ -669,7 +669,7 @@ void TQWidgetFactory::inputSpacer( const UibStrTable& strings, TQDataStream& in, TQVariant value; TQCString comment; TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred; - bool vertical = FALSE; + bool vertical = false; int w = 0; int h = 0; TQ_UINT16 column = 0; @@ -731,8 +731,8 @@ void TQWidgetFactory::inputColumnOrRow( const UibStrTable& strings, TQString text; TQPixmap pixmap; TQString field; - bool clickable = TRUE; - bool resizable = TRUE; + bool clickable = true; + bool resizable = true; TQCString name; TQVariant value; @@ -814,7 +814,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, switch ( objectTag ) { case Object_Item: if ( listView != 0 ) - d->lastItem->setOpen( TRUE ); + d->lastItem->setOpen( true ); inputItem( strings, in, parent, item ); break; case Object_TextProperty: @@ -1005,7 +1005,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, metAttribute = 2; break; case Object_Column: - inputColumnOrRow( strings, in, obj, FALSE ); + inputColumnOrRow( strings, in, obj, false ); break; case Object_Event: unpackCString( strings, in, name ); @@ -1031,13 +1031,13 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, font.setPointSize( pointSize ); } if ( fontFlags & Font_Bold ) - font.setBold( TRUE ); + font.setBold( true ); if ( fontFlags & Font_Italic ) - font.setItalic( TRUE ); + font.setItalic( true ); if ( fontFlags & Font_Underline ) - font.setUnderline( TRUE ); + font.setUnderline( true ); if ( fontFlags & Font_StrikeOut ) - font.setStrikeOut( TRUE ); + font.setStrikeOut( true ); if ( obj != 0 ) setProperty( obj, name, font ); @@ -1100,7 +1100,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, } break; case Object_Row: - inputColumnOrRow( strings, in, obj, TRUE ); + inputColumnOrRow( strings, in, obj, true ); break; case Object_Spacer: inputSpacer( strings, in, layout ); @@ -1302,7 +1302,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, unpackCString( strings, in, d->translationContext ); if ( introFlags & Intro_Pixmapinproject ) - usePixmapCollection = TRUE; + usePixmapCollection = true; if ( defaultMargin != -32768 ) defMargin = defaultMargin; if ( defaultSpacing != -32768 ) @@ -1458,7 +1458,7 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa } else if ( className == "TQTabWidget" ) { return new TQTabWidget( parent, name ); } else if ( className == "TQComboBox" ) { - return new TQComboBox( FALSE, parent, name ); + return new TQComboBox( false, parent, name ); } else if ( className == "TQWidget" ) { if ( !qwf_stays_on_top ) return new TQWidget( parent, name ); @@ -1466,7 +1466,7 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa } else if ( className == "TQDialog" ) { if ( !qwf_stays_on_top ) return new TQDialog( parent, name ); - return new TQDialog( parent, name, FALSE, TQt::WStyle_StaysOnTop ); + return new TQDialog( parent, name, false, TQt::WStyle_StaysOnTop ); } else if ( className == "TQWizard" ) { return new TQWizard( parent, name ); } else if ( className == "TQLCDNumber" ) { @@ -1545,7 +1545,7 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa if ( iface ) { TQWidget *w = iface->create( className, parent, name ); if ( w ) { - d->customWidgets.replace( className.latin1(), new bool(TRUE) ); + d->customWidgets.replace( className.latin1(), new bool(true) ); return w; } } @@ -1569,8 +1569,8 @@ TQStringList TQWidgetFactory::widgets() return *availableWidgetList; } -/*! Returns TRUE if the widget factory can create the specified \a widget; -otherwise returns FALSE. */ +/*! Returns true if the widget factory can create the specified \a widget; +otherwise returns false. */ bool TQWidgetFactory::supportsWidget( const TQString &widget ) { @@ -1597,12 +1597,12 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget if ( colspan < 1 ) colspan = 1; - bool isTQLayoutWidget = FALSE; + bool isTQLayoutWidget = false; if ( !className.isEmpty() ) { if ( !layout && className == "TQLayoutWidget" ) { className = "TQWidget"; - isTQLayoutWidget = TRUE; + isTQLayoutWidget = true; } if ( layout && className == "TQLayoutWidget" ) { // hide layout widgets @@ -1638,7 +1638,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget } #ifdef QT_CONTAINER_CUSTOM_WIDGETS TQString parentClassName = parent ? parent->className() : 0; - bool isPlugin = parent ? !!d->customWidgets.find( parent->className() ) : FALSE; + bool isPlugin = parent ? !!d->customWidgets.find( parent->className() ) : false; if ( isPlugin ) tqWarning( "####### loading custom container widgets without page support not implemented!" ); // ### TODO loading for custom container widgets without pages @@ -1819,7 +1819,7 @@ TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) cons void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop, TQVariant value ) { - int offset = obj->metaObject()->findProperty( prop, TRUE ); + int offset = obj->metaObject()->findProperty( prop, true ); if ( offset != -1 ) { if ( prop == "geometry" && obj == toplevel ) { @@ -1830,7 +1830,7 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop, if ( value.type() == TQVariant::String || value.type() == TQVariant::CString ) { const TQMetaProperty *metaProp = - obj->metaObject()->property( offset, TRUE ); + obj->metaObject()->property( offset, true ); if ( metaProp != 0 && metaProp->isEnumType() ) { if ( metaProp->isSetType() ) { TQStrList flagsCStr; @@ -2084,7 +2084,7 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto } else { if ( name == "this" ) name = toplevel->name(); - TQObjectList *l = toplevel->queryList( 0, name, FALSE ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -2100,7 +2100,7 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { conn.receiver = toplevel; } else { - TQObjectList *l = toplevel->queryList( 0, name, FALSE ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -2122,7 +2122,7 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto } TQObject *sender = 0, *receiver = 0; - TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), FALSE ); + TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), false ); if ( qstrcmp( conn.sender->name(), toplevel->name() ) == 0 ) { sender = toplevel; } else { @@ -2140,7 +2140,7 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto if ( qstrcmp( conn.receiver->name(), toplevel->name() ) == 0 ) { receiver = toplevel; } else { - l = toplevel->queryList( 0, conn.receiver->name(), FALSE ); + l = toplevel->queryList( 0, conn.receiver->name(), false ); if ( !l || !l->first() ) { delete l; n = n.nextSibling().toElement(); @@ -2155,12 +2155,12 @@ void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connecto TQString s2 = "1""%1"; s2 = s2.arg( conn.slot ); - TQStrList signalList = sender->metaObject()->signalNames( TRUE ); - TQStrList slotList = receiver->metaObject()->slotNames( TRUE ); + TQStrList signalList = sender->metaObject()->signalNames( true ); + TQStrList slotList = receiver->metaObject()->slotNames( true ); // if this is a connection to a custom slot and we have a connector, try this as receiver if ( slotList.find( conn.slot ) == -1 && receiver == toplevel && connector ) { - slotList = connector->metaObject()->slotNames( TRUE ); + slotList = connector->metaObject()->slotNames( true ); receiver = connector; } @@ -2183,7 +2183,7 @@ void TQWidgetFactory::loadTabOrder( const TQDomElement &e ) while ( !n.isNull() ) { if ( n.tagName() == "tabstop" ) { TQString name = n.firstChild().toText().data(); - TQObjectList *l = toplevel->queryList( 0, name, FALSE ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) { TQWidget *w = (TQWidget*)l->first(); @@ -2272,7 +2272,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget ) TQDomElement n = e.firstChild().toElement(); TQPixmap pix; TQString txt; - bool clickable = TRUE, resizable = TRUE; + bool clickable = true, resizable = true; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -2321,7 +2321,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget ) void TQWidgetFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap ) { TQDomElement n = e; - hasPixmap = FALSE; + hasPixmap = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -2342,7 +2342,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; - bool hasPixmap = FALSE; + bool hasPixmap = false; TQString txt; loadItem( n, pix, txt, hasPixmap ); TQListBox *lb = 0; @@ -2365,7 +2365,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis } else if ( widget->inherits( "TQIconView" ) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; - bool hasPixmap = FALSE; + bool hasPixmap = false; TQString txt; loadItem( n, pix, txt, hasPixmap ); @@ -2399,7 +2399,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis } } } else if ( n.tagName() == "item" ) { - item->setOpen( TRUE ); + item->setOpen( true ); createItem( n, widget, item ); } @@ -2420,7 +2420,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) { TQDomElement n = e; TQAction *a = 0; - bool hasMenuText = FALSE; + bool hasMenuText = false; if ( n.tagName() == "action" ) { a = new TQAction( parent ); TQDomElement n2 = n.firstChild().toElement(); @@ -2429,7 +2429,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) if ( n2.tagName() == "property" ) { TQString prop(n2.attribute("name")); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; setProperty( a, prop, n2.firstChild().toElement() ); } n2 = n2.nextSibling().toElement(); @@ -2443,7 +2443,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) if ( n2.tagName() == "property" ) { TQString prop(n2.attribute("name")); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; setProperty( a, prop, n2.firstChild().toElement() ); } else if ( n2.tagName() == "action" || n2.tagName() == "actiongroup" ) { |
