summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r--kdevdesigner/designer/widgetfactory.cpp988
1 files changed, 498 insertions, 490 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp
index a38e75af..43081cdd 100644
--- a/kdevdesigner/designer/widgetfactory.cpp
+++ b/kdevdesigner/designer/widgetfactory.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qt Designer.
+** This file is part of TQt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -31,14 +31,14 @@
#include "mainwindow.h"
#include "formwindow.h"
#include "propertyeditor.h"
-#include "layout.h"
+#include "tqlayout.h"
#include "listboxeditorimpl.h"
#include "listvieweditorimpl.h"
#include "iconvieweditorimpl.h"
#include "formwindow.h"
#include "multilineeditorimpl.h"
#include "../interfaces/widgetinterface.h"
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
#include "tableeditorimpl.h"
#endif
#include "project.h"
@@ -54,10 +54,10 @@
#include <tqpixmap.h>
#include <tqgroupbox.h>
#include <tqiconview.h>
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
#include <tqtable.h>
#endif
-#ifndef QT_NO_SQL
+#ifndef TQT_NO_SQL
#include <tqdatatable.h>
#endif
#include <tqdatetimeedit.h>
@@ -92,7 +92,7 @@
#include <tqsplitter.h>
#include <tqtoolbox.h>
#include <tqsizegrip.h>
-#ifndef QT_NO_SQL
+#ifndef TQT_NO_SQL
#include "database.h"
#endif
@@ -107,15 +107,15 @@ FormWindow *find_formwindow( TQWidget *w )
if ( !w )
return 0;
for (;;) {
- if ( ::qt_cast<FormWindow*>(w) )
+ if ( ::tqqt_cast<FormWindow*>(w) )
return (FormWindow*)w;
- if ( !w->parentWidget() )
+ if ( !w->tqparentWidget() )
return 0;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
}
-void QLayoutWidget::paintEvent( TQPaintEvent* )
+void TQLayoutWidget::paintEvent( TQPaintEvent* )
{
TQPainter p ( this );
p.setPen( red );
@@ -123,54 +123,54 @@ void QLayoutWidget::paintEvent( TQPaintEvent* )
}
-QDesignerTabWidget::QDesignerTabWidget( TQWidget *parent, const char *name )
- : TQTabWidget( parent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( FALSE )
+TQDesignerTabWidget::TQDesignerTabWidget( TQWidget *tqparent, const char *name )
+ : TQTabWidget( tqparent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( FALSE )
{
tabBar()->setAcceptDrops( TRUE );
tabBar()->installEventFilter( this );
}
-int QDesignerTabWidget::currentPage() const
+int TQDesignerTabWidget::currentPage() const
{
return tabBar()->currentTab();
}
-void QDesignerTabWidget::setCurrentPage( int i )
+void TQDesignerTabWidget::setCurrentPage( int i )
{
tabBar()->setCurrentTab( i );
}
-TQString QDesignerTabWidget::pageTitle() const
+TQString TQDesignerTabWidget::pageTitle() const
{
return ((TQTabWidget*)this)->tabLabel( TQTabWidget::currentPage() );
}
-void QDesignerTabWidget::setPageTitle( const TQString& title )
+void TQDesignerTabWidget::setPageTitle( const TQString& title )
{
changeTab( TQTabWidget::currentPage(), title );
}
-void QDesignerTabWidget::setPageName( const TQCString& name )
+void TQDesignerTabWidget::setPageName( const TQCString& name )
{
if ( TQTabWidget::currentPage() )
TQTabWidget::currentPage()->setName( name );
}
-TQCString QDesignerTabWidget::pageName() const
+TQCString TQDesignerTabWidget::pageName() const
{
if ( !TQTabWidget::currentPage() )
return 0;
return TQTabWidget::currentPage()->name();
}
-int QDesignerTabWidget::count() const
+int TQDesignerTabWidget::count() const
{
return tabBar()->count();
}
-bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
+bool TQDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
{
- if ( o != tabBar() ) return FALSE;
+ if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(tabBar()) ) return FALSE;
switch ( e->type() ) {
case TQEvent::MouseButtonPress: {
@@ -218,7 +218,7 @@ bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
int index = 0;
TQRect rect;
for ( ; index < tabBar()->count(); index++ ) {
- if ( tabBar()->tabAt( index )->rect().contains( de->pos() ) ) {
+ if ( tabBar()->tabAt( index )->rect().tqcontains( de->pos() ) ) {
rect = tabBar()->tabAt( index )->rect();
break;
}
@@ -227,7 +227,7 @@ bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
if ( index == tabBar()->count() -1 ) {
TQRect rect2 = rect;
rect2.setLeft( rect2.left() + rect2.width() / 2 );
- if ( rect2.contains( de->pos() ) )
+ if ( rect2.tqcontains( de->pos() ) )
index++;
}
@@ -255,20 +255,20 @@ bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
int newIndex = 0;
for ( ; newIndex < tabBar()->count(); newIndex++ ) {
- if ( tabBar()->tabAt( newIndex )->rect().contains( de->pos() ) )
+ if ( tabBar()->tabAt( newIndex )->rect().tqcontains( de->pos() ) )
break;
}
if ( newIndex == tabBar()->count() -1 ) {
TQRect rect2 = tabBar()->tabAt( newIndex )->rect();
rect2.setLeft( rect2.left() + rect2.width() / 2 );
- if ( rect2.contains( de->pos() ) )
+ if ( rect2.tqcontains( de->pos() ) )
newIndex++;
}
int oldIndex = 0;
for ( ; oldIndex < tabBar()->count(); oldIndex++ ) {
- if ( tabBar()->tabAt( oldIndex )->rect().contains( pressPoint ) )
+ if ( tabBar()->tabAt( oldIndex )->rect().tqcontains( pressPoint ) )
break;
}
@@ -290,23 +290,23 @@ bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
}
-QDesignerWidgetStack::QDesignerWidgetStack( TQWidget *parent, const char *name )
- : TQWidgetStack( parent, name )
+TQDesignerWidgetStack::TQDesignerWidgetStack( TQWidget *tqparent, const char *name )
+ : TQWidgetStack( tqparent, name )
{
- prev = new TQToolButton( Qt::LeftArrow, this, "designer_wizardstack_button" );
+ prev = new TQToolButton( TQt::LeftArrow, this, "designer_wizardstack_button" );
prev->setAutoRaise( TRUE );
prev->setAutoRepeat( TRUE );
- prev->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
- next = new TQToolButton( Qt::RightArrow, this, "designer_wizardstack_button" );
+ prev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
+ next = new TQToolButton( TQt::RightArrow, this, "designer_wizardstack_button" );
next->setAutoRaise( TRUE );
next->setAutoRepeat( TRUE );
- next->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
+ next->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
connect( prev, TQT_SIGNAL( clicked() ), this, TQT_SLOT( prevPage() ) );
connect( next, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPage() ) );
updateButtons();
}
-void QDesignerWidgetStack::updateButtons()
+void TQDesignerWidgetStack::updateButtons()
{
prev->setGeometry( width() - 31, 1, 15, 15 );
next->setGeometry( width() - 16, 1, 15, 15 );
@@ -316,23 +316,23 @@ void QDesignerWidgetStack::updateButtons()
next->raise();
}
-void QDesignerWidgetStack::prevPage()
+void TQDesignerWidgetStack::prevPage()
{
setCurrentPage( currentPage() - 1 );
}
-void QDesignerWidgetStack::nextPage()
+void TQDesignerWidgetStack::nextPage()
{
setCurrentPage( currentPage() + 1 );
}
-int QDesignerWidgetStack::currentPage() const
+int TQDesignerWidgetStack::currentPage() const
{
- QDesignerWidgetStack* that = (QDesignerWidgetStack*) this;
- return that->pages.find( visibleWidget() );
+ TQDesignerWidgetStack* that = (TQDesignerWidgetStack*) this;
+ return that->pages.tqfind( visibleWidget() );
}
-void QDesignerWidgetStack::setCurrentPage( int i )
+void TQDesignerWidgetStack::setCurrentPage( int i )
{
// help next/prev page commands
if ( i < 0 )
@@ -346,34 +346,34 @@ void QDesignerWidgetStack::setCurrentPage( int i )
updateButtons();
}
-TQCString QDesignerWidgetStack::pageName() const
+TQCString TQDesignerWidgetStack::pageName() const
{
if ( !visibleWidget() )
return 0;
return visibleWidget()->name();
}
-void QDesignerWidgetStack::setPageName( const TQCString& name )
+void TQDesignerWidgetStack::setPageName( const TQCString& name )
{
if ( visibleWidget() )
visibleWidget()->setName( name );
}
-int QDesignerWidgetStack::count() const
+int TQDesignerWidgetStack::count() const
{
return pages.count();
}
-TQWidget* QDesignerWidgetStack::page( int i ) const
+TQWidget* TQDesignerWidgetStack::page( int i ) const
{
if ( i < 0 || i >= count() )
return 0;
- QDesignerWidgetStack* that = (QDesignerWidgetStack*) this;
+ TQDesignerWidgetStack* that = (TQDesignerWidgetStack*) this;
return that->pages.at( i );
}
-int QDesignerWidgetStack::insertPage( TQWidget *p, int i )
+int TQDesignerWidgetStack::insertPage( TQWidget *p, int i )
{
if ( i < 0 )
pages.append( p );
@@ -384,12 +384,12 @@ int QDesignerWidgetStack::insertPage( TQWidget *p, int i )
raiseWidget( p );
TQApplication::sendPostedEvents();
updateButtons();
- return pages.find( p );
+ return pages.tqfind( p );
}
-int QDesignerWidgetStack::removePage( TQWidget *p )
+int TQDesignerWidgetStack::removePage( TQWidget *p )
{
- int i = pages.find( p );
+ int i = pages.tqfind( p );
pages.remove( p );
removeWidget( p );
setCurrentPage( 0 );
@@ -398,7 +398,7 @@ int QDesignerWidgetStack::removePage( TQWidget *p )
}
-int QDesignerWizard::currentPageNum() const
+int TQDesignerWizard::currentPageNum() const
{
for ( int i = 0; i < pageCount(); ++i ) {
if ( page( i ) == currentPage() )
@@ -411,7 +411,7 @@ int QDesignerWizard::currentPageNum() const
-void QDesignerWizard::setCurrentPage( int i )
+void TQDesignerWizard::setCurrentPage( int i )
{
if ( i < currentPageNum() ) {
while ( i < currentPageNum() ) {
@@ -429,30 +429,30 @@ void QDesignerWizard::setCurrentPage( int i )
}
}
-TQString QDesignerWizard::pageTitle() const
+TQString TQDesignerWizard::pageTitle() const
{
return title( currentPage() );
}
-void QDesignerWizard::setPageTitle( const TQString& title )
+void TQDesignerWizard::setPageTitle( const TQString& title )
{
setTitle( currentPage(), title );
}
-void QDesignerWizard::setPageName( const TQCString& name )
+void TQDesignerWizard::setPageName( const TQCString& name )
{
if ( TQWizard::currentPage() )
TQWizard::currentPage()->setName( name );
}
-TQCString QDesignerWizard::pageName() const
+TQCString TQDesignerWizard::pageName() const
{
if ( !TQWizard::currentPage() )
return 0;
return TQWizard::currentPage()->name();
}
-int QDesignerWizard::pageNum( TQWidget *p )
+int TQDesignerWizard::pageNum( TQWidget *p )
{
for ( int i = 0; i < pageCount(); ++i ) {
if ( page( i ) == p )
@@ -461,23 +461,23 @@ int QDesignerWizard::pageNum( TQWidget *p )
return -1;
}
-void QDesignerWizard::addPage( TQWidget *p, const TQString &t )
+void TQDesignerWizard::addPage( TQWidget *p, const TQString &t )
{
TQWizard::addPage( p, t );
- if ( removedPages.find( p ) )
+ if ( removedPages.tqfind( p ) )
removedPages.remove( p );
}
-void QDesignerWizard::removePage( TQWidget *p )
+void TQDesignerWizard::removePage( TQWidget *p )
{
TQWizard::removePage( p );
removedPages.insert( p, p );
}
-void QDesignerWizard::insertPage( TQWidget *p, const TQString &t, int index )
+void TQDesignerWizard::insertPage( TQWidget *p, const TQString &t, int index )
{
TQWizard::insertPage( p, t, index );
- if ( removedPages.find( p ) )
+ if ( removedPages.tqfind( p ) )
removedPages.remove( p );
}
@@ -486,10 +486,10 @@ TQMap< int, TQStringList > *changedProperties = 0;
/*!
\class WidgetFactory widgetfactory.h
- \brief Set of static functions for creating widgets, layouts and do other stuff
+ \brief Set of static functions for creating widgets, tqlayouts and do other stuff
The widget factory offers functions to create widgets, create and
- delete layouts find out other details - all based on the
+ delete tqlayouts find out other details - all based on the
WidgetDatabase's data. So the functions that use ids use the same
ids as in the WidgetDatabase.
*/
@@ -498,16 +498,16 @@ TQMap< int, TQStringList > *changedProperties = 0;
void WidgetFactory::saveDefaultProperties( TQObject *w, int id )
{
TQMap< TQString, TQVariant> propMap;
- TQStrList lst = w->metaObject()->propertyNames( TRUE );
+ TQStrList lst = w->tqmetaObject()->propertyNames( TRUE );
for ( uint i = 0; i < lst.count(); ++i ) {
TQVariant var = w->property( lst.at( i ) );
if ( !var.isValid() && qstrcmp( "pixmap", lst.at( i ) ) == 0 )
var = TQVariant( TQPixmap() );
else if ( !var.isValid() && qstrcmp( "iconSet", lst.at( i ) ) == 0 )
var = TQVariant( TQIconSet() );
- propMap.replace( lst.at( i ), var );
+ propMap.tqreplace( lst.at( i ), var );
}
- defaultProperties->replace( id, propMap );
+ defaultProperties->tqreplace( id, propMap );
}
void WidgetFactory::saveChangedProperties( TQObject *w, int id )
@@ -517,12 +517,12 @@ void WidgetFactory::saveChangedProperties( TQObject *w, int id )
}
/*! Creates a widget of the type which is registered as \a id as
- child of \a parent. The \a name is optional. If \a init is TRUE, the
+ child of \a tqparent. The \a name is optional. If \a init is TRUE, the
widget is initialized with some defaults, else the plain widget is
created.
*/
-TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, bool init, const TQRect *r, Qt::Orientation orient )
+TQWidget *WidgetFactory::create( int id, TQWidget *tqparent, const char *name, bool init, const TQRect *r, Qt::Orientation orient )
{
TQString n = WidgetDatabase::className( id );
if ( n.isEmpty() )
@@ -536,97 +536,97 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo
TQWidget *w = 0;
TQString str = WidgetDatabase::createWidgetName( id );
const char *s = str.latin1();
- w = createWidget( n, parent, name ? name : s, init, r, orient );
- if ( ::qt_cast<TQScrollView*>(w) )
+ w = createWidget( n, tqparent, name ? name : s, init, r, orient );
+ if ( ::tqqt_cast<TQScrollView*>(w) )
( (TQScrollView*)w )->disableSizeHintCaching();
if ( !w && WidgetDatabase::isCustomWidget( id ) )
- w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) );
+ w = createCustomWidget( tqparent, name ? name : s, MetaDataBase::customWidget( id ) );
if ( !w )
return 0;
- MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
- if ( !defaultProperties->contains( id ) )
- saveDefaultProperties( w, id );
- if ( !changedProperties->contains( id ) )
- saveChangedProperties( w, id );
+ if ( !defaultProperties->tqcontains( id ) )
+ saveDefaultProperties( TQT_TQOBJECT(w), id );
+ if ( !changedProperties->tqcontains( id ) )
+ saveChangedProperties( TQT_TQOBJECT(w), id );
return w;
}
-/*! Creates a layout on the widget \a widget of the type \a type
+/*! Creates a tqlayout on the widget \a widget of the type \a type
which can be \c HBox, \c VBox or \c Grid.
*/
-TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type )
+TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, LayoutType type )
{
int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0;
- int metaspacing = MetaDataBase::spacing( widget );
- int metamargin = MetaDataBase::margin( widget );
+ int metaspacing = MetaDataBase::spacing( TQT_TQOBJECT(widget) );
+ int metamargin = MetaDataBase::margin( TQT_TQOBJECT(widget) );
- if ( ::qt_cast<QLayoutWidget*>(widget) &&
- ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
- widget && ::qt_cast<FormWindow*>(widget->parentWidget()) ) )
+ if ( ::tqqt_cast<TQLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
+ widget && ::tqqt_cast<FormWindow*>(widget->tqparentWidget()) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
- if ( !layout && ::qt_cast<TQTabWidget*>(widget) )
+ if ( !tqlayout && ::tqqt_cast<TQTabWidget*>(widget) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !layout && ::qt_cast<TQWizard*>(widget) )
+ if ( !tqlayout && ::tqqt_cast<TQWizard*>(widget) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !layout && ::qt_cast<TQMainWindow*>(widget) )
+ if ( !tqlayout && ::tqqt_cast<TQMainWindow*>(widget) )
widget = ((TQMainWindow*)widget)->centralWidget();
- if ( !layout && ::qt_cast<TQWidgetStack*>(widget) )
+ if ( !tqlayout && ::tqqt_cast<TQWidgetStack*>(widget) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- if ( !layout && ::qt_cast<TQToolBox*>(widget) )
+ if ( !tqlayout && ::tqqt_cast<TQToolBox*>(widget) )
widget = ((TQToolBox*)widget)->currentItem();
- MetaDataBase::addEntry( widget );
+ MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
TQLayout *l = 0;
int align = 0;
- if ( !layout && ::qt_cast<TQGroupBox*>(widget) ) {
+ if ( !tqlayout && ::tqqt_cast<TQGroupBox*>(widget) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
- layout = gb->layout();
- layout->setMargin( 0 );
- layout->setSpacing( 0 );
+ tqlayout = gb->tqlayout();
+ tqlayout->setMargin( 0 );
+ tqlayout->setSpacing( 0 );
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( layout );
+ l = new TQHBoxLayout( tqlayout );
break;
case VBox:
- l = new TQVBoxLayout( layout );
+ l = new TQVBoxLayout( tqlayout );
break;
case Grid:
- l = new QDesignerGridLayout( layout );
+ l = new TQDesignerGridLayout( tqlayout );
break;
default:
return 0;
}
- align = Qt::AlignTop;
- MetaDataBase::setMargin( gb, metamargin );
- MetaDataBase::setSpacing( gb, metaspacing );
+ align = TQt::AlignTop;
+ MetaDataBase::setMargin( TQT_TQOBJECT(gb), metamargin );
+ MetaDataBase::setSpacing( TQT_TQOBJECT(gb), metaspacing );
} else {
- if ( layout ) {
+ if ( tqlayout ) {
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( layout );
+ l = new TQHBoxLayout( tqlayout );
break;
case VBox:
- l = new TQVBoxLayout( layout );
+ l = new TQVBoxLayout( tqlayout );
break;
case Grid:
- l = new QDesignerGridLayout( layout );
+ l = new TQDesignerGridLayout( tqlayout );
break;
default:
return 0;
}
- MetaDataBase::addEntry( l );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
} else {
@@ -638,23 +638,23 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, Layou
l = new TQVBoxLayout( widget );
break;
case Grid:
- l = new QDesignerGridLayout( widget );
+ l = new TQDesignerGridLayout( widget );
break;
default:
return 0;
}
- MetaDataBase::addEntry( l );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
if ( widget ) {
- MetaDataBase::setMargin( widget, metamargin );
- MetaDataBase::setSpacing( widget, metaspacing );
+ MetaDataBase::setMargin( TQT_TQOBJECT(widget), metamargin );
+ MetaDataBase::setSpacing( TQT_TQOBJECT(widget), metaspacing );
} else {
l->setMargin( margin );
l->setSpacing( spacing );
}
}
}
- l->setAlignment( align );
- MetaDataBase::addEntry( l );
+ l->tqsetAlignment( align );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
}
@@ -663,44 +663,44 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
if ( !widget )
return;
- if ( ::qt_cast<TQTabWidget*>(widget) )
+ if ( ::tqqt_cast<TQTabWidget*>(widget) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( ::qt_cast<TQWizard*>(widget) )
+ if ( ::tqqt_cast<TQWizard*>(widget) )
widget = ((TQWizard*)widget)->currentPage();
- if ( ::qt_cast<TQMainWindow*>(widget) )
+ if ( ::tqqt_cast<TQMainWindow*>(widget) )
widget = ((TQMainWindow*)widget)->centralWidget();
- if ( ::qt_cast<TQWidgetStack*>(widget) )
+ if ( ::tqqt_cast<TQWidgetStack*>(widget) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- if ( ::qt_cast<TQToolBox*>(widget) )
+ if ( ::tqqt_cast<TQToolBox*>(widget) )
widget = ((TQToolBox*)widget)->currentItem();
- delete widget->layout();
+ delete widget->tqlayout();
}
/*! Factory functions for creating a widget of the type \a className
- as child of \a parent with the name \a name.
+ as child of \a tqparent with the name \a name.
If \a init is TRUE, some initial default properties are set. This
has to be in sync with the initChangedProperties() function!
*/
-TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *parent, const char *name, bool init,
+TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqparent, const char *name, bool init,
const TQRect *r, Qt::Orientation orient )
{
if ( className == TQPUSHBUTTON_OBJECT_NAME_STRING ) {
TQPushButton *b = 0;
if ( init ) {
- b = new QDesignerPushButton( parent, name );
- b->setText( TQString::fromLatin1( name ) );
+ b = new TQDesignerPushButton( tqparent, name );
+ b->setText( TQString::tqfromLatin1( name ) );
} else {
- b = new QDesignerPushButton( parent, name );
+ b = new TQDesignerPushButton( tqparent, name );
}
TQWidget *w = find_formwindow( b );
- b->setAutoDefault( w && ::qt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
+ b->setAutoDefault( w && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
return b;
} else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
- QDesignerToolButton *tb = new QDesignerToolButton( parent, name );
- if ( ::qt_cast<TQToolBox*>(widgetOfContainer(parent))) {
+ TQDesignerToolButton *tb = new TQDesignerToolButton( tqparent, name );
+ if ( ::tqqt_cast<TQToolBox*>(widgetOfContainer(tqparent))) {
tb->setUsesTextLabel(TRUE);
tb->setTextLabel("...");
tb->setAutoRaise(TRUE);
@@ -710,32 +710,32 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
}
return tb;
}
- return new QDesignerToolButton( parent, name );
+ return new TQDesignerToolButton( tqparent, name );
} else if ( className == TQCHECKBOX_OBJECT_NAME_STRING ) {
if ( init ) {
- QDesignerCheckBox *cb = new QDesignerCheckBox( parent, name );
- cb->setText( TQString::fromLatin1( name ) );
+ TQDesignerCheckBox *cb = new TQDesignerCheckBox( tqparent, name );
+ cb->setText( TQString::tqfromLatin1( name ) );
return cb;
}
- return new QDesignerCheckBox( parent, name );
+ return new TQDesignerCheckBox( tqparent, name );
} else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
- QDesignerRadioButton *rb = new QDesignerRadioButton( parent, name );
- rb->setText( TQString::fromLatin1( name ) );
+ TQDesignerRadioButton *rb = new TQDesignerRadioButton( tqparent, name );
+ rb->setText( TQString::tqfromLatin1( name ) );
return rb;
}
- return new QDesignerRadioButton( parent, name );
+ return new TQDesignerRadioButton( tqparent, name );
} else if ( className == TQGROUPBOX_OBJECT_NAME_STRING ) {
if ( init )
- return new TQGroupBox( TQString::fromLatin1( name ), parent, name );
- return new TQGroupBox( parent, name );
+ return new TQGroupBox( TQString::tqfromLatin1( name ), tqparent, name );
+ return new TQGroupBox( tqparent, name );
} else if ( className == TQBUTTONGROUP_OBJECT_NAME_STRING ) {
if ( init )
- return new TQButtonGroup( TQString::fromLatin1( name ), parent, name );
- return new TQButtonGroup( parent, name );
+ return new TQButtonGroup( TQString::tqfromLatin1( name ), tqparent, name );
+ return new TQButtonGroup( tqparent, name );
} else if ( className == TQICONVIEW_OBJECT_NAME_STRING ) {
-#if !defined(QT_NO_ICONVIEW)
- TQIconView* iv = new TQIconView( parent, name );
+#if !defined(TQT_NO_ICONVIEW)
+ TQIconView* iv = new TQIconView( tqparent, name );
if ( init )
(void) new TQIconViewItem( iv, i18n( "New Item" ) );
return iv;
@@ -743,33 +743,33 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return 0;
#endif
} else if ( className == TQTABLE_OBJECT_NAME_STRING ) {
-#if !defined(QT_NO_TABLE)
+#if !defined(TQT_NO_TABLE)
if ( init )
- return new TQTable( 3, 3, parent, name );
- return new TQTable( parent, name );
+ return new TQTable( 3, 3, tqparent, name );
+ return new TQTable( tqparent, name );
#else
return 0;
#endif
-#ifndef QT_NO_SQL
+#ifndef TQT_NO_SQL
} else if ( className == TQDATATABLE_OBJECT_NAME_STRING ) {
- return new TQDataTable( parent, name );
-#endif //QT_NO_SQL
+ return new TQDataTable( tqparent, name );
+#endif //TQT_NO_SQL
} else if ( className == TQDATEEDIT_OBJECT_NAME_STRING ) {
- return new QDateEdit( parent, name );
+ return new TQDateEdit( tqparent, name );
} else if ( className == TQTIMEEDIT_OBJECT_NAME_STRING ) {
- return new QTimeEdit( parent, name );
+ return new TQTimeEdit( tqparent, name );
} else if ( className == TQDATETIMEEDIT_OBJECT_NAME_STRING ) {
- return new QDateTimeEdit( parent, name );
+ return new TQDateTimeEdit( tqparent, name );
}
else if ( className == TQLISTBOX_OBJECT_NAME_STRING ) {
- TQListBox* lb = new TQListBox( parent, name );
+ TQListBox* lb = new TQListBox( tqparent, name );
if ( init ) {
lb->insertItem( i18n( "New Item" ) );
lb->setCurrentItem( 0 );
}
return lb;
} else if ( className == TQLISTVIEW_OBJECT_NAME_STRING ) {
- TQListView *lv = new TQListView( parent, name );
+ TQListView *lv = new TQListView( tqparent, name );
lv->setSorting( -1 );
if ( init ) {
lv->addColumn( i18n( "Column 1" ) );
@@ -777,109 +777,109 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
}
return lv;
} else if ( className == TQLINEEDIT_OBJECT_NAME_STRING )
- return new TQLineEdit( parent, name );
+ return new TQLineEdit( tqparent, name );
else if ( className == TQSPINBOX_OBJECT_NAME_STRING )
- return new TQSpinBox( parent, name );
+ return new TQSpinBox( tqparent, name );
else if ( className == TQSPLITTER_OBJECT_NAME_STRING )
- return new TQSplitter( parent, name );
+ return new TQSplitter( tqparent, name );
else if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING )
- return new TQMultiLineEdit( parent, name );
+ return new TQMultiLineEdit( tqparent, name );
else if ( className == TQTEXTEDIT_OBJECT_NAME_STRING )
- return new TQTextEdit( parent, name );
+ return new TQTextEdit( tqparent, name );
else if ( className == TQLABEL_OBJECT_NAME_STRING || className == "TextLabel" ) {
- QDesignerLabel *l = new QDesignerLabel( parent, name );
+ TQDesignerLabel *l = new TQDesignerLabel( tqparent, name );
if ( init ) {
- l->setText( TQString::fromLatin1( name ) );
- MetaDataBase::addEntry( l );
- MetaDataBase::setPropertyChanged( l, "text", TRUE );
+ l->setText( TQString::tqfromLatin1( name ) );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "text", TRUE );
}
return l;
} else if ( className == "PixmapLabel" ) {
- QDesignerLabel *l = new QDesignerLabel( parent, name );
+ TQDesignerLabel *l = new TQDesignerLabel( tqparent, name );
if ( init ) {
l->setPixmap( BarIcon( "designer_qtlogo.png", KDevDesignerPartFactory::instance() ) );
l->setScaledContents( TRUE );
- MetaDataBase::addEntry( l );
- MetaDataBase::setPropertyChanged( l, "pixmap", TRUE );
- MetaDataBase::setPropertyChanged( l, "scaledContents", TRUE );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "pixmap", TRUE );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "scaledContents", TRUE );
}
return l;
} else if ( className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
- return new QLayoutWidget( parent, name );
+ return new TQLayoutWidget( tqparent, name );
else if ( className == TQTABWIDGET_OBJECT_NAME_STRING ) {
- TQTabWidget *tw = new QDesignerTabWidget( parent, name );
+ TQTabWidget *tw = new TQDesignerTabWidget( tqparent, name );
if ( init ) {
- FormWindow *fw = find_formwindow( parent );
- TQWidget *w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
+ FormWindow *fw = find_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
tw->addTab( w, i18n("Tab 1") );
- MetaDataBase::addEntry( w );
- w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ w = fw ? new TQDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
tw->addTab( w, i18n("Tab 2") );
- MetaDataBase::addEntry( tw );
- MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( TQT_TQOBJECT(tw) );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
}
return tw;
} else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) {
- QDesignerWidgetStack *ws = new QDesignerWidgetStack( parent, name );
+ TQDesignerWidgetStack *ws = new TQDesignerWidgetStack( tqparent, name );
if ( init ) {
- FormWindow *fw = find_formwindow( parent );
- TQWidget *w = fw ? new QDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" );
+ FormWindow *fw = find_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" );
ws->insertPage( w );
- MetaDataBase::addEntry( w );
- MetaDataBase::addEntry( ws );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ MetaDataBase::addEntry( TQT_TQOBJECT(ws) );
}
return ws;
} else if ( className == TQCOMBOBOX_OBJECT_NAME_STRING ) {
- return new TQComboBox( FALSE, parent, name );
+ return new TQComboBox( FALSE, tqparent, name );
} else if ( className == TQWIDGET_OBJECT_NAME_STRING ) {
- if ( parent &&
- ( ::qt_cast<FormWindow*>(parent) ||
- ::qt_cast<TQWizard*>(parent) ||
- ::qt_cast<TQTabWidget*>(parent) ||
- ::qt_cast<TQWidgetStack*>(parent) ||
- ::qt_cast<TQToolBox*>(parent) ||
- ::qt_cast<TQMainWindow*>(parent) ) ) {
- FormWindow *fw = find_formwindow( parent );
+ if ( tqparent &&
+ ( ::tqqt_cast<FormWindow*>(tqparent) ||
+ ::tqqt_cast<TQWizard*>(tqparent) ||
+ ::tqqt_cast<TQTabWidget*>(tqparent) ||
+ ::tqqt_cast<TQWidgetStack*>(tqparent) ||
+ ::tqqt_cast<TQToolBox*>(tqparent) ||
+ ::tqqt_cast<TQMainWindow*>(tqparent) ) ) {
+ FormWindow *fw = find_formwindow( tqparent );
if ( fw ) {
- QDesignerWidget *dw = new QDesignerWidget( fw, parent, name );
- MetaDataBase::addEntry( dw );
+ TQDesignerWidget *dw = new TQDesignerWidget( fw, tqparent, name );
+ MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
return dw;
}
}
- return new TQWidget( parent, name );
+ return new TQWidget( tqparent, name );
} else if ( className == TQDIALOG_OBJECT_NAME_STRING ) {
TQDialog *dia = 0;
- if ( ::qt_cast<FormWindow*>(parent) )
- dia = new QDesignerDialog( (FormWindow*)parent, parent, name );
+ if ( ::tqqt_cast<FormWindow*>(tqparent) )
+ dia = new TQDesignerDialog( (FormWindow*)tqparent, tqparent, name );
else
- dia = new TQDialog( parent, name );
-#if defined(QT_NON_COMMERCIAL)
- if ( ::qt_cast<MainWindow*>(parent) )
+ dia = new TQDialog( tqparent, name );
+#if defined(TQT_NON_COMMERCIAL)
+ if ( ::tqqt_cast<MainWindow*>(tqparent) )
#else
- if ( parent )
+ if ( tqparent )
#endif
- dia->reparent( parent, TQPoint( 0, 0 ), TRUE );
+ dia->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
return dia;
} else if ( className == TQWIZARD_OBJECT_NAME_STRING ) {
- TQWizard *wiz = new QDesignerWizard( parent, name );
-#if defined(QT_NON_COMMERCIAL)
- if ( ::qt_cast<MainWindow*>(parent) )
+ TQWizard *wiz = new TQDesignerWizard( tqparent, name );
+#if defined(TQT_NON_COMMERCIAL)
+ if ( ::tqqt_cast<MainWindow*>(tqparent) )
#else
- if ( parent )
+ if ( tqparent )
#endif
- wiz->reparent( parent, TQPoint( 0, 0 ), TRUE );
- if ( init && ::qt_cast<FormWindow*>(parent) ) {
- QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" );
- MetaDataBase::addEntry( dw );
+ wiz->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
+ if ( init && ::tqqt_cast<FormWindow*>(tqparent) ) {
+ TQDesignerWidget *dw = new TQDesignerWidget( (FormWindow*)tqparent, wiz, "WizardPage" );
+ MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
wiz->addPage( dw, i18n( "Page" ) );
TQTimer::singleShot( 0, wiz, TQT_SLOT( next() ) );
}
return wiz;
} else if ( className == "Spacer" ) {
- Spacer *s = new Spacer( parent, name );
- MetaDataBase::addEntry( s );
- MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
- MetaDataBase::setPropertyChanged( s, "sizeType", TRUE );
+ Spacer *s = new Spacer( tqparent, name );
+ MetaDataBase::addEntry( TQT_TQOBJECT(s) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "sizeType", TRUE );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
@@ -890,49 +890,49 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
s->setOrientation( Qt::Horizontal );
return s;
} else if ( className == TQLCDNUMBER_OBJECT_NAME_STRING )
- return new TQLCDNumber( parent, name );
+ return new TQLCDNumber( tqparent, name );
else if ( className == TQPROGRESSBAR_OBJECT_NAME_STRING )
- return new TQProgressBar( parent, name );
+ return new TQProgressBar( tqparent, name );
else if ( className == TQTEXTVIEW_OBJECT_NAME_STRING )
- return new TQTextView( parent, name );
+ return new TQTextView( tqparent, name );
else if ( className == TQTEXTBROWSER_OBJECT_NAME_STRING )
- return new TQTextBrowser( parent, name );
+ return new TQTextBrowser( tqparent, name );
else if ( className == TQDIAL_OBJECT_NAME_STRING )
- return new TQDial( parent, name );
+ return new TQDial( tqparent, name );
else if ( className == TQSLIDER_OBJECT_NAME_STRING ) {
- TQSlider *s = new TQSlider( parent, name );
+ TQSlider *s = new TQSlider( tqparent, name );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( Qt::Horizontal );
- MetaDataBase::addEntry( s );
- MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ MetaDataBase::addEntry( TQT_TQOBJECT(s) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
return s;
} else if ( className == TQSCROLLBAR_OBJECT_NAME_STRING ) {
- TQScrollBar *s = new TQScrollBar( parent, name );
+ TQScrollBar *s = new TQScrollBar( tqparent, name );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( Qt::Horizontal );
- MetaDataBase::addEntry( s );
- MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ MetaDataBase::addEntry( TQT_TQOBJECT(s) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE );
return s;
} else if ( className == TQFRAME_OBJECT_NAME_STRING ) {
if ( !init )
- return new TQFrame( parent, name );
- TQFrame *f = new TQFrame( parent, name );
+ return new TQFrame( tqparent, name );
+ TQFrame *f = new TQFrame( tqparent, name );
f->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
return f;
} else if ( className == "Line" ) {
- Line *l = new Line( parent, name );
- MetaDataBase::addEntry( l );
- MetaDataBase::setPropertyChanged( l, "orientation", TRUE );
- MetaDataBase::setPropertyChanged( l, "frameShadow", TRUE );
- MetaDataBase::setPropertyChanged( l, "frameShape", TRUE );
+ Line *l = new Line( tqparent, name );
+ MetaDataBase::addEntry( TQT_TQOBJECT(l) );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "frameShape", TRUE );
if ( !r )
return l;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
@@ -941,40 +941,40 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
l->setOrientation( Qt::Vertical );
return l;
} else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) {
- TQMainWindow *mw = new TQMainWindow( parent, name, 0 );
- mw->setDockEnabled( Qt::DockMinimized, FALSE );
- QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, mw, "central widget" );
+ TQMainWindow *mw = new TQMainWindow( tqparent, name, 0 );
+ mw->setDockEnabled( TQt::DockMinimized, FALSE );
+ TQDesignerWidget *dw = new TQDesignerWidget( (FormWindow*)tqparent, mw, "central widget" );
mw->setDockMenuEnabled( FALSE );
- MetaDataBase::addEntry( dw );
+ MetaDataBase::addEntry( TQT_TQOBJECT(dw) );
mw->setCentralWidget( dw );
(void)mw->statusBar();
dw->show();
return mw;
} else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) {
if ( !init )
- return new QDesignerToolBox( parent, name );
- TQToolBox *tb = new QDesignerToolBox( parent, name );
- FormWindow *fw = find_formwindow( parent );
- TQWidget *w = fw ? new QDesignerWidget( fw, tb, "page1" ) :
+ return new TQDesignerToolBox( tqparent, name );
+ TQToolBox *tb = new TQDesignerToolBox( tqparent, name );
+ FormWindow *fw = find_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, tb, "page1" ) :
new TQWidget( tb, "page1" );
tb->addItem( w, i18n("Page 1") );
- MetaDataBase::addEntry( w );
- w = fw ? new QDesignerWidget( fw, tb, "page2" ) : new TQWidget( tb, "page2" );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
+ w = fw ? new TQDesignerWidget( fw, tb, "page2" ) : new TQWidget( tb, "page2" );
tb->addItem( w, i18n("Page 2") );
- MetaDataBase::addEntry( tb );
- MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( TQT_TQOBJECT(tb) );
+ MetaDataBase::addEntry( TQT_TQOBJECT(w) );
return tb;
}
-#ifndef QT_NO_SQL
+#ifndef TQT_NO_SQL
else if ( className == TQDATABROWSER_OBJECT_NAME_STRING ) {
- TQWidget *w = new QDesignerDataBrowser( parent, name );
- if ( parent )
- w->reparent( parent, TQPoint( 0, 0 ), TRUE );
+ TQWidget *w = new TQDesignerDataBrowser( tqparent, name );
+ if ( tqparent )
+ w->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
return w;
} else if ( className == TQDATAVIEW_OBJECT_NAME_STRING ) {
- TQWidget *w = new QDesignerDataView( parent, name );
- if ( parent )
- w->reparent( parent, TQPoint( 0, 0 ), TRUE );
+ TQWidget *w = new TQDesignerDataView( tqparent, name );
+ if ( tqparent )
+ w->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
return w;
}
#endif
@@ -984,63 +984,63 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if ( !iface )
return 0;
- TQWidget *w = iface->create( className, parent, name );
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ TQWidget *w = iface->create( className, tqparent, name );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
if ( init && WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( className ) ) ) {
- QWidgetContainerInterfacePrivate *iface2 = 0;
- iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
if ( iface2 ) {
iface2->addPage( className, w, "Page", -1 );
iface2->release();
}
}
-#endif // QT_CONTAINER_CUSTOM_WIDGETS
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
iface->release();
return w;
}
-/*! Find out which type the layout of the widget is. Returns \c HBox,
- \c VBox, \c Grid or \c NoLayout. \a layout points to this
- TQWidget::layout() of \a w or to 0 after the function call.
+/*! Find out which type the tqlayout of the widget is. Returns \c HBox,
+ \c VBox, \c Grid or \c NoLayout. \a tqlayout points to this
+ TQWidget::tqlayout() of \a w or to 0 after the function call.
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout )
+WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQWidget *w, TQLayout *&tqlayout )
{
- layout = 0;
+ tqlayout = 0;
- if ( ::qt_cast<TQTabWidget*>(w) )
+ if ( ::tqqt_cast<TQTabWidget*>(w) )
w = ((TQTabWidget*)w)->currentPage();
- if ( ::qt_cast<TQWizard*>(w) )
+ if ( ::tqqt_cast<TQWizard*>(w) )
w = ((TQWizard*)w)->currentPage();
- if ( ::qt_cast<TQMainWindow*>(w) )
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
w = ((TQMainWindow*)w)->centralWidget();
- if ( ::qt_cast<TQWidgetStack*>(w) )
+ if ( ::tqqt_cast<TQWidgetStack*>(w) )
w = ((TQWidgetStack*)w)->visibleWidget();
- if ( ::qt_cast<TQToolBox*>(w) )
+ if ( ::tqqt_cast<TQToolBox*>(w) )
w = ((TQToolBox*)w)->currentItem();
- if ( ::qt_cast<TQSplitter*>(w) )
- return ( (TQSplitter*)w )->orientation() == Horizontal ? HBox : VBox;
+ if ( ::tqqt_cast<TQSplitter*>(w) )
+ return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox;
- if ( !w || !w->layout() )
+ if ( !w || !w->tqlayout() )
return NoLayout;
- TQLayout *lay = w->layout();
+ TQLayout *lay = w->tqlayout();
- if ( ::qt_cast<TQGroupBox*>(w) ) {
- TQObjectList *l = lay->queryList( TQLAYOUT_OBJECT_NAME_STRING );
+ if ( ::tqqt_cast<TQGroupBox*>(w) ) {
+ TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING );
if ( l && l->first() )
lay = (TQLayout*)l->first();
delete l;
}
- layout = lay;
+ tqlayout = lay;
- if ( ::qt_cast<TQHBoxLayout*>(lay) )
+ if ( ::tqqt_cast<TQHBoxLayout*>(lay) )
return HBox;
- else if ( ::qt_cast<TQVBoxLayout*>(lay) )
+ else if ( ::tqqt_cast<TQVBoxLayout*>(lay) )
return VBox;
- else if ( ::qt_cast<TQGridLayout*>(lay) )
+ else if ( ::tqqt_cast<TQGridLayout*>(lay) )
return Grid;
return NoLayout;
}
@@ -1048,13 +1048,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
+WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQLayout *tqlayout )
{
- if ( ::qt_cast<TQHBoxLayout*>(layout) )
+ if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout) )
return HBox;
- else if ( ::qt_cast<TQVBoxLayout*>(layout) )
+ else if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout) )
return VBox;
- else if ( ::qt_cast<TQGridLayout*>(layout) )
+ else if ( ::tqqt_cast<TQGridLayout*>(tqlayout) )
return Grid;
return NoLayout;
}
@@ -1062,25 +1062,25 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
+WidgetFactory::LayoutType WidgetFactory::tqlayoutType( TQWidget *w )
{
TQLayout *l = 0;
- return layoutType( w, l );
+ return tqlayoutType( w, l );
}
-TQWidget *WidgetFactory::layoutParent( TQLayout *layout )
+TQWidget *WidgetFactory::tqlayoutParent( TQLayout *tqlayout )
{
- TQObject *o = layout;
+ TQObject *o = TQT_TQOBJECT(tqlayout);
while ( o ) {
if ( o->isWidgetType() )
return (TQWidget*)o;
- o = o->parent();
+ o = o->tqparent();
}
return 0;
}
-/*! Returns the widget into which children should be inserted when \a
+/*! Returns the widget into which tqchildren should be inserted when \a
w is a container known to the designer.
Usually that is \a w itself, sometimes it is different (e.g. a
@@ -1093,25 +1093,25 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
{
if ( !w )
return w;
- if ( ::qt_cast<TQTabWidget*>(w) )
+ if ( ::tqqt_cast<TQTabWidget*>(w) )
return ((TQTabWidget*)w)->currentPage();
- if ( ::qt_cast<TQWizard*>(w) )
+ if ( ::tqqt_cast<TQWizard*>(w) )
return ((TQWizard*)w)->currentPage();
- if ( ::qt_cast<TQWidgetStack*>(w) )
+ if ( ::tqqt_cast<TQWidgetStack*>(w) )
return ((TQWidgetStack*)w)->visibleWidget();
- if ( ::qt_cast<TQToolBox*>(w) )
+ if ( ::tqqt_cast<TQToolBox*>(w) )
return ((TQToolBox*)w)->currentItem();
- if ( ::qt_cast<TQMainWindow*>(w) )
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
return ((TQMainWindow*)w)->centralWidget();
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) )
return w;
WidgetInterface *iface = 0;
widgetManager()->queryInterface( classNameOf( w ), &iface );
if ( !iface )
return w;
- QWidgetContainerInterfacePrivate *iface2 = 0;
- iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
if ( !iface2 )
return w;
TQWidget *c = iface2->containerOfWidget( w->className(), w );
@@ -1119,32 +1119,32 @@ TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
iface->release();
if ( c )
return c;
-#endif // QT_CONTAINER_CUSTOM_WIDGETS
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
return w;
}
/*! Returns the actual designer widget of the container \a w. This is
- normally \a w itself, but might be a parent or grand parent of \a w
+ normally \a w itself, but might be a tqparent or grand tqparent of \a w
(e.g. when working with a tabwidget and \a w is the container which
- contains and layouts childs, but the actual widget known to the
- designer is the tabwidget which is the parent of \a w. So this
+ contains and tqlayouts childs, but the actual widget known to the
+ designer is the tabwidget which is the tqparent of \a w. So this
function returns the tabwidget then.)
*/
TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
{
- if ( w && ::qt_cast<TQWidgetStack*>(w->parentWidget()) )
- w = w->parentWidget();
- if ( w->parentWidget() && w->parentWidget()->parentWidget() &&
- w->parentWidget()->parentWidget()->parentWidget() &&
- ::qt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) )
- return w->parentWidget()->parentWidget()->parentWidget();
+ if ( w && ::tqqt_cast<TQWidgetStack*>(w->tqparentWidget()) )
+ w = w->tqparentWidget();
+ if ( w->tqparentWidget() && w->tqparentWidget()->tqparentWidget() &&
+ w->tqparentWidget()->tqparentWidget()->tqparentWidget() &&
+ ::tqqt_cast<TQToolBox*>(w->tqparentWidget()->tqparentWidget()->tqparentWidget()) )
+ return w->tqparentWidget()->tqparentWidget()->tqparentWidget();
while ( w ) {
- int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) );
if ( WidgetDatabase::isContainer( id ) ||
- w && ::qt_cast<FormWindow*>(w->parentWidget()) )
+ w && ::tqqt_cast<FormWindow*>(w->tqparentWidget()) )
return w;
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
return w;
}
@@ -1165,38 +1165,38 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o )
if ( TQApplication::activePopupWidget() ) // if a popup is open, we have to make sure that this one is closed, else X might do funny things
return ( lastWasAPassiveInteractor = TRUE );
- if ( ::qt_cast<TQTabBar*>(o) )
+ if ( ::tqqt_cast<TQTabBar*>(o) )
return ( lastWasAPassiveInteractor = TRUE );
- else if ( ::qt_cast<TQSizeGrip*>(o) )
+ else if ( ::tqqt_cast<TQSizeGrip*>(o) )
return ( lastWasAPassiveInteractor = TRUE );
- else if ( ::qt_cast<TQButton*>(o) &&
- ( ::qt_cast<TQTabBar*>(o->parent()) || ::qt_cast<TQToolBox*>(o->parent()) ) )
+ else if ( ::tqqt_cast<TQButton*>(o) &&
+ ( ::tqqt_cast<TQTabBar*>(o->tqparent()) || ::tqqt_cast<TQToolBox*>(o->tqparent()) ) )
return ( lastWasAPassiveInteractor = TRUE );
- else if ( ::qt_cast<TQPushButton*>(o) && ::qt_cast<TQWizard*>(o->parent()) )
+ else if ( ::tqqt_cast<TQPushButton*>(o) && ::tqqt_cast<TQWizard*>(o->tqparent()) )
return ( lastWasAPassiveInteractor = TRUE );
- else if ( ::qt_cast<TQMenuBar*>(o) && ::qt_cast<TQMainWindow*>(o->parent()) )
+ else if ( ::tqqt_cast<TQMenuBar*>(o) && ::tqqt_cast<TQMainWindow*>(o->tqparent()) )
return ( lastWasAPassiveInteractor = TRUE );
-// else if ( ::qt_cast<QDockWindowHandle*>(o) )
- else if ( o->inherits( "QDockWindowHandle" ) )
+// else if ( ::tqqt_cast<TQDockWindowHandle*>(o) )
+ else if ( o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) )
return ( lastWasAPassiveInteractor = TRUE );
-// else if ( ::qt_cast<QHideDock*>(o) )
- else if ( o->inherits( "QHideDock" ) )
+// else if ( ::tqqt_cast<TQHideDock*>(o) )
+ else if ( o->inherits( TQHIDEDOCK_OBJECT_NAME_STRING ) )
return ( lastWasAPassiveInteractor = TRUE );
else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 )
return ( lastWasAPassiveInteractor = TRUE );
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
if ( !o->isWidgetType() )
return ( lastWasAPassiveInteractor = FALSE );
WidgetInterface *iface = 0;
TQWidget *w = (TQWidget*)o;
- while ( !iface && w && !::qt_cast<FormWindow*>(w) ) {
+ while ( !iface && w && !::tqqt_cast<FormWindow*>(w) ) {
widgetManager()->queryInterface( classNameOf( w ), &iface );
- w = w->parentWidget();
+ w = w->tqparentWidget();
}
if ( !iface )
return ( lastWasAPassiveInteractor = FALSE );
- QWidgetContainerInterfacePrivate *iface2 = 0;
- iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
if ( !iface2 )
return ( lastWasAPassiveInteractor = FALSE );
TQWidget *fw = MainWindow::self->isAFormWindowChild( (TQWidget*)o );
@@ -1208,7 +1208,7 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o )
lastWasAPassiveInteractor = iface2->isPassiveInteractor( dw->className(), (TQWidget*)o );
iface2->release();
iface->release();
-#endif // QT_CONTAINER_CUSTOM_WIDGETS
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
return lastWasAPassiveInteractor;
}
@@ -1222,78 +1222,78 @@ const char* WidgetFactory::classNameOf( TQObject* o )
return o->className();
if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className())))
return o->className();
- else if ( ::qt_cast<QDesignerTabWidget*>(o) )
- return "TQTabWidget";
- else if ( ::qt_cast<QDesignerWidgetStack*>(o) )
- return "TQWidgetStack";
- else if ( ::qt_cast<TQWidgetStack*>(o) )
- return "QWeDoNotWantToBreakTabWidget";
- else if ( ::qt_cast<QDesignerDialog*>(o) )
- return "TQDialog";
- else if ( ::qt_cast<QDesignerWidget*>(o) )
- return "TQWidget";
+ else if ( ::tqqt_cast<TQDesignerTabWidget*>(o) )
+ return TQTABWIDGET_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerWidgetStack*>(o) )
+ return TQWIDGETSTACK_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQWidgetStack*>(o) )
+ return "TQWeDoNotWantToBreakTabWidget";
+ else if ( ::tqqt_cast<TQDesignerDialog*>(o) )
+ return TQDIALOG_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerWidget*>(o) )
+ return TQWIDGET_OBJECT_NAME_STRING;
else if ( o->inherits( "CustomWidget" ) )
return ( (CustomWidget*)o )->realClassName().latin1();
- else if ( ::qt_cast<QDesignerLabel*>(o) )
- return "TQLabel";
- else if ( ::qt_cast<QDesignerWizard*>(o) )
- return "TQWizard";
- else if ( ::qt_cast<QDesignerPushButton*>(o) )
- return "TQPushButton";
- else if ( ::qt_cast<QDesignerToolButton*>(o) )
- return "TQToolButton";
- else if ( ::qt_cast<QDesignerRadioButton*>(o) )
- return "TQRadioButton";
- else if ( ::qt_cast<QDesignerCheckBox*>(o) )
- return "TQCheckBox";
- else if ( ::qt_cast<MenuBarEditor*>(o) )
- return "TQMenuBar";
- else if ( ::qt_cast<QDesignerToolBar*>(o) )
- return "TQToolBar";
- else if ( ::qt_cast<QDesignerAction*>(o) )
- return "TQAction";
- else if ( ::qt_cast<QDesignerActionGroup*>(o) )
- return "TQActionGroup";
- else if ( ::qt_cast<PopupMenuEditor*>(o) )
- return "TQPopupMenu";
- else if ( ::qt_cast<QDesignerToolBox*>(o) )
- return "TQToolBox";
-#ifndef QT_NO_SQL
- else if ( ::qt_cast<QDesignerDataBrowser*>(o) )
- return "TQDataBrowser";
- else if ( ::qt_cast<QDesignerDataView*>(o) )
- return "TQDataView";
+ else if ( ::tqqt_cast<TQDesignerLabel*>(o) )
+ return TQLABEL_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerWizard*>(o) )
+ return TQWIZARD_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerPushButton*>(o) )
+ return TQPUSHBUTTON_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerToolButton*>(o) )
+ return TQTOOLBUTTON_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerRadioButton*>(o) )
+ return TQRADIOBUTTON_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerCheckBox*>(o) )
+ return TQCHECKBOX_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<MenuBarEditor*>(o) )
+ return TQMENUBAR_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerToolBar*>(o) )
+ return TQTOOLBAR_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerAction*>(o) )
+ return TQACTION_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerActionGroup*>(o) )
+ return TQACTIONGROUP_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<PopupMenuEditor*>(o) )
+ return TQPOPUPMENU_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerToolBox*>(o) )
+ return TQTOOLBOX_OBJECT_NAME_STRING;
+#ifndef TQT_NO_SQL
+ else if ( ::tqqt_cast<TQDesignerDataBrowser*>(o) )
+ return TQDATABROWSER_OBJECT_NAME_STRING;
+ else if ( ::tqqt_cast<TQDesignerDataView*>(o) )
+ return TQDATAVIEW_OBJECT_NAME_STRING;
#endif
return o->className();
}
TQString WidgetFactory::defaultSignal( TQObject *w )
{
- if ( ::qt_cast<TQRadioButton*>(w) || ::qt_cast<TQCheckBox*>(w) )
+ if ( ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQCheckBox*>(w) )
return "toggled";
- else if ( ::qt_cast<TQButton*>(w) || ::qt_cast<TQButtonGroup*>(w) )
+ else if ( ::tqqt_cast<TQButton*>(w) || ::tqqt_cast<TQButtonGroup*>(w) )
return "clicked";
- else if ( ::qt_cast<TQTextBrowser*>(w) )
+ else if ( ::tqqt_cast<TQTextBrowser*>(w) )
return "linkClicked";
- else if ( ::qt_cast<TQLineEdit*>(w) || ::qt_cast<TQTextEdit*>(w) )
+ else if ( ::tqqt_cast<TQLineEdit*>(w) || ::tqqt_cast<TQTextEdit*>(w) )
return "textChanged";
- else if ( ::qt_cast<TQListView*>(w) || ::qt_cast<TQIconView*>(w) ||
- ::qt_cast<TQListBox*>(w) || ::qt_cast<TQTable*>(w) )
+ else if ( ::tqqt_cast<TQListView*>(w) || ::tqqt_cast<TQIconView*>(w) ||
+ ::tqqt_cast<TQListBox*>(w) || ::tqqt_cast<TQTable*>(w) )
return "selectionChanged";
- else if ( ::qt_cast<TQTabWidget*>(w) )
+ else if ( ::tqqt_cast<TQTabWidget*>(w) )
return "selected";
- else if ( ::qt_cast<TQToolBox*>(w) )
+ else if ( ::tqqt_cast<TQToolBox*>(w) )
return "currentChanged";
- else if ( ::qt_cast<TQWidgetStack*>(w) )
+ else if ( ::tqqt_cast<TQWidgetStack*>(w) )
return "aboutToShow";
- else if ( ::qt_cast<TQSpinBox*>(w) || ::qt_cast<TQSlider*>(w) ||
- ::qt_cast<TQScrollBar*>(w) || ::qt_cast<QDateEdit*>(w) ||
- ::qt_cast<QTimeEdit*>(w) || ::qt_cast<QDateTimeEdit*>(w) ||
- ::qt_cast<TQDial*>(w) )
+ else if ( ::tqqt_cast<TQSpinBox*>(w) || ::tqqt_cast<TQSlider*>(w) ||
+ ::tqqt_cast<TQScrollBar*>(w) || ::tqqt_cast<TQDateEdit*>(w) ||
+ ::tqqt_cast<TQTimeEdit*>(w) || ::tqqt_cast<TQDateTimeEdit*>(w) ||
+ ::tqqt_cast<TQDial*>(w) )
return "valueChanged";
- else if ( ::qt_cast<TQComboBox*>(w) )
+ else if ( ::tqqt_cast<TQComboBox*>(w) )
return "activated";
- return TQString::null;
+ return TQString();
}
/*! As some properties are set by default when creating a widget this
@@ -1307,14 +1307,14 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MainWindow::self->currProject()->fakeFormFileFor( o ) )
return;
MetaDataBase::setPropertyChanged( o, "name", TRUE );
- if ( !::qt_cast<QDesignerToolBar*>(o) && !::qt_cast<MenuBarEditor*>(o) )
+ if ( !::tqqt_cast<TQDesignerToolBar*>(o) && !::tqqt_cast<MenuBarEditor*>(o) )
MetaDataBase::setPropertyChanged( o, "geometry", TRUE );
- if ( ::qt_cast<TQPushButton*>(o) ||
- ::qt_cast<TQRadioButton*>(o) ||
- ::qt_cast<TQCheckBox*>(o) ||
- ::qt_cast<TQToolButton*>(o) ) {
- if (::qt_cast<TQToolButton*>(o) && ::qt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) {
+ if ( ::tqqt_cast<TQPushButton*>(o) ||
+ ::tqqt_cast<TQRadioButton*>(o) ||
+ ::tqqt_cast<TQCheckBox*>(o) ||
+ ::tqqt_cast<TQToolButton*>(o) ) {
+ if (::tqqt_cast<TQToolButton*>(o) && ::tqqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->tqparent()))) {
MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "textLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE );
@@ -1323,29 +1323,29 @@ void WidgetFactory::initChangedProperties( TQObject *o )
MetaDataBase::setPropertyChanged( o, "text", TRUE );
}
}
- else if ( ::qt_cast<TQGroupBox*>(o) )
+ else if ( ::tqqt_cast<TQGroupBox*>(o) )
MetaDataBase::setPropertyChanged( o, "title", TRUE );
else if ( o->isA( TQFRAME_OBJECT_NAME_STRING ) ) {
MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE );
MetaDataBase::setPropertyChanged( o, "frameShape", TRUE );
- } else if ( ::qt_cast<TQTabWidget*>(o) || ::qt_cast<TQWizard*>(o) ) {
+ } else if ( ::tqqt_cast<TQTabWidget*>(o) || ::tqqt_cast<TQWizard*>(o) ) {
MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE );
MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
- } else if ( ::qt_cast<TQWidgetStack*>(o) ) {
+ } else if ( ::tqqt_cast<TQWidgetStack*>(o) ) {
MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
- } else if ( ::qt_cast<TQToolBox*>(o) ) {
+ } else if ( ::tqqt_cast<TQToolBox*>(o) ) {
MetaDataBase::setPropertyChanged( o, "currentIndex", TRUE );
MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
MetaDataBase::setPropertyChanged( o, "itemLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "itemIconSet", TRUE );
MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE );
MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE );
-#ifndef QT_NO_TABLE
- } else if ( ::qt_cast<TQTable*>(o) ) {
-# ifndef QT_NO_SQL
- if (!::qt_cast<TQDataTable*>(o) )
+#ifndef TQT_NO_TABLE
+ } else if ( ::tqqt_cast<TQTable*>(o) ) {
+# ifndef TQT_NO_SQL
+ if (!::tqqt_cast<TQDataTable*>(o) )
# endif
{
MetaDataBase::setPropertyChanged( o, "numRows", TRUE );
@@ -1357,11 +1357,11 @@ void WidgetFactory::initChangedProperties( TQObject *o )
}
}
#endif
- } else if ( ::qt_cast<TQSplitter*>(o) ) {
+ } else if ( ::tqqt_cast<TQSplitter*>(o) ) {
MetaDataBase::setPropertyChanged( o, "orientation", TRUE );
- } else if ( ::qt_cast<QDesignerToolBar*>(o) ) {
+ } else if ( ::tqqt_cast<TQDesignerToolBar*>(o) ) {
MetaDataBase::setPropertyChanged( o, "label", TRUE );
- } else if ( ::qt_cast<MenuBarEditor*>(o) ) {
+ } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE );
MetaDataBase::setPropertyChanged( o, "itemText", TRUE );
@@ -1372,17 +1372,17 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
{
TQString className = WidgetDatabase::className( id );
- if ( className.contains( "ListBox" ) )
+ if ( className.tqcontains( "ListBox" ) )
return TRUE;
- if ( className.contains( "ComboBox" ) )
+ if ( className.tqcontains( "ComboBox" ) )
return TRUE;
- if ( className.contains( "ListView" ) )
+ if ( className.tqcontains( "ListView" ) )
return TRUE;
- if ( className.contains( "IconView" ) )
+ if ( className.tqcontains( "IconView" ) )
return TRUE;
if ( className == TQTEXTEDIT_OBJECT_NAME_STRING || className == TQMULTILINEEDIT_OBJECT_NAME_STRING )
return TRUE;
- if ( ::qt_cast<TQTable*>(editorWidget) != 0 )
+ if ( ::tqqt_cast<TQTable*>(editorWidget) != 0 )
return TRUE;
return FALSE;
@@ -1392,66 +1392,66 @@ bool WidgetFactory::hasItems( int id, TQObject *editorWidget )
{
TQString className = WidgetDatabase::className( id );
- if ( className.contains( "ListBox" ) || className.contains( "ListView" ) ||
- className.contains( "IconView" ) || className.contains( "ComboBox" ) ||
- ::qt_cast<TQTable*>(editorWidget) != 0 )
+ if ( className.tqcontains( "ListBox" ) || className.tqcontains( "ListView" ) ||
+ className.tqcontains( "IconView" ) || className.tqcontains( "ComboBox" ) ||
+ ::tqqt_cast<TQTable*>(editorWidget) != 0 )
return TRUE;
return FALSE;
}
-void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, FormWindow *fw )
+void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw )
{
TQString className = WidgetDatabase::className( id );
- if ( className.contains( "ListBox" ) ) {
- if ( !::qt_cast<TQListBox*>(editWidget) )
+ if ( className.tqcontains( "ListBox" ) ) {
+ if ( !::tqqt_cast<TQListBox*>(editWidget) )
return;
- ListBoxEditor *e = new ListBoxEditor( parent, editWidget, fw );
+ ListBoxEditor *e = new ListBoxEditor( tqparent, editWidget, fw );
e->exec();
delete e;
return;
}
- if ( className.contains( "ComboBox" ) ) {
- if ( !::qt_cast<TQComboBox*>(editWidget) )
+ if ( className.tqcontains( "ComboBox" ) ) {
+ if ( !::tqqt_cast<TQComboBox*>(editWidget) )
return;
TQComboBox *cb = (TQComboBox*)editWidget;
- ListBoxEditor *e = new ListBoxEditor( parent, cb->listBox(), fw );
+ ListBoxEditor *e = new ListBoxEditor( tqparent, cb->listBox(), fw );
e->exec();
delete e;
cb->update();
return;
}
- if ( className.contains( "ListView" ) ) {
- if ( !::qt_cast<TQListView*>(editWidget) )
+ if ( className.tqcontains( "ListView" ) ) {
+ if ( !::tqqt_cast<TQListView*>(editWidget) )
return;
TQListView *lv = (TQListView*)editWidget;
- ListViewEditor *e = new ListViewEditor( parent, lv, fw );
+ ListViewEditor *e = new ListViewEditor( tqparent, lv, fw );
e->exec();
delete e;
return;
}
- if ( className.contains( "IconView" ) ) {
- if ( !::qt_cast<TQIconView*>(editWidget) )
+ if ( className.tqcontains( "IconView" ) ) {
+ if ( !::tqqt_cast<TQIconView*>(editWidget) )
return;
- IconViewEditor *e = new IconViewEditor( parent, editWidget, fw );
+ IconViewEditor *e = new IconViewEditor( tqparent, editWidget, fw );
e->exec();
delete e;
return;
}
if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING || className == TQTEXTEDIT_OBJECT_NAME_STRING ) {
- MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, parent, editWidget, fw );
+ MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, tqparent, editWidget, fw );
e->exec();
delete e;
return;
}
-#ifndef QT_NO_TABLE
- if (::qt_cast<TQTable*>(editWidget) != 0) {
- TableEditor *e = new TableEditor( parent, editWidget, fw );
+#ifndef TQT_NO_TABLE
+ if (::tqqt_cast<TQTable*>(editWidget) != 0) {
+ TableEditor *e = new TableEditor( tqparent, editWidget, fw );
e->exec();
delete e;
return;
@@ -1463,14 +1463,14 @@ bool WidgetFactory::canResetProperty( TQObject *w, const TQString &propName )
{
if ( propName == "name" || propName == "geometry" )
return FALSE;
- TQStringList l = *changedProperties->find( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
- return l.findIndex( propName ) == -1;
+ TQStringList l = *changedProperties->tqfind( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
+ return l.tqfindIndex( propName ) == -1;
}
bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName )
{
- const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->
- findProperty( propName, TRUE ), TRUE );
+ const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->
+ tqfindProperty( propName, TRUE ), TRUE );
if (!p )
return FALSE;
return p->reset( w );
@@ -1479,27 +1479,27 @@ bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName )
TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
{
if ( propName == "wordwrap" ) {
- int v = defaultValue( w, "alignment" ).toInt();
+ int v = defaultValue( w, "tqalignment" ).toInt();
return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
} else if ( propName == "toolTip" || propName == "whatsThis" ) {
- return TQVariant( TQString::fromLatin1( "" ) );
+ return TQVariant( TQString::tqfromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) {
return TQVariant();
} else if ( propName == "frameworkCode" ) {
return TQVariant( TRUE, 0 );
- } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
+ } else if ( propName == "tqlayoutMargin" || propName == "tqlayoutSpacing" ) {
return TQVariant( -1 );
}
- return *( *defaultProperties->find( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).find( propName );
+ return *( *defaultProperties->tqfind( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).tqfind( propName );
}
TQString WidgetFactory::defaultCurrentItem( TQObject *w, const TQString &propName )
{
- const TQMetaProperty *p = w->metaObject()->
- property( w->metaObject()->findProperty( propName, TRUE ), TRUE );
+ const TQMetaProperty *p = w->tqmetaObject()->
+ property( w->tqmetaObject()->tqfindProperty( propName, TRUE ), TRUE );
if ( !p ) {
- int v = defaultValue( w, "alignment" ).toInt();
+ int v = defaultValue( w, "tqalignment" ).toInt();
if ( propName == "hAlign" ) {
if ( ( v & AlignAuto ) == AlignAuto )
return "AlignAuto";
@@ -1521,35 +1521,35 @@ TQString WidgetFactory::defaultCurrentItem( TQObject *w, const TQString &propNam
} else if ( propName == "resizeMode" ) {
return "Auto";
}
- return TQString::null;
+ return TQString();
}
return p->valueToKey( defaultValue( w, propName ).toInt() );
}
-TQWidget *WidgetFactory::createCustomWidget( TQWidget *parent, const char *name, MetaDataBase::CustomWidget *w )
+TQWidget *WidgetFactory::createCustomWidget( TQWidget *tqparent, const char *name, MetaDataBase::CustomWidget *w )
{
if ( !w )
return 0;
- return new CustomWidget( parent, name, w );
+ return new CustomWidget( tqparent, name, w );
}
TQVariant WidgetFactory::property( TQObject *w, const char *name )
{
- int id = w->metaObject()->findProperty( name, TRUE );
- const TQMetaProperty* p = w->metaObject()->property( id, TRUE );
+ int id = w->tqmetaObject()->tqfindProperty( name, TRUE );
+ const TQMetaProperty* p = w->tqmetaObject()->property( id, TRUE );
if ( !p || !p->isValid() )
return MetaDataBase::fakeProperty( w, name );
return w->property( name );
}
-void QDesignerLabel::updateBuddy()
+void TQDesignerLabel::updateBuddy()
{
if ( myBuddy.isEmpty() )
return;
- TQObjectList *l = topLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, FALSE, TRUE );
+ TQObjectList *l = tqtopLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, FALSE, TRUE );
if ( !l || !l->first() ) {
delete l;
return;
@@ -1560,7 +1560,7 @@ void QDesignerLabel::updateBuddy()
}
-void QDesignerWidget::resizeEvent( TQResizeEvent* e)
+void TQDesignerWidget::resizeEvent( TQResizeEvent* e)
{
if ( need_frame ) {
TQPainter p(this);
@@ -1569,7 +1569,7 @@ void QDesignerWidget::resizeEvent( TQResizeEvent* e)
}
}
-void QDesignerWidget::paintEvent( TQPaintEvent *e )
+void TQDesignerWidget::paintEvent( TQPaintEvent *e )
{
if ( need_frame ) {
TQPainter p(this);
@@ -1579,17 +1579,17 @@ void QDesignerWidget::paintEvent( TQPaintEvent *e )
formwindow->paintGrid( this, e );
}
-void QDesignerDialog::paintEvent( TQPaintEvent *e )
+void TQDesignerDialog::paintEvent( TQPaintEvent *e )
{
formwindow->paintGrid( this, e );
}
-TQSizePolicy QLayoutWidget::sizePolicy() const
+TQSizePolicy TQLayoutWidget::sizePolicy() const
{
return sp;
}
-bool QLayoutWidget::event( TQEvent *e )
+bool TQLayoutWidget::event( TQEvent *e )
{
if ( e && ( e->type() == TQEvent::ChildInserted ||
e->type() == TQEvent::ChildRemoved ||
@@ -1600,14 +1600,14 @@ bool QLayoutWidget::event( TQEvent *e )
}
/*
- This function must be called on QLayoutWidget creation and whenever
- the QLayoutWidget's parent layout changes (e.g., from a QHBoxLayout
- to a TQVBoxLayout), because of the (illogical) way layouting works.
+ This function must be called on TQLayoutWidget creation and whenever
+ the TQLayoutWidget's tqparent tqlayout changes (e.g., from a TQHBoxLayout
+ to a TQVBoxLayout), because of the (illogical) way tqlayouting works.
*/
-void QLayoutWidget::updateSizePolicy()
+void TQLayoutWidget::updateSizePolicy()
{
- if ( !children() || children()->count() == 0 ) {
- sp = TQWidget::sizePolicy();
+ if ( childrenListObject().isEmpty() || childrenListObject().count() == 0 ) {
+ sp = TQWidget::tqsizePolicy();
return;
}
@@ -1624,24 +1624,24 @@ void QLayoutWidget::updateSizePolicy()
int ht = (int) TQSizePolicy::Preferred;
int vt = (int) TQSizePolicy::Preferred;
- if ( layout() ) {
+ if ( tqlayout() ) {
/*
- parentLayout is set to the parent layout if there is one and if it is
- top level, in which case layouting is illogical.
+ tqparentLayout is set to the tqparent tqlayout if there is one and if it is
+ top level, in which case tqlayouting is illogical.
*/
- TQLayout *parentLayout = 0;
- if ( parent() && parent()->isWidgetType() ) {
- parentLayout = ((TQWidget *)parent())->layout();
- if ( parentLayout &&
- ::qt_cast<QLayoutWidget*>(parentLayout->mainWidget()) )
- parentLayout = 0;
+ TQLayout *tqparentLayout = 0;
+ if ( tqparent() && tqparent()->isWidgetType() ) {
+ tqparentLayout = ((TQWidget *)tqparent())->tqlayout();
+ if ( tqparentLayout &&
+ ::tqqt_cast<TQLayoutWidget*>(tqparentLayout->mainWidget()) )
+ tqparentLayout = 0;
}
- TQObjectListIt it( *children() );
+ TQObjectListIt it( childrenListObject() );
TQObject *o;
- if ( ::qt_cast<TQVBoxLayout*>(layout()) ) {
- if ( ::qt_cast<TQHBoxLayout*>(parentLayout) )
+ if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout()) ) {
+ if ( ::tqqt_cast<TQHBoxLayout*>(tqparentLayout) )
vt = TQSizePolicy::Minimum;
else
vt = TQSizePolicy::Fixed;
@@ -1652,17 +1652,17 @@ void QLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( !w->sizePolicy().mayGrowHorizontally() )
+ if ( !w->tqsizePolicy().mayGrowHorizontally() )
ht &= ~TQSizePolicy::Minimum;
- if ( !w->sizePolicy().mayShrinkHorizontally() )
+ if ( !w->tqsizePolicy().mayShrinkHorizontally() )
ht &= ~TQSizePolicy::Maximum;
- if ( w->sizePolicy().mayGrowVertically() )
+ if ( w->tqsizePolicy().mayGrowVertically() )
vt |= TQSizePolicy::Minimum;
- if ( w->sizePolicy().mayShrinkVertically() )
+ if ( w->tqsizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum;
}
- } else if ( ::qt_cast<TQHBoxLayout*>(layout()) ) {
- if ( ::qt_cast<TQVBoxLayout*>(parentLayout) )
+ } else if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout()) ) {
+ if ( ::tqqt_cast<TQVBoxLayout*>(tqparentLayout) )
ht = TQSizePolicy::Minimum;
else
ht = TQSizePolicy::Fixed;
@@ -1673,22 +1673,22 @@ void QLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( w->sizePolicy().mayGrowHorizontally() )
+ if ( w->tqsizePolicy().mayGrowHorizontally() )
ht |= TQSizePolicy::Minimum;
- if ( w->sizePolicy().mayShrinkHorizontally() )
+ if ( w->tqsizePolicy().mayShrinkHorizontally() )
ht |= TQSizePolicy::Maximum;
- if ( !w->sizePolicy().mayGrowVertically() )
+ if ( !w->tqsizePolicy().mayGrowVertically() )
vt &= ~TQSizePolicy::Minimum;
- if ( !w->sizePolicy().mayShrinkVertically() )
+ if ( !w->tqsizePolicy().mayShrinkVertically() )
vt &= ~TQSizePolicy::Maximum;
}
- } else if ( ::qt_cast<TQGridLayout*>(layout()) ) {
+ } else if ( ::tqqt_cast<TQGridLayout*>(tqlayout()) ) {
ht = TQSizePolicy::Fixed;
vt = TQSizePolicy::Fixed;
- if ( parentLayout ) {
- if ( ::qt_cast<TQVBoxLayout*>(parentLayout) )
+ if ( tqparentLayout ) {
+ if ( ::tqqt_cast<TQVBoxLayout*>(tqparentLayout) )
ht = TQSizePolicy::Minimum;
- else if ( ::qt_cast<TQHBoxLayout*>(parentLayout) )
+ else if ( ::tqqt_cast<TQHBoxLayout*>(tqparentLayout) )
vt = TQSizePolicy::Minimum;
}
@@ -1698,22 +1698,30 @@ void QLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( w->sizePolicy().mayGrowHorizontally() )
+ if ( w->tqsizePolicy().mayGrowHorizontally() )
ht |= TQSizePolicy::Minimum;
- if ( w->sizePolicy().mayShrinkHorizontally() )
+ if ( w->tqsizePolicy().mayShrinkHorizontally() )
ht |= TQSizePolicy::Maximum;
- if ( w->sizePolicy().mayGrowVertically() )
+ if ( w->tqsizePolicy().mayGrowVertically() )
vt |= TQSizePolicy::Minimum;
- if ( w->sizePolicy().mayShrinkVertically() )
+ if ( w->tqsizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum;
}
}
- if ( layout()->expanding() & TQSizePolicy::Horizontally )
+#ifdef USE_QT4
+ if ( tqlayout()->expandingDirections() & TQSizePolicy::Horizontally )
+#else // USE_QT4
+ if ( tqlayout()->expanding() & TQSizePolicy::Horizontally )
+#endif // USE_QT4
ht = TQSizePolicy::Expanding;
- if ( layout()->expanding() & TQSizePolicy::Vertically )
+#ifdef USE_QT4
+ if ( tqlayout()->expandingDirections() & TQSizePolicy::Vertically )
+#else // USE_QT4
+ if ( tqlayout()->expanding() & TQSizePolicy::Vertically )
+#endif // USE_QT4
vt = TQSizePolicy::Expanding;
- layout()->invalidate();
+ tqlayout()->tqinvalidate();
}
sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt );
@@ -1722,13 +1730,13 @@ void QLayoutWidget::updateSizePolicy()
void CustomWidget::paintEvent( TQPaintEvent *e )
{
- if ( ::qt_cast<FormWindow*>(parentWidget()) ) {
- ( (FormWindow*)parentWidget() )->paintGrid( this, e );
+ if ( ::tqqt_cast<FormWindow*>(tqparentWidget()) ) {
+ ( (FormWindow*)tqparentWidget() )->paintGrid( this, e );
} else {
TQPainter p( this );
- p.fillRect( rect(), colorGroup().dark() );
- p.setPen( colorGroup().light() );
- p.drawText( 2, 2, width() - 4, height() - 4, Qt::AlignAuto | Qt::AlignTop, cusw->className );
+ p.fillRect( rect(), tqcolorGroup().dark() );
+ p.setPen( tqcolorGroup().light() );
+ p.drawText( 2, 2, width() - 4, height() - 4, TQt::AlignAuto | TQt::AlignTop, cusw->className );
p.drawPixmap( ( width() - cusw->pixmap->width() ) / 2,
( height() - cusw->pixmap->height() ) / 2,
*cusw->pixmap );
@@ -1740,48 +1748,48 @@ CustomWidgetFactory::CustomWidgetFactory()
{
}
-TQWidget *CustomWidgetFactory::createWidget( const TQString &className, TQWidget *parent, const char *name ) const
+TQWidget *CustomWidgetFactory::createWidget( const TQString &className, TQWidget *tqparent, const char *name ) const
{
MetaDataBase::CustomWidget *w = MetaDataBase::customWidget( WidgetDatabase::idFromClassName( className ) );
if ( !w )
return 0;
- return WidgetFactory::createCustomWidget( parent, name, w );
+ return WidgetFactory::createCustomWidget( tqparent, name, w );
}
-QDesignerToolBox::QDesignerToolBox( TQWidget *parent, const char *name )
- : TQToolBox( parent, name )
+TQDesignerToolBox::TQDesignerToolBox( TQWidget *tqparent, const char *name )
+ : TQToolBox( tqparent, name )
{
}
-TQString QDesignerToolBox::itemLabel() const
+TQString TQDesignerToolBox::itemLabel() const
{
return TQToolBox::itemLabel( currentIndex() );
}
-void QDesignerToolBox::setItemLabel( const TQString &l )
+void TQDesignerToolBox::setItemLabel( const TQString &l )
{
TQToolBox::setItemLabel( currentIndex(), l );
}
-TQCString QDesignerToolBox::itemName() const
+TQCString TQDesignerToolBox::itemName() const
{
return currentItem() ? currentItem()->name() : 0;
}
-void QDesignerToolBox::setItemName( const TQCString &n )
+void TQDesignerToolBox::setItemName( const TQCString &n )
{
if (currentItem())
currentItem()->setName( n );
}
-Qt::BackgroundMode QDesignerToolBox::itemBackgroundMode() const
+TQt::BackgroundMode TQDesignerToolBox::itemBackgroundMode() const
{
return (item(0) ? item(0)->backgroundMode() : PaletteBackground);
}
-void QDesignerToolBox::setItemBackgroundMode( BackgroundMode bmode )
+void TQDesignerToolBox::setItemBackgroundMode( BackgroundMode bmode )
{
for (int i = 0; i < count(); ++i) {
TQWidget *w = item(i);
@@ -1790,7 +1798,7 @@ void QDesignerToolBox::setItemBackgroundMode( BackgroundMode bmode )
}
}
-void QDesignerToolBox::itemInserted( int index )
+void TQDesignerToolBox::itemInserted( int index )
{
if (count() > 1)
item(index)->setBackgroundMode(item(index>0?0:1)->backgroundMode());