diff options
Diffstat (limited to 'kdevdesigner/designer/propertyeditor.cpp')
-rw-r--r-- | kdevdesigner/designer/propertyeditor.cpp | 268 |
1 files changed, 132 insertions, 136 deletions
diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp index 10fd4aaf..af1d26d7 100644 --- a/kdevdesigner/designer/propertyeditor.cpp +++ b/kdevdesigner/designer/propertyeditor.cpp @@ -294,7 +294,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(); } @@ -417,8 +417,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(); @@ -555,7 +555,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(); } @@ -598,7 +598,7 @@ TQLineEdit *PropertyTextItem::lined() if ( asciiOnly ) { if ( PropertyItem::name() == "name" ) { - lin->setValidator( new AsciiValidator( TQString(":"), TQT_TQOBJECT(lin), "ascii_validator" ) ); + lin->setValidator( new AsciiValidator( TQString(":"), lin, "ascii_validator" ) ); if ( listview->propertyEditor()->formWindow()->isFake() ) lin->setEnabled( FALSE ); } else { @@ -606,7 +606,7 @@ TQLineEdit *PropertyTextItem::lined() "\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(); @@ -614,18 +614,18 @@ TQLineEdit *PropertyTextItem::lined() button = new TQPushButton( "...", box ); setupStyle( button ); 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; } @@ -753,7 +753,7 @@ void PropertyTextItem::setValue() void PropertyTextItem::getText() { - bool richText = !::tqqt_cast<TQButton*>(listview->propertyEditor()->widget()) || + bool richText = !::tqt_cast<TQButton*>(listview->propertyEditor()->widget()) || ( text( 0 ) == "whatsThis" ); bool doWrap = FALSE; TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap ); @@ -781,12 +781,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; } @@ -861,12 +861,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; } @@ -910,13 +910,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 ); @@ -936,9 +936,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; @@ -985,13 +985,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 ); @@ -1011,9 +1011,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; @@ -1060,13 +1060,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 ); @@ -1089,8 +1089,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; } @@ -1182,12 +1182,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; } @@ -1278,12 +1278,12 @@ TQSpinBox* PropertyLayoutItem::spinBox() spinBx->setSpecialValueText( i18n( "default" ) ); 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; } @@ -1347,11 +1347,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; @@ -1644,8 +1644,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() @@ -1747,8 +1747,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() @@ -1869,8 +1869,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() @@ -2026,13 +2026,13 @@ void PropertyDatabaseItem::initChildren() else if ( lst.count() > 0 ) item->setValue( TQStringList( lst[ 0 ] ) ); else if ( withField ) - item->setValue( TQStringList( MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), + item->setValue( TQStringList( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList()[ 0 ] ) ); if ( lst.count() > 0 && !lst[ 0 ].isEmpty() ) item->setCurrentItem( lst[ 0 ] ); else if ( !isChanged() && withField ) - item->setCurrentItem( MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), + item->setCurrentItem( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList()[ 0 ] ); else item->setCurrentItem( 0 ); @@ -2044,7 +2044,7 @@ void PropertyDatabaseItem::initChildren() else if ( lst.count() > 1 ) item->setValue( TQStringList( lst[ 1 ] ) ); else if ( withField ) { - TQStringList fakeLst = MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList(); + TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList(); if ( fakeLst.count() > 1 ) item->setValue( fakeLst[ 1 ] ); } @@ -2052,7 +2052,7 @@ void PropertyDatabaseItem::initChildren() if ( lst.count() > 1 && !lst[ 1 ].isEmpty() ) item->setCurrentItem( lst[ 1 ] ); else if ( !isChanged() && withField ) { - TQStringList fakeLst = MetaDataBase::fakeProperty( TQT_TQOBJECT(listview->propertyEditor()->formWindow()->mainContainer()), "database" ).toStringList(); + TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList(); if ( fakeLst.count() > 1 ) item->setCurrentItem( fakeLst[ 1 ] ); else @@ -2269,8 +2269,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() { @@ -2307,14 +2307,10 @@ void PropertyPaletteItem::getPalette() return; bool ok = FALSE; TQWidget *w = (TQWidget*)listview->propertyEditor()->widget(); - if ( ::tqqt_cast<TQScrollView*>(w) ) + if ( ::tqt_cast<TQScrollView*>(w) ) 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; @@ -2395,8 +2391,8 @@ TQComboBox *PropertyCursorItem::combo() comb->insertItem( HandPix, i18n("Pointing Hand"), TQObject::PointingHandCursor ); comb->insertItem( NoPix, 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; } @@ -2463,8 +2459,8 @@ PropertyKeysequenceItem::PropertyKeysequenceItem( PropertyList *l, box = new TQHBox( listview->viewport() ); box->hide(); sequence = new TQLineEdit( box ); - connect( sequence, TQT_SIGNAL(textChanged( const TQString & )), - this, TQT_SLOT(setValue()) ); + connect( sequence, TQ_SIGNAL(textChanged( const TQString & )), + this, TQ_SLOT(setValue()) ); sequence->installEventFilter( this ); } @@ -2658,8 +2654,8 @@ EnumBox::EnumBox( TQWidget *parent, const char *name ) : TQComboBox( parent, name ) { pop = new EnumPopup( this, "popup", TQObject::WType_Popup ); - connect( pop, TQT_SIGNAL( hidden() ), this, TQT_SLOT( popupHidden() ) ); - connect( pop, TQT_SIGNAL( closed() ), this, TQT_SLOT( popupClosed() ) ); + connect( pop, TQ_SIGNAL( hidden() ), this, TQ_SLOT( popupHidden() ) ); + connect( pop, TQ_SIGNAL( closed() ), this, TQ_SLOT( popupClosed() ) ); popupShown = FALSE; arrowDown = FALSE; } @@ -2739,7 +2735,7 @@ void EnumBox::popup() void EnumBox::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() != Qt::LeftButton ) + if ( e->button() != TQt::LeftButton ) return; TQRect arrowRect = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, @@ -2754,14 +2750,14 @@ void EnumBox::mousePressEvent( TQMouseEvent *e ) } popup(); - TQTimer::singleShot( 100, this, TQT_SLOT( restoreArrow() ) ); + TQTimer::singleShot( 100, this, TQ_SLOT( restoreArrow() ) ); } void EnumBox::keyPressEvent( TQKeyEvent *e ) { if ( e->key() == Key_Space ) { popup(); - TQTimer::singleShot( 100, this, TQT_SLOT( restoreArrow() ) ); + TQTimer::singleShot( 100, this, TQ_SLOT( restoreArrow() ) ); } else if ( e->key() == Key_Enter || e->key() == Key_Return ) { popup(); } @@ -2790,8 +2786,8 @@ PropertyEnumItem::PropertyEnumItem( PropertyList *l, box = new EnumBox( listview->viewport() ); box->hide(); box->installEventFilter( listview ); - connect( box, TQT_SIGNAL( aboutToShowPopup() ), this, TQT_SLOT( insertEnums() ) ); - connect( box, TQT_SIGNAL( valueChanged() ), this, TQT_SLOT( setValue() ) ); + connect( box, TQ_SIGNAL( aboutToShowPopup() ), this, TQ_SLOT( insertEnums() ) ); + connect( box, TQ_SIGNAL( valueChanged() ), this, TQ_SLOT( setValue() ) ); } PropertyEnumItem::~PropertyEnumItem() @@ -2921,16 +2917,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 ); @@ -3023,7 +3019,7 @@ static bool parent_is_data_aware( TQWidget *w ) { TQWidget *p = w ? w->parentWidget() : 0; while ( p && !p->isTopLevel() ) { - if ( ::tqqt_cast<QDesignerDataBrowser*>(p) || ::tqqt_cast<QDesignerDataView*>(p) ) + if ( ::tqt_cast<QDesignerDataBrowser*>(p) || ::tqt_cast<QDesignerDataView*>(p) ) return TRUE; p = p->parentWidget(); } @@ -3039,7 +3035,7 @@ void PropertyList::setupProperties() { if ( !editor->widget() ) return; - bool allProperties = !::tqqt_cast<Spacer*>(editor->widget()); + bool allProperties = !::tqt_cast<Spacer*>(editor->widget()); TQStrList lst = editor->widget()->metaObject()->propertyNames( allProperties ); PropertyItem *item = 0; TQMap<TQString, bool> unique; @@ -3047,7 +3043,7 @@ void PropertyList::setupProperties() TQStringList valueSet; bool parentHasLayout = w->isWidgetType() && - !editor->formWindow()->isMainContainer( TQT_TQOBJECT(w) ) && ( (TQWidget*)w )->parentWidget() && + !editor->formWindow()->isMainContainer( w ) && ( (TQWidget*)w )->parentWidget() && WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { const TQMetaProperty* p = @@ -3057,8 +3053,8 @@ void PropertyList::setupProperties() continue; if ( unique.contains( TQString::fromLatin1( it.current() ) ) ) continue; - if ( ::tqqt_cast<QDesignerToolBar*>(editor->widget()) || - ::tqqt_cast<MenuBarEditor*>(editor->widget()) ) { + if ( ::tqt_cast<QDesignerToolBar*>(editor->widget()) || + ::tqt_cast<MenuBarEditor*>(editor->widget()) ) { if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) continue; if ( qstrcmp( p->name(), "minimumWidth" ) == 0 ) @@ -3078,7 +3074,7 @@ void PropertyList::setupProperties() } unique.insert( TQString::fromLatin1( it.current() ), TRUE ); if ( editor->widget()->isWidgetType() && - editor->formWindow()->isMainContainer( TQT_TQOBJECT(editor->widget()) ) ) { + editor->formWindow()->isMainContainer( editor->widget() ) ) { if ( qstrcmp( p->name(), "geometry" ) == 0 ) continue; } else { // hide some toplevel-only stuff @@ -3094,7 +3090,7 @@ void PropertyList::setupProperties() continue; if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 ) continue; - if ( ::tqqt_cast<TQLayoutWidget*>(w) || ::tqqt_cast<Spacer*>(w) ) { + if ( ::tqt_cast<TQLayoutWidget*>(w) || ::tqt_cast<Spacer*>(w) ) { if ( qstrcmp( p->name(), "sizePolicy" ) == 0 ) continue; if ( qstrcmp( p->name(), "minimumHeight" ) == 0 ) @@ -3137,7 +3133,7 @@ void PropertyList::setupProperties() continue; } } - if ( ::tqqt_cast<TQActionGroup*>(w) ) { + if ( ::tqt_cast<TQActionGroup*>(w) ) { if ( qstrcmp( p->name(), "usesDropDown" ) == 0 ) continue; if ( qstrcmp( p->name(), "toggleAction" ) == 0 ) @@ -3154,7 +3150,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() || - !::tqqt_cast<TQButtonGroup*>(editor->widget()->parent()) ) + !::tqt_cast<TQButtonGroup*>(editor->widget()->parent()) ) continue; } @@ -3176,7 +3172,7 @@ void PropertyList::setupProperties() setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) ) item->setChanged( TRUE, FALSE ); - if ( !::tqqt_cast<TQMultiLineEdit*>(editor->widget()) ) { + if ( !::tqt_cast<TQMultiLineEdit*>(editor->widget()) ) { lst.clear(); lst << p->valueToKey( AlignTop ) << p->valueToKey( AlignVCenter ) @@ -3187,7 +3183,7 @@ void PropertyList::setupProperties() if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) ) item->setChanged( TRUE, FALSE ); item = new PropertyBoolItem( this, item, 0, "wordwrap" ); - if ( ::tqqt_cast<TQGroupBox*>(w) ) + if ( ::tqt_cast<TQGroupBox*>(w) ) item->setVisible( FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) @@ -3235,7 +3231,7 @@ void PropertyList::setupProperties() } } - if ( !::tqqt_cast<TQSplitter*>(w) && !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<QDesignerToolBar*>(w) && + if ( !::tqt_cast<TQSplitter*>(w) && !::tqt_cast<MenuBarEditor*>(w) && !::tqt_cast<QDesignerToolBar*>(w) && w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) { item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" ); setPropertyValue( item ); @@ -3252,8 +3248,8 @@ void PropertyList::setupProperties() else layoutInitValue( item ); TQWidget *widget = (TQWidget*)w; - if ( ( !::tqqt_cast<TQLayoutWidget*>(widget) && - widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) { + if ( ( !::tqt_cast<TQLayoutWidget*>(widget) && + widget->parentWidget() && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) ) { item = new PropertyListItem( this, item, 0, "resizeMode", FALSE ); TQStringList lst; lst << "Auto" << "FreeResize" << "Minimum" << "Fixed"; @@ -3268,8 +3264,8 @@ void PropertyList::setupProperties() } } - if ( !::tqqt_cast<Spacer*>(w) && !::tqqt_cast<TQLayoutWidget*>(w) && - !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<QDesignerToolBar*>(w) ) { + if ( !::tqt_cast<Spacer*>(w) && !::tqt_cast<TQLayoutWidget*>(w) && + !::tqt_cast<MenuBarEditor*>(w) && !::tqt_cast<QDesignerToolBar*>(w) ) { item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) ) @@ -3281,16 +3277,16 @@ void PropertyList::setupProperties() } #ifndef TQT_NO_SQL - if ( !::tqqt_cast<TQDataTable*>(editor->widget()) && !::tqqt_cast<TQDataBrowser*>(editor->widget()) && - !::tqqt_cast<TQDataView*>(editor->widget()) && parent_is_data_aware( ::tqqt_cast<TQWidget*>(editor->widget()) ) ) { - item = new PropertyDatabaseItem( this, item, 0, "database", TQT_BASE_OBJECT(editor->formWindow()->mainContainer()) != TQT_BASE_OBJECT(w) ); + if ( !::tqt_cast<TQDataTable*>(editor->widget()) && !::tqt_cast<TQDataBrowser*>(editor->widget()) && + !::tqt_cast<TQDataView*>(editor->widget()) && parent_is_data_aware( ::tqt_cast<TQWidget*>(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 ( ::tqqt_cast<TQDataTable*>(editor->widget()) || ::tqqt_cast<TQDataBrowser*>(editor->widget()) || - ::tqqt_cast<TQDataView*>(editor->widget()) ) { + if ( ::tqt_cast<TQDataTable*>(editor->widget()) || ::tqt_cast<TQDataBrowser*>(editor->widget()) || + ::tqt_cast<TQDataView*>(editor->widget()) ) { item = new PropertyDatabaseItem( this, item, 0, "database", FALSE ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) ) @@ -3373,14 +3369,14 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, switch ( t ) { case TQVariant::String: item = new PropertyTextItem( this, item, 0, name, TRUE, - ::tqqt_cast<TQLabel*>(editor->widget()) || - ::tqqt_cast<TQTextView*>(editor->widget()) || - ::tqqt_cast<TQButton*>(editor->widget()) ); + ::tqt_cast<TQLabel*>(editor->widget()) || + ::tqt_cast<TQTextView*>(editor->widget()) || + ::tqt_cast<TQButton*>(editor->widget()) ); 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: @@ -3546,15 +3542,15 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) else if ( e->type() == TQEvent::MouseButtonPress ) theLastEvent = MouseEvent; - 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 ( ( !::tqqt_cast<TQLineEdit*>(o) || - ( ::tqqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && + } else if ( ( !::tqt_cast<TQLineEdit*>(o) || + ( ::tqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && i && i->hasSubItems() ) { if ( !i->isOpen() && ( ke->key() == Key_Plus || @@ -3564,21 +3560,21 @@ 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 ) && ::tqqt_cast<TQComboBox*>(o) ) { + } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && ::tqt_cast<TQComboBox*>(o) ) { TQKeyEvent ke2( TQEvent::KeyPress, Key_Space, 0, 0 ); TQApplication::sendEvent( o, &ke2 ); return TRUE; } - } else if ( e->type() == TQEvent::FocusOut && ::tqqt_cast<TQLineEdit*>(o) && 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 && ::tqt_cast<TQLineEdit*>(o) && editor->formWindow() ) { + TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQ_SLOT( checkCompressedCommand() ) ); + } else if ( o == viewport() ) { TQMouseEvent *me; PropertyListItem* i; switch ( e->type() ) { case TQEvent::MouseButtonPress: me = (TQMouseEvent*)e; i = (PropertyListItem*) itemAt( me->pos() ); - if ( i && ( ::tqqt_cast<PropertyColorItem*>(i) || ::tqqt_cast<PropertyPixmapItem*>(i) ) ) { + if ( i && ( ::tqt_cast<PropertyColorItem*>(i) || ::tqt_cast<PropertyPixmapItem*>(i) ) ) { pressItem = i; pressPos = me->pos(); mousePressed = TRUE; @@ -3586,13 +3582,13 @@ 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 ) { if (( pressPos - me->pos() ).manhattanLength() > TQApplication::startDragDistance() ){ - if ( ::tqqt_cast<PropertyColorItem*>(i) ) { + if ( ::tqt_cast<PropertyColorItem*>(i) ) { TQColor col = i->value().asColor(); TQColorDrag *drg = new TQColorDrag( col, this ); TQPixmap pix( 25, 25 ); @@ -3604,7 +3600,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) mousePressed = FALSE; drg->dragCopy(); } - else if ( ::tqqt_cast<PropertyPixmapItem*>(i) ) { + else if ( ::tqt_cast<PropertyPixmapItem*>(i) ) { TQPixmap pix = i->value().asPixmap(); if( !pix.isNull() ) { TQImage img = pix.convertToImage(); @@ -3621,7 +3617,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 ); @@ -3716,11 +3712,11 @@ void PropertyList::setPropertyValue( PropertyItem *i ) else i->setValue( TQVariant( false ) ); } else if ( i->name() == "layoutSpacing" ) { - ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) ) )); + ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( static_cast<TQWidget*>(editor->widget()) ) )); } else if ( i->name() == "layoutMargin" ) { - ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) ) )); + ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( WidgetFactory::containerOfWidget( static_cast<TQWidget*>(editor->widget()) ) )); } else if ( i->name() == "resizeMode" ) { - ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) ) )) ); + ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( static_cast<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" ) ) { @@ -3790,9 +3786,9 @@ void PropertyList::viewportDragEnterEvent( TQDragEnterEvent *e ) return; } - if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) + if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) e->accept(); - else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) + else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) e->accept(); else e->ignore(); @@ -3806,9 +3802,9 @@ void PropertyList::viewportDragMoveEvent ( TQDragMoveEvent *e ) return; } - if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) + if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) e->accept(); - else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) + else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) e->accept(); else e->ignore(); @@ -3822,14 +3818,14 @@ void PropertyList::viewportDropEvent ( TQDropEvent *e ) return; } - if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) { + if ( ::tqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) { TQColor color; TQColorDrag::decode( e, color ); i->setValue( TQVariant( color ) ); valueChanged( i ); e->accept(); } - else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) { + else if ( ::tqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) { TQImage img; TQImageDrag::decode( e, img ); TQPixmap pm; @@ -3922,8 +3918,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 * ) ) ); } TQString clean_arguments( const TQString &s ) @@ -3970,7 +3966,7 @@ void EventList::setup() it.current(), TQString(), TQString() ); eventItem->setOpen( TRUE ); TQValueList<MetaDataBase::Connection> conns = - MetaDataBase::connections( TQT_TQOBJECT(formWindow), TQT_TQOBJECT(editor->widget()), TQT_TQOBJECT(formWindow->mainContainer()) ); + MetaDataBase::connections( formWindow, editor->widget(), formWindow->mainContainer() ); HierarchyItem *item = 0; for ( TQValueList<MetaDataBase::Connection>::Iterator cit = conns.begin(); cit != conns.end(); ++cit ) { @@ -4046,7 +4042,7 @@ void EventList::showRMBMenu( TQListViewItem *i, const TQPoint &pos ) } else if ( res == DEL_ITEM && i->parent() ) { MetaDataBase::Connection conn; conn.sender = editor->widget(); - conn.receiver = TQT_TQOBJECT(formWindow->mainContainer()); + conn.receiver = formWindow->mainContainer(); conn.signal = i->parent()->text( 0 ); conn.slot = i->text( 0 ); delete i; @@ -4080,7 +4076,7 @@ void EventList::renamed( TQListViewItem *i ) } else { MetaDataBase::Connection conn; conn.sender = editor->widget(); - conn.receiver = TQT_TQOBJECT(formWindow->mainContainer()); + conn.receiver = formWindow->mainContainer(); conn.signal = i->parent()->text( 0 ); conn.slot = i->text( 0 ); AddConnectionCommand *cmd = new AddConnectionCommand( i18n( "Add Connection" ), |