diff options
Diffstat (limited to 'kommander/editor/propertyeditor.cpp')
-rw-r--r-- | kommander/editor/propertyeditor.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/kommander/editor/propertyeditor.cpp b/kommander/editor/propertyeditor.cpp index 0007a415..50938a89 100644 --- a/kommander/editor/propertyeditor.cpp +++ b/kommander/editor/propertyeditor.cpp @@ -41,7 +41,7 @@ #include <limits.h> #include <tqpainter.h> -#include <palette.h> +#include <tqpalette.h> #include <tqapplication.h> #include <tqheader.h> #include <tqlineedit.h> @@ -59,7 +59,7 @@ #include <tqcolor.h> #include <kcolordialog.h> #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqsizepolicy.h> #include <tqbitmap.h> #include <tqtooltip.h> @@ -105,7 +105,7 @@ static TQStringList getFontList() fontDataBase = new TQFontDatabase; qAddPostRoutine( cleanupFontDatabase ); } - return fontDataBase->families(); + return fontDataBase->tqfamilies(); } @@ -317,9 +317,9 @@ void PropertyItem::setOpen( bool b ) open = b; if ( !open ) { - children.setAutoDelete( true ); - children.clear(); - children.setAutoDelete( false ); + tqchildren.setAutoDelete( true ); + tqchildren.clear(); + tqchildren.setAutoDelete( false ); tqApp->processEvents(); listview->updateEditorSize(); return; @@ -375,7 +375,7 @@ void PropertyItem::setChanged( bool b, bool updateDb ) if ( changed == b ) return; changed = b; - repaint(); + tqrepaint(); if ( updateDb ) MetaDataBase::setPropertyChanged( listview->propertyEditor()->widget(), name(), changed ); updateResetButtonState(); @@ -397,8 +397,8 @@ void PropertyItem::createResetButton() hbox->setLineWidth( 1 ); resetButton = new TQPushButton( hbox ); resetButton->setPixmap( PixmapChooser::loadPixmap( "resetproperty.xpm", PixmapChooser::Mini ) ); - resetButton->setFixedWidth( resetButton->sizeHint().width() ); - hbox->layout()->setAlignment( TQt::AlignRight ); + resetButton->setFixedWidth( resetButton->tqsizeHint().width() ); + hbox->tqlayout()->tqsetAlignment( TQt::AlignRight ); listview->addChild( hbox ); hbox->hide(); TQObject::connect( resetButton, TQT_SIGNAL( clicked() ), @@ -425,13 +425,13 @@ void PropertyItem::updateResetButtonState() void PropertyItem::placeEditor( TQWidget *w ) { createResetButton(); - TQRect r = listview->itemRect( this ); + TQRect r = listview->tqitemRect( this ); if ( !r.size().isValid() ) { listview->ensureItemVisible( this ); #if defined(TQ_WS_WIN) listview->repaintContents( false ); #endif - r = listview->itemRect( this ); + r = listview->tqitemRect( this ); } r.setX( listview->header()->sectionPos( 1 ) ); r.setWidth( listview->header()->sectionSize( 1 ) - 1 ); @@ -439,7 +439,7 @@ void PropertyItem::placeEditor( TQWidget *w ) r = TQRect( listview->viewportToContents( r.topLeft() ), r.size() ); w->resize( r.size() ); listview->moveChild( w, r.x(), r.y() ); - resetButton->parentWidget()->resize( resetButton->sizeHint().width() + 10, r.height() ); + resetButton->parentWidget()->resize( resetButton->tqsizeHint().width() + 10, r.height() ); listview->moveChild( resetButton->parentWidget(), r.x() + r.width() - 8, r.y() ); resetButton->setFixedHeight( r.height() - 3 ); } @@ -475,18 +475,18 @@ void PropertyItem::childValueChanged( PropertyItem * ) void PropertyItem::addChild( PropertyItem *i ) { - children.append( i ); + tqchildren.append( i ); } int PropertyItem::childCount() const { - return children.count(); + return tqchildren.count(); } PropertyItem *PropertyItem::child( int i ) const { // ARRRRRRRRG - return ( (PropertyItem*)this )->children.at( i ); + return ( (PropertyItem*)this )->tqchildren.at( i ); } /*! If the contents of the item is not displayable with a text, but @@ -537,10 +537,10 @@ TQString PropertyItem::currentItemFromObject() const void PropertyItem::setFocus( TQWidget *w ) { - if ( !tqApp->focusWidget() || + if ( !tqApp->tqfocusWidget() || listview->propertyEditor()->formWindow() && - ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->focusWidget()) ) && - !tqApp->focusWidget()->inherits( "Editor" ) ) ) + ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->tqfocusWidget()) ) && + !tqApp->tqfocusWidget()->inherits( "Editor" ) ) ) w->setFocus(); } @@ -1540,8 +1540,8 @@ PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, Pr box = new TQHBox( listview->viewport() ); box->hide(); pixPrev = new TQLabel( box ); - pixPrev->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Minimum ) ); - pixPrev->setBackgroundColor( pixPrev->colorGroup().color( TQColorGroup::Base ) ); + pixPrev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Minimum ) ); + pixPrev->setBackgroundColor( pixPrev->tqcolorGroup().color( TQColorGroup::Base ) ); button = new TQPushButton( "...", box ); button->setFixedWidth( 20 ); box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); @@ -1580,7 +1580,7 @@ void PropertyPixmapItem::setValue( const TQVariant &v ) else pixPrev->setPixmap( v.toIconSet().pixmap() ); PropertyItem::setValue( v ); - repaint(); + tqrepaint(); } void PropertyPixmapItem::getPixmap() @@ -1605,8 +1605,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) TQPixmap pix( (!iconSet ? value().toPixmap() : value().toIconSet().pixmap()) ); if ( !pix.isNull() ) { p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), - (int)(p->worldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), + (int)(p->tqworldMatrix().dy() + r.y()) ), r.size() ) ); p->drawPixmap( r.x(), r.y() + ( r.height() - pix.height() ) / 2, pix ); p->restore(); @@ -1617,8 +1617,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) // -------------------------------------------------------------- PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, - const TQString &propName, bool children ) - : PropertyItem( l, after, prop, propName ), withChildren( children ) + const TQString &propName, bool tqchildren ) + : PropertyItem( l, after, prop, propName ), withChildren( tqchildren ) { box = new TQHBox( listview->viewport() ); box->hide(); @@ -2112,7 +2112,7 @@ void PropertySizePolicyItem::setValue( const TQVariant &v ) return; TQString s = TQString( "%1/%2/%2/%2" ); - s = s.arg( size_type_to_string( v.toSizePolicy().horData() ) ). + s = s.tqarg( size_type_to_string( v.toSizePolicy().horData() ) ). arg( size_type_to_string( v.toSizePolicy().verData() ) ). arg( v.toSizePolicy().horStretch() ). arg( v.toSizePolicy().verStretch() ); @@ -2185,7 +2185,7 @@ void PropertyPaletteItem::setValue( const TQVariant &v ) TQString s; palettePrev->setPalette( v.toPalette() ); PropertyItem::setValue( v ); - repaint(); + tqrepaint(); } void PropertyPaletteItem::getPalette() @@ -2198,7 +2198,7 @@ void PropertyPaletteItem::getPalette() w = ( (TQScrollView*)w )->viewport(); TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), #if defined(TQT_NON_COMMERCIAL) - w->backgroundMode(), listview->topLevelWidget(), + w->backgroundMode(), listview->tqtopLevelWidget(), #else w->backgroundMode(), listview, #endif @@ -2218,8 +2218,8 @@ void PropertyPaletteItem::drawCustomContents( TQPainter *p, const TQRect &r ) { TQPalette pal( value().toPalette() ); p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), - (int)(p->worldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), + (int)(p->tqworldMatrix().dy() + r.y()) ), r.size() ) ); TQRect r2( r ); r2.setX( r2.x() + 2 ); @@ -2325,7 +2325,7 @@ void PropertyCursorItem::showEditor() PropertyItem::showEditor(); if ( !comb ) { combo()->blockSignals( true ); - combo()->setCurrentItem( (int)value().toCursor().shape() ); + combo()->setCurrentItem( (int)value().toCursor().tqshape() ); combo()->blockSignals( false ); } placeEditor( combo() ); @@ -2348,7 +2348,7 @@ void PropertyCursorItem::setValue( const TQVariant &v ) return; combo()->blockSignals( true ); - combo()->setCurrentItem( (int)v.toCursor().shape() ); + combo()->setCurrentItem( (int)v.toCursor().tqshape() ); combo()->blockSignals( false ); setText( 1, combo()->currentText() ); PropertyItem::setValue( v ); @@ -2522,7 +2522,7 @@ void PropertyList::setupProperties() if ( !editor->widget() ) return; bool allProperties = !editor->widget()->inherits( "Spacer" ); - TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties ); + TQStrList lst = editor->widget()->tqmetaObject()->propertyNames( allProperties ); PropertyItem *item = 0; TQMap<TQString, bool> unique; TQObject *w = editor->widget(); @@ -2533,11 +2533,11 @@ void PropertyList::setupProperties() WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { const TQMetaProperty* p = - editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( it.current(), allProperties), allProperties ); + editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->findProperty( it.current(), allProperties), allProperties ); if ( !p ) continue; - if ( unique.contains( TQString::fromLatin1( it.current() ) ) ) + if ( unique.contains( TQString::tqfromLatin1( it.current() ) ) ) continue; if ( editor->widget()->inherits( "QDesignerToolBar" ) || editor->widget()->inherits( "QDesignerMenuBar" ) ) { if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) @@ -2552,12 +2552,12 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; - if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) continue; } - unique.insert( TQString::fromLatin1( it.current() ), true ); + unique.insert( TQString::tqfromLatin1( it.current() ), true ); if ( editor->widget()->isWidgetType() && editor->formWindow()->isMainContainer( TQT_TQOBJECT((TQWidget*)editor->widget()) ) ) { if ( qstrcmp( p->name(), "geometry" ) == 0 ) @@ -2588,9 +2588,9 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) continue; if ( qstrcmp( p->name(), "enabled" ) == 0 ) continue; @@ -2642,7 +2642,7 @@ void PropertyList::setupProperties() if ( p->designable(w) ) { if ( p->isSetType() ) { - if ( TQString( p->name() ) == "alignment" ) { + if ( TQString( p->name() ) == "tqalignment" ) { TQStringList lst; lst << p->valueToKey( AlignAuto ) << p->valueToKey( AlignLeft ) @@ -2672,7 +2672,7 @@ void PropertyList::setupProperties() item->setChanged( true, false ); } } else { - qWarning( "Sets except 'alignment' not supported yet.... %s.", p->name() ); + qWarning( "Sets except 'tqalignment' not supported yet.... %s.", p->name() ); } } else if ( p->isEnumType() ) { TQStrList l = p->enumKeys(); @@ -2882,7 +2882,7 @@ void PropertyList::valueChanged( PropertyItem *i ) { if ( !editor->widget() ) return; - TQString pn( i18n("Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); + TQString pn( i18n("Set '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), WidgetFactory::property( editor->widget(), i->name() ), @@ -3061,25 +3061,25 @@ static void clearAlignList( TQStrList &l ) void PropertyList::setPropertyValue( PropertyItem *i ) { const TQMetaProperty *p = - editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( i->name(), true), true ); + editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->findProperty( i->name(), true), true ); if ( !p ) { if ( i->name() == "hAlign" ) { - int align = editor->widget()->property( "alignment" ).toInt(); - p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( "alignment", true ), true ); + int align = editor->widget()->property( "tqalignment" ).toInt(); + p = editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->findProperty( "tqalignment", true ), true ); align &= ~AlignVertical_Mask; TQStrList l = p->valueToKeys( align ); clearAlignList( l ); ( (PropertyListItem*)i )->setCurrentItem( l.last() ); } else if ( i->name() == "vAlign" ) { - int align = editor->widget()->property( "alignment" ).toInt(); - p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( "alignment", true ), true ); + int align = editor->widget()->property( "tqalignment" ).toInt(); + p = editor->widget()->tqmetaObject()-> + property( editor->widget()->tqmetaObject()->findProperty( "tqalignment", true ), true ); align &= ~AlignHorizontal_Mask; ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() ); } else if ( i->name() == "wordwrap" ) { - int align = editor->widget()->property( "alignment" ).toInt(); + int align = editor->widget()->property( "tqalignment" ).toInt(); if ( align & WordBreak ) i->setValue( TQVariant( true, 0 ) ); else @@ -3134,7 +3134,7 @@ void PropertyList::resetProperty() PropertyItem *i = (PropertyItem*)currentItem(); if ( !MetaDataBase::isPropertyChanged( editor->widget(), i->PropertyItem::name() ) ) return; - TQString pn( i18n("Reset '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); + TQString pn( i18n("Reset '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), i->value(), @@ -3229,7 +3229,7 @@ TQString PropertyList::whatsThisText( TQListViewItem *i ) if ( ( (PropertyItem*)i )->propertyParent() ) i = ( (PropertyItem*)i )->propertyParent(); - const TQMetaObject *mo = editor->widget()->metaObject(); + const TQMetaObject *mo = editor->widget()->tqmetaObject(); TQString prop = ( (PropertyItem*)i )->name(); while ( mo ) { TQString s; @@ -3238,10 +3238,10 @@ TQString PropertyList::whatsThisText( TQListViewItem *i ) if ( ( it = propertyDocs.find( s ) ) != propertyDocs.end() ) { return *it; } - mo = mo->superClass(); + mo = mo->tqsuperClass(); } - return i18n("<p><b>TQWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).arg( prop ); + return i18n("<p><b>TQWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).tqarg( prop ); } void PropertyList::readPropertyDocs() @@ -3327,7 +3327,7 @@ void EventList::setup() #endif } } else { - TQStrList sigs = editor->widget()->metaObject()->signalNames( true ); + TQStrList sigs = editor->widget()->tqmetaObject()->signalNames( true ); sigs.remove( "destroyed()" ); TQStrListIterator it( sigs ); while ( it.current() ) { @@ -3588,7 +3588,7 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) wid = w; formwindow = fw; - setCaption( i18n("Property Editor (%1)" ).arg( formwindow->name() ) ); + setCaption( i18n("Property Editor (%1)" ).tqarg( formwindow->name() ) ); listview->viewport()->setUpdatesEnabled( false ); listview->setUpdatesEnabled( false ); clear(); @@ -3674,21 +3674,21 @@ TQString PropertyEditor::classOfCurrentProperty() const return TQString(); TQObject *o = wid; TQString curr = currentProperty(); - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); while ( mo ) { TQStrList props = mo->propertyNames( false ); if ( props.find( curr.latin1() ) != -1 ) return mo->className(); - mo = mo->superClass(); + mo = mo->tqsuperClass(); } return TQString(); } -TQMetaObject* PropertyEditor::metaObjectOfCurrentProperty() const +TQMetaObject* PropertyEditor::tqmetaObjectOfCurrentProperty() const { if ( !wid ) return 0; - return wid->metaObject(); + return wid->tqmetaObject(); } void PropertyEditor::resetFocus() |