summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-05-23 22:57:29 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-05-23 22:57:29 +0900
commitcfc76de73cecd5c569cbec280fe8aaa680956df3 (patch)
tree294561f215a17658f23eac128312542ab30721f1
parente9567cacadf2fdc305f3ddbebce43ef395368c51 (diff)
downloadtqt3-cfc76de7.tar.gz
tqt3-cfc76de7.zip
Removed dummy int parameter from TQVariant(bool, int).
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--src/kernel/ntqvariant.h3
-rw-r--r--src/kernel/qucomextra.cpp2
-rw-r--r--src/kernel/qvariant.cpp8
-rw-r--r--src/moc/moc.y10
-rw-r--r--src/moc/moc_yacc.cpp10
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp2
-rw-r--r--src/widgets/qdialogbuttons.cpp6
-rw-r--r--tools/designer/designer/mainwindow.cpp8
-rw-r--r--tools/designer/designer/propertyeditor.cpp16
-rw-r--r--tools/designer/designer/widgetfactory.cpp4
-rw-r--r--tools/designer/plugins/dlg/dlg2ui.cpp4
-rw-r--r--tools/designer/plugins/glade/glade2ui.cpp20
-rw-r--r--tools/designer/shared/domtool.cpp2
-rw-r--r--tools/designer/uic/form.cpp2
-rw-r--r--tools/designer/uic/object.cpp2
-rw-r--r--tools/designer/uic/uic.cpp2
-rw-r--r--tools/designer/uilib/qwidgetfactory.cpp2
17 files changed, 48 insertions, 55 deletions
diff --git a/src/kernel/ntqvariant.h b/src/kernel/ntqvariant.h
index f794eeb1..1d5206d9 100644
--- a/src/kernel/ntqvariant.h
+++ b/src/kernel/ntqvariant.h
@@ -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 );
diff --git a/src/kernel/qucomextra.cpp b/src/kernel/qucomextra.cpp
index 1bb064ca..53af84de 100644
--- a/src/kernel/qucomextra.cpp
+++ b/src/kernel/qucomextra.cpp
@@ -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 ) )
diff --git a/src/kernel/qvariant.cpp b/src/kernel/qvariant.cpp
index 6d734d6b..f7479fb6 100644
--- a/src/kernel/qvariant.cpp
+++ b/src/kernel/qvariant.cpp
@@ -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;
diff --git a/src/moc/moc.y b/src/moc/moc.y
index 49fcc61f..cfd8af0c 100644
--- a/src/moc/moc.y
+++ b/src/moc/moc.y
@@ -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);
}
diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp
index f2a5c53b..f5c59d84 100644
--- a/src/moc/moc_yacc.cpp
+++ b/src/moc/moc_yacc.cpp
@@ -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);
}
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 8e2c02ad..b6466e89 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -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:
diff --git a/src/widgets/qdialogbuttons.cpp b/src/widgets/qdialogbuttons.cpp
index c248d2e0..fd3d5c4c 100644
--- a/src/widgets/qdialogbuttons.cpp
+++ b/src/widgets/qdialogbuttons.cpp
@@ -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);
diff --git a/tools/designer/designer/mainwindow.cpp b/tools/designer/designer/mainwindow.cpp
index f80cf602..5e4a4678 100644
--- a/tools/designer/designer/mainwindow.cpp
+++ b/tools/designer/designer/mainwindow.cpp
@@ -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 );
diff --git a/tools/designer/designer/propertyeditor.cpp b/tools/designer/designer/propertyeditor.cpp
index b3448a8d..31908b3e 100644
--- a/tools/designer/designer/propertyeditor.cpp
+++ b/tools/designer/designer/propertyeditor.cpp
@@ -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" ) {
diff --git a/tools/designer/designer/widgetfactory.cpp b/tools/designer/designer/widgetfactory.cpp
index 53fa747c..2bcf1886 100644
--- a/tools/designer/designer/widgetfactory.cpp
+++ b/tools/designer/designer/widgetfactory.cpp
@@ -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 );
}
diff --git a/tools/designer/plugins/dlg/dlg2ui.cpp b/tools/designer/plugins/dlg/dlg2ui.cpp
index e44c285f..23e18063 100644
--- a/tools/designer/plugins/dlg/dlg2ui.cpp
+++ b/tools/designer/plugins/dlg/dlg2ui.cpp
@@ -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") ) {
diff --git a/tools/designer/plugins/glade/glade2ui.cpp b/tools/designer/plugins/glade/glade2ui.cpp
index 4d4eae25..b1bbe9ca 100644
--- a/tools/designer/plugins/glade/glade2ui.cpp
+++ b/tools/designer/plugins/glade/glade2ui.cpp
@@ -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" );
diff --git a/tools/designer/shared/domtool.cpp b/tools/designer/shared/domtool.cpp
index 4baf1941..499ee562 100644
--- a/tools/designer/shared/domtool.cpp
+++ b/tools/designer/shared/domtool.cpp
@@ -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" ) {
diff --git a/tools/designer/uic/form.cpp b/tools/designer/uic/form.cpp
index 5c564c9d..198f2c08 100644
--- a/tools/designer/uic/form.cpp
+++ b/tools/designer/uic/form.cpp
@@ -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" ) )
diff --git a/tools/designer/uic/object.cpp b/tools/designer/uic/object.cpp
index 82aabee3..1306e9c0 100644
--- a/tools/designer/uic/object.cpp
+++ b/tools/designer/uic/object.cpp
@@ -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();
diff --git a/tools/designer/uic/uic.cpp b/tools/designer/uic/uic.cpp
index 305f7133..c3880271 100644
--- a/tools/designer/uic/uic.cpp
+++ b/tools/designer/uic/uic.cpp
@@ -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;
}
diff --git a/tools/designer/uilib/qwidgetfactory.cpp b/tools/designer/uilib/qwidgetfactory.cpp
index a0bc0852..6d901446 100644
--- a/tools/designer/uilib/qwidgetfactory.cpp
+++ b/tools/designer/uilib/qwidgetfactory.cpp
@@ -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();