summaryrefslogtreecommitdiffstats
path: root/tools/designer
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2019-05-27 00:31:56 +0900
committerMichele Calgaro <[email protected]>2019-05-27 00:31:56 +0900
commita2fa7ca9838e204ec41c39fcb80ee82ec93d084f (patch)
tree667608ea9bc8d1e4827077c1321ad6fa02bf8cc3 /tools/designer
parent2c29133f7ee2a270da8d8504345390a1d60e80fa (diff)
downloadqt3-a2fa7ca9838e204ec41c39fcb80ee82ec93d084f.tar.gz
qt3-a2fa7ca9838e204ec41c39fcb80ee82ec93d084f.zip
Adjusted to latest QVariant::QVariant(bool) function.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tools/designer')
-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
10 files changed, 31 insertions, 31 deletions
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();