diff options
Diffstat (limited to 'kdevdesigner/designer/propertyeditor.cpp')
-rw-r--r-- | kdevdesigner/designer/propertyeditor.cpp | 694 |
1 files changed, 345 insertions, 349 deletions
diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp index 10fd4aaf..41d21a02 100644 --- a/kdevdesigner/designer/propertyeditor.cpp +++ b/kdevdesigner/designer/propertyeditor.cpp @@ -151,7 +151,7 @@ bool PropertyWhatsThis::clicked( const TQString& href ) TQAssistantClient *ac = MainWindow::self->assistantClient(); ac->showPage( TQString( tqInstallPathDocs() ) + "/html/" + href ); } - return FALSE; // do not hide window + return false; // do not hide window } @@ -173,10 +173,10 @@ bool PropertyWhatsThis::clicked( const TQString& href ) PropertyItem::PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName ) : TQListViewItem( l, after ), listview( l ), property( prop ), propertyName( propName ) { - setSelectable( FALSE ); - open = FALSE; + setSelectable( false ); + open = false; setText( 0, propertyName ); - changed = FALSE; + changed = false; setText( 1, "" ); resetButton = 0; } @@ -247,7 +247,7 @@ void PropertyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, if ( isChanged() && column == 0 ) { p->save(); TQFont f = p->font(); - f.setBold( TRUE ); + f.setBold( true ); p->setFont( f ); } @@ -294,18 +294,18 @@ 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(); } -/*! Subclasses which are expandable items have to return TRUE - here. Default is FALSE. +/*! Subclasses which are expandable items have to return true + here. Default is false. */ bool PropertyItem::hasSubItems() const { - return FALSE; + return false; } /*! Returns the parent property item here if this is a child or 0 @@ -329,9 +329,9 @@ void PropertyItem::setOpen( bool b ) open = b; if ( !open ) { - children.setAutoDelete( TRUE ); + children.setAutoDelete( true ); children.clear(); - children.setAutoDelete( FALSE ); + children.setAutoDelete( false ); tqApp->processEvents(); listview->updateEditorSize(); return; @@ -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(); @@ -429,7 +429,7 @@ void PropertyItem::updateResetButtonState() if ( !resetButton ) return; if ( propertyParent() || !WidgetFactory::canResetProperty( listview->propertyEditor()->widget(), name() ) ) - resetButton->setEnabled( FALSE ); + resetButton->setEnabled( false ); else resetButton->setEnabled( isChanged() ); } @@ -445,7 +445,7 @@ void PropertyItem::placeEditor( TQWidget *w ) if ( !r.size().isValid() ) { listview->ensureItemVisible( this ); #if defined(TQ_WS_WIN) - listview->repaintContents( FALSE ); + listview->repaintContents( false ); #endif r = listview->itemRect( this ); } @@ -468,12 +468,12 @@ void PropertyItem::notifyValueChange() { if ( !propertyParent() ) { listview->valueChanged( this ); - setChanged( TRUE ); + setChanged( true ); if ( hasSubItems() ) initChildren(); } else { propertyParent()->childValueChanged( this ); - setChanged( TRUE ); + setChanged( true ); } } @@ -507,12 +507,12 @@ PropertyItem *PropertyItem::child( int i ) const /*! If the contents of the item is not displayable with a text, but you want to draw it yourself (using drawCustomContents()), return - TRUE here. + true here. */ bool PropertyItem::hasCustomContents() const { - return FALSE; + return false; } /*! @@ -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,15 +598,15 @@ 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 ); + lin->setEnabled( false ); } 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(); @@ -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() ) ); - lin->setFrame( FALSE ); + 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; } @@ -657,16 +657,16 @@ void PropertyTextItem::childValueChanged( PropertyItem *child ) PropertyItem::name(), child->value().toString() ); else MetaDataBase::setExportMacro( listview->propertyEditor()->widget(), child->value().toString() ); - listview->propertyEditor()->formWindow()->commandHistory()->setModified( TRUE ); + listview->propertyEditor()->formWindow()->commandHistory()->setModified( true ); } void PropertyTextItem::showEditor() { PropertyItem::showEditor(); if ( !lin || lin->text().length() == 0 ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setText( value().toString() ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } TQWidget* w; @@ -686,7 +686,7 @@ void PropertyTextItem::createChildren() { PropertyTextItem *i = new PropertyTextItem( listview, this, this, PropertyItem::name() == "name" ? - "export macro" : "comment", FALSE, FALSE, + "export macro" : "comment", false, false, PropertyItem::name() == "name" ); i->lined()->setEnabled( isChanged() ); addChild( i ); @@ -724,13 +724,13 @@ void PropertyTextItem::setValue( const TQVariant &v ) && value() == v ) return; if ( lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); int oldCursorPos; oldCursorPos = lin->cursorPosition(); lined()->setText( v.toString() ); if ( oldCursorPos < (int)lin->text().length() ) lin->setCursorPosition( oldCursorPos ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } setText( 1, v.toString() ); PropertyItem::setValue( v ); @@ -753,17 +753,17 @@ 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; + bool doWrap = false; TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap ); if ( !txt.isEmpty() ) { setText( 1, txt ); PropertyItem::setValue( txt ); notifyValueChange(); - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setText( txt ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } } @@ -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; } @@ -801,9 +801,9 @@ void PropertyDoubleItem::showEditor() { PropertyItem::showEditor(); if ( !lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setText( TQString::number( value().toDouble() ) ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } TQWidget* w = lined(); @@ -827,13 +827,13 @@ void PropertyDoubleItem::setValue( const TQVariant &v ) if ( value() == v ) return; if ( lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); int oldCursorPos; oldCursorPos = lin->cursorPosition(); lined()->setText( TQString::number( v.toDouble() ) ); if ( oldCursorPos < (int)lin->text().length() ) lin->setCursorPosition( oldCursorPos ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } setText( 1, TQString::number( v.toDouble() ) ); PropertyItem::setValue( v ); @@ -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; } @@ -880,9 +880,9 @@ void PropertyDateItem::showEditor() { PropertyItem::showEditor(); if ( !lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setDate( value().toDate() ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } placeEditor( lin ); if ( !lin->isVisible() ) { @@ -905,18 +905,18 @@ void PropertyDateItem::setValue( const TQVariant &v ) return; if ( lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); if ( lined()->date() != v.toDate() ) lined()->setDate( v.toDate() ); - lined()->blockSignals( FALSE ); + 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; @@ -955,9 +955,9 @@ void PropertyTimeItem::showEditor() { PropertyItem::showEditor(); if ( !lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setTime( value().toTime() ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } placeEditor( lin ); if ( !lin->isVisible() ) { @@ -980,18 +980,18 @@ void PropertyTimeItem::setValue( const TQVariant &v ) return; if ( lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); if ( lined()->time() != v.toTime() ) lined()->setTime( v.toTime() ); - lined()->blockSignals( FALSE ); + 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; @@ -1030,9 +1030,9 @@ void PropertyDateTimeItem::showEditor() { PropertyItem::showEditor(); if ( !lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); lined()->setDateTime( value().toDateTime() ); - lined()->blockSignals( FALSE ); + lined()->blockSignals( false ); } placeEditor( lin ); if ( !lin->isVisible() ) { @@ -1055,18 +1055,18 @@ void PropertyDateTimeItem::setValue( const TQVariant &v ) return; if ( lin ) { - lined()->blockSignals( TRUE ); + lined()->blockSignals( true ); if ( lined()->dateTime() != v.toDateTime() ) lined()->setDateTime( v.toDateTime() ); - lined()->blockSignals( FALSE ); + 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 ); @@ -1085,12 +1085,12 @@ TQComboBox *PropertyBoolItem::combo() { if ( comb ) return comb; - comb = new TQComboBox( FALSE, listview->viewport() ); + comb = new TQComboBox( false, listview->viewport() ); 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; } @@ -1112,12 +1112,12 @@ void PropertyBoolItem::showEditor() { PropertyItem::showEditor(); if ( !comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); if ( value().toBool() ) combo()->setCurrentItem( 1 ); else combo()->setCurrentItem( 0 ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } placeEditor( combo() ); if ( !combo()->isVisible() || !combo()->hasFocus() ) { @@ -1139,12 +1139,12 @@ void PropertyBoolItem::setValue( const TQVariant &v ) return; if ( comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); if ( v.toBool() ) combo()->setCurrentItem( 1 ); else combo()->setCurrentItem( 0 ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } TQString tmp = i18n( "True" ); if ( !v.toBool() ) @@ -1158,7 +1158,7 @@ void PropertyBoolItem::setValue() if ( !comb ) return; setText( 1, combo()->currentText() ); - bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE; + bool b = combo()->currentItem() != 0; PropertyItem::setValue( TQVariant( b ) ); notifyValueChange(); } @@ -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; } @@ -1201,12 +1201,12 @@ void PropertyIntItem::showEditor() { PropertyItem::showEditor(); if ( !spinBx ) { - spinBox()->blockSignals( TRUE ); + spinBox()->blockSignals( true ); if ( signedValue ) spinBox()->setValue( value().toInt() ); else spinBox()->setValue( value().toUInt() ); - spinBox()->blockSignals( FALSE ); + spinBox()->blockSignals( false ); } placeEditor( spinBox() ); if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) { @@ -1228,12 +1228,12 @@ void PropertyIntItem::setValue( const TQVariant &v ) return; if ( spinBx ) { - spinBox()->blockSignals( TRUE ); + spinBox()->blockSignals( true ); if ( signedValue ) spinBox()->setValue( v.toInt() ); else spinBox()->setValue( v.toUInt() ); - spinBox()->blockSignals( FALSE ); + spinBox()->blockSignals( false ); } if ( signedValue ) @@ -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; } @@ -1291,9 +1291,9 @@ void PropertyLayoutItem::showEditor() { PropertyItem::showEditor(); if ( !spinBx ) { - spinBox()->blockSignals( TRUE ); + spinBox()->blockSignals( true ); spinBox()->setValue( value().toInt() ); - spinBox()->blockSignals( TRUE ); + spinBox()->blockSignals( true ); } placeEditor( spinBox() ); if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) { @@ -1311,9 +1311,9 @@ void PropertyLayoutItem::hideEditor() void PropertyLayoutItem::setValue( const TQVariant &v ) { if ( spinBx ) { - spinBox()->blockSignals( TRUE ); + spinBox()->blockSignals( true ); spinBox()->setValue( v.toInt() ); - spinBox()->blockSignals( FALSE ); + spinBox()->blockSignals( false ); } TQString s = v.toString(); if ( v.toInt() == -1 ) @@ -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; @@ -1369,10 +1369,10 @@ void PropertyListItem::showEditor() { PropertyItem::showEditor(); if ( !comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->clear(); combo()->insertStringList( value().toStringList() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } placeEditor( combo() ); if ( !combo()->isVisible() || !combo()->hasFocus() ) { @@ -1390,10 +1390,10 @@ void PropertyListItem::hideEditor() void PropertyListItem::setValue( const TQVariant &v ) { if ( comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->clear(); combo()->insertStringList( v.toStringList() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } setText( 1, v.toStringList().first() ); PropertyItem::setValue( v ); @@ -1424,10 +1424,10 @@ void PropertyListItem::setCurrentItem( const TQString &s ) return; if ( !comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->clear(); combo()->insertStringList( value().toStringList() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } for ( uint i = 0; i < combo()->listBox()->count(); ++i ) { if ( combo()->listBox()->item( i )->text().lower() == s.lower() ) { @@ -1451,10 +1451,10 @@ void PropertyListItem::setCurrentItem( int i ) return; if ( !comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->clear(); combo()->insertStringList( value().toStringList() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } combo()->setCurrentItem( i ); setText( 1, combo()->currentText() ); @@ -1492,7 +1492,7 @@ TQLineEdit *PropertyCoordItem::lined() if ( lin ) return lin; lin = new TQLineEdit( listview->viewport() ); - lin->setReadOnly( TRUE ); + lin->setReadOnly( true ); lin->installEventFilter( listview ); lin->hide(); return lin; @@ -1502,15 +1502,15 @@ void PropertyCoordItem::createChildren() { PropertyItem *i = this; if ( typ == Rect || typ == Point ) { - i = new PropertyIntItem( listview, i, this, i18n( "x" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "x" ), true ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "y" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "y" ), true ); addChild( i ); } if ( typ == Rect || typ == Size ) { - i = new PropertyIntItem( listview, i, this, i18n( "width" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "width" ), true ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "height" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "height" ), true ); addChild( i ); } } @@ -1592,7 +1592,7 @@ void PropertyCoordItem::setValue( const TQVariant &v ) bool PropertyCoordItem::hasSubItems() const { - return TRUE; + return true; } void PropertyCoordItem::childValueChanged( PropertyItem *child ) @@ -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() @@ -1699,7 +1699,7 @@ void PropertyPixmapItem::getPixmap() bool PropertyPixmapItem::hasCustomContents() const { - return TRUE; + return true; } void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r ) @@ -1747,18 +1747,18 @@ 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() { PropertyItem *i = this; - i = new PropertyIntItem( listview, i, this, i18n( "Red" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "Red" ), true ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "Green" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "Green" ), true ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "Blue" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "Blue" ), true ); addChild( i ); } @@ -1838,7 +1838,7 @@ void PropertyColorItem::getColor() bool PropertyColorItem::hasCustomContents() const { - return TRUE; + return true; } void PropertyColorItem::drawCustomContents( TQPainter *p, const TQRect &r ) @@ -1863,22 +1863,22 @@ PropertyFontItem::PropertyFontItem( PropertyList *l, PropertyItem *after, Proper button->setFixedWidth( 20 ); box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); box->setLineWidth( 2 ); - lined->setFrame( FALSE ); - lined->setReadOnly( TRUE ); + lined->setFrame( false ); + lined->setReadOnly( true ); box->setFocusProxy( lined ); 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() { PropertyItem *i = this; - i = new PropertyListItem( listview, i, this, i18n( "Family" ), FALSE ); + i = new PropertyListItem( listview, i, this, i18n( "Family" ), false ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "Point Size" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "Point Size" ), true ); addChild( i ); i = new PropertyBoolItem( listview, i, this, i18n( "Bold" ) ); addChild( i ); @@ -1944,7 +1944,7 @@ void PropertyFontItem::setValue( const TQVariant &v ) void PropertyFontItem::getFont() { - bool ok = FALSE; + bool ok = false; TQFont f = TQFontDialog::getFont( &ok, val.toFont(), listview ); if ( ok && f != val.toFont() ) { setValue( f ); @@ -1954,7 +1954,7 @@ void PropertyFontItem::getFont() bool PropertyFontItem::hasSubItems() const { - return TRUE; + return true; } void PropertyFontItem::childValueChanged( PropertyItem *child ) @@ -1990,8 +1990,8 @@ PropertyDatabaseItem::PropertyDatabaseItem( PropertyList *l, PropertyItem *after button->setFixedWidth( 20 ); box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); box->setLineWidth( 2 ); - lined->setFrame( FALSE ); - lined->setReadOnly( TRUE ); + lined->setFrame( false ); + lined->setReadOnly( true ); box->setFocusProxy( lined ); box->installEventFilter( listview ); lined->installEventFilter( listview ); @@ -2001,12 +2001,12 @@ PropertyDatabaseItem::PropertyDatabaseItem( PropertyList *l, PropertyItem *after void PropertyDatabaseItem::createChildren() { PropertyItem *i = this; - i = new PropertyListItem( listview, i, this, i18n( "Connection" ), TRUE ); + i = new PropertyListItem( listview, i, this, i18n( "Connection" ), true ); addChild( i ); - i = new PropertyListItem( listview, i, this, i18n( "Table" ), TRUE ); + i = new PropertyListItem( listview, i, this, i18n( "Table" ), true ); addChild( i ); if ( withField ) { - i = new PropertyListItem( listview, i, this, i18n( "Field" ), TRUE ); + i = new PropertyListItem( listview, i, this, i18n( "Field" ), true ); addChild( i ); } } @@ -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 @@ -2110,7 +2110,7 @@ void PropertyDatabaseItem::setValue( const TQVariant &v ) bool PropertyDatabaseItem::hasSubItems() const { - return TRUE; + return true; } void PropertyDatabaseItem::childValueChanged( PropertyItem *c ) @@ -2158,7 +2158,7 @@ TQLineEdit *PropertySizePolicyItem::lined() return lin; lin = new TQLineEdit( listview->viewport() ); lin->hide(); - lin->setReadOnly( TRUE ); + lin->setReadOnly( true ); return lin; } @@ -2168,15 +2168,15 @@ void PropertySizePolicyItem::createChildren() lst << "Fixed" << "Minimum" << "Maximum" << "Preferred" << "MinimumExpanding" << "Expanding" << "Ignored"; PropertyItem *i = this; - i = new PropertyListItem( listview, i, this, i18n( "hSizeType" ), FALSE ); + i = new PropertyListItem( listview, i, this, i18n( "hSizeType" ), false ); i->setValue( lst ); addChild( i ); - i = new PropertyListItem( listview, i, this, i18n( "vSizeType" ), FALSE ); + i = new PropertyListItem( listview, i, this, i18n( "vSizeType" ), false ); i->setValue( lst ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "horizontalStretch" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "horizontalStretch" ), true ); addChild( i ); - i = new PropertyIntItem( listview, i, this, i18n( "verticalStretch" ), TRUE ); + i = new PropertyIntItem( listview, i, this, i18n( "verticalStretch" ), true ); addChild( i ); } @@ -2250,7 +2250,7 @@ void PropertySizePolicyItem::childValueChanged( PropertyItem *child ) bool PropertySizePolicyItem::hasSubItems() const { - return TRUE; + return true; } // -------------------------------------------------------------- @@ -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() { @@ -2305,16 +2305,12 @@ void PropertyPaletteItem::getPalette() { if ( !listview->propertyEditor()->widget()->isWidgetType() ) return; - bool ok = FALSE; + 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; @@ -2324,7 +2320,7 @@ void PropertyPaletteItem::getPalette() bool PropertyPaletteItem::hasCustomContents() const { - return TRUE; + return true; } void PropertyPaletteItem::drawCustomContents( TQPainter *p, const TQRect &r ) @@ -2358,7 +2354,7 @@ TQComboBox *PropertyCursorItem::combo() { if ( comb ) return comb; - comb = new TQComboBox( FALSE, listview->viewport() ); + comb = new TQComboBox( false, listview->viewport() ); comb->hide(); TQBitmap cur; @@ -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; } @@ -2410,9 +2406,9 @@ void PropertyCursorItem::showEditor() { PropertyItem::showEditor(); if ( !comb ) { - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->setCurrentItem( (int)value().toCursor().shape() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); } placeEditor( combo() ); if ( !combo()->isVisible() || !combo()->hasFocus() ) { @@ -2433,9 +2429,9 @@ void PropertyCursorItem::setValue( const TQVariant &v ) && value() == v ) return; - combo()->blockSignals( TRUE ); + combo()->blockSignals( true ); combo()->setCurrentItem( (int)v.toCursor().shape() ); - combo()->blockSignals( FALSE ); + combo()->blockSignals( false ); setText( 1, combo()->currentText() ); PropertyItem::setValue( v ); } @@ -2458,13 +2454,13 @@ PropertyKeysequenceItem::PropertyKeysequenceItem( PropertyList *l, PropertyItem *prop, const TQString &propName ) : PropertyItem( l, after, prop, propName ), - k1( 0 ), k2( 0 ), k3( 0 ), k4( 0 ), num( 0 ), mouseEnter( FALSE ) + k1( 0 ), k2( 0 ), k3( 0 ), k4( 0 ), num( 0 ), mouseEnter( false ) { 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 ); } @@ -2497,22 +2493,22 @@ bool PropertyKeysequenceItem::eventFilter( TQObject *o, TQEvent *e ) if ( !mouseEnter && (k->key() == TQObject::Key_Up || k->key() == TQObject::Key_Down) ) - return FALSE; + return false; handleKeyEvent( k ); - return TRUE; + return true; } else if ( (e->type() == TQEvent::FocusIn) || (e->type() == TQEvent::MouseButtonPress) ) { mouseEnter = ( listview->lastEvent() == PropertyList::MouseEvent ) || (e->type() == TQEvent::MouseButtonPress); - return TRUE; + return true; } // Lets eat accelerators now.. if ( e->type() == TQEvent::Accel || e->type() == TQEvent::AccelOverride || e->type() == TQEvent::KeyRelease ) - return TRUE; - return FALSE; + return true; + return false; } void PropertyKeysequenceItem::handleKeyEvent( TQKeyEvent *e ) @@ -2572,7 +2568,7 @@ void PropertyKeysequenceItem::setValue() PropertyItem::setValue( v ); if ( sequence->hasFocus() ) notifyValueChange(); - setChanged( TRUE ); + setChanged( true ); } void PropertyKeysequenceItem::setValue( const TQVariant &v ) @@ -2599,7 +2595,7 @@ EnumPopup::EnumPopup( TQWidget *parent, const char *name, WFlags f ) setFrameStyle( Panel | Plain ); setPaletteBackgroundColor( TQt::white ); popLayout = new TQVBoxLayout( this, 3 ); - checkBoxList.setAutoDelete( TRUE ); + checkBoxList.setAutoDelete( true ); } EnumPopup::~EnumPopup() @@ -2658,20 +2654,20 @@ 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() ) ); - popupShown = FALSE; - arrowDown = FALSE; + connect( pop, TQ_SIGNAL( hidden() ), this, TQ_SLOT( popupHidden() ) ); + connect( pop, TQ_SIGNAL( closed() ), this, TQ_SLOT( popupClosed() ) ); + popupShown = false; + arrowDown = false; } void EnumBox::popupHidden() { - popupShown = FALSE; + popupShown = false; } void EnumBox::popupClosed() { - popupShown = FALSE; + popupShown = false; emit valueChanged(); } @@ -2688,7 +2684,7 @@ void EnumBox::paintEvent( TQPaintEvent * ) flags |= TQStyle::Style_HasFocus; if ( width() < 5 || height() < 5 ) { - qDrawShadePanel( &p, rect().x(), rect().y(), rect().width(), rect().height(), g, FALSE, 2, + qDrawShadePanel( &p, rect().x(), rect().y(), rect().width(), rect().height(), g, false, 2, &g.brush( TQColorGroup::Button ) ); return; } @@ -2727,19 +2723,19 @@ void EnumBox::popup() { if ( popupShown ) { pop->closeWidget(); - popupShown = FALSE; + popupShown = false; return; } pop->move( ((TQWidget*)parent())->mapToGlobal( geometry().bottomLeft() ) ); pop->setMinimumWidth( width() ); emit aboutToShowPopup(); pop->show(); - popupShown = TRUE; + popupShown = true; } void EnumBox::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() != Qt::LeftButton ) + if ( e->button() != TQt::LeftButton ) return; TQRect arrowRect = style().querySubControlMetrics( TQStyle::CC_ComboBox, this, @@ -2749,19 +2745,19 @@ void EnumBox::mousePressEvent( TQMouseEvent *e ) arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) ); if ( arrowRect.contains( e->pos() ) ) { - arrowDown = TRUE; - repaint( FALSE ); + arrowDown = true; + repaint( false ); } 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(); } @@ -2769,14 +2765,14 @@ void EnumBox::keyPressEvent( TQKeyEvent *e ) void EnumBox::restoreArrow() { - arrowDown = FALSE; - repaint( FALSE ); + arrowDown = false; + repaint( false ); } void EnumBox::setText( const TQString &text ) { str = text; - repaint( FALSE ); + repaint( false ); } @@ -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() @@ -2824,8 +2820,8 @@ void PropertyEnumItem::setValue( const TQVariant &v ) TQStringList lst = v.toStringList(); TQValueListConstIterator<TQString> it = lst.begin(); for ( ; it != lst.end(); ++it ) - enumList.append( EnumItem( *it, FALSE ) ); - enumList.first().selected = TRUE; + enumList.append( EnumItem( *it, false ) ); + enumList.first().selected = true; enumString = enumList.first().key; box->setText( enumString ); setText( 1, enumString ); @@ -2860,10 +2856,10 @@ void PropertyEnumItem::setCurrentValues( TQStrList lst ) TQStrList::ConstIterator it = lst.begin(); TQValueList<EnumItem>::Iterator eit = enumList.begin(); for ( ; eit != enumList.end(); ++eit ) { - (*eit).selected = FALSE; + (*eit).selected = false; for ( it = lst.begin(); it != lst.end(); ++it ) { if ( TQString( *it ) == (*eit).key ) { - (*eit).selected = TRUE; + (*eit).selected = true; enumString += "|" + (*eit).key; break; } @@ -2913,29 +2909,29 @@ PropertyList::PropertyList( PropertyEditor *e ) init_colors(); whatsThis = new PropertyWhatsThis( this ); - showSorted = FALSE; - header()->setMovingEnabled( FALSE ); - header()->setStretchEnabled( TRUE ); + showSorted = false; + header()->setMovingEnabled( false ); + header()->setStretchEnabled( true ); setResizePolicy( TQScrollView::Manual ); - viewport()->setAcceptDrops( TRUE ); + viewport()->setAcceptDrops( true ); 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 ); setColumnWidthMode( 1, Manual ); - mousePressed = FALSE; + mousePressed = false; pressItem = 0; theLastEvent = MouseEvent; header()->installEventFilter( this ); @@ -3023,11 +3019,11 @@ 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) ) - return TRUE; + if ( ::tqt_cast<QDesignerDataBrowser*>(p) || ::tqt_cast<QDesignerDataView*>(p) ) + return true; p = p->parentWidget(); } - return FALSE; + return false; } #endif @@ -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 ) @@ -3076,9 +3072,9 @@ void PropertyList::setupProperties() if ( qstrcmp( p->name(), "maximumSize" ) == 0 ) continue; } - unique.insert( TQString::fromLatin1( it.current() ), TRUE ); + 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; } @@ -3171,27 +3167,27 @@ void PropertyList::setupProperties() << p->valueToKey( AlignHCenter ) << p->valueToKey( AlignRight ) << p->valueToKey( AlignJustify ); - item = new PropertyListItem( this, item, 0, "hAlign", FALSE ); + item = new PropertyListItem( this, item, 0, "hAlign", false ); item->setValue( lst ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) ) - item->setChanged( TRUE, FALSE ); - if ( !::tqqt_cast<TQMultiLineEdit*>(editor->widget()) ) { + item->setChanged( true, false ); + if ( !::tqt_cast<TQMultiLineEdit*>(editor->widget()) ) { lst.clear(); lst << p->valueToKey( AlignTop ) << p->valueToKey( AlignVCenter ) << p->valueToKey( AlignBottom ); - item = new PropertyListItem( this, item, 0, "vAlign", FALSE ); + item = new PropertyListItem( this, item, 0, "vAlign", false ); item->setValue( lst ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); item = new PropertyBoolItem( this, item, 0, "wordwrap" ); - if ( ::tqqt_cast<TQGroupBox*>(w) ) - item->setVisible( FALSE ); + if ( ::tqt_cast<TQGroupBox*>(w) ) + item->setVisible( false ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } } else { TQStrList lst( p->enumKeys() ); @@ -3205,7 +3201,7 @@ void PropertyList::setupProperties() item->setValue( l ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } } else if ( p->isEnumType() ) { TQStrList l = p->enumKeys(); @@ -3217,7 +3213,7 @@ void PropertyList::setupProperties() continue; lst << k; } - item = new PropertyListItem( this, item, 0, p->name(), FALSE ); + item = new PropertyListItem( this, item, 0, p->name(), false ); item->setValue( lst ); } else { TQVariant::Type t = TQVariant::nameToType( p->type() ); @@ -3231,30 +3227,30 @@ void PropertyList::setupProperties() valueSet << item->name(); } if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } } - 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 ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutSpacing" ) || MetaDataBase::spacing( editor->widget() ) != -1 ) - layoutInitValue( item, TRUE ); + layoutInitValue( item, true ); else layoutInitValue( item ); item = new PropertyLayoutItem( this, item, 0, "layoutMargin" ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutMargin" ) || MetaDataBase::margin( editor->widget() ) != -1 ) - layoutInitValue( item, TRUE ); + layoutInitValue( item, true ); else layoutInitValue( item ); TQWidget *widget = (TQWidget*)w; - if ( ( !::tqqt_cast<TQLayoutWidget*>(widget) && - widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) { - item = new PropertyListItem( this, item, 0, "resizeMode", FALSE ); + 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"; item->setValue( lst ); @@ -3262,43 +3258,43 @@ void PropertyList::setupProperties() TQString resizeMod = MetaDataBase::resizeMode( editor->widget() ); if ( !resizeMod.isEmpty() && resizeMod != WidgetFactory::defaultCurrentItem( editor->widget(), "resizeMode" ) ) { - item->setChanged( TRUE, FALSE ); - MetaDataBase::setPropertyChanged( editor->widget(), "resizeMode", TRUE ); + item->setChanged( true, false ); + MetaDataBase::setPropertyChanged( editor->widget(), "resizeMode", true ); } } } - if ( !::tqqt_cast<Spacer*>(w) && !::tqqt_cast<TQLayoutWidget*>(w) && - !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<QDesignerToolBar*>(w) ) { - item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE ); + 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" ) ) - item->setChanged( TRUE, FALSE ); - item = new PropertyTextItem( this, item, 0, "whatsThis", TRUE, TRUE ); + item->setChanged( true, false ); + item = new PropertyTextItem( this, item, 0, "whatsThis", true, true ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "whatsThis" ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } #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 ); + item->setChanged( true, false ); } - if ( ::tqqt_cast<TQDataTable*>(editor->widget()) || ::tqqt_cast<TQDataBrowser*>(editor->widget()) || - ::tqqt_cast<TQDataView*>(editor->widget()) ) { - item = new PropertyDatabaseItem( this, item, 0, "database", FALSE ); + 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" ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); item = new PropertyBoolItem( this, item, 0, "frameworkCode" ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), "frameworkCode" ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } #endif @@ -3341,18 +3337,18 @@ void PropertyList::setupCusWidgetProperties( MetaDataBase::CustomWidget *cw, cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) { if ( unique.contains( TQString( (*it).property ) ) ) continue; - unique.insert( TQString( (*it).property ), TRUE ); + unique.insert( TQString( (*it).property ), true ); addPropertyItem( item, (*it).property, type_to_variant( (*it).type ) ); setPropertyValue( item ); if ( MetaDataBase::isPropertyChanged( editor->widget(), (*it).property ) ) - item->setChanged( TRUE, FALSE ); + item->setChanged( true, false ); } } bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, TQVariant::Type t ) { if ( name == "buddy" ) { - PropertyListItem *itm = new PropertyListItem( this, item, 0, name, TRUE ); + PropertyListItem *itm = new PropertyListItem( this, item, 0, name, true ); TQPtrDict<TQWidget> *widgets = editor->formWindow()->widgets(); TQPtrDictIterator<TQWidget> it( *widgets ); TQStringList l; @@ -3367,21 +3363,21 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, l.sort(); itm->setValue( l ); item = itm; - return TRUE; + return true; } 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()) ); + item = new PropertyTextItem( this, item, 0, name, true, + ::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()), - FALSE, TRUE ); + editor->widget() == editor->formWindow()->mainContainer(), + false, true ); break; case TQVariant::Bool: item = new PropertyBoolItem( this, item, 0, name ); @@ -3391,13 +3387,13 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, break; case TQVariant::Int: if ( name == "accel" ) - item = new PropertyTextItem( this, item, 0, name, FALSE, FALSE, FALSE, TRUE ); + item = new PropertyTextItem( this, item, 0, name, false, false, false, true ); else if ( name == "layoutSpacing" || name == "layoutMargin" ) item = new PropertyLayoutItem( this, item, 0, name ); else if ( name == "resizeMode" ) - item = new PropertyListItem( this, item, 0, name, TRUE ); + item = new PropertyListItem( this, item, 0, name, true ); else - item = new PropertyIntItem( this, item, 0, name, TRUE ); + item = new PropertyIntItem( this, item, 0, name, true ); break; case TQVariant::Double: item = new PropertyDoubleItem( this, item, 0, name ); @@ -3406,10 +3402,10 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, item = new PropertyKeysequenceItem( this, item, 0, name ); break; case TQVariant::UInt: - item = new PropertyIntItem( this, item, 0, name, FALSE ); + item = new PropertyIntItem( this, item, 0, name, false ); break; case TQVariant::StringList: - item = new PropertyListItem( this, item, 0, name, TRUE ); + item = new PropertyListItem( this, item, 0, name, true ); break; case TQVariant::Rect: item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Rect ); @@ -3421,7 +3417,7 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Size ); break; case TQVariant::Color: - item = new PropertyColorItem( this, item, 0, name, TRUE ); + item = new PropertyColorItem( this, item, 0, name, true ); break; case TQVariant::Pixmap: item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::Pixmap ); @@ -3451,9 +3447,9 @@ bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, item = new PropertyDateTimeItem( this, item, 0, name ); break; default: - return FALSE; + return false; } - return TRUE; + return true; } void PropertyList::paintEmptyArea( TQPainter *p, const TQRect &r ) @@ -3493,7 +3489,7 @@ void PropertyList::valueChanged( PropertyItem *i ) i->value(), i->currentItem(), i->currentItemFromObject() ); cmd->execute(); - editor->formWindow()->commandHistory()->addCommand( cmd, TRUE ); + editor->formWindow()->commandHistory()->addCommand( cmd, true ); } void PropertyList::layoutInitValue( PropertyItem *i, bool changed ) @@ -3507,7 +3503,7 @@ void PropertyList::layoutInitValue( PropertyItem *i, bool changed ) i->value(), i->currentItem(), i->currentItemFromObject() ); cmd->execute(); if ( i->value().toString() != "-1" ) - changed = TRUE; + changed = true; i->setChanged( changed ); } @@ -3538,7 +3534,7 @@ void PropertyList::toggleOpen( TQListViewItem *i ) bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) { if ( !o || !e ) - return TRUE; + return true; PropertyItem *i = (PropertyItem*)currentItem(); if ( e->type() == TQEvent::KeyPress ) @@ -3546,53 +3542,53 @@ 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() ) ) && + return true; + } else if ( ( !::tqt_cast<TQLineEdit*>(o) || + ( ::tqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) && i && i->hasSubItems() ) { if ( !i->isOpen() && ( ke->key() == Key_Plus || ke->key() == Key_Right )) - i->setOpen( TRUE ); + i->setOpen( true ); else if ( i->isOpen() && ( 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) ) { + i->setOpen( false ); + } 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; + 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; + mousePressed = true; } 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 ); @@ -3601,16 +3597,16 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) p.drawRect( 0, 0, pix.width(), pix.height() ); p.end(); drg->setPixmap( pix ); - mousePressed = FALSE; + 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(); TQImageDrag *drg = new TQImageDrag( img, this ); drg->setPixmap( pix ); - mousePressed = FALSE; + mousePressed = false; drg->dragCopy(); } } @@ -3621,19 +3617,19 @@ 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 ); - menu.setCheckable( TRUE ); + menu.setCheckable( true ); const int cat_id = 1; const int alpha_id = 2; menu.insertItem( i18n( "Sort &Categorized" ), cat_id ); int alpha = menu.insertItem( i18n( "Sort &Alphabetically" ), alpha_id ); if ( showSorted ) - menu.setItemChecked( alpha_id, TRUE ); + menu.setItemChecked( alpha_id, true ); else - menu.setItemChecked( cat_id, TRUE ); + menu.setItemChecked( cat_id, true ); int res = menu.exec( ( (TQContextMenuEvent*)e )->globalPos() ); if ( res != -1 ) { bool newShowSorted = ( res == alpha ); @@ -3643,7 +3639,7 @@ bool PropertyList::eventFilter( TQObject *o, TQEvent *e ) editor->setup(); } } - return TRUE; + return true; } } @@ -3665,12 +3661,12 @@ void PropertyList::refetchData() bool changed = MetaDataBase::isPropertyChanged( editor->widget(), i->name() ); if ( ( i->name() == "layoutSpacing" || i->name() == "layoutMargin" ) ) { if ( i->value().toString() != "-1" ) - i->setChanged( TRUE, FALSE ); + i->setChanged( true, false ); else - i->setChanged( FALSE, FALSE ); + i->setChanged( false, false ); } else if ( changed != i->isChanged() ) - i->setChanged( changed, FALSE ); + i->setChanged( changed, false ); } updateEditorSize(); } @@ -3693,12 +3689,12 @@ 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(), 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 ); + property( editor->widget()->metaObject()->findProperty( "alignment", true ), true ); align &= ~AlignVertical_Mask; TQStrList l = p->valueToKeys( align ); clearAlignList( l ); @@ -3706,7 +3702,7 @@ void PropertyList::setPropertyValue( PropertyItem *i ) } else if ( i->name() == "vAlign" ) { int align = editor->widget()->property( "alignment" ).toInt(); p = editor->widget()->metaObject()-> - property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE ); + property( editor->widget()->metaObject()->findProperty( "alignment", true ), true ); align &= ~AlignHorizontal_Mask; ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() ); } else if ( i->name() == "wordwrap" ) { @@ -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" ) ) { @@ -3775,9 +3771,9 @@ void PropertyList::resetProperty() i->name(), i->value(), WidgetFactory::defaultValue( editor->widget(), i->name() ), WidgetFactory::defaultCurrentItem( editor->widget(), i->name() ), - i->currentItem(), TRUE ); + i->currentItem(), true ); cmd->execute(); - editor->formWindow()->commandHistory()->addCommand( cmd, FALSE ); + editor->formWindow()->commandHistory()->addCommand( cmd, false ); if ( i->hasSubItems() ) i->initChildren(); } @@ -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; @@ -3917,13 +3913,13 @@ PropertyList::LastEventType PropertyList::lastEvent() // ------------------------------------------------------------ EventList::EventList( TQWidget *parent, FormWindow *fw, PropertyEditor *e ) - : HierarchyList( parent, fw, TRUE ), editor( e ) + : HierarchyList( parent, fw, true ), editor( e ) { header()->hide(); removeColumn( 1 ); - setRootIsDecorated( TRUE ); - connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), - this, TQT_SLOT( renamed( TQListViewItem * ) ) ); + setRootIsDecorated( true ); + connect( this, TQ_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ), + this, TQ_SLOT( renamed( TQListViewItem * ) ) ); } TQString clean_arguments( const TQString &s ) @@ -3968,9 +3964,9 @@ void EventList::setup() while ( it.current() ) { HierarchyItem *eventItem = new HierarchyItem( HierarchyItem::Event, this, (HierarchyItem*)0, it.current(), TQString(), TQString() ); - eventItem->setOpen( TRUE ); + 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; @@ -4066,21 +4062,21 @@ void EventList::renamed( TQListViewItem *i ) if ( !i->parent() ) return; TQListViewItem *itm = i->parent()->firstChild(); - bool del = FALSE; + bool del = false; while ( itm ) { if ( itm != i && itm->text( 0 ) == i->text( 0 ) ) { - del = TRUE; + del = true; break; } itm = itm->nextSibling(); } - i->setRenameEnabled( 0, FALSE ); + i->setRenameEnabled( 0, false ); if ( del ) { delete 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" ), @@ -4110,11 +4106,11 @@ void EventList::renamed( TQListViewItem *i ) /* MetaDataBase::addFunction( formWindow, funcname.latin1(), "virtual", "public", "slot", formWindow->project()->language(), "void" ); editor->formWindow()->mainWindow()-> - editFunction( i->text( 0 ).left( i->text( 0 ).find( "(" ) ), TRUE );*/ + editFunction( i->text( 0 ).left( i->text( 0 ).find( "(" ) ), true );*/ cmd->execute(); cmd2->execute(); editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView(); - editor->formWindow()->formFile()->setModified( TRUE ); + editor->formWindow()->formFile()->setModified( true ); } } @@ -4164,13 +4160,13 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) if ( w && w == wid ) { // if there is no properties displayed then we really should show them. // to do this check the number of properties in the list. - bool ret = (listview->childCount() > 0) ? TRUE : FALSE; + bool ret = listview->childCount() > 0; if ( wid->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)wid ) != WidgetFactory::NoLayout ) { TQListViewItemIterator it( listview ); - ret = FALSE; + ret = false; while ( it.current() ) { if ( it.current()->text( 0 ) == "layoutSpacing" || it.current()->text( 0 ) == "layoutMargin" ) { - ret = TRUE; + ret = true; break; } ++it; @@ -4191,11 +4187,11 @@ void PropertyEditor::setWidget( TQObject *w, FormWindow *fw ) wid = w; formwindow = fw; setCaption( i18n( "Property Editor (%1)" ).arg( formwindow->name() ) ); - listview->viewport()->setUpdatesEnabled( FALSE ); - listview->setUpdatesEnabled( FALSE ); + listview->viewport()->setUpdatesEnabled( false ); + listview->setUpdatesEnabled( false ); clear(); - listview->viewport()->setUpdatesEnabled( TRUE ); - listview->setUpdatesEnabled( TRUE ); + listview->viewport()->setUpdatesEnabled( true ); + listview->setUpdatesEnabled( true ); setup(); } @@ -4211,15 +4207,15 @@ void PropertyEditor::setup() { if ( !formwindow || !wid ) return; - listview->viewport()->setUpdatesEnabled( FALSE ); + listview->viewport()->setUpdatesEnabled( false ); listview->setupProperties(); - listview->viewport()->setUpdatesEnabled( TRUE ); + listview->viewport()->setUpdatesEnabled( true ); listview->updateEditorSize(); if ( !wid->isA( "PropertyObject" ) ) { - eList->viewport()->setUpdatesEnabled( FALSE ); + eList->viewport()->setUpdatesEnabled( false ); eList->setup(); - eList->viewport()->setUpdatesEnabled( TRUE ); + eList->viewport()->setUpdatesEnabled( true ); } } @@ -4276,7 +4272,7 @@ TQString PropertyEditor::classOfCurrentProperty() const TQString curr = currentProperty(); TQMetaObject *mo = o->metaObject(); while ( mo ) { - TQStrList props = mo->propertyNames( FALSE ); + TQStrList props = mo->propertyNames( false ); if ( props.find( curr.latin1() ) != -1 ) return mo->className(); mo = mo->superClass(); @@ -4324,9 +4320,9 @@ void PropertyEditor::updateWindow() { if ( isHidden() && count() ) { parentWidget()->show(); - MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), TRUE ); + MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), true ); } else if ( isShown() && !count() ) { parentWidget()->hide(); - MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), FALSE ); + MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), false ); } } |