Removed dummy int parameter from TQVariant(bool, int).

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/8/head
Michele Calgaro 5 years ago
parent e9567cacad
commit cfc76de73c
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -167,8 +167,7 @@ public:
TQVariant( uint );
TQVariant( TQ_LLONG );
TQVariant( TQ_ULLONG );
// ### Problems on some compilers ?
TQVariant( bool, int );
TQVariant( bool );
TQVariant( double );
TQVariant( TQSizePolicy );

@ -85,7 +85,7 @@ bool TQUType_TQVariant::convertFrom( TQUObject *o, TQUType *t )
else if ( isEqual( o->type, &static_QUType_int ) )
var = new TQVariant( static_QUType_int.get( o ) );
else if ( isEqual( o->type, &static_QUType_bool ) )
var = new TQVariant( static_QUType_bool.get( o ), 42 );
var = new TQVariant( static_QUType_bool.get( o ) );
else if ( isEqual( o->type, &static_QUType_double ) )
var = new TQVariant( static_QUType_double.get( o ) );
else if ( isEqual( o->type, &static_QUType_charstar ) )

@ -877,12 +877,10 @@ TQVariant::TQVariant( TQ_ULLONG val )
}
/*!
Constructs a new variant with a boolean value, \a val. The integer
argument is a dummy, necessary for compatibility with some
compilers.
Constructs a new variant with a boolean value, \a val.
*/
TQVariant::TQVariant( bool val, int )
{ // this is the comment that does NOT name said compiler.
TQVariant::TQVariant( bool val )
{
d = new Private;
d->typ = Bool;
d->value.b = val;

@ -3441,16 +3441,14 @@ void generateClass() // generate C++ source code for a class
}
if ( it.current()->getfunc ) {
if ( it.current()->gspec == Property::Pointer )
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n",
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s() ); break;\n",
it.current()->getfunc->name.data(),
!isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(),
it.current()->type == "bool" ? ", 0" : "" );
it.current()->getfunc->name.data());
else
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n",
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s() ); break;\n",
!isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(),
it.current()->type == "bool" ? ", 0" : "" );
it.current()->getfunc->name.data());
} else if ( it.current()->override ) {
flag_propagate |= 1<< (1+1);
}

@ -6316,16 +6316,14 @@ void generateClass() // generate C++ source code for a class
}
if ( it.current()->getfunc ) {
if ( it.current()->gspec == Property::Pointer )
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n",
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s() ); break;\n",
it.current()->getfunc->name.data(),
!isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(),
it.current()->type == "bool" ? ", 0" : "" );
it.current()->getfunc->name.data());
else
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n",
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s() ); break;\n",
!isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(),
it.current()->type == "bool" ? ", 0" : "" );
it.current()->getfunc->name.data());
} else if ( it.current()->override ) {
flag_propagate |= 1<< (1+1);
}

@ -288,7 +288,7 @@ TQVariant TQPSQLResult::data( int i )
switch ( type ) {
case TQVariant::Bool:
{
TQVariant b ( (bool)(val == "t"), 0 );
TQVariant b ( (bool)(val == "t") );
return ( b );
}
case TQVariant::String:

@ -185,12 +185,12 @@ TQDialogButtons::setDefaultButton(Button button)
if(d->def != button) {
#ifndef TQT_NO_PROPERTIES
if(d->buttons.contains(d->def))
d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0));
d->buttons[d->def]->setProperty("default", TQVariant(false));
#endif
d->def = button;
#ifndef TQT_NO_PROPERTIES
if(d->buttons.contains(d->def))
d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0));
d->buttons[d->def]->setProperty("default", TQVariant(false));
#endif
}
}
@ -413,7 +413,7 @@ TQDialogButtons::layoutButtons()
if(b == d->def) {
w->setFocus();
#ifndef TQT_NO_PROPERTIES
w->setProperty("default", TQVariant(TRUE,0));
w->setProperty("default", TQVariant(true));
#endif
}
w->setEnabled(d->enabled & b);

@ -1740,8 +1740,8 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
if ( oldDoWrap != doWrap ) {
TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
"wordwrap", TQVariant( oldDoWrap, 0 ),
TQVariant( doWrap, 0 ), TQString::null, TQString::null );
"wordwrap", TQVariant( oldDoWrap ),
TQVariant( doWrap ), TQString::null, TQString::null );
cmd->execute();
formWindow()->commandHistory()->addCommand( cmd );
MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
@ -2647,8 +2647,8 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
if ( oldDoWrap != doWrap ) {
TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
"wordwrap", TQVariant( oldDoWrap, 0 ),
TQVariant( doWrap, 0 ), TQString::null, TQString::null );
"wordwrap", TQVariant( oldDoWrap ),
TQVariant( doWrap ), TQString::null, TQString::null );
cmd->execute();
formWindow()->commandHistory()->addCommand( cmd );
MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );

@ -1103,7 +1103,7 @@ PropertyBoolItem::~PropertyBoolItem()
void PropertyBoolItem::toggle()
{
bool b = value().toBool();
setValue( TQVariant( !b, 0 ) );
setValue( TQVariant( !b ) );
setValue();
}
@ -1158,7 +1158,7 @@ void PropertyBoolItem::setValue()
return;
setText( 1, combo()->currentText() );
bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE;
PropertyItem::setValue( TQVariant( b, 0 ) );
PropertyItem::setValue( TQVariant( b ) );
notifyValueChange();
}
@ -1900,13 +1900,13 @@ void PropertyFontItem::initChildren()
} else if ( item->name() == tr( "Point Size" ) )
item->setValue( val.toFont().pointSize() );
else if ( item->name() == tr( "Bold" ) )
item->setValue( TQVariant( val.toFont().bold(), 0 ) );
item->setValue( TQVariant( val.toFont().bold() ) );
else if ( item->name() == tr( "Italic" ) )
item->setValue( TQVariant( val.toFont().italic(), 0 ) );
item->setValue( TQVariant( val.toFont().italic() ) );
else if ( item->name() == tr( "Underline" ) )
item->setValue( TQVariant( val.toFont().underline(), 0 ) );
item->setValue( TQVariant( val.toFont().underline() ) );
else if ( item->name() == tr( "Strikeout" ) )
item->setValue( TQVariant( val.toFont().strikeOut(), 0 ) );
item->setValue( TQVariant( val.toFont().strikeOut() ) );
}
}
@ -3702,9 +3702,9 @@ void PropertyList::setPropertyValue( PropertyItem *i )
} else if ( i->name() == "wordwrap" ) {
int align = editor->widget()->property( "alignment" ).toInt();
if ( align & WordBreak )
i->setValue( TQVariant( TRUE, 0 ) );
i->setValue( TQVariant( true ) );
else
i->setValue( TQVariant( FALSE, 0 ) );
i->setValue( TQVariant( false ) );
} else if ( i->name() == "layoutSpacing" ) {
( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
} else if ( i->name() == "layoutMargin" ) {

@ -1486,13 +1486,13 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
{
if ( propName == "wordwrap" ) {
int v = defaultValue( w, "alignment" ).toInt();
return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
return TQVariant( ( v & WordBreak ) == WordBreak );
} else if ( propName == "toolTip" || propName == "whatsThis" ) {
return TQVariant( TQString::fromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) {
return TQVariant();
} else if ( propName == "frameworkCode" ) {
return TQVariant( TRUE, 0 );
return TQVariant( true );
} else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
return TQVariant( -1 );
}

@ -718,7 +718,7 @@ void Dlg2Ui::emitWidgetBody( const TQDomElement& e, bool layouted )
if ( tagName == TQString("Style") ) {
if ( getTextValue(n) == TQString("ReadWrite") )
emitProperty( TQString("editable"),
TQVariant(TRUE, 0) );
TQVariant(true) );
}
} else if ( parentTagName == TQString("DlgWidget") ) {
if ( tagName == TQString("Name") ) {
@ -891,7 +891,7 @@ TQVariant Dlg2Ui::getValue( const TQDomElement& e, const TQString& tagName,
if ( type == TQString("integer") ) {
return getTextValue( e ).toInt();
} else if ( type == TQString("boolean") ) {
return TQVariant( isTrue(getTextValue(e)), 0 );
return TQVariant( isTrue(getTextValue(e)) );
} else if ( type == TQString("double") ) {
return getTextValue( e ).toDouble();
} else if ( type == TQString("qcstring") ) {

@ -839,7 +839,7 @@ void Glade2Ui::emitPushButton( const TQString& text, const TQString& name )
emitProperty( TQString("name"), name.latin1() );
emitProperty( TQString("text"), text );
if ( name.contains(TQString("ok")) > 0 ) {
emitProperty( TQString("default"), TQVariant(TRUE, 0) );
emitProperty( TQString("default"), TQVariant(true) );
} else if ( name.contains(TQString("help")) > 0 ) {
emitProperty( TQString("accel"), (int) TQt::Key_F1 );
}
@ -1215,7 +1215,7 @@ void Glade2Ui::emitTQListViewColumns( const TQDomElement& qlistview )
} else if ( tagName == TQString("class") ) {
TQString gtkClass = getTextValue( n );
if ( gtkClass.endsWith(TQString("Tree")) )
emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) );
emitProperty( TQString("rootIsDecorated"), TQVariant(true) );
} else if ( tagName == TQString("selection_mode") ) {
emitProperty( TQString("selectionMode"),
gtk2qtSelectionMode(getTextValue(n)) );
@ -1815,16 +1815,16 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
if ( !layouted && (x != 0 || y != 0 || width != 0 || height != 0) )
emitProperty( TQString("geometry"), TQRect(x, y, width, height) );
if ( gtkClass == TQString("GtkToggleButton") ) {
emitProperty( TQString("toggleButton"), TQVariant(TRUE, 0) );
emitProperty( TQString("toggleButton"), TQVariant(true) );
if ( active )
emitProperty( TQString("on"), TQVariant(TRUE, 0) );
emitProperty( TQString("on"), TQVariant(true) );
} else {
if ( active )
emitProperty( TQString("checked"), TQVariant(TRUE, 0) );
emitProperty( TQString("checked"), TQVariant(true) );
}
if ( !editable )
emitProperty( TQString("readOnly"), TQVariant(TRUE, 0) );
emitProperty( TQString("readOnly"), TQVariant(true) );
if ( !focusTarget.isEmpty() )
emitProperty( TQString("buddy"),
fixedName(focusTarget).latin1() );
@ -1889,7 +1889,7 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
}
if ( !showText )
emitProperty( TQString("percentageVisible"),
TQVariant(FALSE, 0) );
TQVariant(false) );
if ( step != 1 )
emitProperty( TQString("lineStep"), step );
if ( tabPos.endsWith(TQString("_BOTTOM")) ||
@ -1905,12 +1905,12 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
if ( !tooltip.isEmpty() )
emitProperty( TQString("toolTip"), tooltip );
if ( !valueInList )
emitProperty( TQString("editable"), TQVariant(TRUE, 0) );
emitProperty( TQString("editable"), TQVariant(true) );
if ( wrap && gtkClass == TQString("GtkSpinButton") )
emitProperty( TQString("wrapping"), TQVariant(TRUE, 0) );
emitProperty( TQString("wrapping"), TQVariant(true) );
if ( gtkClass.endsWith(TQString("Tree")) ) {
emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) );
emitProperty( TQString("rootIsDecorated"), TQVariant(true) );
} else if ( gtkOrientedWidget.exactMatch(gtkClass) ) {
TQString s = ( gtkOrientedWidget.cap(1) == TQChar('H') ) ?
TQString( "Horizontal" ) : TQString( "Vertical" );

@ -199,7 +199,7 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
v = TQVariant( e.firstChild().toText().data().toDouble() );
} else if ( e.tagName() == "bool" ) {
TQString t = e.firstChild().toText().data();
v = TQVariant( t == "true" || t == "1", 0 );
v = TQVariant( t == "true" || t == "1" );
} else if ( e.tagName() == "pixmap" ) {
v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "iconset" ) {

@ -1052,7 +1052,7 @@ void Uic::createFormImpl( const TQDomElement &e )
TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << "addPage( " << page << ", TQString(\"\") );" << endl;
trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl;
TQVariant def( FALSE, 0 );
TQVariant def( false );
if ( DomTool::hasAttribute( n, "backEnabled" ) )
out << indent << "setBackEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << endl;
if ( DomTool::hasAttribute( n, "nextEnabled" ) )

@ -537,7 +537,7 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
if ( stdset )
v = "%1";
else
v = "TQVariant( %1, 0 )";
v = "TQVariant( %1 )";
v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data();

@ -263,7 +263,7 @@ bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
{
TQDomElement n = getObjectProperty( e, "frameworkCode" );
if ( n.attribute("name") == "frameworkCode" &&
!DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE, 0 ) ).toBool() )
!DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true ) ).toBool() )
return FALSE;
return TRUE;
}

@ -637,7 +637,7 @@ void TQWidgetFactory::unpackVariant( const UibStrTable& strings, TQDataStream& i
break;
case TQVariant::Bool:
in >> bit;
value = TQVariant( bit != 0, 0 );
value = TQVariant( bit != 0 );
break;
case TQVariant::Double:
in >> value.asDouble();

Loading…
Cancel
Save