Adjusted to latest TQVariant::TQVariant(bool) function.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 6 years ago
parent 5c2e2bba88
commit 5fcb1d91b4
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

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

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

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

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

Loading…
Cancel
Save