summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/formwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/formwindow.cpp')
-rw-r--r--kdevdesigner/designer/formwindow.cpp524
1 files changed, 262 insertions, 262 deletions
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp
index 99f631ae..6bea093f 100644
--- a/kdevdesigner/designer/formwindow.cpp
+++ b/kdevdesigner/designer/formwindow.cpp
@@ -87,7 +87,7 @@ static void setCursorToAll( const TQCursor &c, TQWidget *start )
TQObjectList l = start->childrenListObject();
if ( !l.isEmpty() ) {
for ( TQObject *o = l.first(); o; o = l.next() ) {
- if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) )
+ if ( o->isWidgetType() && !::tqt_cast<SizeHandle*>(o) )
setCursorToAll( c, ( (TQWidget*)o ) );
}
}
@@ -102,7 +102,7 @@ static void restoreCursors( TQWidget *start, FormWindow *fw )
TQObjectList l = start->childrenListObject();
if ( !l.isEmpty() ) {
for ( TQObject *o = l.first(); o; o = l.next() ) {
- if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) )
+ if ( o->isWidgetType() && !::tqt_cast<SizeHandle*>(o) )
restoreCursors( ( (TQWidget*)o ), fw );
}
}
@@ -112,7 +112,7 @@ static void restoreCursors( TQWidget *start, FormWindow *fw )
#include <tqt_windows.h>
static void flickerfree_update( TQWidget *w )
{
- InvalidateRect( w->winId(), 0, FALSE );
+ InvalidateRect( w->winId(), 0, false );
}
#endif
@@ -136,7 +136,7 @@ static void flickerfree_update( TQWidget *w )
FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const char *name )
: TQWidget( parent, name, WDestructiveClose ), mainwindow( mw ),
- commands( 100 ), pixInline( TRUE ), pixProject( FALSE )
+ commands( 100 ), pixInline( true ), pixProject( false )
{
ff = f;
init();
@@ -145,7 +145,7 @@ FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *parent, const cha
FormWindow::FormWindow( FormFile *f, TQWidget *parent, const char *name )
: TQWidget( parent, name, WDestructiveClose ), mainwindow( 0 ),
- commands( 100 ), pixInline( TRUE )
+ commands( 100 ), pixInline( true )
{
ff = f;
init();
@@ -156,63 +156,63 @@ void FormWindow::init()
setWFlags(getWFlags() & TQt::WStyle_Maximize);
fake = qstrcmp( name(), "qt_fakewindow" ) == 0;
- MetaDataBase::addEntry( TQT_TQOBJECT(this) );
+ MetaDataBase::addEntry( this );
ff->setFormWindow( this );
iface = 0;
proj = 0;
propertyWidget = 0;
- toolFixed = FALSE;
- checkedSelectionsForMove = FALSE;
+ toolFixed = false;
+ checkedSelectionsForMove = false;
mContainer = 0;
startWidget = endWidget = 0;
currTool = POINTER_TOOL;
unclippedPainter = 0;
- widgetPressed = FALSE;
- drawRubber = FALSE;
- setFocusPolicy( TQ_ClickFocus );
+ widgetPressed = false;
+ drawRubber = false;
+ setFocusPolicy( TQWidget::ClickFocus );
sizePreviewLabel = 0;
checkSelectionsTimer = new TQTimer( this, "checkSelectionsTimer" );
- connect( checkSelectionsTimer, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( invalidCheckedSelections() ) );
+ connect( checkSelectionsTimer, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( invalidCheckedSelections() ) );
updatePropertiesTimer = new TQTimer( this );
- connect( updatePropertiesTimer, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( updatePropertiesTimerDone() ) );
+ connect( updatePropertiesTimer, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( updatePropertiesTimerDone() ) );
showPropertiesTimer = new TQTimer( this );
//!!!!
- connect( showPropertiesTimer, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( showPropertiesTimerDone() ) );
+ connect( showPropertiesTimer, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( showPropertiesTimerDone() ) );
selectionChangedTimer = new TQTimer( this );
- connect( selectionChangedTimer, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( selectionChangedTimerDone() ) );
+ connect( selectionChangedTimer, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( selectionChangedTimerDone() ) );
windowsRepaintWorkaroundTimer = new TQTimer( this );
- connect( windowsRepaintWorkaroundTimer, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( windowsRepaintWorkaroundTimerTimeout() ) );
+ connect( windowsRepaintWorkaroundTimer, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( windowsRepaintWorkaroundTimerTimeout() ) );
insertParent = 0;
- connect( &commands, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ),
- this, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) );
- propShowBlocked = FALSE;
+ connect( &commands, TQ_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ),
+ this, TQ_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) );
+ propShowBlocked = false;
setIcon( SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()) );
- connect( &commands, TQT_SIGNAL( modificationChanged( bool ) ),
- this, TQT_SLOT( modificationChanged( bool ) ) );
+ connect( &commands, TQ_SIGNAL( modificationChanged( bool ) ),
+ this, TQ_SLOT( modificationChanged( bool ) ) );
buffer = 0;
- TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( TQFRAME_OBJECT_NAME_STRING ), this );
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQFrame" ), this );
setMainContainer( w );
- propertyWidget = TQT_TQOBJECT(w);
+ propertyWidget = w;
targetContainer = 0;
- hadOwnPalette = FALSE;
+ hadOwnPalette = false;
defSpacing = BOXLAYOUT_DEFAULT_SPACING;
defMargin = BOXLAYOUT_DEFAULT_MARGIN;
- hasLayoutFunc = FALSE;
+ hasLayoutFunc = false;
}
void FormWindow::setMainWindow( MainWindow *w )
{
mainwindow = w;
- MetaDataBase::addEntry( TQT_TQOBJECT(this) );
+ MetaDataBase::addEntry( this );
initSlots();
}
@@ -236,7 +236,7 @@ FormWindow::~FormWindow()
if ( MainWindow::self && MainWindow::self->objectHierarchy()->formWindow() == this )
MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 );
- MetaDataBase::clear( TQT_TQOBJECT(this) );
+ MetaDataBase::clear( this );
if ( ff )
ff->setFormWindow( 0 );
delete iface;
@@ -353,19 +353,19 @@ void FormWindow::insertWidget()
return;
bool useSizeHint = !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 );
- Qt::Orientation orient =Qt::Horizontal;
+ TQt::Orientation orient =TQt::Horizontal;
TQString n = WidgetDatabase::className( currTool );
- if ( useSizeHint && ( n == "Spacer" || n == TQSLIDER_OBJECT_NAME_STRING || n == "Line" || n == TQSCROLLBAR_OBJECT_NAME_STRING ) ) {
+ if ( useSizeHint && ( n == "Spacer" || n == "TQSlider" || n == "Line" || n == "TQScrollBar" ) ) {
TQPopupMenu m( mainWindow() );
m.insertItem( i18n( "&Horizontal" ) );
int ver = m.insertItem( i18n( "&Vertical" ) );
int r = m.exec( TQCursor::pos() );
if ( r == ver )
- orient =Qt::Vertical;
+ orient =TQt::Vertical;
}
- TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient );
+ TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, true, &currRect, orient );
if ( !w )
return;
@@ -375,7 +375,7 @@ void FormWindow::insertWidget()
pix.convertFromImage( SmallIcon( "designer_image.png" , KDevDesignerPartFactory::instance()).convertToImage() );
( (TQLabel*)w )->setPixmap( pix );
}
- int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
if ( WidgetDatabase::isCustomWidget( id ) ) {
TQWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> "
"<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
@@ -393,7 +393,7 @@ void FormWindow::insertWidget()
}
TQString s = w->name();
- unify( TQT_TQOBJECT(w), s, TRUE );
+ unify( w, s, true );
w->setName( s );
insertWidget( w );
TQRect r( currRect );
@@ -408,7 +408,7 @@ void FormWindow::insertWidget()
if ( useSizeHint ) {
if ( n == "Spacer" ) {
- if ( orient ==Qt::Vertical ) {
+ if ( orient ==TQt::Vertical ) {
r.setWidth( 20 );
r.setHeight( 40 );
} else {
@@ -429,13 +429,13 @@ void FormWindow::insertWidget()
const TQObjectList l = insertParent->childrenListObject();
TQObjectListIt it( l );
TQWidgetList lst;
- if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) {
+ if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
for ( ; it.current(); ) {
TQObject *o = it.current();
++it;
if ( o->isWidgetType() &&
( (TQWidget*)o )->isVisibleTo( this ) &&
- insertedWidgets.find( TQT_TQWIDGET(o) ) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w) ) {
+ insertedWidgets.find( o ) && o != w ) {
TQRect r2( ( (TQWidget*)o )->pos(),
( (TQWidget*)o )->size() );
if ( r.contains( r2 ) )
@@ -497,12 +497,12 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName )
return;
if ( checkName ) {
TQString s = w->name();
- unify( TQT_TQOBJECT(w), s, TRUE );
+ unify( w, s, true );
w->setName( s );
}
- MetaDataBase::addEntry( TQT_TQOBJECT(w) );
- int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) );
+ MetaDataBase::addEntry( w );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
if ( WidgetDatabase::isCustomWidget( id ) ) {
TQWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> "
"<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
@@ -526,7 +526,7 @@ void FormWindow::insertWidget( TQWidget *w, bool checkName )
void FormWindow::removeWidget( TQWidget *w )
{
- MetaDataBase::removeEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::removeEntry( w );
widgets()->take( w );
}
@@ -535,16 +535,16 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
CHECK_MAINWINDOW;
switch ( currTool ) {
case POINTER_TOOL: {
- if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
raiseChildSelections( w ); // raise selections and select widget
- selectWidget( TQT_TQOBJECT(w) );
+ selectWidget( w );
// if widget is laid out, find the first non-laid out super-widget
TQWidget *realWidget = w; // but store the original one
while ( w->parentWidget() &&
( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout ||
!insertedWidgets.find(w) ) )
w = w->parentWidget();
- if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) {
+ if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) {
e->accept();
mainwindow->popupFormWindowMenu( e->globalPos(), this );
} else {
@@ -565,7 +565,7 @@ void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
{
CHECK_MAINWINDOW;
- checkedSelectionsForMove = FALSE;
+ checkedSelectionsForMove = false;
checkSelectionsTimer->stop();
if ( !sizePreviewLabel ) {
sizePreviewLabel = new TQLabel( this );
@@ -576,72 +576,72 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
switch ( currTool ) {
case POINTER_TOOL:
- if ( !isMainContainer( TQT_TQOBJECT(w) ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
// if the clicked widget is not in a layout, raise it
if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
w->raise();
if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection
- drawRubber = TRUE;
+ drawRubber = true;
currRect = TQRect( 0, 0, -1, -1 );
startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
break;
}
- bool sel = isWidgetSelected( TQT_TQOBJECT(w) );
+ bool sel = isWidgetSelected( w );
if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { // control not pressed...
if ( !sel ) { // ...and widget no selectted: unselect all
- clearSelection( FALSE );
+ clearSelection( false );
} else { // ...widget selected
// only if widget has a layout (it is a layout meta widget or a laid out container!), unselect its childs
if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ) {
- TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
- setPropertyShowingBlocked( TRUE );
+ TQObjectList *l = w->queryList( "TQWidget" );
+ setPropertyShowingBlocked( true );
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( !o->isWidgetType() )
continue;
if ( insertedWidgets.find( (TQWidget*)o ) )
- selectWidget( TQT_TQOBJECT(o), FALSE );
+ selectWidget( o, false );
}
- setPropertyShowingBlocked( FALSE );
+ setPropertyShowingBlocked( false );
delete l;
}
}
tqApp->processEvents();
}
if ( ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) &&
- sel && e->button() == Qt::LeftButton ) { // control pressed and selected, unselect widget
- selectWidget( TQT_TQOBJECT(w), FALSE );
+ sel && e->button() == TQt::LeftButton ) { // control pressed and selected, unselect widget
+ selectWidget( w, false );
break;
}
raiseChildSelections( w ); // raise selections and select widget
- selectWidget( TQT_TQOBJECT(w) );
+ selectWidget( w );
// if widget is laid out, find the first non-laid out super-widget
while ( w->parentWidget() &&
( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.find(w) ) )
w = w->parentWidget();
- if ( e->button() == Qt::LeftButton ) { // left button: store original geometry and more as the widget might start moving
- widgetPressed = TRUE;
+ if ( e->button() == TQt::LeftButton ) { // left button: store original geometry and more as the widget might start moving
+ widgetPressed = true;
widgetGeom = TQRect( w->pos(), w->size() );
oldPressPos = w->mapFromGlobal( e->globalPos() );
origPressPos = oldPressPos;
- checkedSelectionsForMove = FALSE;
+ checkedSelectionsForMove = false;
moving.clear();
- if ( w->parentWidget() && !isMainContainer( TQT_TQOBJECT(w->parentWidget()) ) && !isCentralWidget( TQT_TQOBJECT(w->parentWidget()) ) ) {
+ if ( w->parentWidget() && !isMainContainer( w->parentWidget() ) && !isCentralWidget( w->parentWidget() ) ) {
targetContainer = w->parentWidget();
hadOwnPalette = w->parentWidget()->ownPalette();
restorePalette = w->parentWidget()->palette();
}
}
} else { // press was on the formwindow
- if ( e->button() == Qt::LeftButton ) { // left button: start rubber selection and show formwindow properties
- drawRubber = TRUE;
+ if ( e->button() == TQt::LeftButton ) { // left button: start rubber selection and show formwindow properties
+ drawRubber = true;
if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) {
- clearSelection( FALSE );
+ clearSelection( false );
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
}
@@ -652,14 +652,14 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
break;
case CONNECT_TOOL:
case BUDDY_TOOL:
- if ( e->button() != Qt::LeftButton )
+ if ( e->button() != TQt::LeftButton )
break;
- validForBuddy = FALSE;
+ validForBuddy = false;
if ( currTool == BUDDY_TOOL ) {
- if ( !::tqqt_cast<TQLabel*>(w) )
+ if ( !::tqt_cast<TQLabel*>(w) )
break;
- clearSelection( FALSE );
- validForBuddy = TRUE;
+ clearSelection( false );
+ validForBuddy = true;
mainWindow()->statusMessage( i18n( "Set buddy for '%1' to..." ).arg( w->name() ) );
} else {
mainWindow()->statusMessage( i18n( "Connect '%1' with..." ).arg( w->name() ) );
@@ -667,13 +667,13 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
saveBackground();
startPos = mapFromGlobal( e->globalPos() );
currentPos = startPos;
- startWidget = designerWidget( TQT_TQOBJECT(w) );
+ startWidget = designerWidget( w );
endWidget = startWidget;
- beginUnclippedPainter( FALSE );
+ beginUnclippedPainter( false );
drawConnectionLine();
break;
case ORDER_TOOL:
- if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget
+ if ( !isMainContainer( w ) ) { // press on a child widget
orderedWidgets.removeRef( w );
orderedWidgets.append( w );
for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
@@ -686,19 +686,19 @@ void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
TQWidgetList oldl = MetaDataBase::tabOrder( this );
TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets );
cmd->execute();
- commandHistory()->addCommand( cmd, TRUE );
+ commandHistory()->addCommand( cmd, true );
updateOrderIndicators();
}
break;
default: // any insert widget tool
- if ( e->button() == Qt::LeftButton ) {
+ if ( e->button() == TQt::LeftButton ) {
insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default parent for new widget is the formwindow
- if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press was not on formwindow, check if we can find another parent
+ if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can find another parent
TQWidget *wid = w;
for (;;) {
- int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(wid) ) );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) );
if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) &&
- !::tqqt_cast<TQLayoutWidget*>(wid) && !::tqqt_cast<TQSplitter*>(wid) ) {
+ !::tqt_cast<TQLayoutWidget*>(wid) && !::tqt_cast<TQSplitter*>(wid) ) {
insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it
break;
} else {
@@ -719,7 +719,7 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w )
CHECK_MAINWINDOW;
switch ( currTool ) {
case ORDER_TOOL:
- if ( !isMainContainer( TQT_TQOBJECT(w) ) ) { // press on a child widget
+ if ( !isMainContainer( w ) ) { // press on a child widget
orderedWidgets.clear();
orderedWidgets.append( w );
for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
@@ -732,12 +732,12 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w )
TQWidgetList oldl = MetaDataBase::tabOrder( this );
TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets );
cmd->execute();
- commandHistory()->addCommand( cmd, TRUE );
+ commandHistory()->addCommand( cmd, true );
updateOrderIndicators();
}
default:
- if ( !WidgetFactory::isPassiveInteractor( TQT_TQOBJECT(w) ) &&
- ( isMainContainer( TQT_TQOBJECT(w) ) || TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(this) ) )
+ if ( !WidgetFactory::isPassiveInteractor( w ) &&
+ ( isMainContainer( w ) || w == this ) )
mainWindow()->editSource();
break;
}
@@ -746,7 +746,7 @@ void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w )
void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
{
CHECK_MAINWINDOW;
- if ( ( e->state() & Qt::LeftButton ) != Qt::LeftButton )
+ if ( ( e->state() & TQt::LeftButton ) != TQt::LeftButton )
return;
TQWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid;
@@ -799,10 +799,10 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
if ( x - p.x() != 0 || y - p.y() != 0 ) { // if we actually have to move
if ( !checkedSelectionsForMove ) { // if not checked yet, check if the correct widget are selected...
- if ( !isWidgetSelected( TQT_TQOBJECT(w) ) ) { // and unselect others. Only siblings can be moved at the same time
- setPropertyShowingBlocked( TRUE );
- selectWidget( TQT_TQOBJECT(w) );
- setPropertyShowingBlocked( FALSE );
+ if ( !isWidgetSelected( w ) ) { // and unselect others. Only siblings can be moved at the same time
+ setPropertyShowingBlocked( true );
+ selectWidget( w );
+ setPropertyShowingBlocked( false );
}
checkSelectionsForMove( w );
}
@@ -810,7 +810,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
// check whether we would have to reparent the selection and highlight the possible new parent container
TQMapConstIterator<TQWidget*, TQPoint> it = moving.begin();
TQWidget* wa = containerAt( e->globalPos(), it.key() );
- if ( wa && !isMainContainer( TQT_TQOBJECT(wa) ) && !isCentralWidget( TQT_TQOBJECT(wa) ) ) {
+ if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) {
wa = WidgetFactory::containerOfWidget( wa );
// ok, looks like we moved onto a container
@@ -845,7 +845,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
sizePreviewLabel->raise();
sizePreviewLabel->show();
#if defined(TQ_WS_WIN32)
- windowsRepaintWorkaroundTimer->start( 100, TRUE );
+ windowsRepaintWorkaroundTimer->start( 100, true );
#endif
} else { // if we don't need to move, do some indication
TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() );
@@ -860,16 +860,16 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
break;
case CONNECT_TOOL:
restoreConnectionLine();
- wid = tqApp->widgetAt( e->globalPos(), TRUE );
+ wid = tqApp->widgetAt( e->globalPos(), true );
if ( wid )
- wid = designerWidget( TQT_TQOBJECT(wid) );
- if ( wid && ( isMainContainer( TQT_TQOBJECT(wid) ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) )
+ wid = designerWidget( wid );
+ if ( wid && ( isMainContainer( wid ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) )
newendWidget = wid;
- if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) )
+ if ( ::tqt_cast<TQLayoutWidget*>(newendWidget) || ::tqt_cast<Spacer*>(newendWidget) )
newendWidget = (TQWidget*)endWidget;
drawRecRect = newendWidget != endWidget;
if ( newendWidget &&
- ( isMainContainer( TQT_TQOBJECT(newendWidget) ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
+ ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) )
endWidget = newendWidget;
mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).arg( startWidget->name() ).
arg( endWidget->name() ) );
@@ -884,19 +884,19 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
if ( !validForBuddy )
break;
restoreConnectionLine();
- wid = tqApp->widgetAt( e->globalPos(), TRUE );
+ wid = tqApp->widgetAt( e->globalPos(), true );
if ( wid )
- wid = designerWidget( TQT_TQOBJECT(wid) );
+ wid = designerWidget( wid );
if ( wid && canBeBuddy( wid ) && wid->isVisibleTo( this ) )
newendWidget = wid;
else
newendWidget = 0;
- if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) )
+ if ( ::tqt_cast<TQLayoutWidget*>(newendWidget) || ::tqt_cast<Spacer*>(newendWidget) )
newendWidget = (TQWidget*)endWidget;
drawRecRect = newendWidget != endWidget;
if ( !newendWidget )
endWidget = newendWidget;
- else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( TQT_TQOBJECT(newendWidget) ) )
+ else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( newendWidget ) )
endWidget = newendWidget;
if ( endWidget )
mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ).
@@ -922,7 +922,7 @@ void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
{
CHECK_MAINWINDOW;
- if ( e->button() != Qt::LeftButton )
+ if ( e->button() != TQt::LeftButton )
return;
switch ( currTool ) {
@@ -974,28 +974,28 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
}
// doesn't need to be a command, the MoveCommand does reparenting too
- bool emitSelChanged = FALSE;
+ bool emitSelChanged = false;
for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) {
TQWidget *i = it.key();
- if ( !emitSelChanged && ::tqqt_cast<TQButton*>(i) ) {
- if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqqt_cast<TQButtonGroup*>(wa) )
- emitSelChanged = TRUE;
- if ( !::tqqt_cast<TQButtonGroup*>(wa) ) {
- MetaDataBase::setPropertyChanged( TQT_TQOBJECT(i), "buttonGroupId", FALSE );
- if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) )
+ if ( !emitSelChanged && ::tqt_cast<TQButton*>(i) ) {
+ if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqt_cast<TQButtonGroup*>(wa) )
+ emitSelChanged = true;
+ if ( !::tqt_cast<TQButtonGroup*>(wa) ) {
+ MetaDataBase::setPropertyChanged( i, "buttonGroupId", false );
+ if ( ::tqt_cast<TQButtonGroup*>(i->parentWidget()) )
( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i );
}
}
TQPoint pos = wa->mapFromGlobal( i->mapToGlobal( TQPoint(0,0) ) );
- i->reparent( wa, pos, TRUE );
+ i->reparent( wa, pos, true );
raiseSelection( i );
raiseChildSelections( i );
- widgetChanged( TQT_TQOBJECT(i) );
+ widgetChanged( i );
mainWindow()->objectHierarchy()->widgetRemoved( i );
mainWindow()->objectHierarchy()->widgetInserted( i );
}
if ( emitSelChanged ) {
- emit showProperties( TQT_TQOBJECT(wa) );
+ emit showProperties( wa );
emit showProperties( propertyWidget );
}
newParent = wa;
@@ -1015,9 +1015,9 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
oldPos, newPos, oldParent, newParent ) );
} else if ( drawRubber ) { // we were drawing a rubber selection
endRectDraw(); // get rid of the rectangle
- blockSignals( TRUE );
+ blockSignals( true );
selectWidgets(); // select widgets which intersect the rect
- blockSignals( FALSE );
+ blockSignals( false );
emitSelectionChanged(); // inform about selection changes
if ( propertyWidget )
emitShowProperties( propertyWidget );
@@ -1045,13 +1045,13 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
if ( oldBuddy.isNull() )
oldBuddy = "";
SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).arg( startWidget->name() ),
- this, TQT_TQOBJECT(startWidget), mainWindow()->propertyeditor(),
+ this, startWidget, mainWindow()->propertyeditor(),
"buddy", startWidget->property( "buddy" ),
endWidget->name(), endWidget->name(),
oldBuddy );
- commandHistory()->addCommand( cmd, TRUE );
+ commandHistory()->addCommand( cmd, true );
cmd->execute();
- emitUpdateProperties( TQT_TQOBJECT(startWidget) );
+ emitUpdateProperties( startWidget );
}
}
if ( !toolFixed )
@@ -1085,8 +1085,8 @@ void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
}
break;
}
- widgetPressed = FALSE;
- drawRubber = FALSE;
+ widgetPressed = false;
+ drawRubber = false;
insertParent = 0;
delete buffer;
buffer = 0;
@@ -1104,7 +1104,7 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w )
e->key() == Key_Down ) &&
propertyWidget->isWidgetType() )
checkSelectionsForMove( (TQWidget*)propertyWidget );
- checkSelectionsTimer->start( 1000, TRUE );
+ checkSelectionsTimer->start( 1000, true );
if ( e->key() == Key_Left || e->key() == Key_Right ||
e->key() == Key_Up || e->key() == Key_Down ) {
TQWidgetList widgets;
@@ -1155,15 +1155,15 @@ void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w )
if ( !widgets.isEmpty() ) {
MoveCommand *cmd = new MoveCommand( i18n( "Move" ), this,
widgets, oldPos, newPos, 0, 0 );
- commandHistory()->addCommand( cmd, TRUE );
+ commandHistory()->addCommand( cmd, true );
cmd->execute();
}
}
if ( !e->isAccepted() ) {
- TQObjectList *l = queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = queryList( "TQWidget" );
if ( !l )
return;
- if ( l->find( TQT_TQOBJECT(w) ) != -1 )
+ if ( l->find( w ) != -1 )
e->accept();
delete l;
}
@@ -1185,30 +1185,30 @@ void FormWindow::selectWidget( TQObject *o, bool select )
TQWidget *w = (TQWidget*)o;
- if ( isMainContainer( TQT_TQOBJECT(w) ) ) {
+ if ( isMainContainer( w ) ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
emitShowProperties( propertyWidget );
return;
}
- if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) {
+ if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
emitShowProperties( propertyWidget );
return;
}
- if ( ::tqqt_cast<QDesignerToolBar*>(o) )
+ if ( ::tqt_cast<QDesignerToolBar*>(o) )
return;
if ( select ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(w);
+ propertyWidget = w;
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
if ( !isPropertyShowingBlocked() )
@@ -1238,9 +1238,9 @@ void FormWindow::selectWidget( TQObject *o, bool select )
s->setWidget( 0 );
TQObject *opw = propertyWidget;
if ( !usedSelections.isEmpty() )
- propertyWidget = TQT_TQOBJECT(TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget());
+ propertyWidget = TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget();
else
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
if ( !isPropertyShowingBlocked() )
@@ -1260,7 +1260,7 @@ void FormWindow::updateSelection( TQWidget *w )
{
WidgetSelection *s = usedSelections.find( w );
if ( !w->isVisibleTo( this ) )
- selectWidget( TQT_TQOBJECT(w), FALSE );
+ selectWidget( w, false );
else if ( s )
s->updateGeometry();
}
@@ -1283,12 +1283,12 @@ void FormWindow::clearSelection( bool changePropertyDisplay )
{
TQPtrDictIterator<WidgetSelection> it( usedSelections );
for ( ; it.current(); ++it )
- it.current()->setWidget( 0, FALSE );
+ it.current()->setWidget( 0, false );
usedSelections.clear();
if ( changePropertyDisplay ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
emitShowProperties( propertyWidget );
@@ -1300,8 +1300,8 @@ void FormWindow::startRectDraw( const TQPoint &p, const TQPoint &global, TQWidge
{
TQPoint pos( p );
pos = mapFromGlobal( global );
- oldRectValid = FALSE;
- beginUnclippedPainter( TRUE );
+ oldRectValid = false;
+ beginUnclippedPainter( true );
if ( t == Rubber )
unclippedPainter->setPen( TQPen( color0, 1 ) );
if ( t == Insert )
@@ -1335,7 +1335,7 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi
if ( oldRectValid )
unclippedPainter->drawRect( currRect );
if ( r.width() > 1 || r.height() > 1 ) {
- oldRectValid = TRUE;
+ oldRectValid = true;
currRect = r;
if ( t == Insert ) {
TQString t = i18n( "%1/%2" );
@@ -1344,9 +1344,9 @@ void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWi
}
unclippedPainter->setClipRegion( TQRegion( rect() ).subtract( TQRect( sizePreviewPos, sizePreviewPixmap.size() ) ) );
unclippedPainter->drawRect( currRect );
- unclippedPainter->setClipping( FALSE );
+ unclippedPainter->setClipping( false );
} else {
- oldRectValid = FALSE;
+ oldRectValid = false;
if ( t == Insert )
drawSizePreview( pos, i18n("Use Size Hint") );
}
@@ -1365,7 +1365,7 @@ void FormWindow::endRectDraw()
void FormWindow::selectWidgets()
{
- TQObjectList *l = mainContainer()->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
if ( l ) {
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
@@ -1374,7 +1374,7 @@ void FormWindow::selectWidgets()
p = mapFromGlobal( p );
TQRect r( p, ( (TQWidget*)o )->size() );
if ( r.intersects( currRect ) && !r.contains( currRect ) )
- selectWidget( TQT_TQOBJECT(o) );
+ selectWidget( o );
}
}
delete l;
@@ -1386,7 +1386,7 @@ bool FormWindow::isWidgetSelected( TQObject *w )
{
if ( w->isWidgetType() )
return usedSelections.find( (TQWidget*)w ) != 0;
- return FALSE; // #### do stuff for TQObjects
+ return false; // #### do stuff for TQObjects
}
void FormWindow::moveSelectedWidgets( int dx, int dy )
@@ -1420,7 +1420,7 @@ void FormWindow::redo()
void FormWindow::raiseChildSelections( TQWidget *w )
{
- TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = w->queryList( "TQWidget" );
if ( !l || !l->first() ) {
delete l;
return;
@@ -1428,7 +1428,7 @@ void FormWindow::raiseChildSelections( TQWidget *w )
TQPtrDictIterator<WidgetSelection> it( usedSelections );
for ( ; it.current(); ++it ) {
- if ( l->findRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 )
+ if ( l->findRef( it.current()->widget() ) != -1 )
it.current()->show();
}
delete l;
@@ -1436,7 +1436,7 @@ void FormWindow::raiseChildSelections( TQWidget *w )
void FormWindow::updateChildSelections( TQWidget *w )
{
- TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = w->queryList( "TQWidget" );
if ( l ) {
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o->isWidgetType() &&
@@ -1449,9 +1449,9 @@ void FormWindow::updateChildSelections( TQWidget *w )
void FormWindow::checkSelectionsForMove( TQWidget *w )
{
- checkedSelectionsForMove = TRUE;
+ checkedSelectionsForMove = true;
- TQObjectList *l = w->parentWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, FALSE, FALSE );
+ TQObjectList *l = w->parentWidget()->queryList( "TQWidget", 0, false, false );
moving.clear();
if ( l ) {
TQPtrDictIterator<WidgetSelection> it( usedSelections );
@@ -1460,7 +1460,7 @@ void FormWindow::checkSelectionsForMove( TQWidget *w )
if ( it.current()->widget() == mainContainer() )
continue;
++it;
- if ( l->find( TQT_TQOBJECT(sel->widget()) ) == -1 ) {
+ if ( l->find( sel->widget() ) == -1 ) {
if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
sel->setWidget( 0 );
} else {
@@ -1483,7 +1483,7 @@ void FormWindow::deleteWidgets()
TQPtrDictIterator<WidgetSelection> it( usedSelections );
for ( ; it.current(); ++it ) {
TQWidget *tb = 0;
- if ( !( tb = mainWindow()->isAToolBarChild( TQT_TQOBJECT(it.current()->widget()) ) ) )
+ if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) )
widgets.append( it.current()->widget() );
else
( (QDesignerToolBar*)tb )->removeWidget( it.current()->widget() );
@@ -1564,12 +1564,12 @@ TQLabel *FormWindow::sizePreview() const
void FormWindow::invalidCheckedSelections()
{
- checkedSelectionsForMove = FALSE;
+ checkedSelectionsForMove = false;
}
void FormWindow::checkPreviewGeometry( TQRect &r )
{
- if ( !TQT_TQRECT_OBJECT(rect()).contains( r ) ) {
+ if ( !rect().contains( r ) ) {
if ( r.left() < rect().left() )
r.moveTopLeft( TQPoint( 0, r.top() ) );
if ( r.right() > rect().right() )
@@ -1591,7 +1591,7 @@ void FormWindow::focusOutEvent( TQFocusEvent * )
{
if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mainContainer());
+ propertyWidget = mainContainer();
if ( opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
}
@@ -1603,17 +1603,17 @@ void FormWindow::resizeEvent( TQResizeEvent *e )
if ( currTool == ORDER_TOOL )
repositionOrderIndicators();
if ( isVisible() )
- formFile()->setModified( TRUE, FormFile::WFormWindow );
+ formFile()->setModified( true, FormFile::WFormWindow );
#if defined(TQ_WS_WIN32)
- windowsRepaintWorkaroundTimer->start( 100, TRUE );
+ windowsRepaintWorkaroundTimer->start( 100, true );
#endif
}
void FormWindow::windowsRepaintWorkaroundTimerTimeout()
{
#if defined(TQ_WS_WIN32)
- TQObjectList *l = queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = queryList( "TQWidget" );
for ( TQObject *o = l->first(); o; o = l->next() ) {
flickerfree_update( (TQWidget*)o );
}
@@ -1632,7 +1632,7 @@ TQWidget *FormWindow::designerWidget( TQObject *o ) const
if ( !o || !o->isWidgetType() )
return 0;
TQWidget *w = (TQWidget*)o;
- while ( w && !isMainContainer( TQT_TQOBJECT(w) ) && !insertedWidgets[ (void*)w ] || isCentralWidget( TQT_TQOBJECT(w) ) )
+ while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) )
w = (TQWidget*)w->parent();
return w;
}
@@ -1646,7 +1646,7 @@ void FormWindow::emitShowProperties( TQObject *w )
repaintSelection( (TQWidget*)opw );
}
showPropertiesTimer->stop();
-// showPropertiesTimer->start( 0, TRUE );
+// showPropertiesTimer->start( 0, true );
showPropertiesTimerDone();
}
@@ -1654,14 +1654,14 @@ void FormWindow::emitUpdateProperties( TQObject *w )
{
if ( w == propertyWidget ) {
updatePropertiesTimer->stop();
- updatePropertiesTimer->start( 0, TRUE );
+ updatePropertiesTimer->start( 0, true );
}
}
void FormWindow::emitSelectionChanged()
{
selectionChangedTimer->stop();
- selectionChangedTimer->start( 0, TRUE );
+ selectionChangedTimer->start( 0, true );
}
void FormWindow::updatePropertiesTimerDone()
@@ -1686,7 +1686,7 @@ void FormWindow::selectionChangedTimerDone()
void FormWindow::currentToolChanged()
{
CHECK_MAINWINDOW;
- toolFixed = FALSE;
+ toolFixed = false;
int t = mainwindow->currentTool();
if ( currTool == t && t != ORDER_TOOL )
return;
@@ -1718,8 +1718,8 @@ void FormWindow::currentToolChanged()
}
startWidget = endWidget = 0;
- widgetPressed = FALSE;
- drawRubber = FALSE;
+ widgetPressed = false;
+ drawRubber = false;
insertParent = 0;
delete buffer;
buffer = 0;
@@ -1727,7 +1727,7 @@ void FormWindow::currentToolChanged()
currTool = t;
if ( hasFocus() )
- clearSelection( FALSE );
+ clearSelection( false );
mainWindow()->statusBar()->clear();
@@ -1735,7 +1735,7 @@ void FormWindow::currentToolChanged()
switch ( currTool ) {
case POINTER_TOOL:
if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) )
- emitShowProperties( TQT_TQOBJECT(mainContainer()) );
+ emitShowProperties( mainContainer() );
restoreCursors( this, this );
break;
case ORDER_TOOL:
@@ -1744,7 +1744,7 @@ void FormWindow::currentToolChanged()
orderedWidgets.clear();
showOrderIndicators();
if ( mainWindow()->formWindow() == this )
- emitShowProperties( TQT_TQOBJECT(mainContainer()) );
+ emitShowProperties( mainContainer() );
setCursorToAll( ArrowCursor, this );
}
break;
@@ -1756,13 +1756,13 @@ void FormWindow::currentToolChanged()
mainWindow()->statusMessage( i18n( "Drag a line to set a buddy...") );
setCursorToAll( CrossCursor, this );
if ( mainWindow()->formWindow() == this )
- emitShowProperties( TQT_TQOBJECT(mainContainer()) );
+ emitShowProperties( mainContainer() );
break;
default:
mainWindow()->statusMessage( i18n( "Click on the form to insert a %1..." ).arg( WidgetDatabase::toolTip( currTool ).lower() ) );
setCursorToAll( CrossCursor, this );
if ( mainWindow()->formWindow() == this )
- emitShowProperties( TQT_TQOBJECT(mainContainer()) );
+ emitShowProperties( mainContainer() );
break;
}
}
@@ -1770,8 +1770,8 @@ void FormWindow::currentToolChanged()
void FormWindow::showOrderIndicators()
{
hideOrderIndicators();
- orderIndicators.setAutoDelete( TRUE );
- TQObjectList *l = mainContainer()->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ orderIndicators.setAutoDelete( true );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
stackedWidgets = MetaDataBase::tabOrder( this );
if ( l ) {
int order = 1;
@@ -1779,7 +1779,7 @@ void FormWindow::showOrderIndicators()
TQWidget* w = (TQWidget*) o;
if ( w->isShown() &&
insertedWidgets[ (void*)w ] &&
- w->focusPolicy() != TQ_NoFocus ) {
+ w->focusPolicy() != TQWidget::NoFocus ) {
OrderIndicator* ind = new OrderIndicator( order++, w, this );
orderIndicators.append( ind );
if ( stackedWidgets.findRef( w ) == -1 )
@@ -1824,7 +1824,7 @@ bool FormWindow::checkCustomWidgets()
TQPtrDictIterator<TQWidget> it( insertedWidgets );
for ( ; it.current(); ++it ) {
if ( it.current()->isA( "CustomWidget" ) ) {
- TQString className = WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) );
+ TQString className = WidgetFactory::classNameOf( it.current() );
if ( !MetaDataBase::hasCustomWidget( className ) )
missingCustomWidgets << className;
}
@@ -1839,9 +1839,9 @@ bool FormWindow::checkCustomWidgets()
"the generated code will not compile.\n"
"Do you want to save this form now?" );
if ( TQMessageBox::information( mainWindow(), i18n( "Save Form" ), txt ) == 1 )
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void FormWindow::setPropertyShowingBlocked( bool b )
@@ -1903,45 +1903,45 @@ void FormWindow::checkAccels()
{
CHECK_MAINWINDOW;
TQMap<TQChar, TQWidgetList > accels;
- TQObjectList *l = mainContainer()->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
if ( l ) {
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
insertedWidgets[ (void*)o ] ) {
TQWidget *w = (TQWidget*)o;
const TQMetaProperty* text =
- w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE );
+ w->metaObject()->property( w->metaObject()->findProperty( "text", true ), true );
const TQMetaProperty* title =
- w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE );
+ w->metaObject()->property( w->metaObject()->findProperty( "title", true ), true );
const TQMetaProperty* pageTitle =
- w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE );
+ w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", true ), true );
if ( text )
find_accel( w->property( "text" ).toString(), accels, w );
if ( title )
find_accel( w->property( "title" ).toString(), accels, w );
if ( pageTitle )
find_accel( w->property( "pageTitle" ).toString(), accels, w );
- } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
+ } else if ( ::tqt_cast<MenuBarEditor*>(o) ) {
((MenuBarEditor *)o)->checkAccels( accels );
}
}
delete l;
}
- bool ok = TRUE;
+ bool ok = true;
TQWidget *wid;
for ( TQMap<TQChar, TQWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) {
if ( (*it).count() > 1 ) {
- ok = FALSE;
+ ok = false;
switch ( TQMessageBox::information( mainWindow(), i18n( "Check Accelerators" ),
i18n( "Accelerator '%1' is used once.", "Accelerator '%1' is used %n times.", (*it).count()
).arg( it.key().upper() ),
i18n( "&Select" ),
i18n( "&Cancel" ), TQString(), 2 ) ) {
case 0: // select
- clearSelection( FALSE );
+ clearSelection( false );
for ( wid = (*it).first(); wid; wid = (*it).next() )
- selectWidget( TQT_TQOBJECT(wid), TRUE );
+ selectWidget( wid, true );
return;
case 1: // cancel
return;
@@ -1976,20 +1976,20 @@ void FormWindow::paste( const TQString &cb, TQWidget *parent )
void FormWindow::selectAll()
{
- checkedSelectionsForMove = FALSE;
- blockSignals( TRUE );
- TQObjectList *l = mainContainer()->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ checkedSelectionsForMove = false;
+ blockSignals( true );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
if ( l ) {
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
insertedWidgets[ (void*)o ] ) {
- selectWidget( TQT_TQOBJECT(o) );
+ selectWidget( o );
}
}
delete l;
}
- blockSignals( FALSE );
+ blockSignals( false );
emitSelectionChanged();
if ( propertyWidget )
emitShowProperties( propertyWidget );
@@ -2001,7 +2001,7 @@ void FormWindow::layoutHorizontal()
TQWidgetList widgets( selectedWidgets() );
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Horizontally" ),
this, mainContainer(), 0, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2011,7 +2011,7 @@ void FormWindow::layoutVertical()
TQWidgetList widgets( selectedWidgets() );
LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Vertically" ),
this, mainContainer(), 0, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2021,7 +2021,7 @@ void FormWindow::layoutHorizontalSplit()
TQWidgetList widgets( selectedWidgets() );
LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay Out Horizontally (in splitter)" ),
this, mainContainer(), 0, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2031,7 +2031,7 @@ void FormWindow::layoutVerticalSplit()
TQWidgetList widgets( selectedWidgets() );
LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay Out Vertically (in splitter)" ),
this, mainContainer(), 0, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2044,7 +2044,7 @@ void FormWindow::layoutGrid()
TQWidgetList widgets( selectedWidgets() );
LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out in a Grid" ),
this, mainContainer(), 0, widgets, xres, yres );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2065,7 +2065,7 @@ void FormWindow::layoutHorizontalContainer( TQWidget *w )
}
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Children Horizontally" ),
this, mainContainer(), w, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2086,7 +2086,7 @@ void FormWindow::layoutVerticalContainer( TQWidget *w )
}
LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Children Vertically" ),
this, mainContainer(), w, widgets );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2110,7 +2110,7 @@ void FormWindow::layoutGridContainer( TQWidget *w )
}
LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ),
this, mainContainer(), w, widgets, xres, yres );
- clearSelection( FALSE );
+ clearSelection( false );
commandHistory()->addCommand( cmd );
cmd->execute();
}
@@ -2126,11 +2126,11 @@ void FormWindow::breakLayout( TQWidget *w )
if ( !w || w == this )
break;
if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout &&
- WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) ) ) {
+ WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
Command *cmd = breakLayoutCommand( w );
if ( cmd )
commands.insert( 0, cmd );
- if ( !::tqqt_cast<TQLayoutWidget*>(w) && !::tqqt_cast<TQSplitter*>(w) )
+ if ( !::tqt_cast<TQLayoutWidget*>(w) && !::tqt_cast<TQSplitter*>(w) )
break;
}
w = w->parentWidget();
@@ -2139,7 +2139,7 @@ void FormWindow::breakLayout( TQWidget *w )
if ( commands.isEmpty() )
return;
- clearSelection( FALSE );
+ clearSelection( false );
MacroCommand *cmd = new MacroCommand( i18n( "Break Layout" ), this, commands );
commandHistory()->addCommand( cmd );
cmd->execute();
@@ -2155,7 +2155,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w )
TQWidgetList widgets;
for ( TQObject *o = l.first(); o; o = l.next() ) {
if ( o->isWidgetType() &&
- !mainWindow()->isAToolBarChild( TQT_TQOBJECT(o) ) &&
+ !mainWindow()->isAToolBarChild( o ) &&
( (TQWidget*)o )->isVisibleTo( this ) &&
insertedWidgets.find( (TQWidget*)o ) )
widgets.append( (TQWidget*)o );
@@ -2177,14 +2177,14 @@ int FormWindow::numVisibleWidgets() const
bool FormWindow::hasInsertedChildren( TQWidget *w ) const
{
if ( !w )
- return FALSE;
+ return false;
w = WidgetFactory::containerOfWidget( w );
if ( !w )
- return FALSE;
- TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING );
+ return false;
+ TQObjectList *l = w->queryList( "TQWidget" );
if ( !l || !l->first() ) {
delete l;
- return FALSE;
+ return false;
}
for ( TQObject *o = l->first(); o; o = l->next() ) {
@@ -2192,23 +2192,23 @@ bool FormWindow::hasInsertedChildren( TQWidget *w ) const
( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) &&
insertedWidgets.find( (TQWidget*)o ) ) {
delete l;
- return TRUE;
+ return true;
}
}
delete l;
- return FALSE;
+ return false;
}
bool FormWindow::allowMove( TQWidget *w )
{
w = w->parentWidget();
while ( w ) {
- if ( ( isMainContainer( TQT_TQOBJECT(w) ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
- return TRUE;
+ if ( ( isMainContainer( w ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ return true;
w = w->parentWidget();
}
- return FALSE;
+ return false;
}
@@ -2221,8 +2221,8 @@ void FormWindow::editConnections()
ConnectionDialog dlg( mainwindow );
mainWindow()->statusMessage( i18n( "Edit connections...") );
- dlg.addConnection( TQT_TQOBJECT(startWidget), TQT_TQOBJECT(endWidget), TQString(), TQString() );
- TQTimer::singleShot( 0, &dlg, TQT_SLOT(ensureConnectionVisible()) );
+ dlg.addConnection( startWidget, endWidget, TQString(), TQString() );
+ TQTimer::singleShot( 0, &dlg, TQ_SLOT(ensureConnectionVisible()) );
dlg.exec();
}
@@ -2361,9 +2361,9 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
int num = 1;
TQPtrDictIterator<TQWidget> it( insertedWidgets );
for ( ; it.current();) {
- if ( TQT_BASE_OBJECT(it.current()) != TQT_BASE_OBJECT(w) &&
+ if ( it.current() != w &&
qstrcmp( it.current()->name(), s.latin1() ) == 0 ) {
- found = TRUE;
+ found = true;
if ( !changeIt )
break;
s = orig + "_" + TQString::number( ++num );
@@ -2376,7 +2376,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
TQPtrList<TQAction> al;
TQAction *a = 0;
for ( a = actions.first(); a; a = actions.next() ) {
- TQObjectList *l = a->queryList( TQACTION_OBJECT_NAME_STRING );
+ TQObjectList *l = a->queryList( "TQAction" );
al.append( a );
for ( TQObject *ao = l->first(); ao; ao = l->next() )
al.append( (TQAction*)ao );
@@ -2385,7 +2385,7 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
for ( a = al.first(); a; a = al.next() ) {
if ( a != w &&
qstrcmp( a->name(), s.latin1() ) == 0 ) {
- found = TRUE;
+ found = true;
if ( !changeIt )
break;
s = orig + "_" + TQString::number( ++num );
@@ -2393,12 +2393,12 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
}
}
}
- if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && !found ) {
+ if ( ::tqt_cast<TQMainWindow*>(mainContainer()) && !found ) {
TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" );
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o != w &&
qstrcmp ( o->name(), s.latin1() ) == 0 ) {
- found = TRUE;
+ found = true;
if ( !changeIt )
break;
s = orig + "_" + TQString::number( ++num );
@@ -2407,13 +2407,13 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
}
delete l;
}
- if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) ) {
+ if ( ::tqt_cast<TQMainWindow*>(mainContainer()) ) {
if ( !found ) {
- TQObjectList *l = mainContainer()->queryList( TQDOCKWINDOW_OBJECT_NAME_STRING, 0, TRUE );
+ TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, true );
for ( TQObject *o = l->first(); o; o = l->next() ) {
if ( o != w &&
qstrcmp( o->name(), s.latin1() ) == 0 ) {
- found = TRUE;
+ found = true;
if ( !changeIt )
break;
s = orig + "_" + TQString::number( ++num );
@@ -2426,8 +2426,8 @@ bool FormWindow::unify( TQObject *w, TQString &s, bool changeIt )
}
if ( !found )
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w )
@@ -2435,45 +2435,45 @@ bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w )
TQPtrDictIterator<TQWidget> it( insertedWidgets );
for ( ; it.current(); ++it ) {
if ( it.current()->isA( "CustomWidget" ) ) {
- if ( qstrcmp( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ), w->className.utf8() ) == 0 )
- return TRUE;
+ if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 )
+ return true;
}
}
- return FALSE;
+ return false;
}
bool FormWindow::isDatabaseWidgetUsed() const
{
#ifndef TQT_NO_SQL
TQStringList dbClasses;
- dbClasses << TQDATATABLE_OBJECT_NAME_STRING; // add more here
+ dbClasses << "TQDataTable"; // add more here
TQPtrDictIterator<TQWidget> it( insertedWidgets );
for ( ; it.current(); ++it ) {
TQString c( it.current()->className() );
if ( dbClasses.contains( c ) > 0 ) {
- return TRUE;
+ return true;
}
}
#endif
- return FALSE;
+ return false;
}
bool FormWindow::isDatabaseAware() const
{
#ifndef TQT_NO_SQL
if ( TQString(mContainer->className()) == "QDesignerDataBrowser" || TQString(mContainer->className()) == "QDesignerDataView" )
- return TRUE;
+ return true;
return isDatabaseWidgetUsed();
#else
- return FALSE;
+ return false;
#endif
}
void FormWindow::visibilityChanged()
{
if ( currTool != ORDER_TOOL ) {
- emitUpdateProperties( TQT_TQOBJECT(currentWidget()) );
+ emitUpdateProperties( currentWidget() );
} else {
updateOrderIndicators();
repositionOrderIndicators();
@@ -2491,7 +2491,7 @@ TQPoint FormWindow::mapToForm( const TQWidget* w, const TQPoint& pos ) const
{
TQPoint p = pos;
const TQWidget* i = w;
- while ( i && !i->isTopLevel() && !isMainContainer( TQT_TQOBJECT(const_cast<TQWidget*>(i)) ) ) {
+ while ( i && !i->isTopLevel() && !isMainContainer( const_cast<TQWidget*>(i) ) ) {
p = i->mapToParent( p );
i = i->parentWidget();
}
@@ -2513,10 +2513,10 @@ static bool isChildOf( TQWidget *c, TQWidget *p )
{
while ( c && !c->isTopLevel() ) {
if ( c == p )
- return TRUE;
+ return true;
c = c->parentWidget();
}
- return FALSE;
+ return false;
}
TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
@@ -2525,27 +2525,27 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
TQWidget *container = 0;
int depth = -1;
TQWidgetList selected = selectedWidgets();
- if ( TQT_TQRECT_OBJECT(rect()).contains( mapFromGlobal( pos ) ) ) {
+ if ( rect().contains( mapFromGlobal( pos ) ) ) {
container = mainContainer();
depth = widgetDepth( container );
}
for ( ; it.current(); ++it ) {
- if ( ::tqqt_cast<TQLayoutWidget*>(it.current())
- || ::tqqt_cast<TQSplitter*>(it.current()) )
+ if ( ::tqt_cast<TQLayoutWidget*>(it.current())
+ || ::tqt_cast<TQSplitter*>(it.current()) )
continue;
if ( !it.current()->isVisibleTo( this ) )
continue;
if ( selected.find( it.current() ) != -1 )
continue;
- if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(it.current()) ) ) ) &&
+ if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( it.current() ) ) ) &&
it.current() != mainContainer() )
continue;
// the rectangles of all ancestors of the container must contain the insert position
TQWidget *w = it.current();
while ( w && !w->isTopLevel() ) {
- if ( !TQT_TQRECT_OBJECT(w->rect()).contains( ( w->mapFromGlobal( pos ) ) ) )
+ if ( !w->rect().contains( ( w->mapFromGlobal( pos ) ) ) )
break;
w = w->parentWidget();
}
@@ -2553,8 +2553,8 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
int wd = widgetDepth( it.current() );
if ( wd == depth && container ) {
- if ( ( it.current()->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(it.current()) ) >
- ( container->parentWidget()->childrenListObject() ).find( TQT_TQOBJECT(container) ) )
+ if ( ( it.current()->parentWidget()->childrenListObject() ).find( it.current() ) >
+ ( container->parentWidget()->childrenListObject() ).find( container ) )
wd++;
}
if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) {
@@ -2568,7 +2568,7 @@ TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
bool FormWindow::isMainContainer( TQObject *w ) const
{
- return w && w->isWidgetType() && ( TQT_BASE_OBJECT(w) == this || TQT_BASE_OBJECT(w) == mainContainer() );
+ return w && w->isWidgetType() && ( w == this || w == mainContainer() );
}
void FormWindow::setMainContainer( TQWidget *w )
@@ -2576,7 +2576,7 @@ void FormWindow::setMainContainer( TQWidget *w )
bool resetPropertyWidget = isMainContainer( propertyWidget );
if ( mContainer )
insertedWidgets.remove( mContainer );
- if ( TQT_BASE_OBJECT(propertyWidget) == TQT_BASE_OBJECT(mContainer) )
+ if ( propertyWidget == mContainer )
propertyWidget = 0;
delete mContainer;
mContainer = w;
@@ -2586,24 +2586,24 @@ void FormWindow::setMainContainer( TQWidget *w )
l->addWidget( w );
if ( resetPropertyWidget ) {
TQObject *opw = propertyWidget;
- propertyWidget = TQT_TQOBJECT(mContainer);
+ propertyWidget = mContainer;
if ( opw && opw->isWidgetType() )
repaintSelection( (TQWidget*)opw );
}
if ( project() ) {
LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() );
if ( iface && !project()->isCpp() && !isFake() ) {
- if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "init()" ) )
- MetaDataBase::addFunction( TQT_TQOBJECT(this), "init()", "", "private", "function",
+ if ( !MetaDataBase::hasFunction( this, "init()" ) )
+ MetaDataBase::addFunction( this, "init()", "", "private", "function",
project()->language(), "void" );
- if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(this), "destroy()" ) )
- MetaDataBase::addFunction( TQT_TQOBJECT(this), "destroy()", "", "private", "function",
+ if ( !MetaDataBase::hasFunction( this, "destroy()" ) )
+ MetaDataBase::addFunction( this, "destroy()", "", "private", "function",
project()->language(), "void" );
- if ( !MetaDataBase::hasConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "shown()", TQT_TQOBJECT(mainContainer()), "init" ) )
- MetaDataBase::addConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "shown()", TQT_TQOBJECT(mainContainer()), "init" );
- if ( !MetaDataBase::hasConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "destroyed()", TQT_TQOBJECT(mainContainer()), "destroy" ) )
- MetaDataBase::addConnection( TQT_TQOBJECT(this), TQT_TQOBJECT(mainContainer()), "destroyed()",
- TQT_TQOBJECT(mainContainer()), "destroy" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "shown()", mainContainer(), "init" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "shown()", mainContainer(), "init" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "destroyed()", mainContainer(), "destroy" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "destroyed()",
+ mainContainer(), "destroy" );
}
}
}
@@ -2627,14 +2627,14 @@ void FormWindow::setSavePixmapInline( bool b )
{
pixInline = b;
if ( b )
- pixProject = FALSE;
+ pixProject = false;
}
void FormWindow::setSavePixmapInProject( bool b )
{
pixProject = b;
if ( b )
- pixInline = FALSE;
+ pixInline = false;
}
void FormWindow::setPixmapLoaderFunction( const TQString &func )
@@ -2663,7 +2663,7 @@ TQAction *FormWindow::findAction( const TQString &name )
for ( TQAction *a = actionList().first(); a; a = actionList().next() ) {
if ( TQString( a->name() ) == name )
return a;
- TQAction *ac = (TQAction*)a->child( name.latin1(), TQACTION_OBJECT_NAME_STRING );
+ TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" );
if ( ac )
return ac;
}
@@ -2672,11 +2672,11 @@ TQAction *FormWindow::findAction( const TQString &name )
void FormWindow::killAccels( TQObject *top )
{
- TQObjectList *l = top->queryList( TQACCEL_OBJECT_NAME_STRING );
+ TQObjectList *l = top->queryList( "TQAccel" );
if ( !l )
return;
for ( TQObject *o = l->first(); o; o = l->next() )
- ( (TQAccel*)o )->setEnabled( FALSE );
+ ( (TQAccel*)o )->setEnabled( false );
delete l;
}
@@ -2689,9 +2689,9 @@ DesignerFormWindow *FormWindow::iFace()
bool FormWindow::isCentralWidget( TQObject *w ) const
{
- if ( !::tqqt_cast<TQMainWindow*>(mainContainer()) )
- return FALSE;
- return TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(( (TQMainWindow*)mainContainer() )->centralWidget());
+ if ( !::tqt_cast<TQMainWindow*>(mainContainer()) )
+ return false;
+ return w == ((TQMainWindow*)mainContainer())->centralWidget();
}
int FormWindow::layoutDefaultSpacing() const
@@ -2753,12 +2753,12 @@ void FormWindow::setFormFile( FormFile *f )
{
ff = f;
if ( ff )
- connect( this, TQT_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQT_SLOT( formWindowChangedSomehow() ) );
+ connect( this, TQ_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQ_SLOT( formWindowChangedSomehow() ) );
}
bool FormWindow::canBeBuddy( const TQWidget *w ) const
{
- return w->focusPolicy() != TQ_NoFocus;
+ return w->focusPolicy() != TQWidget::NoFocus;
}
bool FormWindow::event( TQEvent *e )