diff options
Diffstat (limited to 'kdevdesigner/designer/propertyeditor.cpp')
-rw-r--r-- | kdevdesigner/designer/propertyeditor.cpp | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp index 01a2bb9f..a37679d4 100644 --- a/kdevdesigner/designer/propertyeditor.cpp +++ b/kdevdesigner/designer/propertyeditor.cpp @@ -50,7 +50,7 @@ #include "kdevdesigner_part.h" #include <tqpainter.h> -#include <tqpalette.h> +#include <palette.h> #include <tqapplication.h> #include <tqheader.h> #include <tqlineedit.h> @@ -68,7 +68,7 @@ #include <tqcolor.h> #include <tqcolordialog.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqsizepolicy.h> #include <tqbitmap.h> #include <tqtooltip.h> @@ -86,7 +86,7 @@ #include <tqmultilineedit.h> // FIXME: obsolete #include <tqsplitter.h> #include <tqdatatable.h> -#include <tqtextview.h> +#include <textview.h> #include <limits.h> @@ -119,7 +119,7 @@ static TQStringList getFontList() fontDataBase = new TQFontDatabase; qAddPostRoutine( cleanupFontDatabase ); } - return fontDataBase->tqfamilies(); + return fontDataBase->families(); } @@ -329,9 +329,9 @@ void PropertyItem::setOpen( bool b ) open = b; if ( !open ) { - tqchildren.setAutoDelete( TRUE ); - tqchildren.clear(); - tqchildren.setAutoDelete( FALSE ); + children.setAutoDelete( TRUE ); + children.clear(); + children.setAutoDelete( FALSE ); tqApp->processEvents(); listview->updateEditorSize(); return; @@ -387,7 +387,7 @@ void PropertyItem::setChanged( bool b, bool updateDb ) if ( changed == b ) return; changed = b; - tqrepaint(); + repaint(); if ( updateDb ) { MetaDataBase::setPropertyChanged( listview->propertyEditor()->widget(), name(), changed ); } @@ -413,8 +413,8 @@ void PropertyItem::createResetButton() resetButton = new TQPushButton( hbox ); setupStyle( resetButton ); resetButton->setPixmap( DesignerResetPix ); - resetButton->setFixedWidth( resetButton->tqsizeHint().width() ); - hbox->tqlayout()->tqsetAlignment( TQt::AlignRight ); + resetButton->setFixedWidth( resetButton->sizeHint().width() ); + hbox->layout()->setAlignment( TQt::AlignRight ); listview->addChild( hbox ); hbox->hide(); TQObject::connect( resetButton, TQT_SIGNAL( clicked() ), @@ -441,13 +441,13 @@ void PropertyItem::updateResetButtonState() void PropertyItem::placeEditor( TQWidget *w ) { createResetButton(); - TQRect r = listview->tqitemRect( this ); + TQRect r = listview->itemRect( this ); if ( !r.size().isValid() ) { listview->ensureItemVisible( this ); #if defined(TQ_WS_WIN) listview->repaintContents( FALSE ); #endif - r = listview->tqitemRect( this ); + r = listview->itemRect( this ); } r.setX( listview->header()->sectionPos( 1 ) ); r.setWidth( listview->header()->sectionSize( 1 ) - 1 ); @@ -455,7 +455,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->tqsizeHint().width() + 10, r.height() ); + resetButton->parentWidget()->resize( resetButton->sizeHint().width() + 10, r.height() ); listview->moveChild( resetButton->parentWidget(), r.x() + r.width() - 8, r.y() ); resetButton->setFixedHeight( TQMAX( 0, r.height() - 3 ) ); } @@ -491,18 +491,18 @@ void PropertyItem::childValueChanged( PropertyItem * ) void PropertyItem::addChild( PropertyItem *i ) { - tqchildren.append( i ); + children.append( i ); } int PropertyItem::childCount() const { - return tqchildren.count(); + return children.count(); } PropertyItem *PropertyItem::child( int i ) const { // ARRRRRRRRG - return ( (PropertyItem*)this )->tqchildren.at( i ); + return ( (PropertyItem*)this )->children.at( i ); } /*! If the contents of the item is not displayable with a text, but @@ -553,10 +553,10 @@ TQString PropertyItem::currentItemFromObject() const void PropertyItem::setFocus( TQWidget *w ) { - if ( !tqApp->tqfocusWidget() || + if ( !tqApp->focusWidget() || listview->propertyEditor()->formWindow() && - ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->tqfocusWidget()) ) && - !tqApp->tqfocusWidget()->inherits( "Editor" ) ) ) + ( !MainWindow::self->isAFormWindowChild( TQT_TQOBJECT(tqApp->focusWidget()) ) && + !tqApp->focusWidget()->inherits( "Editor" ) ) ) w->setFocus(); } @@ -1635,8 +1635,8 @@ PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, Pr box = new TQHBox( listview->viewport() ); box->hide(); pixPrev = new TQLabel( box ); - pixPrev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Minimum ) ); - pixPrev->setBackgroundColor( pixPrev->tqcolorGroup().color( TQColorGroup::Base ) ); + pixPrev->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Minimum ) ); + pixPrev->setBackgroundColor( pixPrev->colorGroup().color( TQColorGroup::Base ) ); button = new TQPushButton( "...", box ); setupStyle( button ); button->setFixedWidth( 20 ); @@ -1679,7 +1679,7 @@ void PropertyPixmapItem::setValue( const TQVariant &v ) else pixPrev->setPixmap( v.toImage() ); PropertyItem::setValue( v ); - tqrepaint(); + repaint(); } void PropertyPixmapItem::getPixmap() @@ -1714,8 +1714,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) if ( !pix.isNull() ) { p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), - (int)(p->tqworldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), + (int)(p->worldMatrix().dy() + r.y()) ), r.size() ) ); p->drawPixmap( r.x(), r.y() + ( r.height() - pix.height() ) / 2, pix ); p->restore(); @@ -1726,8 +1726,8 @@ void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) // -------------------------------------------------------------- PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, - const TQString &propName, bool tqchildren ) - : PropertyItem( l, after, prop, propName ), withChildren( tqchildren ) + const TQString &propName, bool children ) + : PropertyItem( l, after, prop, propName ), withChildren( children ) { box = new TQHBox( listview->viewport() ); box->hide(); @@ -2224,7 +2224,7 @@ void PropertySizePolicyItem::setValue( const TQVariant &v ) return; TQString s = i18n( "%1/%2/%3/%4" ); - s = s.tqarg( size_type_to_string( v.toSizePolicy().horData() ) ). + s = s.arg( size_type_to_string( v.toSizePolicy().horData() ) ). arg( size_type_to_string( v.toSizePolicy().verData() ) ). arg( v.toSizePolicy().horStretch() ). arg( v.toSizePolicy().verStretch() ); @@ -2298,7 +2298,7 @@ void PropertyPaletteItem::setValue( const TQVariant &v ) TQString s; palettePrev->setPalette( v.toPalette() ); PropertyItem::setValue( v ); - tqrepaint(); + repaint(); } void PropertyPaletteItem::getPalette() @@ -2311,7 +2311,7 @@ void PropertyPaletteItem::getPalette() w = ( (TQScrollView*)w )->viewport(); TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(), #if defined(TQT_NON_COMMERCIAL) - w->backgroundMode(), listview->tqtopLevelWidget(), + w->backgroundMode(), listview->topLevelWidget(), #else w->backgroundMode(), listview, #endif @@ -2331,8 +2331,8 @@ void PropertyPaletteItem::drawCustomContents( TQPainter *p, const TQRect &r ) { TQPalette pal( value().toPalette() ); p->save(); - p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()), - (int)(p->tqworldMatrix().dy() + r.y()) ), + p->setClipRect( TQRect( TQPoint( (int)(p->worldMatrix().dx() + r.x()), + (int)(p->worldMatrix().dy() + r.y()) ), r.size() ) ); TQRect r2( r ); r2.setX( r2.x() + 2 ); @@ -2411,7 +2411,7 @@ void PropertyCursorItem::showEditor() PropertyItem::showEditor(); if ( !comb ) { combo()->blockSignals( TRUE ); - combo()->setCurrentItem( (int)value().toCursor().tqshape() ); + combo()->setCurrentItem( (int)value().toCursor().shape() ); combo()->blockSignals( FALSE ); } placeEditor( combo() ); @@ -2434,7 +2434,7 @@ void PropertyCursorItem::setValue( const TQVariant &v ) return; combo()->blockSignals( TRUE ); - combo()->setCurrentItem( (int)v.toCursor().tqshape() ); + combo()->setCurrentItem( (int)v.toCursor().shape() ); combo()->blockSignals( FALSE ); setText( 1, combo()->currentText() ); PropertyItem::setValue( v ); @@ -2678,7 +2678,7 @@ void EnumBox::popupClosed() void EnumBox::paintEvent( TQPaintEvent * ) { TQPainter p( this ); - const TQColorGroup & g = tqcolorGroup(); + const TQColorGroup & g = colorGroup(); p.setPen(g.text()); TQStyle::SFlags flags = TQStyle::Style_Default; @@ -2692,7 +2692,7 @@ void EnumBox::paintEvent( TQPaintEvent * ) &g.brush( TQColorGroup::Button ) ); return; } - tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, + tqstyle().drawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g, flags, TQStyle::SC_All, (arrowDown ? TQStyle::SC_ComboBoxArrow : @@ -2700,7 +2700,7 @@ void EnumBox::paintEvent( TQPaintEvent * ) TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxEditField ); - re = TQStyle::tqvisualRect(re, this); + re = TQStyle::visualRect(re, this); p.setClipRect( re ); if ( !str.isNull() ) { @@ -2730,7 +2730,7 @@ void EnumBox::popup() popupShown = FALSE; return; } - pop->move( ((TQWidget*)parent())->mapToGlobal( tqgeometry().bottomLeft() ) ); + pop->move( ((TQWidget*)parent())->mapToGlobal( geometry().bottomLeft() ) ); pop->setMinimumWidth( width() ); emit aboutToShowPopup(); pop->show(); @@ -2744,13 +2744,13 @@ void EnumBox::mousePressEvent( TQMouseEvent *e ) TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this, TQStyle::SC_ComboBoxArrow); - arrowRect = TQStyle::tqvisualRect(arrowRect, this); + arrowRect = TQStyle::visualRect(arrowRect, this); arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); if ( arrowRect.contains( e->pos() ) ) { arrowDown = TRUE; - tqrepaint( FALSE ); + repaint( FALSE ); } popup(); @@ -2770,13 +2770,13 @@ void EnumBox::keyPressEvent( TQKeyEvent *e ) void EnumBox::restoreArrow() { arrowDown = FALSE; - tqrepaint( FALSE ); + repaint( FALSE ); } void EnumBox::setText( const TQString &text ) { str = text; - tqrepaint( FALSE ); + repaint( FALSE ); } @@ -3040,7 +3040,7 @@ void PropertyList::setupProperties() if ( !editor->widget() ) return; bool allProperties = !::tqqt_cast<Spacer*>(editor->widget()); - TQStrList lst = editor->widget()->tqmetaObject()->propertyNames( allProperties ); + TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties ); PropertyItem *item = 0; TQMap<TQString, bool> unique; TQObject *w = editor->widget(); @@ -3051,11 +3051,11 @@ void PropertyList::setupProperties() WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { const TQMetaProperty* p = - editor->widget()->tqmetaObject()-> - property( editor->widget()->tqmetaObject()->findProperty( it.current(), allProperties), allProperties ); + editor->widget()->metaObject()-> + property( editor->widget()->metaObject()->findProperty( it.current(), allProperties), allProperties ); if ( !p ) continue; - if ( unique.contains( TQString::tqfromLatin1( it.current() ) ) ) + if ( unique.contains( TQString::fromLatin1( it.current() ) ) ) continue; if ( ::tqqt_cast<QDesignerToolBar*>(editor->widget()) || ::tqqt_cast<MenuBarEditor*>(editor->widget()) ) { @@ -3071,12 +3071,12 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; - if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) continue; } - unique.insert( TQString::tqfromLatin1( it.current() ), TRUE ); + unique.insert( TQString::fromLatin1( it.current() ), TRUE ); if ( editor->widget()->isWidgetType() && editor->formWindow()->isMainContainer( TQT_TQOBJECT(editor->widget()) ) ) { if ( qstrcmp( p->name(), "geometry" ) == 0 ) @@ -3107,9 +3107,9 @@ void PropertyList::setupProperties() continue; if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 ) + if ( qstrcmp( p->name(), "minimumSize" ) == 0 ) continue; - if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 ) + if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) continue; if ( qstrcmp( p->name(), "enabled" ) == 0 ) continue; @@ -3164,7 +3164,7 @@ void PropertyList::setupProperties() isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) && ( !isPropertyObject || qstrcmp( p->name(), "name" ) != 0 ) ) { if ( p->isSetType() ) { - if ( TQString( p->name() ) == "tqalignment" ) { + if ( TQString( p->name() ) == "alignment" ) { TQStringList lst; lst << p->valueToKey( AlignAuto ) << p->valueToKey( AlignLeft ) @@ -3486,7 +3486,7 @@ void PropertyList::valueChanged( PropertyItem *i ) { if ( !editor->widget() ) return; - TQString pn( i18n( "Set '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); + 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() ), @@ -3500,7 +3500,7 @@ void PropertyList::layoutInitValue( PropertyItem *i, bool changed ) { if ( !editor->widget() ) return; - TQString pn( i18n( "Set '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); + 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() ), @@ -3692,25 +3692,25 @@ static void clearAlignList( TQStrList &l ) void PropertyList::setPropertyValue( PropertyItem *i ) { const TQMetaProperty *p = - editor->widget()->tqmetaObject()-> - property( editor->widget()->tqmetaObject()->findProperty( i->name(), TRUE), TRUE ); + editor->widget()->metaObject()-> + property( editor->widget()->metaObject()->findProperty( i->name(), TRUE), TRUE ); if ( !p ) { if ( i->name() == "hAlign" ) { - int align = editor->widget()->property( "tqalignment" ).toInt(); - p = editor->widget()->tqmetaObject()-> - property( editor->widget()->tqmetaObject()->findProperty( "tqalignment", TRUE ), TRUE ); + int align = editor->widget()->property( "alignment" ).toInt(); + p = editor->widget()->metaObject()-> + property( editor->widget()->metaObject()->findProperty( "alignment", 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( "tqalignment" ).toInt(); - p = editor->widget()->tqmetaObject()-> - property( editor->widget()->tqmetaObject()->findProperty( "tqalignment", TRUE ), TRUE ); + int align = editor->widget()->property( "alignment" ).toInt(); + p = editor->widget()->metaObject()-> + property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE ); align &= ~AlignHorizontal_Mask; ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() ); } else if ( i->name() == "wordwrap" ) { - int align = editor->widget()->property( "tqalignment" ).toInt(); + int align = editor->widget()->property( "alignment" ).toInt(); if ( align & WordBreak ) i->setValue( TQVariant( TRUE, 0 ) ); else @@ -3769,7 +3769,7 @@ void PropertyList::resetProperty() PropertyItem *i = (PropertyItem*)currentItem(); if ( !MetaDataBase::isPropertyChanged( editor->widget(), i->PropertyItem::name() ) ) return; - TQString pn( i18n( "Reset '%1' of '%2'" ).tqarg( i->name() ).tqarg( editor->widget()->name() ) ); + TQString pn( i18n( "Reset '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) ); SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(), editor->widget(), editor, i->name(), i->value(), @@ -3864,7 +3864,7 @@ TQString PropertyList::whatsThisText( TQListViewItem *i ) if ( ( (PropertyItem*)i )->propertyParent() ) i = ( (PropertyItem*)i )->propertyParent(); - const TQMetaObject *mo = editor->widget()->tqmetaObject(); + const TQMetaObject *mo = editor->widget()->metaObject(); TQString prop = ( (PropertyItem*)i )->name(); while ( mo ) { TQString s; @@ -3873,10 +3873,10 @@ TQString PropertyList::whatsThisText( TQListViewItem *i ) if ( ( it = propertyDocs.find( s ) ) != propertyDocs.end() ) { return *it; } - mo = mo->tqsuperClass(); + mo = mo->superClass(); } - return i18n( "<p><b>TQWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).tqarg( prop ); + return i18n( "<p><b>TQWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).arg( prop ); } void PropertyList::readPropertyDocs() @@ -4190,7 +4190,7 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) wid = w; formwindow = fw; - setCaption( i18n( "Property Editor (%1)" ).tqarg( formwindow->name() ) ); + setCaption( i18n( "Property Editor (%1)" ).arg( formwindow->name() ) ); listview->viewport()->setUpdatesEnabled( FALSE ); listview->setUpdatesEnabled( FALSE ); clear(); @@ -4274,21 +4274,21 @@ TQString PropertyEditor::classOfCurrentProperty() const return TQString(); TQObject *o = wid; TQString curr = currentProperty(); - TQMetaObject *mo = o->tqmetaObject(); + TQMetaObject *mo = o->metaObject(); while ( mo ) { TQStrList props = mo->propertyNames( FALSE ); if ( props.find( curr.latin1() ) != -1 ) return mo->className(); - mo = mo->tqsuperClass(); + mo = mo->superClass(); } return TQString(); } -TQMetaObject* PropertyEditor::tqmetaObjectOfCurrentProperty() const +TQMetaObject* PropertyEditor::metaObjectOfCurrentProperty() const { if ( !wid ) return 0; - return wid->tqmetaObject(); + return wid->metaObject(); } void PropertyEditor::resetFocus() |