summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-05-27 00:31:56 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-05-27 00:31:56 +0900
commita2fa7ca9838e204ec41c39fcb80ee82ec93d084f (patch)
tree667608ea9bc8d1e4827077c1321ad6fa02bf8cc3
parent2c29133f7ee2a270da8d8504345390a1d60e80fa (diff)
downloadqt3-a2fa7ca9838e204ec41c39fcb80ee82ec93d084f.tar.gz
qt3-a2fa7ca9838e204ec41c39fcb80ee82ec93d084f.zip
Adjusted to latest QVariant::QVariant(bool) function.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--src/kernel/qucomextra.cpp2
-rw-r--r--src/kernel/qvariant.cpp8
-rw-r--r--src/kernel/qvariant.h3
-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/qucomextra.cpp b/src/kernel/qucomextra.cpp
index 427c29a..0ea698a 100644
--- a/src/kernel/qucomextra.cpp
+++ b/src/kernel/qucomextra.cpp
@@ -85,7 +85,7 @@ bool QUType_QVariant::convertFrom( QUObject *o, QUType *t )
else if ( isEqual( o->type, &static_QUType_int ) )
var = new QVariant( static_QUType_int.get( o ) );
else if ( isEqual( o->type, &static_QUType_bool ) )
- var = new QVariant( static_QUType_bool.get( o ), 42 );
+ var = new QVariant( static_QUType_bool.get( o ) );
else if ( isEqual( o->type, &static_QUType_double ) )
var = new QVariant( 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 c9ea5b1..99659df 100644
--- a/src/kernel/qvariant.cpp
+++ b/src/kernel/qvariant.cpp
@@ -877,12 +877,10 @@ QVariant::QVariant( Q_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.
*/
-QVariant::QVariant( bool val, int )
-{ // this is the comment that does NOT name said compiler.
+QVariant::QVariant( bool val )
+{
d = new Private;
d->typ = Bool;
d->value.b = val;
diff --git a/src/kernel/qvariant.h b/src/kernel/qvariant.h
index b2cab8d..d4b49df 100644
--- a/src/kernel/qvariant.h
+++ b/src/kernel/qvariant.h
@@ -167,8 +167,7 @@ public:
QVariant( uint );
QVariant( Q_LLONG );
QVariant( Q_ULLONG );
- // ### Problems on some compilers ?
- QVariant( bool, int );
+ QVariant( bool );
QVariant( double );
QVariant( QSizePolicy );
diff --git a/src/moc/moc.y b/src/moc/moc.y
index 90f72ab..b117b68 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 = QVariant( %s*%s()%s ); break;\n",
+ fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %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 = QVariant( %sthis->%s()%s ); break;\n",
+ fprintf( out, "\tcase 1: *v = QVariant( %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 2ab0be7..8d48f86 100644
--- a/src/moc/moc_yacc.cpp
+++ b/src/moc/moc_yacc.cpp
@@ -6267,16 +6267,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 = QVariant( %s*%s()%s ); break;\n",
+ fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %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 = QVariant( %sthis->%s()%s ); break;\n",
+ fprintf( out, "\tcase 1: *v = QVariant( %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 9d028c0..c5e93c0 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -288,7 +288,7 @@ QVariant QPSQLResult::data( int i )
switch ( type ) {
case QVariant::Bool:
{
- QVariant b ( (bool)(val == "t"), 0 );
+ QVariant b ( (bool)(val == "t") );
return ( b );
}
case QVariant::String:
diff --git a/src/widgets/qdialogbuttons.cpp b/src/widgets/qdialogbuttons.cpp
index 39f6d67..07e09cf 100644
--- a/src/widgets/qdialogbuttons.cpp
+++ b/src/widgets/qdialogbuttons.cpp
@@ -185,12 +185,12 @@ QDialogButtons::setDefaultButton(Button button)
if(d->def != button) {
#ifndef QT_NO_PROPERTIES
if(d->buttons.contains(d->def))
- d->buttons[d->def]->setProperty("default", QVariant(FALSE,0));
+ d->buttons[d->def]->setProperty("default", QVariant(false));
#endif
d->def = button;
#ifndef QT_NO_PROPERTIES
if(d->buttons.contains(d->def))
- d->buttons[d->def]->setProperty("default", QVariant(FALSE,0));
+ d->buttons[d->def]->setProperty("default", QVariant(false));
#endif
}
}
@@ -413,7 +413,7 @@ QDialogButtons::layoutButtons()
if(b == d->def) {
w->setFocus();
#ifndef QT_NO_PROPERTIES
- w->setProperty("default", QVariant(TRUE,0));
+ w->setProperty("default", QVariant(true));
#endif
}
w->setEnabled(d->enabled & b);
diff --git a/tools/designer/designer/mainwindow.cpp b/tools/designer/designer/mainwindow.cpp
index 1263c6b..4a786ed 100644
--- a/tools/designer/designer/mainwindow.cpp
+++ b/tools/designer/designer/mainwindow.cpp
@@ -1740,8 +1740,8 @@ void MainWindow::handleRMBProperties( int id, QMap<QString, int> &props, QWidget
if ( oldDoWrap != doWrap ) {
QString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
- "wordwrap", QVariant( oldDoWrap, 0 ),
- QVariant( doWrap, 0 ), QString::null, QString::null );
+ "wordwrap", QVariant( oldDoWrap ),
+ QVariant( doWrap ), QString::null, QString::null );
cmd->execute();
formWindow()->commandHistory()->addCommand( cmd );
MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
@@ -2647,8 +2647,8 @@ bool MainWindow::openEditor( QWidget *w, FormWindow *f )
if ( oldDoWrap != doWrap ) {
QString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
- "wordwrap", QVariant( oldDoWrap, 0 ),
- QVariant( doWrap, 0 ), QString::null, QString::null );
+ "wordwrap", QVariant( oldDoWrap ),
+ QVariant( doWrap ), QString::null, QString::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 98d299c..c1cde23 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( QVariant( !b, 0 ) );
+ setValue( QVariant( !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( QVariant( b, 0 ) );
+ PropertyItem::setValue( QVariant( 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( QVariant( val.toFont().bold(), 0 ) );
+ item->setValue( QVariant( val.toFont().bold() ) );
else if ( item->name() == tr( "Italic" ) )
- item->setValue( QVariant( val.toFont().italic(), 0 ) );
+ item->setValue( QVariant( val.toFont().italic() ) );
else if ( item->name() == tr( "Underline" ) )
- item->setValue( QVariant( val.toFont().underline(), 0 ) );
+ item->setValue( QVariant( val.toFont().underline() ) );
else if ( item->name() == tr( "Strikeout" ) )
- item->setValue( QVariant( val.toFont().strikeOut(), 0 ) );
+ item->setValue( QVariant( 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( QVariant( TRUE, 0 ) );
+ i->setValue( QVariant( true ) );
else
- i->setValue( QVariant( FALSE, 0 ) );
+ i->setValue( QVariant( false ) );
} else if ( i->name() == "layoutSpacing" ) {
( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ) ) );
} else if ( i->name() == "layoutMargin" ) {
diff --git a/tools/designer/designer/widgetfactory.cpp b/tools/designer/designer/widgetfactory.cpp
index 3757f5c..9ae35f4 100644
--- a/tools/designer/designer/widgetfactory.cpp
+++ b/tools/designer/designer/widgetfactory.cpp
@@ -1486,13 +1486,13 @@ QVariant WidgetFactory::defaultValue( QObject *w, const QString &propName )
{
if ( propName == "wordwrap" ) {
int v = defaultValue( w, "alignment" ).toInt();
- return QVariant( ( v & WordBreak ) == WordBreak, 0 );
+ return QVariant( ( v & WordBreak ) == WordBreak );
} else if ( propName == "toolTip" || propName == "whatsThis" ) {
return QVariant( QString::fromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) {
return QVariant();
} else if ( propName == "frameworkCode" ) {
- return QVariant( TRUE, 0 );
+ return QVariant( true );
} else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
return QVariant( -1 );
}
diff --git a/tools/designer/plugins/dlg/dlg2ui.cpp b/tools/designer/plugins/dlg/dlg2ui.cpp
index c309eb2..6b23453 100644
--- a/tools/designer/plugins/dlg/dlg2ui.cpp
+++ b/tools/designer/plugins/dlg/dlg2ui.cpp
@@ -718,7 +718,7 @@ void Dlg2Ui::emitWidgetBody( const QDomElement& e, bool layouted )
if ( tagName == QString("Style") ) {
if ( getTextValue(n) == QString("ReadWrite") )
emitProperty( QString("editable"),
- QVariant(TRUE, 0) );
+ QVariant(true) );
}
} else if ( parentTagName == QString("DlgWidget") ) {
if ( tagName == QString("Name") ) {
@@ -891,7 +891,7 @@ QVariant Dlg2Ui::getValue( const QDomElement& e, const QString& tagName,
if ( type == QString("integer") ) {
return getTextValue( e ).toInt();
} else if ( type == QString("boolean") ) {
- return QVariant( isTrue(getTextValue(e)), 0 );
+ return QVariant( isTrue(getTextValue(e)) );
} else if ( type == QString("double") ) {
return getTextValue( e ).toDouble();
} else if ( type == QString("qcstring") ) {
diff --git a/tools/designer/plugins/glade/glade2ui.cpp b/tools/designer/plugins/glade/glade2ui.cpp
index 39ff5e8..00ba9eb 100644
--- a/tools/designer/plugins/glade/glade2ui.cpp
+++ b/tools/designer/plugins/glade/glade2ui.cpp
@@ -839,7 +839,7 @@ void Glade2Ui::emitPushButton( const QString& text, const QString& name )
emitProperty( QString("name"), name.latin1() );
emitProperty( QString("text"), text );
if ( name.contains(QString("ok")) > 0 ) {
- emitProperty( QString("default"), QVariant(TRUE, 0) );
+ emitProperty( QString("default"), QVariant(true) );
} else if ( name.contains(QString("help")) > 0 ) {
emitProperty( QString("accel"), (int) Qt::Key_F1 );
}
@@ -1215,7 +1215,7 @@ void Glade2Ui::emitQListViewColumns( const QDomElement& qlistview )
} else if ( tagName == QString("class") ) {
QString gtkClass = getTextValue( n );
if ( gtkClass.endsWith(QString("Tree")) )
- emitProperty( QString("rootIsDecorated"), QVariant(TRUE, 0) );
+ emitProperty( QString("rootIsDecorated"), QVariant(true) );
} else if ( tagName == QString("selection_mode") ) {
emitProperty( QString("selectionMode"),
gtk2qtSelectionMode(getTextValue(n)) );
@@ -1815,16 +1815,16 @@ QString Glade2Ui::emitWidget( const QDomElement& widget, bool layouted,
if ( !layouted && (x != 0 || y != 0 || width != 0 || height != 0) )
emitProperty( QString("geometry"), QRect(x, y, width, height) );
if ( gtkClass == QString("GtkToggleButton") ) {
- emitProperty( QString("toggleButton"), QVariant(TRUE, 0) );
+ emitProperty( QString("toggleButton"), QVariant(true) );
if ( active )
- emitProperty( QString("on"), QVariant(TRUE, 0) );
+ emitProperty( QString("on"), QVariant(true) );
} else {
if ( active )
- emitProperty( QString("checked"), QVariant(TRUE, 0) );
+ emitProperty( QString("checked"), QVariant(true) );
}
if ( !editable )
- emitProperty( QString("readOnly"), QVariant(TRUE, 0) );
+ emitProperty( QString("readOnly"), QVariant(true) );
if ( !focusTarget.isEmpty() )
emitProperty( QString("buddy"),
fixedName(focusTarget).latin1() );
@@ -1889,7 +1889,7 @@ QString Glade2Ui::emitWidget( const QDomElement& widget, bool layouted,
}
if ( !showText )
emitProperty( QString("percentageVisible"),
- QVariant(FALSE, 0) );
+ QVariant(false) );
if ( step != 1 )
emitProperty( QString("lineStep"), step );
if ( tabPos.endsWith(QString("_BOTTOM")) ||
@@ -1905,12 +1905,12 @@ QString Glade2Ui::emitWidget( const QDomElement& widget, bool layouted,
if ( !tooltip.isEmpty() )
emitProperty( QString("toolTip"), tooltip );
if ( !valueInList )
- emitProperty( QString("editable"), QVariant(TRUE, 0) );
+ emitProperty( QString("editable"), QVariant(true) );
if ( wrap && gtkClass == QString("GtkSpinButton") )
- emitProperty( QString("wrapping"), QVariant(TRUE, 0) );
+ emitProperty( QString("wrapping"), QVariant(true) );
if ( gtkClass.endsWith(QString("Tree")) ) {
- emitProperty( QString("rootIsDecorated"), QVariant(TRUE, 0) );
+ emitProperty( QString("rootIsDecorated"), QVariant(true) );
} else if ( gtkOrientedWidget.exactMatch(gtkClass) ) {
QString s = ( gtkOrientedWidget.cap(1) == QChar('H') ) ?
QString( "Horizontal" ) : QString( "Vertical" );
diff --git a/tools/designer/shared/domtool.cpp b/tools/designer/shared/domtool.cpp
index 51796e1..2b75dc7 100644
--- a/tools/designer/shared/domtool.cpp
+++ b/tools/designer/shared/domtool.cpp
@@ -199,7 +199,7 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal
v = QVariant( e.firstChild().toText().data().toDouble() );
} else if ( e.tagName() == "bool" ) {
QString t = e.firstChild().toText().data();
- v = QVariant( t == "true" || t == "1", 0 );
+ v = QVariant( t == "true" || t == "1" );
} else if ( e.tagName() == "pixmap" ) {
v = QVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "iconset" ) {
diff --git a/tools/designer/uic/form.cpp b/tools/designer/uic/form.cpp
index 699e446..6ded3f3 100644
--- a/tools/designer/uic/form.cpp
+++ b/tools/designer/uic/form.cpp
@@ -1052,7 +1052,7 @@ void Uic::createFormImpl( const QDomElement &e )
QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << "addPage( " << page << ", QString(\"\") );" << endl;
trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl;
- QVariant def( FALSE, 0 );
+ QVariant 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 00eaa55..20a5400 100644
--- a/tools/designer/uic/object.cpp
+++ b/tools/designer/uic/object.cpp
@@ -537,7 +537,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
if ( stdset )
v = "%1";
else
- v = "QVariant( %1, 0 )";
+ v = "QVariant( %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 b0a61d6..d8b1d25 100644
--- a/tools/designer/uic/uic.cpp
+++ b/tools/designer/uic/uic.cpp
@@ -263,7 +263,7 @@ bool Uic::isFrameworkCodeGenerated( const QDomElement& e )
{
QDomElement n = getObjectProperty( e, "frameworkCode" );
if ( n.attribute("name") == "frameworkCode" &&
- !DomTool::elementToVariant( n.firstChild().toElement(), QVariant( TRUE, 0 ) ).toBool() )
+ !DomTool::elementToVariant( n.firstChild().toElement(), QVariant( true ) ).toBool() )
return FALSE;
return TRUE;
}
diff --git a/tools/designer/uilib/qwidgetfactory.cpp b/tools/designer/uilib/qwidgetfactory.cpp
index b7fc6e9..5276d50 100644
--- a/tools/designer/uilib/qwidgetfactory.cpp
+++ b/tools/designer/uilib/qwidgetfactory.cpp
@@ -637,7 +637,7 @@ void QWidgetFactory::unpackVariant( const UibStrTable& strings, QDataStream& in,
break;
case QVariant::Bool:
in >> bit;
- value = QVariant( bit != 0, 0 );
+ value = QVariant( bit != 0 );
break;
case QVariant::Double:
in >> value.asDouble();