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.cpp162
1 files changed, 81 insertions, 81 deletions
diff --git a/kommander/editor/widgetfactory.cpp b/kommander/editor/widgetfactory.cpp
index 9f619c79..d04d75d9 100644
--- a/kommander/editor/widgetfactory.cpp
+++ b/kommander/editor/widgetfactory.cpp
@@ -29,7 +29,7 @@
#include "mainwindow.h"
#include "formwindow.h"
#include "pixmapchooser.h"
-#include "tqlayout.h"
+#include "layout.h"
#include "listboxeditorimpl.h"
#include "listvieweditorimpl.h"
#include "iconvieweditorimpl.h"
@@ -56,9 +56,9 @@
#include <tqlineedit.h>
#include <tqspinbox.h>
#include <tqmultilineedit.h>
-#include <tqtextedit.h>
+#include <textedit.h>
#include <tqlabel.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqwidgetstack.h>
#include <tqcombobox.h>
#include <tqtabbar.h>
@@ -69,8 +69,8 @@
#include <tqslider.h>
#include <tqdial.h>
#include <tqprogressbar.h>
-#include <tqtextview.h>
-#include <tqtextbrowser.h>
+#include <textview.h>
+#include <textbrowser.h>
#include <tqframe.h>
#include <tqmetaobject.h>
#include <tqwizard.h>
@@ -399,7 +399,7 @@ TQMap< int, TQStringList > *changedProperties = 0;
void WidgetFactory::saveDefaultProperties( TQWidget *w, int id )
{
TQMap< TQString, TQVariant> propMap;
- TQStrList lst = w->tqmetaObject()->propertyNames( true );
+ TQStrList lst = w->metaObject()->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 )
@@ -668,11 +668,11 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo
return w;
}
-/*! Creates a tqlayout on the widget \a widget of the type \a type
+/*! Creates a layout 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 *tqlayout, LayoutType type )
+TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type )
{
int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0;
@@ -682,74 +682,74 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay
widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
- if ( !tqlayout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !tqlayout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem();
- if ( !tqlayout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !tqlayout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
widget = ((TQMainWindow*)widget)->centralWidget();
- if ( !tqlayout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
- if ( !tqlayout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
+ if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
- gb->tqlayout()->setMargin( 0 );
- gb->tqlayout()->setSpacing( 0 );
+ gb->layout()->setMargin( 0 );
+ gb->layout()->setSpacing( 0 );
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( gb->tqlayout() );
+ l = new TQHBoxLayout( gb->layout() );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
- l->tqsetAlignment( AlignTop );
+ l->setAlignment( AlignTop );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case VBox:
- l = new TQVBoxLayout( gb->tqlayout(), spacing );
+ l = new TQVBoxLayout( gb->layout(), spacing );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
- l->tqsetAlignment( AlignTop );
+ l->setAlignment( AlignTop );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case Grid:
- l = new QDesignerGridLayout( gb->tqlayout() );
+ l = new QDesignerGridLayout( gb->layout() );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
- l->tqsetAlignment( AlignTop );
+ l->setAlignment( AlignTop );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
default:
return 0;
}
} else {
- if ( tqlayout ) {
+ if ( layout ) {
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( tqlayout );
+ l = new TQHBoxLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case VBox:
- l = new TQVBoxLayout( tqlayout );
+ l = new TQVBoxLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case Grid: {
- l = new QDesignerGridLayout( tqlayout );
+ l = new QDesignerGridLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
@@ -819,7 +819,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
widget = ((TQMainWindow*)widget)->centralWidget();
if ( widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- delete widget->tqlayout();
+ delete widget->layout();
}
/*! Factory functions for creating a widget of the type \a className
@@ -838,7 +838,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (init)
{
b = new QDesignerPushButton(parent, name);
- b->setText(TQString::tqfromLatin1(name));
+ b->setText(TQString::fromLatin1(name));
} else
{
b = new QDesignerPushButton(parent, name);
@@ -860,7 +860,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (init)
{
QDesignerCheckBox *cb = new QDesignerCheckBox(parent, name);
- cb->setText(TQString::tqfromLatin1(name));
+ cb->setText(TQString::fromLatin1(name));
return cb;
}
return new QDesignerCheckBox(parent, name);
@@ -869,19 +869,19 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
if (init)
{
QDesignerRadioButton *rb = new QDesignerRadioButton(parent, name);
- rb->setText(TQString::tqfromLatin1(name));
+ rb->setText(TQString::fromLatin1(name));
return rb;
}
return new QDesignerRadioButton(parent, name);
} else if (className == TQGROUPBOX_OBJECT_NAME_STRING)
{
if (init)
- return new TQGroupBox(TQString::tqfromLatin1(name), parent, name);
+ return new TQGroupBox(TQString::fromLatin1(name), parent, name);
return new TQGroupBox(parent, name);
} else if (className == TQBUTTONGROUP_OBJECT_NAME_STRING)
{
if (init)
- return new TQButtonGroup(TQString::tqfromLatin1(name), parent, name);
+ return new TQButtonGroup(TQString::fromLatin1(name), parent, name);
return new TQButtonGroup(parent, name);
} else if (className == TQICONVIEW_OBJECT_NAME_STRING)
{
@@ -950,7 +950,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
QDesignerLabel *l = new QDesignerLabel(parent, name);
if (init)
{
- l->setText(TQString::tqfromLatin1(name));
+ l->setText(TQString::fromLatin1(name));
MetaDataBase::addEntry(TQT_TQOBJECT(l));
MetaDataBase::setPropertyChanged(TQT_TQOBJECT(l), "text", true);
}
@@ -1257,14 +1257,14 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
-/*! 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.
+/*! 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.
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout )
{
- tqlayout = 0;
+ layout = 0;
if ( w && w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
w = ((TQTabWidget*)w)->currentPage();
@@ -1280,9 +1280,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
if ( w && w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox;
- if ( !w || !w->tqlayout() )
+ if ( !w || !w->layout() )
return NoLayout;
- TQLayout *lay = w->tqlayout();
+ TQLayout *lay = w->layout();
if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING );
@@ -1290,7 +1290,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
lay = (TQLayout*)l->first();
delete l;
}
- tqlayout = lay;
+ layout = lay;
if ( lay->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
@@ -1304,13 +1304,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
{
- if ( tqlayout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
- else if ( tqlayout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox;
- else if ( tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid;
return NoLayout;
}
@@ -1325,9 +1325,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
}
-TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout )
+TQWidget *WidgetFactory::layoutParent( TQLayout *layout )
{
- TQObject *o = TQT_TQOBJECT(tqlayout);
+ TQObject *o = TQT_TQOBJECT(layout);
while ( o ) {
if ( o->isWidgetType() )
return (TQWidget*)o;
@@ -1336,7 +1336,7 @@ TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout )
return 0;
}
-/*! Returns the widget into which tqchildren should be inserted when \a
+/*! Returns the widget into which children 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
@@ -1668,7 +1668,7 @@ bool WidgetFactory::canResetProperty( TQObject *w, const TQString &propName )
bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName )
{
- const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->
+ const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->
findProperty( propName, true ), true );
if (!p )
return false;
@@ -1678,10 +1678,10 @@ bool WidgetFactory::resetProperty( TQObject *w, const TQString &propName )
TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
{
if ( propName == "wordwrap" ) {
- int v = defaultValue( w, "tqalignment" ).toInt();
+ int v = defaultValue( w, "alignment" ).toInt();
return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
} else if ( propName == "toolTip" || propName == "whatsThis" ) {
- return TQVariant( TQString::tqfromLatin1( "" ) );
+ return TQVariant( TQString::fromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) {
return TQVariant();
} else if ( propName == "frameworkCode" ) {
@@ -1701,10 +1701,10 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
TQString WidgetFactory::defaultCurrentItem( TQObject *w, const TQString &propName )
{
- const TQMetaProperty *p = w->tqmetaObject()->
- property( w->tqmetaObject()->findProperty( propName, true ), true );
+ const TQMetaProperty *p = w->metaObject()->
+ property( w->metaObject()->findProperty( propName, true ), true );
if ( !p ) {
- int v = defaultValue( w, "tqalignment" ).toInt();
+ int v = defaultValue( w, "alignment" ).toInt();
if ( propName == "hAlign" ) {
if ( ( v & AlignAuto ) == AlignAuto )
return "AlignAuto";
@@ -1751,7 +1751,7 @@ void QDesignerLabel::updateBuddy()
if ( myBuddy.isEmpty() )
return;
- TQObjectList *l = tqtopLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, false, true );
+ TQObjectList *l = topLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, false, true );
if ( !l || !l->first() ) {
delete l;
return;
@@ -1793,14 +1793,14 @@ bool TQLayoutWidget::event( TQEvent *e )
/*
This function must be called on TQLayoutWidget creation and whenever
- the TQLayoutWidget's parent tqlayout changes (e.g., from a TQHBoxLayout
+ the TQLayoutWidget's parent layout changes (e.g., from a TQHBoxLayout
to a TQVBoxLayout), because of the (illogical) way layouting works.
*/
void TQLayoutWidget::updateSizePolicy()
{
TQObjectList clo = childrenListObject();
if ( clo.isEmpty() || clo.count() == 0 ) {
- sp = TQWidget::tqsizePolicy();
+ sp = TQWidget::sizePolicy();
return;
}
@@ -1817,14 +1817,14 @@ void TQLayoutWidget::updateSizePolicy()
int ht = (int) TQSizePolicy::Preferred;
int vt = (int) TQSizePolicy::Preferred;
- if ( tqlayout() ) {
+ if ( layout() ) {
/*
- parentLayout is set to the parent tqlayout if there is one and if it is
+ parentLayout is set to the parent layout if there is one and if it is
top level, in which case layouting is illogical.
*/
TQLayout *parentLayout = 0;
if ( parent() && parent()->isWidgetType() ) {
- parentLayout = ((TQWidget *)parent())->tqlayout();
+ parentLayout = ((TQWidget *)parent())->layout();
if ( parentLayout && parentLayout->mainWidget()->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) )
parentLayout = 0;
}
@@ -1832,7 +1832,7 @@ void TQLayoutWidget::updateSizePolicy()
TQObjectListIt it( childrenListObject() );
TQObject *o;
- if ( tqlayout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( layout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) )
vt = TQSizePolicy::Minimum;
else
@@ -1844,16 +1844,16 @@ void TQLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( !w->tqsizePolicy().mayGrowHorizontally() )
+ if ( !w->sizePolicy().mayGrowHorizontally() )
ht &= ~TQSizePolicy::Minimum;
- if ( !w->tqsizePolicy().mayShrinkHorizontally() )
+ if ( !w->sizePolicy().mayShrinkHorizontally() )
ht &= ~TQSizePolicy::Maximum;
- if ( w->tqsizePolicy().mayGrowVertically() )
+ if ( w->sizePolicy().mayGrowVertically() )
vt |= TQSizePolicy::Minimum;
- if ( w->tqsizePolicy().mayShrinkVertically() )
+ if ( w->sizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum;
}
- } else if ( tqlayout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) {
+ } else if ( layout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) )
ht = TQSizePolicy::Minimum;
else
@@ -1865,16 +1865,16 @@ void TQLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( w->tqsizePolicy().mayGrowHorizontally() )
+ if ( w->sizePolicy().mayGrowHorizontally() )
ht |= TQSizePolicy::Minimum;
- if ( w->tqsizePolicy().mayShrinkHorizontally() )
+ if ( w->sizePolicy().mayShrinkHorizontally() )
ht |= TQSizePolicy::Maximum;
- if ( !w->tqsizePolicy().mayGrowVertically() )
+ if ( !w->sizePolicy().mayGrowVertically() )
vt &= ~TQSizePolicy::Minimum;
- if ( !w->tqsizePolicy().mayShrinkVertically() )
+ if ( !w->sizePolicy().mayShrinkVertically() )
vt &= ~TQSizePolicy::Maximum;
}
- } else if ( tqlayout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ } else if ( layout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
ht = TQSizePolicy::Fixed;
vt = TQSizePolicy::Fixed;
if ( parentLayout ) {
@@ -1890,29 +1890,29 @@ void TQLayoutWidget::updateSizePolicy()
continue;
TQWidget *w = (TQWidget*)o;
- if ( w->tqsizePolicy().mayGrowHorizontally() )
+ if ( w->sizePolicy().mayGrowHorizontally() )
ht |= TQSizePolicy::Minimum;
- if ( w->tqsizePolicy().mayShrinkHorizontally() )
+ if ( w->sizePolicy().mayShrinkHorizontally() )
ht |= TQSizePolicy::Maximum;
- if ( w->tqsizePolicy().mayGrowVertically() )
+ if ( w->sizePolicy().mayGrowVertically() )
vt |= TQSizePolicy::Minimum;
- if ( w->tqsizePolicy().mayShrinkVertically() )
+ if ( w->sizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum;
}
}
#ifdef USE_QT4
- if ( tqlayout()->expandingDirections() & TQSizePolicy::Horizontally )
+ if ( layout()->expanding() & TQSizePolicy::Horizontally )
ht = TQSizePolicy::Expanding;
- if ( tqlayout()->expandingDirections() & TQSizePolicy::Vertically )
+ if ( layout()->expanding() & TQSizePolicy::Vertically )
vt = TQSizePolicy::Expanding;
#else // USE_QT4
- if ( tqlayout()->expanding() & TQSizePolicy::Horizontally )
+ if ( layout()->expanding() & TQSizePolicy::Horizontally )
ht = TQSizePolicy::Expanding;
- if ( tqlayout()->expanding() & TQSizePolicy::Vertically )
+ if ( layout()->expanding() & TQSizePolicy::Vertically )
vt = TQSizePolicy::Expanding;
#endif // USE_QT4
- tqlayout()->tqinvalidate();
+ layout()->invalidate();
}
sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt );
@@ -1925,7 +1925,7 @@ void CustomWidget::paintEvent( TQPaintEvent *e )
( (FormWindow*)parentWidget() )->paintGrid( this, e );
} else {
TQPainter p( this );
- p.fillRect( rect(), tqcolorGroup().dark() );
+ p.fillRect( rect(), colorGroup().dark() );
p.drawPixmap( ( width() - cusw->pixmap->width() ) / 2,
( height() - cusw->pixmap->height() ) / 2,
*cusw->pixmap );