summaryrefslogtreecommitdiffstats
path: root/kommander/editor/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/widgetfactory.cpp')
-rw-r--r--kommander/editor/widgetfactory.cpp926
1 files changed, 463 insertions, 463 deletions
diff --git a/kommander/editor/widgetfactory.cpp b/kommander/editor/widgetfactory.cpp
index 0dbab517..34cd0514 100644
--- a/kommander/editor/widgetfactory.cpp
+++ b/kommander/editor/widgetfactory.cpp
@@ -22,7 +22,7 @@
#include <kommanderfactory.h>
#include "kmdrmainwindow.h"
-#include <qvariant.h> // HP-UX compiler need this here
+#include <tqvariant.h> // HP-UX compiler need this here
#include "widgetfactory.h"
#include "widgetdatabase.h"
#include "metadatabase.h"
@@ -41,46 +41,46 @@
#include "tableeditorimpl.h"
#endif
-#include <qfeatures.h>
+#include <tqfeatures.h>
-#include <qpixmap.h>
-#include <qgroupbox.h>
-#include <qiconview.h>
+#include <tqpixmap.h>
+#include <tqgroupbox.h>
+#include <tqiconview.h>
#ifndef QT_NO_TABLE
-#include <qtable.h>
+#include <tqtable.h>
#endif
#ifndef QT_NO_SQL
-#include <qdatatable.h>
+#include <tqdatatable.h>
#endif
-#include <qdatetimeedit.h>
-#include <qlineedit.h>
-#include <qspinbox.h>
-#include <qmultilineedit.h>
-#include <qtextedit.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qwidgetstack.h>
-#include <qcombobox.h>
-#include <qtabbar.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qobjectlist.h>
-#include <qlcdnumber.h>
-#include <qslider.h>
-#include <qdial.h>
-#include <qprogressbar.h>
-#include <qtextview.h>
-#include <qtextbrowser.h>
-#include <qframe.h>
-#include <qmetaobject.h>
-#include <qwizard.h>
-#include <qvaluelist.h>
-#include <qtimer.h>
-#include <qscrollbar.h>
-#include <qmainwindow.h>
-#include <qmenubar.h>
-#include <qapplication.h>
-#include <qsplitter.h>
+#include <tqdatetimeedit.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
+#include <tqmultilineedit.h>
+#include <tqtextedit.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqwidgetstack.h>
+#include <tqcombobox.h>
+#include <tqtabbar.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqobjectlist.h>
+#include <tqlcdnumber.h>
+#include <tqslider.h>
+#include <tqdial.h>
+#include <tqprogressbar.h>
+#include <tqtextview.h>
+#include <tqtextbrowser.h>
+#include <tqframe.h>
+#include <tqmetaobject.h>
+#include <tqwizard.h>
+#include <tqvaluelist.h>
+#include <tqtimer.h>
+#include <tqscrollbar.h>
+#include <tqmainwindow.h>
+#include <tqmenubar.h>
+#include <tqapplication.h>
+#include <tqsplitter.h>
#ifndef QT_NO_SQL
#include "database.h"
#endif
@@ -116,7 +116,7 @@
#include "fontdialog.h"
#include "aboutdialog.h"
-FormWindow *find_formwindow( QWidget *w )
+FormWindow *find_formwindow( TQWidget *w )
{
if ( !w )
return 0;
@@ -129,16 +129,16 @@ FormWindow *find_formwindow( QWidget *w )
}
}
-void QLayoutWidget::paintEvent( QPaintEvent* )
+void QLayoutWidget::paintEvent( TQPaintEvent* )
{
- QPainter p ( this );
+ TQPainter p ( this );
p.setPen( red );
p.drawRect( rect() );
}
-QDesignerTabWidget::QDesignerTabWidget( QWidget *parent, const char *name )
- : QTabWidget( parent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( false )
+QDesignerTabWidget::QDesignerTabWidget( TQWidget *parent, const char *name )
+ : TQTabWidget( parent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( false )
{
tabBar()->setAcceptDrops( true );
tabBar()->installEventFilter( this );
@@ -154,27 +154,27 @@ void QDesignerTabWidget::setCurrentPage( int i )
tabBar()->setCurrentTab( i );
}
-QString QDesignerTabWidget::pageTitle() const
+TQString QDesignerTabWidget::pageTitle() const
{
- return ((QTabWidget*)this)->tabLabel( QTabWidget::currentPage() );
+ return ((TQTabWidget*)this)->tabLabel( TQTabWidget::currentPage() );
}
-void QDesignerTabWidget::setPageTitle( const QString& title )
+void QDesignerTabWidget::setPageTitle( const TQString& title )
{
- changeTab( QTabWidget::currentPage(), title );
+ changeTab( TQTabWidget::currentPage(), title );
}
-void QDesignerTabWidget::setPageName( const QCString& name )
+void QDesignerTabWidget::setPageName( const TQCString& name )
{
- if ( QTabWidget::currentPage() )
- QTabWidget::currentPage()->setName( name );
+ if ( TQTabWidget::currentPage() )
+ TQTabWidget::currentPage()->setName( name );
}
-QCString QDesignerTabWidget::pageName() const
+TQCString QDesignerTabWidget::pageName() const
{
- if ( !QTabWidget::currentPage() )
+ if ( !TQTabWidget::currentPage() )
return 0;
- return QTabWidget::currentPage()->name();
+ return TQTabWidget::currentPage()->name();
}
int QDesignerTabWidget::count() const
@@ -182,24 +182,24 @@ int QDesignerTabWidget::count() const
return tabBar()->count();
}
-bool QDesignerTabWidget::eventFilter( QObject *o, QEvent *e )
+bool QDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
{
if ( o != tabBar() ) return false;
switch ( e->type() ) {
- case QEvent::MouseButtonPress: {
+ case TQEvent::MouseButtonPress: {
mousePressed = true;
- QMouseEvent *me = (QMouseEvent*)e;
+ TQMouseEvent *me = (TQMouseEvent*)e;
pressPoint = me->pos();
}
break;
- case QEvent::MouseMove: {
- QMouseEvent *me = (QMouseEvent*)e;
- if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > QApplication::startDragDistance() ) {
- QTextDrag *drg = new QTextDrag( QString::number( (long) this ) , this );
+ case TQEvent::MouseMove: {
+ TQMouseEvent *me = (TQMouseEvent*)e;
+ if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > TQApplication::startDragDistance() ) {
+ TQTextDrag *drg = new TQTextDrag( TQString::number( (long) this ) , this );
mousePressed = false;
- dragPage = QTabWidget::currentPage();
- dragLabel = QTabWidget::tabLabel( dragPage );
+ dragPage = TQTabWidget::currentPage();
+ dragLabel = TQTabWidget::tabLabel( dragPage );
int index = indexOf( dragPage );
@@ -213,24 +213,24 @@ bool QDesignerTabWidget::eventFilter( QObject *o, QEvent *e )
}
}
break;
- case QEvent::DragLeave: {
+ case TQEvent::DragLeave: {
if ( dropIndicator )
dropIndicator->hide();
}
break;
- case QEvent::DragMove: {
- QDragEnterEvent *de = (QDragEnterEvent*) e;
- if ( QTextDrag::canDecode( de ) ) {
- QString text;
- QTextDrag::decode( de, text );
- if ( text == QString::number( (long)this ) )
+ case TQEvent::DragMove: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) )
de->accept();
else
return false;
}
int index = 0;
- QRect rect;
+ TQRect rect;
for ( ; index < tabBar()->count(); index++ ) {
if ( tabBar()->tabAt( index )->rect().contains( de->pos() ) ) {
rect = tabBar()->tabAt( index )->rect();
@@ -239,33 +239,33 @@ bool QDesignerTabWidget::eventFilter( QObject *o, QEvent *e )
}
if ( index == tabBar()->count() -1 ) {
- QRect rect2 = rect;
+ TQRect rect2 = rect;
rect2.setLeft( rect2.left() + rect2.width() / 2 );
if ( rect2.contains( de->pos() ) )
index++;
}
if ( ! dropIndicator ) {
- dropIndicator = new QWidget( this );
+ dropIndicator = new TQWidget( this );
dropIndicator->setBackgroundColor( red );
}
- QPoint pos;
+ TQPoint pos;
if ( index == tabBar()->count() )
- pos = tabBar()->mapToParent( QPoint( rect.x() + rect.width(), rect.y() ) );
+ pos = tabBar()->mapToParent( TQPoint( rect.x() + rect.width(), rect.y() ) );
else
- pos = tabBar()->mapToParent( QPoint( rect.x(), rect.y() ) );
+ pos = tabBar()->mapToParent( TQPoint( rect.x(), rect.y() ) );
dropIndicator->setGeometry( pos.x(), pos.y() , 3, rect.height() );
dropIndicator->show();
}
break;
- case QEvent::Drop: {
- QDragEnterEvent *de = (QDragEnterEvent*) e;
- if ( QTextDrag::canDecode( de ) ) {
- QString text;
- QTextDrag::decode( de, text );
- if ( text == QString::number( (long)this ) ) {
+ case TQEvent::Drop: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) ) {
int newIndex = 0;
for ( ; newIndex < tabBar()->count(); newIndex++ ) {
@@ -274,7 +274,7 @@ bool QDesignerTabWidget::eventFilter( QObject *o, QEvent *e )
}
if ( newIndex == tabBar()->count() -1 ) {
- QRect rect2 = tabBar()->tabAt( newIndex )->rect();
+ TQRect rect2 = tabBar()->tabAt( newIndex )->rect();
rect2.setLeft( rect2.left() + rect2.width() / 2 );
if ( rect2.contains( de->pos() ) )
newIndex++;
@@ -330,30 +330,30 @@ void QDesignerWizard::setCurrentPage( int i )
}
}
-QString QDesignerWizard::pageTitle() const
+TQString QDesignerWizard::pageTitle() const
{
return title( currentPage() );
}
-void QDesignerWizard::setPageTitle( const QString& title )
+void QDesignerWizard::setPageTitle( const TQString& title )
{
setTitle( currentPage(), title );
}
-void QDesignerWizard::setPageName( const QCString& name )
+void QDesignerWizard::setPageName( const TQCString& name )
{
- if ( QWizard::currentPage() )
- QWizard::currentPage()->setName( name );
+ if ( TQWizard::currentPage() )
+ TQWizard::currentPage()->setName( name );
}
-QCString QDesignerWizard::pageName() const
+TQCString QDesignerWizard::pageName() const
{
- if ( !QWizard::currentPage() )
+ if ( !TQWizard::currentPage() )
return 0;
- return QWizard::currentPage()->name();
+ return TQWizard::currentPage()->name();
}
-int QDesignerWizard::pageNum( QWidget *p )
+int QDesignerWizard::pageNum( TQWidget *p )
{
for ( int i = 0; i < pageCount(); ++i ) {
if ( page( i ) == p )
@@ -362,28 +362,28 @@ int QDesignerWizard::pageNum( QWidget *p )
return -1;
}
-void QDesignerWizard::addPage( QWidget *p, const QString &t )
+void QDesignerWizard::addPage( TQWidget *p, const TQString &t )
{
- QWizard::addPage( p, t );
+ TQWizard::addPage( p, t );
if ( removedPages.find( p ) )
removedPages.remove( p );
}
-void QDesignerWizard::removePage( QWidget *p )
+void QDesignerWizard::removePage( TQWidget *p )
{
- QWizard::removePage( p );
+ TQWizard::removePage( p );
removedPages.insert( p, p );
}
-void QDesignerWizard::insertPage( QWidget *p, const QString &t, int index )
+void QDesignerWizard::insertPage( TQWidget *p, const TQString &t, int index )
{
- QWizard::insertPage( p, t, index );
+ TQWizard::insertPage( p, t, index );
if ( removedPages.find( p ) )
removedPages.remove( p );
}
-QMap< int, QMap< QString, QVariant> > *defaultProperties = 0;
-QMap< int, QStringList > *changedProperties = 0;
+TQMap< int, TQMap< TQString, TQVariant> > *defaultProperties = 0;
+TQMap< int, TQStringList > *changedProperties = 0;
/*!
\class WidgetFactory widgetfactory.h
@@ -396,28 +396,28 @@ QMap< int, QStringList > *changedProperties = 0;
*/
-void WidgetFactory::saveDefaultProperties( QWidget *w, int id )
+void WidgetFactory::saveDefaultProperties( TQWidget *w, int id )
{
- QMap< QString, QVariant> propMap;
- QStrList lst = w->metaObject()->propertyNames( true );
+ TQMap< TQString, TQVariant> propMap;
+ TQStrList lst = w->metaObject()->propertyNames( true );
for ( uint i = 0; i < lst.count(); ++i ) {
- QVariant var = w->property( lst.at( i ) );
+ TQVariant var = w->property( lst.at( i ) );
if ( !var.isValid() && qstrcmp( "pixmap", lst.at( i ) ) == 0 )
- var = QVariant( QPixmap() );
+ var = TQVariant( TQPixmap() );
else if ( !var.isValid() && qstrcmp( "iconSet", lst.at( i ) ) == 0 )
- var = QVariant( QIconSet() );
+ var = TQVariant( TQIconSet() );
propMap.replace( lst.at( i ), var );
}
defaultProperties->replace( id, propMap );
}
-static void saveChangedProperties( QWidget *w, int id )
+static void saveChangedProperties( TQWidget *w, int id )
{
- QStringList l = MetaDataBase::changedProperties( w );
+ TQStringList l = MetaDataBase::changedProperties( w );
changedProperties->insert( id, l );
}
-EditorTabWidget::EditorTabWidget( QWidget *parent, const char *name )
+EditorTabWidget::EditorTabWidget( TQWidget *parent, const char *name )
: TabWidget( parent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( false )
{
tabBar()->setAcceptDrops( true );
@@ -434,27 +434,27 @@ void EditorTabWidget::setCurrentPage( int i )
tabBar()->setCurrentTab( i );
}
-QString EditorTabWidget::pageTitle() const
+TQString EditorTabWidget::pageTitle() const
{
- return ((QTabWidget*)this)->tabLabel( QTabWidget::currentPage() );
+ return ((TQTabWidget*)this)->tabLabel( TQTabWidget::currentPage() );
}
-void EditorTabWidget::setPageTitle( const QString& title )
+void EditorTabWidget::setPageTitle( const TQString& title )
{
- changeTab( QTabWidget::currentPage(), title );
+ changeTab( TQTabWidget::currentPage(), title );
}
-void EditorTabWidget::setPageName( const QCString& name )
+void EditorTabWidget::setPageName( const TQCString& name )
{
- if ( QTabWidget::currentPage() )
- QTabWidget::currentPage()->setName( name );
+ if ( TQTabWidget::currentPage() )
+ TQTabWidget::currentPage()->setName( name );
}
-QCString EditorTabWidget::pageName() const
+TQCString EditorTabWidget::pageName() const
{
- if ( !QTabWidget::currentPage() )
+ if ( !TQTabWidget::currentPage() )
return 0;
- return QTabWidget::currentPage()->name();
+ return TQTabWidget::currentPage()->name();
}
int EditorTabWidget::count() const
@@ -462,24 +462,24 @@ int EditorTabWidget::count() const
return tabBar()->count();
}
-bool EditorTabWidget::eventFilter( QObject *o, QEvent *e )
+bool EditorTabWidget::eventFilter( TQObject *o, TQEvent *e )
{
if ( o != tabBar() ) return false;
switch ( e->type() ) {
- case QEvent::MouseButtonPress: {
+ case TQEvent::MouseButtonPress: {
mousePressed = true;
- QMouseEvent *me = (QMouseEvent*)e;
+ TQMouseEvent *me = (TQMouseEvent*)e;
pressPoint = me->pos();
}
break;
- case QEvent::MouseMove: {
- QMouseEvent *me = (QMouseEvent*)e;
- if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > QApplication::startDragDistance() ) {
- QTextDrag *drg = new QTextDrag( QString::number( (long) this ) , this );
+ case TQEvent::MouseMove: {
+ TQMouseEvent *me = (TQMouseEvent*)e;
+ if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > TQApplication::startDragDistance() ) {
+ TQTextDrag *drg = new TQTextDrag( TQString::number( (long) this ) , this );
mousePressed = false;
- dragPage = QTabWidget::currentPage();
- dragLabel = QTabWidget::tabLabel( dragPage );
+ dragPage = TQTabWidget::currentPage();
+ dragLabel = TQTabWidget::tabLabel( dragPage );
int index = indexOf( dragPage );
@@ -493,24 +493,24 @@ bool EditorTabWidget::eventFilter( QObject *o, QEvent *e )
}
}
break;
- case QEvent::DragLeave: {
+ case TQEvent::DragLeave: {
if ( dropIndicator )
dropIndicator->hide();
}
break;
- case QEvent::DragMove: {
- QDragEnterEvent *de = (QDragEnterEvent*) e;
- if ( QTextDrag::canDecode( de ) ) {
- QString text;
- QTextDrag::decode( de, text );
- if ( text == QString::number( (long)this ) )
+ case TQEvent::DragMove: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) )
de->accept();
else
return false;
}
int index = 0;
- QRect rect;
+ TQRect rect;
for ( ; index < tabBar()->count(); index++ ) {
if ( tabBar()->tabAt( index )->rect().contains( de->pos() ) ) {
rect = tabBar()->tabAt( index )->rect();
@@ -519,33 +519,33 @@ bool EditorTabWidget::eventFilter( QObject *o, QEvent *e )
}
if ( index == tabBar()->count() -1 ) {
- QRect rect2 = rect;
+ TQRect rect2 = rect;
rect2.setLeft( rect2.left() + rect2.width() / 2 );
if ( rect2.contains( de->pos() ) )
index++;
}
if ( ! dropIndicator ) {
- dropIndicator = new QWidget( this );
+ dropIndicator = new TQWidget( this );
dropIndicator->setBackgroundColor( red );
}
- QPoint pos;
+ TQPoint pos;
if ( index == tabBar()->count() )
- pos = tabBar()->mapToParent( QPoint( rect.x() + rect.width(), rect.y() ) );
+ pos = tabBar()->mapToParent( TQPoint( rect.x() + rect.width(), rect.y() ) );
else
- pos = tabBar()->mapToParent( QPoint( rect.x(), rect.y() ) );
+ pos = tabBar()->mapToParent( TQPoint( rect.x(), rect.y() ) );
dropIndicator->setGeometry( pos.x(), pos.y() , 3, rect.height() );
dropIndicator->show();
}
break;
- case QEvent::Drop: {
- QDragEnterEvent *de = (QDragEnterEvent*) e;
- if ( QTextDrag::canDecode( de ) ) {
- QString text;
- QTextDrag::decode( de, text );
- if ( text == QString::number( (long)this ) ) {
+ case TQEvent::Drop: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) ) {
int newIndex = 0;
for ( ; newIndex < tabBar()->count(); newIndex++ ) {
@@ -554,7 +554,7 @@ bool EditorTabWidget::eventFilter( QObject *o, QEvent *e )
}
if ( newIndex == tabBar()->count() -1 ) {
- QRect rect2 = tabBar()->tabAt( newIndex )->rect();
+ TQRect rect2 = tabBar()->tabAt( newIndex )->rect();
rect2.setLeft( rect2.left() + rect2.width() / 2 );
if ( rect2.contains( de->pos() ) )
newIndex++;
@@ -584,7 +584,7 @@ bool EditorTabWidget::eventFilter( QObject *o, QEvent *e )
}
-EditorToolBox::EditorToolBox( QWidget *parent, const char *name )
+EditorToolBox::EditorToolBox( TQWidget *parent, const char *name )
: ToolBox( parent, name )
{
setAcceptDrops( true );
@@ -600,23 +600,23 @@ void EditorToolBox::setCurrentPage( int i )
setCurrentItem( item( i ) );
}
-QString EditorToolBox::pageTitle() const
+TQString EditorToolBox::pageTitle() const
{
return itemLabel( currentIndex() );
}
-void EditorToolBox::setPageTitle( const QString& title )
+void EditorToolBox::setPageTitle( const TQString& title )
{
setItemLabel( currentIndex(), title );
}
-void EditorToolBox::setPageName( const QCString& name )
+void EditorToolBox::setPageName( const TQCString& name )
{
if ( currentItem() )
currentItem()->setName( name );
}
-QCString EditorToolBox::pageName() const
+TQCString EditorToolBox::pageName() const
{
if ( !currentItem() )
return 0;
@@ -625,7 +625,7 @@ QCString EditorToolBox::pageName() const
int EditorToolBox::count() const
{
- return QToolBox::count();
+ return TQToolBox::count();
}
@@ -636,21 +636,21 @@ int EditorToolBox::count() const
created.
*/
-QWidget *WidgetFactory::create( int id, QWidget *parent, const char *name, bool init, const QRect *r, Qt::Orientation orient )
+TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, bool init, const TQRect *r, Qt::Orientation orient )
{
- QString n = WidgetDatabase::className(id);
+ TQString n = WidgetDatabase::className(id);
//qDebug("Trying to create '%s'", n.latin1());
if (n.isEmpty())
return 0;
if (!defaultProperties)
{
- defaultProperties = new QMap < int, QMap < QString, QVariant > >();
- changedProperties = new QMap < int, QStringList > ();
+ defaultProperties = new TQMap < int, TQMap < TQString, TQVariant > >();
+ changedProperties = new TQMap < int, TQStringList > ();
}
- QWidget *w = 0;
- QString str = WidgetDatabase::createWidgetName(id);
+ TQWidget *w = 0;
+ TQString str = WidgetDatabase::createWidgetName(id);
const char *s = str.latin1();
w = createWidget(n, parent, name ? name : s, init, r, orient);
//qDebug("Trying to create '%s', widget (id=%d) - %s", s, id, w ? "successful" : "failure");
@@ -672,7 +672,7 @@ QWidget *WidgetFactory::create( int id, QWidget *parent, const char *name, bool
which can be \c HBox, \c VBox or \c Grid.
*/
-QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutType type )
+TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type )
{
int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0;
@@ -682,39 +682,39 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
- if ( !layout && widget && widget->inherits( "QTabWidget" ) )
- widget = ((QTabWidget*)widget)->currentPage();
+ if ( !layout && widget && widget->inherits( "TQTabWidget" ) )
+ widget = ((TQTabWidget*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( "QToolBox" ) )
- widget = ((QToolBox*)widget)->currentItem();
+ if ( !layout && widget && widget->inherits( "TQToolBox" ) )
+ widget = ((TQToolBox*)widget)->currentItem();
- if ( !layout && widget && widget->inherits( "QWizard" ) )
- widget = ((QWizard*)widget)->currentPage();
+ if ( !layout && widget && widget->inherits( "TQWizard" ) )
+ widget = ((TQWizard*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( "QMainWindow" ) )
- widget = ((QMainWindow*)widget)->centralWidget();
+ if ( !layout && widget && widget->inherits( "TQMainWindow" ) )
+ widget = ((TQMainWindow*)widget)->centralWidget();
- if ( !layout && widget && widget->inherits( "QWidgetStack" ) )
- widget = ((QWidgetStack*)widget)->visibleWidget();
+ if ( !layout && widget && widget->inherits( "TQWidgetStack" ) )
+ widget = ((TQWidgetStack*)widget)->visibleWidget();
MetaDataBase::addEntry( widget );
- if ( !layout && widget && widget->inherits( "QGroupBox" ) ) {
- QGroupBox *gb = (QGroupBox*)widget;
+ if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) {
+ TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
gb->layout()->setMargin( 0 );
gb->layout()->setSpacing( 0 );
- QLayout *l;
+ TQLayout *l;
switch ( type ) {
case HBox:
- l = new QHBoxLayout( gb->layout() );
+ l = new TQHBoxLayout( gb->layout() );
MetaDataBase::setMargin( gb, margin );
MetaDataBase::setSpacing( gb, spacing );
l->setAlignment( AlignTop );
MetaDataBase::addEntry( l );
return l;
case VBox:
- l = new QVBoxLayout( gb->layout(), spacing );
+ l = new TQVBoxLayout( gb->layout(), spacing );
MetaDataBase::setMargin( gb, margin );
MetaDataBase::setSpacing( gb, spacing );
l->setAlignment( AlignTop );
@@ -732,17 +732,17 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
}
} else {
if ( layout ) {
- QLayout *l;
+ TQLayout *l;
switch ( type ) {
case HBox:
- l = new QHBoxLayout( layout );
+ l = new TQHBoxLayout( layout );
MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
MetaDataBase::addEntry( l );
return l;
case VBox:
- l = new QVBoxLayout( layout );
+ l = new TQVBoxLayout( layout );
MetaDataBase::addEntry( l );
l->setSpacing( spacing );
l->setMargin( margin );
@@ -760,10 +760,10 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
return 0;
}
} else {
- QLayout *l;
+ TQLayout *l;
switch ( type ) {
case HBox:
- l = new QHBoxLayout( widget );
+ l = new TQHBoxLayout( widget );
MetaDataBase::addEntry( l );
if ( widget ) {
MetaDataBase::setMargin( widget, margin );
@@ -775,7 +775,7 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
MetaDataBase::addEntry( l );
return l;
case VBox:
- l = new QVBoxLayout( widget );
+ l = new TQVBoxLayout( widget );
MetaDataBase::addEntry( l );
if ( widget ) {
MetaDataBase::setMargin( widget, margin );
@@ -806,19 +806,19 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
}
}
-void WidgetFactory::deleteLayout( QWidget *widget )
+void WidgetFactory::deleteLayout( TQWidget *widget )
{
if ( !widget )
return;
- if ( widget->inherits( "QTabWidget" ) )
- widget = ((QTabWidget*)widget)->currentPage();
- if ( widget->inherits( "QWizard" ) )
- widget = ((QWizard*)widget)->currentPage();
- if ( widget->inherits( "QMainWindow" ) )
- widget = ((QMainWindow*)widget)->centralWidget();
- if ( widget->inherits( "QWidgetStack" ) )
- widget = ((QWidgetStack*)widget)->visibleWidget();
+ if ( widget->inherits( "TQTabWidget" ) )
+ widget = ((TQTabWidget*)widget)->currentPage();
+ if ( widget->inherits( "TQWizard" ) )
+ widget = ((TQWizard*)widget)->currentPage();
+ if ( widget->inherits( "TQMainWindow" ) )
+ widget = ((TQMainWindow*)widget)->centralWidget();
+ if ( widget->inherits( "TQWidgetStack" ) )
+ widget = ((TQWidgetStack*)widget)->visibleWidget();
delete widget->layout();
}
@@ -829,24 +829,24 @@ void WidgetFactory::deleteLayout( QWidget *widget )
has to be in sync with the initChangedProperties() function!
*/
-QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent, const char *name, bool init,
- const QRect *r, Qt::Orientation orient )
+TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *parent, const char *name, bool init,
+ const TQRect *r, Qt::Orientation orient )
{
- if (className == "QPushButton")
+ if (className == "TQPushButton")
{
- QPushButton *b = 0;
+ TQPushButton *b = 0;
if (init)
{
b = new QDesignerPushButton(parent, name);
- b->setText(QString::fromLatin1(name));
+ b->setText(TQString::fromLatin1(name));
} else
{
b = new QDesignerPushButton(parent, name);
}
- QWidget *w = find_formwindow(b);
- b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits("QDialog"));
+ TQWidget *w = find_formwindow(b);
+ b->setAutoDefault(w && ((FormWindow *) w)->mainContainer()->inherits("TQDialog"));
return b;
- } else if (className == "QToolButton")
+ } else if (className == "TQToolButton")
{
if (init)
{
@@ -855,57 +855,57 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return tb;
}
return new QDesignerToolButton(parent, name);
- } else if (className == "QCheckBox")
+ } else if (className == "TQCheckBox")
{
if (init)
{
QDesignerCheckBox *cb = new QDesignerCheckBox(parent, name);
- cb->setText(QString::fromLatin1(name));
+ cb->setText(TQString::fromLatin1(name));
return cb;
}
return new QDesignerCheckBox(parent, name);
- } else if (className == "QRadioButton")
+ } else if (className == "TQRadioButton")
{
if (init)
{
QDesignerRadioButton *rb = new QDesignerRadioButton(parent, name);
- rb->setText(QString::fromLatin1(name));
+ rb->setText(TQString::fromLatin1(name));
return rb;
}
return new QDesignerRadioButton(parent, name);
- } else if (className == "QGroupBox")
+ } else if (className == "TQGroupBox")
{
if (init)
- return new QGroupBox(QString::fromLatin1(name), parent, name);
- return new QGroupBox(parent, name);
- } else if (className == "QButtonGroup")
+ return new TQGroupBox(TQString::fromLatin1(name), parent, name);
+ return new TQGroupBox(parent, name);
+ } else if (className == "TQButtonGroup")
{
if (init)
- return new QButtonGroup(QString::fromLatin1(name), parent, name);
- return new QButtonGroup(parent, name);
- } else if (className == "QIconView")
+ return new TQButtonGroup(TQString::fromLatin1(name), parent, name);
+ return new TQButtonGroup(parent, name);
+ } else if (className == "TQIconView")
{
#if !defined(QT_NO_ICONVIEW)
- QIconView *iv = new QIconView(parent, name);
+ TQIconView *iv = new TQIconView(parent, name);
if (init)
- (void) new QIconViewItem(iv, i18n("New Item"));
+ (void) new TQIconViewItem(iv, i18n("New Item"));
return iv;
#else
return 0;
#endif
- } else if (className == "QTable")
+ } else if (className == "TQTable")
{
#if !defined(QT_NO_TABLE)
if (init)
- return new QTable(3, 3, parent, name);
- return new QTable(parent, name);
+ return new TQTable(3, 3, parent, name);
+ return new TQTable(parent, name);
#else
return 0;
#endif
#ifndef QT_NO_SQL
- } else if (className == "QDataTable")
+ } else if (className == "TQDataTable")
{
- return new QDataTable(parent, name);
+ return new TQDataTable(parent, name);
#endif //QT_NO_SQL
} else if (className == "QDateEdit")
{
@@ -916,70 +916,70 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
} else if (className == "QDateTimeEdit")
{
return new QDateTimeEdit(parent, name);
- } else if (className == "QListBox")
+ } else if (className == "TQListBox")
{
- QListBox *lb = new QListBox(parent, name);
+ TQListBox *lb = new TQListBox(parent, name);
if (init)
{
lb->insertItem(i18n("New Item"));
lb->setCurrentItem(0);
}
return lb;
- } else if (className == "QListView")
+ } else if (className == "TQListView")
{
- QListView *lv = new QListView(parent, name);
+ TQListView *lv = new TQListView(parent, name);
lv->setSorting(-1);
if (init)
{
lv->addColumn(i18n("Column 1"));
- lv->setCurrentItem(new QListViewItem(lv, i18n("New Item")));
+ lv->setCurrentItem(new TQListViewItem(lv, i18n("New Item")));
}
return lv;
- } else if (className == "QLineEdit")
- return new QLineEdit(parent, name);
- else if (className == "QSpinBox")
- return new QSpinBox(parent, name);
- else if (className == "QSplitter")
- return new QSplitter(parent, name);
- else if (className == "QMultiLineEdit")
- return new QMultiLineEdit(parent, name);
- else if (className == "QTextEdit")
- return new QTextEdit(parent, name);
- else if (className == "QLabel")
+ } else if (className == "TQLineEdit")
+ return new TQLineEdit(parent, name);
+ else if (className == "TQSpinBox")
+ return new TQSpinBox(parent, name);
+ else if (className == "TQSplitter")
+ return new TQSplitter(parent, name);
+ else if (className == "TQMultiLineEdit")
+ return new TQMultiLineEdit(parent, name);
+ else if (className == "TQTextEdit")
+ return new TQTextEdit(parent, name);
+ else if (className == "TQLabel")
{
QDesignerLabel *l = new QDesignerLabel(parent, name);
if (init)
{
- l->setText(QString::fromLatin1(name));
+ l->setText(TQString::fromLatin1(name));
MetaDataBase::addEntry(l);
MetaDataBase::setPropertyChanged(l, "text", true);
}
return l;
} else if (className == "QLayoutWidget")
return new QLayoutWidget(parent, name);
- else if (className == "QTabWidget")
+ else if (className == "TQTabWidget")
{
- QTabWidget *tw = new QDesignerTabWidget(parent, name);
+ TQTabWidget *tw = new QDesignerTabWidget(parent, name);
if (init)
{
FormWindow *fw = find_formwindow(parent);
- QWidget *w = fw ? new QDesignerWidget(fw, tw, "tab") : new QWidget(tw, "tab");
+ TQWidget *w = fw ? new QDesignerWidget(fw, tw, "tab") : new TQWidget(tw, "tab");
tw->addTab(w, i18n("Tab 1"));
MetaDataBase::addEntry(w);
- w = fw ? new QDesignerWidget(fw, tw, "tab") : new QWidget(tw, "tab");
+ w = fw ? new QDesignerWidget(fw, tw, "tab") : new TQWidget(tw, "tab");
tw->addTab(w, i18n("Tab 2"));
MetaDataBase::addEntry(tw);
MetaDataBase::addEntry(w);
}
return tw;
- } else if (className == "QComboBox")
+ } else if (className == "TQComboBox")
{
- return new QComboBox(false, parent, name);
- } else if (className == "QWidget")
+ return new TQComboBox(false, parent, name);
+ } else if (className == "TQWidget")
{
if (parent &&
- (parent->inherits("FormWindow") || parent->inherits("QWizard")
- || parent->inherits("QTabWidget") || parent->inherits("QToolBox") || parent->inherits("QMainWindow")))
+ (parent->inherits("FormWindow") || parent->inherits("TQWizard")
+ || parent->inherits("TQTabWidget") || parent->inherits("TQToolBox") || parent->inherits("TQMainWindow")))
{
FormWindow *fw = find_formwindow(parent);
if (fw)
@@ -989,30 +989,30 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return dw;
}
}
- return new QWidget(parent, name);
- } else if (className == "QDialog")
+ return new TQWidget(parent, name);
+ } else if (className == "TQDialog")
{
- QDialog *dia = 0;
+ TQDialog *dia = 0;
if (parent && parent->inherits("FormWindow"))
dia = new QDesignerDialog((FormWindow *) parent, parent, name);
else
- dia = new QDialog(parent, name);
+ dia = new TQDialog(parent, name);
if (parent && !parent->inherits("MainWindow"))
- dia->reparent(parent, QPoint(0, 0), true);
+ dia->reparent(parent, TQPoint(0, 0), true);
return dia;
- } else if (className == "QWizard")
+ } else if (className == "TQWizard")
{
- QWizard *wiz = new QDesignerWizard(parent, name);
+ TQWizard *wiz = new QDesignerWizard(parent, name);
if (parent && !parent->inherits("MainWindow"))
{
- wiz->reparent(parent, QPoint(0, 0), true);
+ wiz->reparent(parent, TQPoint(0, 0), true);
}
if (init && parent && parent->inherits("FormWindow"))
{
QDesignerWidget *dw = new QDesignerWidget((FormWindow *) parent, wiz, "page");
MetaDataBase::addEntry(dw);
wiz->addPage(dw, i18n("Page"));
- QTimer::singleShot(0, wiz, SLOT(next()));
+ TQTimer::singleShot(0, wiz, TQT_SLOT(next()));
}
return wiz;
} else if (className == "Spacer")
@@ -1030,19 +1030,19 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
else
s->setOrientation(Qt::Horizontal);
return s;
- } else if (className == "QLCDNumber")
- return new QLCDNumber(parent, name);
- else if (className == "QProgressBar")
- return new QProgressBar(parent, name);
- else if (className == "QTextView")
- return new QTextView(parent, name);
- else if (className == "QTextBrowser")
- return new QTextBrowser(parent, name);
- else if (className == "QDial")
- return new QDial(parent, name);
- else if (className == "QSlider")
+ } else if (className == "TQLCDNumber")
+ return new TQLCDNumber(parent, name);
+ else if (className == "TQProgressBar")
+ return new TQProgressBar(parent, name);
+ else if (className == "TQTextView")
+ return new TQTextView(parent, name);
+ else if (className == "TQTextBrowser")
+ return new TQTextBrowser(parent, name);
+ else if (className == "TQDial")
+ return new TQDial(parent, name);
+ else if (className == "TQSlider")
{
- QSlider *s = new QSlider(parent, name);
+ TQSlider *s = new TQSlider(parent, name);
if (!r)
return s;
if (!r->isValid() || r->width() < 2 && r->height() < 2)
@@ -1052,9 +1052,9 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
MetaDataBase::addEntry(s);
MetaDataBase::setPropertyChanged(s, "orientation", true);
return s;
- } else if (className == "QScrollBar")
+ } else if (className == "TQScrollBar")
{
- QScrollBar *s = new QScrollBar(parent, name);
+ TQScrollBar *s = new TQScrollBar(parent, name);
if (!r)
return s;
if (!r->isValid() || r->width() < 2 && r->height() < 2)
@@ -1064,12 +1064,12 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
MetaDataBase::addEntry(s);
MetaDataBase::setPropertyChanged(s, "orientation", true);
return s;
- } else if (className == "QFrame")
+ } else if (className == "TQFrame")
{
if (!init)
- return new QFrame(parent, name);
- QFrame *f = new QFrame(parent, name);
- f->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
+ return new TQFrame(parent, name);
+ TQFrame *f = new TQFrame(parent, name);
+ f->setFrameStyle(TQFrame::StyledPanel | TQFrame::Raised);
return f;
} else if (className == "Line")
{
@@ -1085,9 +1085,9 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
else if (r->width() < r->height())
l->setOrientation(Qt::Vertical);
return l;
- } else if (className == "QMainWindow")
+ } else if (className == "TQMainWindow")
{
- QMainWindow *mw = new KmdrMainWindow(parent, name, 0);
+ TQMainWindow *mw = new KmdrMainWindow(parent, name, 0);
mw->setDockEnabled(Qt::DockMinimized, false);
QDesignerWidget *dw = new QDesignerWidget((FormWindow *) parent, mw, "central widget");
mw->setDockMenuEnabled(false);
@@ -1098,17 +1098,17 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return mw;
}
#ifndef QT_NO_SQL
- else if (className == "QDataBrowser")
+ else if (className == "TQDataBrowser")
{
- QWidget *w = new QDesignerDataBrowser(parent, name);
+ TQWidget *w = new QDesignerDataBrowser(parent, name);
if (parent)
- w->reparent(parent, QPoint(0, 0), true);
+ w->reparent(parent, TQPoint(0, 0), true);
return w;
- } else if (className == "QDataView")
+ } else if (className == "TQDataView")
{
- QWidget *w = new QDesignerDataView(parent, name);
+ TQWidget *w = new QDesignerDataView(parent, name);
if (parent)
- w->reparent(parent, QPoint(0, 0), true);
+ w->reparent(parent, TQPoint(0, 0), true);
return w;
}
#endif
@@ -1118,57 +1118,57 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return new LineEdit(parent, name);
else if (className == "ListView")
{
- QListView *lv = new QListView(parent, name);
+ TQListView *lv = new TQListView(parent, name);
lv->setSorting(-1);
if (init)
{
lv->addColumn(i18n("Column 1"));
- lv->setCurrentItem(new QListViewItem(lv, i18n("New Item")));
+ lv->setCurrentItem(new TQListViewItem(lv, i18n("New Item")));
}
return lv;
}
else if (className == "Dialog")
{
- QDialog *dia = 0;
+ TQDialog *dia = 0;
if (parent && parent->inherits("FormWindow"))
dia = new EditorDialog((FormWindow *) parent, parent, name);
else
dia = new Dialog(parent, name, false);
if (parent)
- dia->reparent(parent, QPoint(0, 0), true);
+ dia->reparent(parent, TQPoint(0, 0), true);
return dia;
}
else if (className == "Wizard")
{
//qDebug("Creating Wizard...");
- QWizard *wiz;
+ TQWizard *wiz;
if (parent && parent->inherits("FormWindow"))
wiz = new QDesignerWizard(parent, name);
else
wiz = new Wizard(parent, name);
if (parent)
- wiz->reparent(parent, QPoint(0, 0), true);
+ wiz->reparent(parent, TQPoint(0, 0), true);
if (init && parent && parent->inherits("FormWindow"))
{
QDesignerWidget *dw = new QDesignerWidget((FormWindow *) parent, wiz, "page");
MetaDataBase::addEntry(dw);
wiz->addPage(dw, i18n("Page 1"));
wiz->addPage(dw, i18n("Page 2"));
- QTimer::singleShot(0, wiz, SLOT(next()));
+ TQTimer::singleShot(0, wiz, TQT_SLOT(next()));
}
return wiz;
}
else if (className == "TabWidget")
{
- QTabWidget *tw = new EditorTabWidget(parent, name);
+ TQTabWidget *tw = new EditorTabWidget(parent, name);
if (init)
{
FormWindow *fw = find_formwindow(parent);
- QWidget *w = fw ? new QDesignerWidget(fw, tw, "tab") : new QWidget(tw, "tab");
+ TQWidget *w = fw ? new QDesignerWidget(fw, tw, "tab") : new TQWidget(tw, "tab");
tw->addTab(w, i18n("Tab 1"));
MetaDataBase::addEntry(w);
- w = fw ? new QDesignerWidget(fw, tw, "tab") : new QWidget(tw, "tab");
+ w = fw ? new QDesignerWidget(fw, tw, "tab") : new TQWidget(tw, "tab");
tw->addTab(w, i18n("Tab 2"));
MetaDataBase::addEntry(tw);
MetaDataBase::addEntry(w);
@@ -1176,14 +1176,14 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return tw;
} else if (className == "ToolBox")
{
- QToolBox *tw = new EditorToolBox(parent, name);
+ TQToolBox *tw = new EditorToolBox(parent, name);
if (init)
{
FormWindow *fw = find_formwindow(parent);
- QWidget *w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new QWidget(tw, "toolbox");
+ TQWidget *w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new TQWidget(tw, "toolbox");
tw->addItem(w, i18n("Page 1"));
MetaDataBase::addEntry(w);
- w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new QWidget(tw, "toolbox");
+ w = fw ? new QDesignerWidget(fw, tw, "toolbox") : new TQWidget(tw, "toolbox");
tw->addItem(w, i18n("Page 2"));
MetaDataBase::addEntry(tw);
MetaDataBase::addEntry(w);
@@ -1228,12 +1228,12 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
return new AboutDialog(parent, name);
else if (className == "TreeWidget")
{
- QListView *lv = new TreeWidget(parent, name);
+ TQListView *lv = new TreeWidget(parent, name);
lv->setSorting(-1);
if (init)
{
lv->addColumn(i18n("Column 1"));
- lv->setCurrentItem(new QListViewItem(lv, i18n("New Item")));
+ lv->setCurrentItem(new TQListViewItem(lv, i18n("New Item")));
}
return lv;
} else if (className == "Slider")
@@ -1251,7 +1251,7 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
}
#endif
- QWidget *w = KommanderFactory::createWidget(className, parent, name);
+ TQWidget *w = KommanderFactory::createWidget(className, parent, name);
return w;
}
@@ -1259,44 +1259,44 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
/*! 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
- QWidget::layout() of \a w or to 0 after the function call.
+ TQWidget::layout() of \a w or to 0 after the function call.
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( QWidget *w, QLayout *&layout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout )
{
layout = 0;
- if ( w && w->inherits( "QTabWidget" ) )
- w = ((QTabWidget*)w)->currentPage();
- if ( w->inherits( "QToolBox" ) )
- w = ((QToolBox*)w)->currentItem();
- if ( w && w->inherits( "QWizard" ) )
- w = ((QWizard*)w)->currentPage();
- if ( w && w->inherits( "QMainWindow" ) )
- w = ((QMainWindow*)w)->centralWidget();
- if ( w && w->inherits( "QWidgetStack" ) )
- w = ((QWidgetStack*)w)->visibleWidget();
+ if ( w && w->inherits( "TQTabWidget" ) )
+ w = ((TQTabWidget*)w)->currentPage();
+ if ( w->inherits( "TQToolBox" ) )
+ w = ((TQToolBox*)w)->currentItem();
+ if ( w && w->inherits( "TQWizard" ) )
+ w = ((TQWizard*)w)->currentPage();
+ if ( w && w->inherits( "TQMainWindow" ) )
+ w = ((TQMainWindow*)w)->centralWidget();
+ if ( w && w->inherits( "TQWidgetStack" ) )
+ w = ((TQWidgetStack*)w)->visibleWidget();
- if ( w && w->inherits( "QSplitter" ) )
- return ( (QSplitter*)w )->orientation() == Horizontal ? HBox : VBox;
+ if ( w && w->inherits( "TQSplitter" ) )
+ return ( (TQSplitter*)w )->orientation() == Horizontal ? HBox : VBox;
if ( !w || !w->layout() )
return NoLayout;
- QLayout *lay = w->layout();
+ TQLayout *lay = w->layout();
- if ( w->inherits( "QGroupBox" ) ) {
- QObjectList *l = lay->queryList( "QLayout" );
+ if ( w->inherits( "TQGroupBox" ) ) {
+ TQObjectList *l = lay->queryList( "TQLayout" );
if ( l && l->first() )
- lay = (QLayout*)l->first();
+ lay = (TQLayout*)l->first();
delete l;
}
layout = lay;
- if ( lay->inherits( "QHBoxLayout" ) )
+ if ( lay->inherits( "TQHBoxLayout" ) )
return HBox;
- else if ( lay->inherits( "QVBoxLayout" ) )
+ else if ( lay->inherits( "TQVBoxLayout" ) )
return VBox;
- else if ( lay->inherits( "QGridLayout" ) )
+ else if ( lay->inherits( "TQGridLayout" ) )
return Grid;
return NoLayout;
}
@@ -1304,13 +1304,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( QWidget *w, QLayout *&layou
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( QLayout *layout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
{
- if ( layout->inherits( "QHBoxLayout" ) )
+ if ( layout->inherits( "TQHBoxLayout" ) )
return HBox;
- else if ( layout->inherits( "QVBoxLayout" ) )
+ else if ( layout->inherits( "TQVBoxLayout" ) )
return VBox;
- else if ( layout->inherits( "QGridLayout" ) )
+ else if ( layout->inherits( "TQGridLayout" ) )
return Grid;
return NoLayout;
}
@@ -1318,19 +1318,19 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( QLayout *layout )
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( QWidget *w )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
{
- QLayout *l = 0;
+ TQLayout *l = 0;
return layoutType( w, l );
}
-QWidget *WidgetFactory::layoutParent( QLayout *layout )
+TQWidget *WidgetFactory::layoutParent( TQLayout *layout )
{
- QObject *o = layout;
+ TQObject *o = layout;
while ( o ) {
if ( o->isWidgetType() )
- return (QWidget*)o;
+ return (TQWidget*)o;
o = o->parent();
}
return 0;
@@ -1345,20 +1345,20 @@ QWidget *WidgetFactory::layoutParent( QLayout *layout )
tabwidget. So in this case this function returns the current page of
the tabwidget.)
*/
-QWidget* WidgetFactory::containerOfWidget( QWidget *w )
+TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
{
if ( !w )
return w;
- if ( w->inherits( "QTabWidget" ) )
- return ((QTabWidget*)w)->currentPage();
- if ( w->inherits( "QToolBox" ) )
- return ((QToolBox*)w)->currentItem();
- if ( w->inherits( "QWizard" ) )
- return ((QWizard*)w)->currentPage();
- if ( w->inherits( "QWidgetStack" ) )
- return ((QWidgetStack*)w)->visibleWidget();
- if ( w->inherits( "QMainWindow" ) )
- return ((QMainWindow*)w)->centralWidget();
+ if ( w->inherits( "TQTabWidget" ) )
+ return ((TQTabWidget*)w)->currentPage();
+ if ( w->inherits( "TQToolBox" ) )
+ return ((TQToolBox*)w)->currentItem();
+ if ( w->inherits( "TQWizard" ) )
+ return ((TQWizard*)w)->currentPage();
+ if ( w->inherits( "TQWidgetStack" ) )
+ return ((TQWidgetStack*)w)->visibleWidget();
+ if ( w->inherits( "TQMainWindow" ) )
+ return ((TQMainWindow*)w)->centralWidget();
return w;
}
@@ -1370,9 +1370,9 @@ QWidget* WidgetFactory::containerOfWidget( QWidget *w )
function returns the tabwidget then.)
*/
-QWidget* WidgetFactory::widgetOfContainer( QWidget *w )
+TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
{
- if ( w->parentWidget() && w->parentWidget()->inherits( "QWidgetStack" ) )
+ if ( w->parentWidget() && w->parentWidget()->inherits( "TQWidgetStack" ) )
w = w->parentWidget();
while ( w ) {
if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ||
@@ -1386,20 +1386,20 @@ QWidget* WidgetFactory::widgetOfContainer( QWidget *w )
/*!
Returns whether \a o is a passive interactor or not.
*/
-bool WidgetFactory::isPassiveInteractor( QObject* o )
+bool WidgetFactory::isPassiveInteractor( TQObject* o )
{
- if ( QApplication::activePopupWidget() ) // if a popup is open, we have to make sure that this one is closed, else X might do funny things
+ 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 true;
- if ( o->inherits( "QTabBar" ) || ::qt_cast<QToolBox*>(o->parent()) )
+ if ( o->inherits( "TQTabBar" ) || ::qt_cast<TQToolBox*>(o->parent()) )
return true;
- else if ( o->inherits( "QSizeGrip" ) )
+ else if ( o->inherits( "TQSizeGrip" ) )
return true;
- else if ( o->inherits( "QToolButton" ) && o->parent() && o->parent()->inherits( "QTabBar" ) )
+ else if ( o->inherits( "TQToolButton" ) && o->parent() && o->parent()->inherits( "TQTabBar" ) )
return true;
- else if ( o->parent() && o->parent()->inherits( "QWizard" ) && o->inherits( "QPushButton" ) )
+ else if ( o->parent() && o->parent()->inherits( "TQWizard" ) && o->inherits( "TQPushButton" ) )
return true;
- else if ( o->parent() && o->parent()->inherits( "QMainWindow" ) && o->inherits( "QMenuBar" ) )
+ else if ( o->parent() && o->parent()->inherits( "TQMainWindow" ) && o->inherits( "TQMenuBar" ) )
return true;
else if ( o->inherits( "QDockWindowHandle" ) )
return true;
@@ -1413,10 +1413,10 @@ bool WidgetFactory::isPassiveInteractor( QObject* o )
/*!
Returns the class name of object \a o that should be used for externally (i.e. for saving)
*/
-const char* WidgetFactory::classNameOf( QObject* o )
+const char* WidgetFactory::classNameOf( TQObject* o )
{
if (o->inherits("QDesignerTabWidget"))
- return "QTabWidget";
+ return "TQTabWidget";
#ifdef KOMMANDER
else if (o->inherits("EditorTabWidget"))
return "TabWidget";
@@ -1424,34 +1424,34 @@ const char* WidgetFactory::classNameOf( QObject* o )
return "ToolBox";
#endif
else if (o->inherits("QDesignerDialog"))
- return "QDialog";
+ return "TQDialog";
else if (o->inherits("QDesignerWidget"))
- return "QWidget";
+ return "TQWidget";
else if (o->inherits("CustomWidget"))
return ((CustomWidget *) o)->realClassName().latin1();
else if (o->inherits("QDesignerLabel"))
- return "QLabel";
+ return "TQLabel";
else if (o->inherits("QDesignerWizard"))
- return "QWizard";
+ return "TQWizard";
else if (o->inherits("EditorWizard"))
return "Wizard";
else if (o->inherits("QDesignerPushButton"))
- return "QPushButton";
+ return "TQPushButton";
else if (o->inherits("QDesignerToolButton"))
- return "QToolButton";
+ return "TQToolButton";
else if (o->inherits("QDesignerRadioButton"))
- return "QRadioButton";
+ return "TQRadioButton";
else if (o->inherits("QDesignerCheckBox"))
- return "QCheckBox";
+ return "TQCheckBox";
else if (o->inherits("QDesignerMenuBar"))
- return "QMenuBar";
+ return "TQMenuBar";
else if (o->inherits("QDesignerToolBar"))
- return "QToolBar";
+ return "TQToolBar";
#ifndef QT_NO_SQL
else if (o->inherits("QDesignerDataBrowser"))
- return "QDataBrowser";
+ return "TQDataBrowser";
else if (o->inherits("QDesignerDataView"))
- return "QDataView";
+ return "TQDataView";
#endif
else if (o->inherits("EditorDialog"))
return "Dialog";
@@ -1463,45 +1463,45 @@ const char* WidgetFactory::classNameOf( QObject* o )
createWidget()!
*/
-void WidgetFactory::initChangedProperties( QObject *o )
+void WidgetFactory::initChangedProperties( TQObject *o )
{
MetaDataBase::setPropertyChanged( o, "name", true );
if ( !o->inherits( "QDesignerToolBar" ) && !o->inherits( "QDesignerMenuBar" ) )
MetaDataBase::setPropertyChanged( o, "geometry", true );
- if ( o->inherits( "QPushButton" ) || o->inherits("QRadioButton") || o->inherits( "QCheckBox" ) || o->inherits( "QToolButton" ) )
+ if ( o->inherits( "TQPushButton" ) || o->inherits("TQRadioButton") || o->inherits( "TQCheckBox" ) || o->inherits( "TQToolButton" ) )
MetaDataBase::setPropertyChanged( o, "text", true );
- else if (::qt_cast<QToolButton*>(o) && ::qt_cast<QToolBox*>(widgetOfContainer((QWidget*)o->parent()))) {
+ else if (::qt_cast<TQToolButton*>(o) && ::qt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->parent()))) {
MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "textLabel", TRUE );
MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE );
MetaDataBase::setPropertyChanged( o, "textPosition", TRUE );
- } else if ( o->inherits( "QGroupBox" ) )
+ } else if ( o->inherits( "TQGroupBox" ) )
MetaDataBase::setPropertyChanged( o, "title", true );
- else if ( o->isA( "QFrame" ) ) {
+ else if ( o->isA( "TQFrame" ) ) {
MetaDataBase::setPropertyChanged( o, "frameShadow", true );
MetaDataBase::setPropertyChanged( o, "frameShape", true );
- } else if ( o->inherits( "QTabWidget" ) || o->inherits( "QWizard" ) ) {
+ } else if ( o->inherits( "TQTabWidget" ) || o->inherits( "TQWizard" ) ) {
MetaDataBase::setPropertyChanged( o, "pageTitle", true );
MetaDataBase::setPropertyChanged( o, "pageName", true );
#ifndef QT_NO_TABLE
- } else if ( o->inherits( "QTable" ) && !o->inherits( "QDataTable" ) ) {
+ } else if ( o->inherits( "TQTable" ) && !o->inherits( "TQDataTable" ) ) {
MetaDataBase::setPropertyChanged( o, "numRows", true );
MetaDataBase::setPropertyChanged( o, "numCols", true );
- QTable *t = (QTable*)o;
+ TQTable *t = (TQTable*)o;
for ( int i = 0; i < 3; ++i ) {
- t->horizontalHeader()->setLabel( i, QString::number( i + 1 ) );
- t->verticalHeader()->setLabel( i, QString::number( i + 1 ) );
+ t->horizontalHeader()->setLabel( i, TQString::number( i + 1 ) );
+ t->verticalHeader()->setLabel( i, TQString::number( i + 1 ) );
}
#endif
- } else if ( ::qt_cast<QToolBox*>(o) ) {
+ } else if ( ::qt_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 );
- } else if ( o->inherits( "QSplitter" ) ) {
+ } else if ( o->inherits( "TQSplitter" ) ) {
MetaDataBase::setPropertyChanged( o, "orientation", true );
} else if ( o->inherits( "QDesignerToolBar" ) ) {
MetaDataBase::setPropertyChanged( o, "label", true );
@@ -1514,7 +1514,7 @@ void WidgetFactory::initChangedProperties( QObject *o )
bool WidgetFactory::hasSpecialEditor( int id )
{
- QString className = WidgetDatabase::className(id);
+ TQString className = WidgetDatabase::className(id);
if (className == "TextEdit" || className == "ComboBox" || className == "ListBox" || className ==
"TreeWidget" || className == "TextBrowser")
@@ -1528,7 +1528,7 @@ bool WidgetFactory::hasSpecialEditor( int id )
return true;
if (className.mid(1) == "IconView")
return true;
- if (className == "QTextEdit" || className == "QMultiLineEdit")
+ if (className == "TQTextEdit" || className == "TQMultiLineEdit")
return true;
if (className.contains("Table"))
return true;
@@ -1538,7 +1538,7 @@ bool WidgetFactory::hasSpecialEditor( int id )
bool WidgetFactory::hasItems( int id )
{
- QString className = WidgetDatabase::className(id);
+ TQString className = WidgetDatabase::className(id);
if (className == "ComboBox" || className == "ListBox" || className == "TreeWidget")
return true;
@@ -1550,17 +1550,17 @@ bool WidgetFactory::hasItems( int id )
return false;
}
-void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, FormWindow *fw )
+void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, FormWindow *fw )
{
- QString className = WidgetDatabase::className(id);
+ TQString className = WidgetDatabase::className(id);
#ifdef KOMMANDER
if (className == "ComboBox")
{
- if (!editWidget->inherits("QComboBox"))
+ if (!editWidget->inherits("TQComboBox"))
return;
- QComboBox *cb = (QComboBox *) editWidget;
+ TQComboBox *cb = (TQComboBox *) editWidget;
ListBoxEditor *e = new ListBoxEditor(parent, cb->listBox(), fw);
e->exec();
@@ -1579,9 +1579,9 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
}
if (className == "TreeWidget")
{
- if (!editWidget->inherits("QListView"))
+ if (!editWidget->inherits("TQListView"))
return;
- QListView *lv = (QListView *) editWidget;
+ TQListView *lv = (TQListView *) editWidget;
ListViewEditor *e = new ListViewEditor(parent, lv, fw);
e->exec();
delete e;
@@ -1589,7 +1589,7 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
}
if (className == "ListBox")
{
- if (!editWidget->inherits("QListBox"))
+ if (!editWidget->inherits("TQListBox"))
return;
ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw);
e->exec();
@@ -1599,7 +1599,7 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
#endif
if (className.mid(1) == "ListBox")
{
- if (!editWidget->inherits("QListBox"))
+ if (!editWidget->inherits("TQListBox"))
return;
ListBoxEditor *e = new ListBoxEditor(parent, editWidget, fw);
e->exec();
@@ -1609,9 +1609,9 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
if (className.mid(1) == "ComboBox")
{
- if (!editWidget->inherits("QComboBox"))
+ if (!editWidget->inherits("TQComboBox"))
return;
- QComboBox *cb = (QComboBox *) editWidget;
+ TQComboBox *cb = (TQComboBox *) editWidget;
ListBoxEditor *e = new ListBoxEditor(parent, cb->listBox(), fw);
e->exec();
delete e;
@@ -1621,9 +1621,9 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
if (className.mid(1) == "ListView")
{
- if (!editWidget->inherits("QListView"))
+ if (!editWidget->inherits("TQListView"))
return;
- QListView *lv = (QListView *) editWidget;
+ TQListView *lv = (TQListView *) editWidget;
ListViewEditor *e = new ListViewEditor(parent, lv, fw);
e->exec();
delete e;
@@ -1632,7 +1632,7 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
if (className.mid(1) == "IconView")
{
- if (!editWidget->inherits("QIconView"))
+ if (!editWidget->inherits("TQIconView"))
return;
IconViewEditor *e = new IconViewEditor(parent, editWidget, fw);
e->exec();
@@ -1640,7 +1640,7 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
return;
}
- if (className == "QMultiLineEdit" || className == "QTextEdit")
+ if (className == "TQMultiLineEdit" || className == "TQTextEdit")
{
MultiLineEditor *e = new MultiLineEditor(parent, editWidget, fw);
e->exec();
@@ -1658,50 +1658,50 @@ void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, Fo
#endif
}
-bool WidgetFactory::canResetProperty( QObject *w, const QString &propName )
+bool WidgetFactory::canResetProperty( TQObject *w, const TQString &propName )
{
if ( propName == "name" || propName == "geometry" )
return false;
- QStringList l = *changedProperties->find( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
+ TQStringList l = *changedProperties->find( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
return l.findIndex( propName ) == -1;
}
-bool WidgetFactory::resetProperty( QObject *w, const QString &propName )
+bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName )
{
- const QMetaProperty *p = w->metaObject()->property( w->metaObject()->
+ const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->
findProperty( propName, true ), true );
if (!p )
return false;
return p->reset( w );
}
-QVariant WidgetFactory::defaultValue( QObject *w, const QString &propName )
+TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
{
if ( propName == "wordwrap" ) {
int v = defaultValue( w, "alignment" ).toInt();
- return QVariant( ( v & WordBreak ) == WordBreak, 0 );
+ return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
} else if ( propName == "toolTip" || propName == "whatsThis" ) {
- return QVariant( QString::fromLatin1( "" ) );
+ return TQVariant( TQString::fromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) {
- return QVariant();
+ return TQVariant();
} else if ( propName == "frameworkCode" ) {
- return QVariant( true, 0 );
+ return TQVariant( true, 0 );
} else if ( propName == "layoutMargin" ) {
if ( w->inherits( "QLayoutWidget" ) )
- return QVariant( 0 );
+ return TQVariant( 0 );
else if ( MainWindow::self->formWindow() )
- return QVariant( MainWindow::self->formWindow()->layoutDefaultMargin() );
+ return TQVariant( MainWindow::self->formWindow()->layoutDefaultMargin() );
} else if ( propName == "layoutSpacing" ) {
if ( MainWindow::self->formWindow() )
- return QVariant( MainWindow::self->formWindow()->layoutDefaultSpacing() );
+ return TQVariant( MainWindow::self->formWindow()->layoutDefaultSpacing() );
}
return *( *defaultProperties->find( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).find( propName );
}
-QString WidgetFactory::defaultCurrentItem( QObject *w, const QString &propName )
+TQString WidgetFactory::defaultCurrentItem( TQObject *w, const TQString &propName )
{
- const QMetaProperty *p = w->metaObject()->
+ const TQMetaProperty *p = w->metaObject()->
property( w->metaObject()->findProperty( propName, true ), true );
if ( !p ) {
int v = defaultValue( w, "alignment" ).toInt();
@@ -1724,22 +1724,22 @@ QString WidgetFactory::defaultCurrentItem( QObject *w, const QString &propName )
if ( ( v & AlignBottom ) == AlignBottom )
return "AlignBottom";
}
- return QString::null;
+ return TQString::null;
}
return p->valueToKey( defaultValue( w, propName ).toInt() );
}
-QWidget *WidgetFactory::createCustomWidget( QWidget *parent, const char *name, MetaDataBase::CustomWidget *w )
+TQWidget *WidgetFactory::createCustomWidget( TQWidget *parent, const char *name, MetaDataBase::CustomWidget *w )
{
if ( !w )
return 0;
return new CustomWidget( parent, name, w );
}
-QVariant WidgetFactory::property( QObject *w, const char *name )
+TQVariant WidgetFactory::property( TQObject *w, const char *name )
{
- QVariant v = w->property( name );
+ TQVariant v = w->property( name );
if ( v.isValid() )
return v;
return MetaDataBase::fakeProperty( w, name );
@@ -1751,60 +1751,60 @@ void QDesignerLabel::updateBuddy()
if ( myBuddy.isEmpty() )
return;
- QObjectList *l = topLevelWidget()->queryList( "QWidget", myBuddy, false, true );
+ TQObjectList *l = topLevelWidget()->queryList( "TQWidget", myBuddy, false, true );
if ( !l || !l->first() ) {
delete l;
return;
}
- QLabel::setBuddy( (QWidget*)l->first() );
+ TQLabel::setBuddy( (TQWidget*)l->first() );
delete l;
}
-void QDesignerWidget::paintEvent( QPaintEvent *e )
+void QDesignerWidget::paintEvent( TQPaintEvent *e )
{
formwindow->paintGrid( this, e );
}
-void QDesignerDialog::paintEvent( QPaintEvent *e )
+void QDesignerDialog::paintEvent( TQPaintEvent *e )
{
formwindow->paintGrid( this, e );
}
-void EditorDialog::paintEvent( QPaintEvent *e )
+void EditorDialog::paintEvent( TQPaintEvent *e )
{
formwindow->paintGrid( this, e );
}
-QSizePolicy QLayoutWidget::sizePolicy() const
+TQSizePolicy QLayoutWidget::sizePolicy() const
{
return sp;
}
-bool QLayoutWidget::event( QEvent *e )
+bool QLayoutWidget::event( TQEvent *e )
{
- if ( e && ( e->type() == QEvent::ChildInserted ||
- e->type() == QEvent::ChildRemoved ||
- e->type() == QEvent::LayoutHint ||
- e->type() == QEvent::Reparent ) )
+ if ( e && ( e->type() == TQEvent::ChildInserted ||
+ e->type() == TQEvent::ChildRemoved ||
+ e->type() == TQEvent::LayoutHint ||
+ e->type() == TQEvent::Reparent ) )
updateSizePolicy();
- return QWidget::event( e );
+ return TQWidget::event( e );
}
/*
This function must be called on QLayoutWidget creation and whenever
the QLayoutWidget's parent layout changes (e.g., from a QHBoxLayout
- to a QVBoxLayout), because of the (illogical) way layouting works.
+ to a TQVBoxLayout), because of the (illogical) way layouting works.
*/
void QLayoutWidget::updateSizePolicy()
{
if ( !children() || children()->count() == 0 ) {
- sp = QWidget::sizePolicy();
+ sp = TQWidget::sizePolicy();
return;
}
/*
- QSizePolicy::MayShrink & friends are private. Here we assume the
+ TQSizePolicy::MayShrink & friends are private. Here we assume the
following:
Fixed = 0
@@ -1813,110 +1813,110 @@ void QLayoutWidget::updateSizePolicy()
Preferred = MayShrink | MayGrow
*/
- int ht = (int) QSizePolicy::Preferred;
- int vt = (int) QSizePolicy::Preferred;
+ int ht = (int) TQSizePolicy::Preferred;
+ int vt = (int) TQSizePolicy::Preferred;
if ( layout() ) {
/*
parentLayout is set to the parent layout if there is one and if it is
top level, in which case layouting is illogical.
*/
- QLayout *parentLayout = 0;
+ TQLayout *parentLayout = 0;
if ( parent() && parent()->isWidgetType() ) {
- parentLayout = ((QWidget *)parent())->layout();
+ parentLayout = ((TQWidget *)parent())->layout();
if ( parentLayout && parentLayout->mainWidget()->inherits("QLayoutWidget") )
parentLayout = 0;
}
- QObjectListIt it( *children() );
- QObject *o;
+ TQObjectListIt it( *children() );
+ TQObject *o;
- if ( layout()->inherits("QVBoxLayout") ) {
- if ( parentLayout && parentLayout->inherits("QHBoxLayout") )
- vt = QSizePolicy::Minimum;
+ if ( layout()->inherits("TQVBoxLayout") ) {
+ if ( parentLayout && parentLayout->inherits("TQHBoxLayout") )
+ vt = TQSizePolicy::Minimum;
else
- vt = QSizePolicy::Fixed;
+ vt = TQSizePolicy::Fixed;
while ( ( o = it.current() ) ) {
++it;
- if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( WState_ForceHide ) )
continue;
- QWidget *w = (QWidget*)o;
+ TQWidget *w = (TQWidget*)o;
if ( !w->sizePolicy().mayGrowHorizontally() )
- ht &= ~QSizePolicy::Minimum;
+ ht &= ~TQSizePolicy::Minimum;
if ( !w->sizePolicy().mayShrinkHorizontally() )
- ht &= ~QSizePolicy::Maximum;
+ ht &= ~TQSizePolicy::Maximum;
if ( w->sizePolicy().mayGrowVertically() )
- vt |= QSizePolicy::Minimum;
+ vt |= TQSizePolicy::Minimum;
if ( w->sizePolicy().mayShrinkVertically() )
- vt |= QSizePolicy::Maximum;
+ vt |= TQSizePolicy::Maximum;
}
- } else if ( layout()->inherits("QHBoxLayout") ) {
- if ( parentLayout && parentLayout->inherits("QVBoxLayout") )
- ht = QSizePolicy::Minimum;
+ } else if ( layout()->inherits("TQHBoxLayout") ) {
+ if ( parentLayout && parentLayout->inherits("TQVBoxLayout") )
+ ht = TQSizePolicy::Minimum;
else
- ht = QSizePolicy::Fixed;
+ ht = TQSizePolicy::Fixed;
while ( ( o = it.current() ) ) {
++it;
- if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( WState_ForceHide ) )
continue;
- QWidget *w = (QWidget*)o;
+ TQWidget *w = (TQWidget*)o;
if ( w->sizePolicy().mayGrowHorizontally() )
- ht |= QSizePolicy::Minimum;
+ ht |= TQSizePolicy::Minimum;
if ( w->sizePolicy().mayShrinkHorizontally() )
- ht |= QSizePolicy::Maximum;
+ ht |= TQSizePolicy::Maximum;
if ( !w->sizePolicy().mayGrowVertically() )
- vt &= ~QSizePolicy::Minimum;
+ vt &= ~TQSizePolicy::Minimum;
if ( !w->sizePolicy().mayShrinkVertically() )
- vt &= ~QSizePolicy::Maximum;
+ vt &= ~TQSizePolicy::Maximum;
}
- } else if ( layout()->inherits("QGridLayout") ) {
- ht = QSizePolicy::Fixed;
- vt = QSizePolicy::Fixed;
+ } else if ( layout()->inherits("TQGridLayout") ) {
+ ht = TQSizePolicy::Fixed;
+ vt = TQSizePolicy::Fixed;
if ( parentLayout ) {
- if ( parentLayout->inherits("QVBoxLayout") )
- ht = QSizePolicy::Minimum;
- else if ( parentLayout->inherits("QHBoxLayout") )
- vt = QSizePolicy::Minimum;
+ if ( parentLayout->inherits("TQVBoxLayout") )
+ ht = TQSizePolicy::Minimum;
+ else if ( parentLayout->inherits("TQHBoxLayout") )
+ vt = TQSizePolicy::Minimum;
}
while ( ( o = it.current() ) ) {
++it;
- if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( WState_ForceHide ) )
continue;
- QWidget *w = (QWidget*)o;
+ TQWidget *w = (TQWidget*)o;
if ( w->sizePolicy().mayGrowHorizontally() )
- ht |= QSizePolicy::Minimum;
+ ht |= TQSizePolicy::Minimum;
if ( w->sizePolicy().mayShrinkHorizontally() )
- ht |= QSizePolicy::Maximum;
+ ht |= TQSizePolicy::Maximum;
if ( w->sizePolicy().mayGrowVertically() )
- vt |= QSizePolicy::Minimum;
+ vt |= TQSizePolicy::Minimum;
if ( w->sizePolicy().mayShrinkVertically() )
- vt |= QSizePolicy::Maximum;
+ vt |= TQSizePolicy::Maximum;
}
}
- if ( layout()->expanding() & QSizePolicy::Horizontally )
- ht = QSizePolicy::Expanding;
- if ( layout()->expanding() & QSizePolicy::Vertically )
- vt = QSizePolicy::Expanding;
+ if ( layout()->expanding() & TQSizePolicy::Horizontally )
+ ht = TQSizePolicy::Expanding;
+ if ( layout()->expanding() & TQSizePolicy::Vertically )
+ vt = TQSizePolicy::Expanding;
layout()->invalidate();
}
- sp = QSizePolicy( (QSizePolicy::SizeType) ht, (QSizePolicy::SizeType) vt );
+ sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt );
updateGeometry();
}
-void CustomWidget::paintEvent( QPaintEvent *e )
+void CustomWidget::paintEvent( TQPaintEvent *e )
{
if ( parentWidget() && parentWidget()->inherits( "FormWindow" ) ) {
( (FormWindow*)parentWidget() )->paintGrid( this, e );
} else {
- QPainter p( this );
+ TQPainter p( this );
p.fillRect( rect(), colorGroup().dark() );
p.drawPixmap( ( width() - cusw->pixmap->width() ) / 2,
( height() - cusw->pixmap->height() ) / 2,