diff options
Diffstat (limited to 'kommander/editor/propertyeditor.cpp')
-rw-r--r-- | kommander/editor/propertyeditor.cpp | 214 |
1 files changed, 105 insertions, 109 deletions
diff --git a/kommander/editor/propertyeditor.cpp b/kommander/editor/propertyeditor.cpp index f105a4e8..4b0c58e4 100644 --- a/kommander/editor/propertyeditor.cpp +++ b/kommander/editor/propertyeditor.cpp @@ -282,7 +282,7 @@ void PropertyItem::paintBranches( TQPainter * p, const TQColorGroup & cg, void PropertyItem::paintFocus( TQPainter *p, const TQColorGroup &cg, const TQRect &r ) { p->save(); - TQApplication::style().tqdrawPrimitive(TQStyle::PE_Panel, p, r, cg, + TQApplication::style().drawPrimitive(TQStyle::PE_Panel, p, r, cg, TQStyle::Style_Sunken, TQStyleOption(1,1) ); p->restore(); } @@ -401,8 +401,8 @@ void PropertyItem::createResetButton() hbox->layout()->setAlignment( TQt::AlignRight ); listview->addChild( hbox ); hbox->hide(); - TQObject::connect( resetButton, TQT_SIGNAL( clicked() ), - listview, TQT_SLOT( resetProperty() ) ); + TQObject::connect( resetButton, TQ_SIGNAL( clicked() ), + listview, TQ_SLOT( resetProperty() ) ); TQToolTip::add( resetButton, i18n("Reset the property to its default value" ) ); TQWhatsThis::add( resetButton, i18n("Click this button to reset the property to its default value" ) ); updateResetButtonState(); @@ -539,7 +539,7 @@ void PropertyItem::setFocus( TQWidget *w ) { if ( !tqApp->focusWidget() || listview->propertyEditor()->formWindow() && - ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->focusWidget()) ) && + ( !MainWindow::self->isAFormWindowChild( tqApp->focusWidget() ) && !tqApp->focusWidget()->inherits( "Editor" ) ) ) w->setFocus(); } @@ -582,30 +582,30 @@ TQLineEdit *PropertyTextItem::lined() if ( asciiOnly ) { if ( PropertyItem::name() == "name" ) - lin->setValidator( new AsciiValidator( TQT_TQOBJECT(lin), "ascii_validator" ) ); + lin->setValidator( new AsciiValidator( lin, "ascii_validator" ) ); else lin->setValidator( new AsciiValidator( TQString("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" "\xaa\xab\xac\xad\xae\xaf\xb1\xb2\xb3" "\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc" - "\xbd\xbe\xbf"), TQT_TQOBJECT(lin), "ascii_validator" ) ); + "\xbd\xbe\xbf"), lin, "ascii_validator" ) ); } if ( !hasMultiLines ) { lin->hide(); } else { button = new TQPushButton( i18n("..."), box ); button->setFixedWidth( 20 ); - connect( button, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( getText() ) ); + connect( button, TQ_SIGNAL( clicked() ), + this, TQ_SLOT( getText() ) ); lin->setFrame( false ); } - connect( lin, TQT_SIGNAL( returnPressed() ), - this, TQT_SLOT( setValue() ) ); - connect( lin, TQT_SIGNAL( textChanged( const TQString & ) ), - this, TQT_SLOT( setValue() ) ); + connect( lin, TQ_SIGNAL( returnPressed() ), + this, TQ_SLOT( setValue() ) ); + connect( lin, TQ_SIGNAL( textChanged( const TQString & ) ), + this, TQ_SLOT( setValue() ) ); if ( PropertyItem::name() == "name" || PropertyItem::name() == "itemName" ) - connect( lin, TQT_SIGNAL( returnPressed() ), + connect( lin, TQ_SIGNAL( returnPressed() ), listview->propertyEditor()->formWindow()->commandHistory(), - TQT_SLOT( checkCompressedCommand() ) ); + TQ_SLOT( checkCompressedCommand() ) ); lin->installEventFilter( listview ); return lin; } @@ -762,12 +762,12 @@ TQLineEdit *PropertyDoubleItem::lined() if ( lin ) return lin; lin = new TQLineEdit( listview->viewport() ); - lin->setValidator( new TQDoubleValidator( TQT_TQOBJECT(lin), "double_validator" ) ); + lin->setValidator( new TQDoubleValidator( lin, "double_validator" ) ); - connect( lin, TQT_SIGNAL( returnPressed() ), - this, TQT_SLOT( setValue() ) ); - connect( lin, TQT_SIGNAL( textChanged( const TQString & ) ), - this, TQT_SLOT( setValue() ) ); + connect( lin, TQ_SIGNAL( returnPressed() ), + this, TQ_SLOT( setValue() ) ); + connect( lin, TQ_SIGNAL( textChanged( const TQString & ) ), + this, TQ_SLOT( setValue() ) ); lin->installEventFilter( listview ); return lin; } @@ -842,12 +842,12 @@ TQDateEdit *PropertyDateItem::lined() if ( lin ) return lin; lin = new TQDateEdit( listview->viewport() ); - TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); + TQObjectList *l = lin->queryList( "TQLineEdit" ); for ( TQObject *o = l->first(); o; o = l->next() ) o->installEventFilter( listview ); delete l; - connect( lin, TQT_SIGNAL( valueChanged( const TQDate & ) ), - this, TQT_SLOT( setValue() ) ); + connect( lin, TQ_SIGNAL( valueChanged( const TQDate & ) ), + this, TQ_SLOT( setValue() ) ); return lin; } @@ -891,13 +891,13 @@ void PropertyDateItem::setValue( const TQVariant &v ) lined()->setDate( v.toDate() ); lined()->blockSignals( false ); } - setText( 1, v.toDate().toString( ::Qt::ISODate ) ); + setText( 1, v.toDate().toString( ::TQt::ISODate ) ); PropertyItem::setValue( v ); } void PropertyDateItem::setValue() { - setText( 1, lined()->date().toString( ::Qt::ISODate ) ); + setText( 1, lined()->date().toString( ::TQt::ISODate ) ); TQVariant v; v = lined()->date(); PropertyItem::setValue( v ); @@ -917,9 +917,9 @@ TQTimeEdit *PropertyTimeItem::lined() if ( lin ) return lin; lin = new TQTimeEdit( listview->viewport() ); - connect( lin, TQT_SIGNAL( valueChanged( const TQTime & ) ), - this, TQT_SLOT( setValue() ) ); - TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); + connect( lin, TQ_SIGNAL( valueChanged( const TQTime & ) ), + this, TQ_SLOT( setValue() ) ); + TQObjectList *l = lin->queryList( "TQLineEdit" ); for ( TQObject *o = l->first(); o; o = l->next() ) o->installEventFilter( listview ); delete l; @@ -966,13 +966,13 @@ void PropertyTimeItem::setValue( const TQVariant &v ) lined()->setTime( v.toTime() ); lined()->blockSignals( false ); } - setText( 1, v.toTime().toString( ::Qt::ISODate ) ); + setText( 1, v.toTime().toString( ::TQt::ISODate ) ); PropertyItem::setValue( v ); } void PropertyTimeItem::setValue() { - setText( 1, lined()->time().toString( ::Qt::ISODate ) ); + setText( 1, lined()->time().toString( ::TQt::ISODate ) ); TQVariant v; v = lined()->time(); PropertyItem::setValue( v ); @@ -992,9 +992,9 @@ TQDateTimeEdit *PropertyDateTimeItem::lined() if ( lin ) return lin; lin = new TQDateTimeEdit( listview->viewport() ); - connect( lin, TQT_SIGNAL( valueChanged( const TQDateTime & ) ), - this, TQT_SLOT( setValue() ) ); - TQObjectList *l = lin->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); + connect( lin, TQ_SIGNAL( valueChanged( const TQDateTime & ) ), + this, TQ_SLOT( setValue() ) ); + TQObjectList *l = lin->queryList( "TQLineEdit" ); for ( TQObject *o = l->first(); o; o = l->next() ) o->installEventFilter( listview ); delete l; @@ -1041,13 +1041,13 @@ void PropertyDateTimeItem::setValue( const TQVariant &v ) lined()->setDateTime( v.toDateTime() ); lined()->blockSignals( false ); } - setText( 1, v.toDateTime().toString( ::Qt::ISODate ) ); + setText( 1, v.toDateTime().toString( ::TQt::ISODate ) ); PropertyItem::setValue( v ); } void PropertyDateTimeItem::setValue() { - setText( 1, lined()->dateTime().toString( ::Qt::ISODate ) ); + setText( 1, lined()->dateTime().toString( ::TQt::ISODate ) ); TQVariant v; v = lined()->dateTime(); PropertyItem::setValue( v ); @@ -1070,8 +1070,8 @@ TQComboBox *PropertyBoolItem::combo() comb->hide(); comb->insertItem( i18n("False" ) ); comb->insertItem( i18n("True" ) ); - connect( comb, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( setValue() ) ); + connect( comb, TQ_SIGNAL( activated( int ) ), + this, TQ_SLOT( setValue() ) ); comb->installEventFilter( listview ); return comb; } @@ -1085,7 +1085,7 @@ PropertyBoolItem::~PropertyBoolItem() void PropertyBoolItem::toggle() { bool b = value().toBool(); - setValue( TQVariant( !b, 0 ) ); + setValue( TQVariant( !b ) ); setValue(); } @@ -1139,8 +1139,8 @@ void PropertyBoolItem::setValue() if ( !comb ) return; setText( 1, combo()->currentText() ); - bool b = combo()->currentItem() == 0 ? (bool)false : (bool)true; - PropertyItem::setValue( TQVariant( b, 0 ) ); + bool b = combo()->currentItem() == 0 ? false : true; + PropertyItem::setValue( TQVariant( b ) ); notifyValueChange(); } @@ -1163,12 +1163,12 @@ TQSpinBox *PropertyIntItem::spinBox() spinBx = new TQSpinBox( 0, INT_MAX, 1, listview->viewport() ); spinBx->hide(); spinBx->installEventFilter( listview ); - TQObjectList *ol = spinBx->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); + TQObjectList *ol = spinBx->queryList( "TQLineEdit" ); if ( ol && ol->first() ) ol->first()->installEventFilter( listview ); delete ol; - connect( spinBx, TQT_SIGNAL( valueChanged( int ) ), - this, TQT_SLOT( setValue() ) ); + connect( spinBx, TQ_SIGNAL( valueChanged( int ) ), + this, TQ_SLOT( setValue() ) ); return spinBx; } @@ -1252,11 +1252,11 @@ TQComboBox *PropertyListItem::combo() return comb; comb = new TQComboBox( editable, listview->viewport() ); comb->hide(); - connect( comb, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( setValue() ) ); + connect( comb, TQ_SIGNAL( activated( int ) ), + this, TQ_SLOT( setValue() ) ); comb->installEventFilter( listview ); if ( editable ) { - TQObjectList *ol = comb->queryList( TQLINEEDIT_OBJECT_NAME_STRING ); + TQObjectList *ol = comb->queryList( "TQLineEdit" ); if ( ol && ol->first() ) ol->first()->installEventFilter( listview ); delete ol; @@ -1548,8 +1548,8 @@ PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, Pr box->setLineWidth( 2 ); pixPrev->setFrameStyle( TQFrame::NoFrame ); box->installEventFilter( listview ); - connect( button, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( getPixmap() ) ); + connect( button, TQ_SIGNAL( clicked() ), + this, TQ_SLOT( getPixmap() ) ); } PropertyPixmapItem::~PropertyPixmapItem() { @@ -1637,8 +1637,8 @@ PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, Prop pal.setDisabled( cg ); colorPrev->setPalette( pal ); box->installEventFilter( listview ); - connect( button, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( getColor() ) ); + connect( button, TQ_SIGNAL( clicked() ), + this, TQ_SLOT( getColor() ) ); } void PropertyColorItem::createChildren() @@ -1758,8 +1758,8 @@ PropertyFontItem::PropertyFontItem( PropertyList *l, PropertyItem *after, Proper box->installEventFilter( listview ); lined->installEventFilter( listview ); button->installEventFilter( listview ); - connect( button, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( getFont() ) ); + connect( button, TQ_SIGNAL( clicked() ), + this, TQ_SLOT( getFont() ) ); } void PropertyFontItem::createChildren() @@ -1790,13 +1790,13 @@ void PropertyFontItem::initChildren() } else if ( item->name() == i18n("Point Size" ) ) item->setValue( val.toFont().pointSize() ); 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" ) ) - item->setValue( TQVariant( val.toFont().italic(), 0 ) ); + item->setValue( TQVariant( val.toFont().italic() ) ); 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" ) ) - item->setValue( TQVariant( val.toFont().strikeOut(), 0 ) ); + item->setValue( TQVariant( val.toFont().strikeOut() ) ); } } @@ -2156,8 +2156,8 @@ PropertyPaletteItem::PropertyPaletteItem( PropertyList *l, PropertyItem *after, box->setLineWidth( 2 ); palettePrev->setFrameStyle( TQFrame::NoFrame ); box->installEventFilter( listview ); - connect( button, TQT_SIGNAL( clicked() ), - this, TQT_SLOT( getPalette() ) ); + connect( button, TQ_SIGNAL( clicked() ), + this, TQ_SLOT( getPalette() ) ); } PropertyPaletteItem::~PropertyPaletteItem() { @@ -2194,14 +2194,10 @@ void PropertyPaletteItem::getPalette() return; bool ok = false; TQWidget *w = (TQWidget*)listview->propertyEditor()->widget(); - if ( w->inherits( TQSCROLLVIEW_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQScrollView" ) ) w = ( (TQScrollView*)w )->viewport(); TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), -#if defined(TQT_NON_COMMERCIAL) - w->backgroundMode(), listview->topLevelWidget(), -#else w->backgroundMode(), listview, -#endif "choose_palette", listview->propertyEditor()->formWindow() ); if ( !ok ) return; @@ -2309,8 +2305,8 @@ TQComboBox *PropertyCursorItem::combo() cur.setMask( cur ); comb->insertItem( cur, i18n("Forbidden"), TQObject::ForbiddenCursor ); - connect( comb, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( setValue() ) ); + connect( comb, TQ_SIGNAL( activated( int ) ), + this, TQ_SLOT( setValue() ) ); comb->installEventFilter( listview ); return comb; } @@ -2401,16 +2397,16 @@ PropertyList::PropertyList( PropertyEditor *e ) viewport()->installEventFilter( this ); addColumn( i18n("Property" ) ); addColumn( i18n("Value" ) ); - connect( header(), TQT_SIGNAL( sizeChange( int, int, int ) ), - this, TQT_SLOT( updateEditorSize() ) ); - disconnect( header(), TQT_SIGNAL( sectionClicked( int ) ), - this, TQT_SLOT( changeSortColumn( int ) ) ); - connect( header(), TQT_SIGNAL( sectionClicked( int ) ), - this, TQT_SLOT( toggleSort() ) ); - connect( this, TQT_SIGNAL( pressed( TQListViewItem *, const TQPoint &, int ) ), - this, TQT_SLOT( itemPressed( TQListViewItem *, const TQPoint &, int ) ) ); - connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), - this, TQT_SLOT( toggleOpen( TQListViewItem * ) ) ); + connect( header(), TQ_SIGNAL( sizeChange( int, int, int ) ), + this, TQ_SLOT( updateEditorSize() ) ); + disconnect( header(), TQ_SIGNAL( sectionClicked( int ) ), + this, TQ_SLOT( changeSortColumn( int ) ) ); + connect( header(), TQ_SIGNAL( sectionClicked( int ) ), + this, TQ_SLOT( toggleSort() ) ); + connect( this, TQ_SIGNAL( pressed( TQListViewItem *, const TQPoint &, int ) ), + this, TQ_SLOT( itemPressed( TQListViewItem *, const TQPoint &, int ) ) ); + connect( this, TQ_SIGNAL( doubleClicked( TQListViewItem * ) ), + this, TQ_SLOT( toggleOpen( TQListViewItem * ) ) ); setSorting( -1 ); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOn ); @@ -2500,7 +2496,7 @@ static TQVariant::Type type_to_variant( const TQString &s ) #ifndef TQT_NO_SQL static bool parent_is_data_aware( TQObject *o ) { - if ( !o->inherits( TQWIDGET_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQWidget" ) ) return false; TQWidget *w = (TQWidget*)o; TQWidget *p = w->parentWidget(); @@ -2529,7 +2525,7 @@ void PropertyList::setupProperties() TQStringList valueSet; bool parentHasLayout = w->isWidgetType() && - !editor->formWindow()->isMainContainer( TQT_TQOBJECT((TQWidget*)w) ) && ( (TQWidget*)w )->parentWidget() && + !editor->formWindow()->isMainContainer( (TQWidget*)w ) && ( (TQWidget*)w )->parentWidget() && WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { const TQMetaProperty* p = @@ -2559,7 +2555,7 @@ void PropertyList::setupProperties() } unique.insert( TQString::fromLatin1( it.current() ), true ); if ( editor->widget()->isWidgetType() && - editor->formWindow()->isMainContainer( TQT_TQOBJECT((TQWidget*)editor->widget()) ) ) { + editor->formWindow()->isMainContainer( (TQWidget*)editor->widget() ) ) { if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; } else { // hide some toplevel-only stuff @@ -2575,7 +2571,7 @@ void PropertyList::setupProperties() continue; if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) || w->inherits( "Spacer" ) ) { + if ( w->inherits( "TQLayoutWidget" ) || w->inherits( "Spacer" ) ) { if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) @@ -2618,7 +2614,7 @@ void PropertyList::setupProperties() continue; } } - if ( w->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ) ) { + if ( w->inherits( "TQActionGroup" ) ) { if ( qstrcmp( p->name(), "usesDropDown" ) == 0 ) continue; if ( qstrcmp( p->name(), "toggleAction" ) == 0 ) @@ -2635,7 +2631,7 @@ void PropertyList::setupProperties() if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in TQ_PROPERTY can take a function (isInButtonGroup() in this case) if ( !editor->widget()->isWidgetType() || !editor->widget()->parent() || - !editor->widget()->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) + !editor->widget()->parent()->inherits( "TQButtonGroup" ) ) continue; } @@ -2654,7 +2650,7 @@ void PropertyList::setupProperties() setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) ) item->setChanged( true, false ); - if ( !editor->widget()->inherits( TQMULTILINEEDIT_OBJECT_NAME_STRING ) ) { + if ( !editor->widget()->inherits( "TQMultiLineEdit" ) ) { lst.clear(); lst << p->valueToKey( AlignTop ) << p->valueToKey( AlignVCenter ) @@ -2665,7 +2661,7 @@ void PropertyList::setupProperties() if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) ) item->setChanged( true, false ); item = new PropertyBoolItem( this, item, 0, "wordwrap" ); - if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQGroupBox" ) ) item->setVisible( false ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) @@ -2702,7 +2698,7 @@ void PropertyList::setupProperties() } } - if ( !w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) && !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) && + if ( !w->inherits( "TQSplitter" ) && !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) && w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { item = new PropertyIntItem( this, item, 0, "layoutSpacing", true ); setPropertyValue( item ); @@ -2713,7 +2709,7 @@ void PropertyList::setupProperties() } - if ( !w->inherits( "Spacer" ) && !w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) && !w->inherits( TQACTION_OBJECT_NAME_STRING ) && + if ( !w->inherits( "Spacer" ) && !w->inherits( "TQLayoutWidget" ) && !w->inherits( "TQAction" ) && !w->inherits( "QDesignerMenuBar" ) && !w->inherits( "QDesignerToolBar" ) ) { item = new PropertyTextItem( this, item, 0, "toolTip", true, false ); setPropertyValue( item ); @@ -2726,15 +2722,15 @@ void PropertyList::setupProperties() } #ifndef TQT_NO_SQL - if ( !editor->widget()->inherits( TQDATATABLE_OBJECT_NAME_STRING ) && !editor->widget()->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) && - !editor->widget()->inherits( TQDATAVIEW_OBJECT_NAME_STRING ) && parent_is_data_aware( editor->widget() ) ) { + if ( !editor->widget()->inherits( "TQDataTable" ) && !editor->widget()->inherits( "TQDataBrowser" ) && + !editor->widget()->inherits( "TQDataView" ) && parent_is_data_aware( editor->widget() ) ) { item = new PropertyDatabaseItem( this, item, 0, "database", editor->formWindow()->mainContainer() != w ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) item->setChanged( true, false ); } - if ( editor->widget()->inherits( TQDATATABLE_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQDATAVIEW_OBJECT_NAME_STRING ) ) { + if ( editor->widget()->inherits( "TQDataTable" ) || editor->widget()->inherits( "TQDataBrowser" ) || editor->widget()->inherits( "TQDataView" ) ) { item = new PropertyDatabaseItem( this, item, 0, "database", false ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) @@ -2780,12 +2776,12 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, switch ( t ) { case TQVariant::String: item = new PropertyTextItem( this, item, 0, name, true, - editor->widget()->inherits( TQLABEL_OBJECT_NAME_STRING ) || editor->widget()->inherits( TQTEXTVIEW_OBJECT_NAME_STRING ) ); + editor->widget()->inherits( "TQLabel" ) || editor->widget()->inherits( "TQTextView" ) ); break; case TQVariant::CString: item = new PropertyTextItem( this, item, 0, name, name == "name" && - TQT_BASE_OBJECT(editor->widget()) == TQT_BASE_OBJECT(editor->formWindow()->mainContainer()), + editor->widget() == editor->formWindow()->mainContainer(), false, true ); break; case TQVariant::Bool: @@ -2885,7 +2881,7 @@ void PropertyList::valueChanged( PropertyItem *i ) TQString pn( i18n("Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, - i->name(), WidgetFactory::property( editor->widget(), i->name() ), + i->name(), WidgetFactory::property( editor->widget(), i->name().latin1() ), i->value(), i->currentItem(), i->currentItemFromObject() ); cmd->execute(); editor->formWindow()->commandHistory()->addCommand( cmd, true ); @@ -2921,15 +2917,15 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) return true; PropertyItem *i = (PropertyItem*)currentItem(); - if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) &&e->type() == TQEvent::KeyPress ) { + if ( o != this &&e->type() == TQEvent::KeyPress ) { TQKeyEvent *ke = (TQKeyEvent*)e; if ( ( ke->key() == Key_Up || ke->key() == Key_Down ) && - ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(viewport()) ) && + ( o != this || o != viewport() ) && !( ke->state() & ControlButton ) ) { TQApplication::sendEvent( this, (TQKeyEvent*)e ); return true; - } else if ( ( !o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || - ( o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) && ( (TQLineEdit*)o )->isReadOnly() ) ) && + } else if ( ( !o->inherits( "TQLineEdit" ) || + ( o->inherits( "TQLineEdit" ) && ( (TQLineEdit*)o )->isReadOnly() ) ) && i && i->hasSubItems() ) { if ( !i->isOpen() && ( ke->key() == Key_Plus || @@ -2939,14 +2935,14 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) ( ke->key() == Key_Minus || ke->key() == Key_Left ) ) i->setOpen( false ); - } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && o->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) { + } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && o->inherits( "TQComboBox" ) ) { TQKeyEvent ke2( TQEvent::KeyPress, Key_Space, 0, 0 ); TQApplication::sendEvent( o, &ke2 ); return true; } - } else if ( e->type() == TQEvent::FocusOut && o->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) && editor->formWindow() ) { - TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQT_SLOT( checkCompressedCommand() ) ); - } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(viewport()) ) { + } else if ( e->type() == TQEvent::FocusOut && o->inherits( "TQLineEdit" ) && editor->formWindow() ) { + TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQ_SLOT( checkCompressedCommand() ) ); + } else if ( o == viewport() ) { TQMouseEvent *me; PropertyListItem* i; switch ( e->type() ) { @@ -2961,7 +2957,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) break; case TQEvent::MouseMove: me = (TQMouseEvent*)e; - if ( me && me->state() & Qt::LeftButton && mousePressed) { + if ( me && me->state() & TQt::LeftButton && mousePressed) { i = (PropertyListItem*) itemAt( me->pos() ); if( i && i == pressItem ) { @@ -2996,7 +2992,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) default: break; } - } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(header()) ) { + } else if ( o == header() ) { if ( e->type() == TQEvent::ContextMenu ) { ((TQContextMenuEvent *)e)->accept(); TQPopupMenu menu( 0 ); @@ -3062,7 +3058,7 @@ void PropertyList::setPropertyValue( PropertyItem *i ) { const TQMetaProperty *p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( i->name(), true), true ); + property( editor->widget()->metaObject()->findProperty( i->name().latin1(), true), true ); if ( !p ) { if ( i->name() == "hAlign" ) { int align = editor->widget()->property( "alignment" ).toInt(); @@ -3081,13 +3077,13 @@ 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" ) { - ( (PropertyIntItem*)i )->setValue( MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() )) ) ); + ( (PropertyIntItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); } else if ( i->name() == "layoutMargin" ) { - ( (PropertyIntItem*)i )->setValue( MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() )) ) ); + ( (PropertyIntItem*)i )->setValue( MetaDataBase::margin( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); } else if ( i->name() == "toolTip" || i->name() == "whatsThis" || i->name() == "database" || i->name() == "frameworkCode" ) { i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) ); } else if ( editor->widget()->inherits( "CustomWidget" ) ) { @@ -3101,9 +3097,9 @@ void PropertyList::setPropertyValue( PropertyItem *i ) if ( p->isSetType() ) ; else if ( p->isEnumType() ) - ( (PropertyListItem*)i )->setCurrentItem( p->valueToKey( editor->widget()->property( i->name() ).toInt() ) ); + ( (PropertyListItem*)i )->setCurrentItem( p->valueToKey( editor->widget()->property( i->name().latin1() ).toInt() ) ); else - i->setValue( editor->widget()->property( i->name() ) ); + i->setValue( editor->widget()->property( i->name().latin1() ) ); } void PropertyList::setCurrentProperty( const TQString &n ) @@ -3284,8 +3280,8 @@ EventList::EventList( TQWidget *parent, FormWindow *fw, PropertyEditor *e ) header()->hide(); removeColumn( 1 ); setRootIsDecorated( true ); - connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), - this, TQT_SLOT( renamed( TQListViewItem * ) ) ); + connect( this, TQ_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), + this, TQ_SLOT( renamed( TQListViewItem * ) ) ); } void EventList::setup() |