summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/connectionitems.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/connectionitems.cpp')
-rw-r--r--kdevdesigner/designer/connectionitems.cpp220
1 files changed, 110 insertions, 110 deletions
diff --git a/kdevdesigner/designer/connectionitems.cpp b/kdevdesigner/designer/connectionitems.cpp
index 197eef65..9f1c3fa6 100644
--- a/kdevdesigner/designer/connectionitems.cpp
+++ b/kdevdesigner/designer/connectionitems.cpp
@@ -30,30 +30,30 @@
#include "metadatabase.h"
#include "widgetfactory.h"
#include "project.h"
-#include <qpainter.h>
-#include <qcombobox.h>
-#include <qmetaobject.h>
-#include <qcombobox.h>
-#include <qlistbox.h>
-#include <qaction.h>
-#include <qdatabrowser.h>
+#include <tqpainter.h>
+#include <tqcombobox.h>
+#include <tqmetaobject.h>
+#include <tqcombobox.h>
+#include <tqlistbox.h>
+#include <tqaction.h>
+#include <tqdatabrowser.h>
static const char* const ignore_slots[] = {
"destroyed()",
- "setCaption(const QString&)",
- "setIcon(const QPixmap&)",
- "setIconText(const QString&)",
+ "setCaption(const TQString&)",
+ "setIcon(const TQPixmap&)",
+ "setIconText(const TQString&)",
"setMouseTracking(bool)",
"clearFocus()",
"setUpdatesEnabled(bool)",
"update()",
"update(int,int,int,int)",
- "update(const QRect&)",
+ "update(const TQRect&)",
"repaint()",
"repaint(bool)",
"repaint(int,int,int,int,bool)",
- "repaint(const QRect&,bool)",
- "repaint(const QRegion&,bool)",
+ "repaint(const TQRect&,bool)",
+ "repaint(const TQRegion&,bool)",
"show()",
"hide()",
"iconify()",
@@ -65,91 +65,91 @@ static const char* const ignore_slots[] = {
"constPolish()",
"raise()",
"lower()",
- "stackUnder(QWidget*)",
+ "stackUnder(TQWidget*)",
"move(int,int)",
- "move(const QPoint&)",
+ "move(const TQPoint&)",
"resize(int,int)",
- "resize(const QSize&)",
+ "resize(const TQSize&)",
"setGeometry(int,int,int,int)",
- "setGeometry(const QRect&)",
+ "setGeometry(const TQRect&)",
"focusProxyDestroyed()",
"showExtension(bool)",
"setUpLayout()",
- "showDockMenu(const QPoint&)",
+ "showDockMenu(const TQPoint&)",
"init()",
"destroy()",
"deleteLater()",
0
};
-ConnectionItem::ConnectionItem( QTable *table, FormWindow *fw )
- : QComboTableItem( table, QStringList(), FALSE ), formWindow( fw ), conn( 0 )
+ConnectionItem::ConnectionItem( TQTable *table, FormWindow *fw )
+ : TQComboTableItem( table, TQStringList(), FALSE ), formWindow( fw ), conn( 0 )
{
setReplaceable( FALSE );
}
-void ConnectionItem::senderChanged( QObject * )
+void ConnectionItem::senderChanged( TQObject * )
{
emit changed();
- QWidget *w = table()->cellWidget( row(), col() );
+ TQWidget *w = table()->cellWidget( row(), col() );
if ( w )
setContentFromEditor( w );
}
-void ConnectionItem::receiverChanged( QObject * )
+void ConnectionItem::receiverChanged( TQObject * )
{
emit changed();
- QWidget *w = table()->cellWidget( row(), col() );
+ TQWidget *w = table()->cellWidget( row(), col() );
if ( w )
setContentFromEditor( w );
}
-void ConnectionItem::signalChanged( const QString & )
+void ConnectionItem::signalChanged( const TQString & )
{
emit changed();
- QWidget *w = table()->cellWidget( row(), col() );
+ TQWidget *w = table()->cellWidget( row(), col() );
if ( w )
setContentFromEditor( w );
}
-void ConnectionItem::slotChanged( const QString & )
+void ConnectionItem::slotChanged( const TQString & )
{
emit changed();
- QWidget *w = table()->cellWidget( row(), col() );
+ TQWidget *w = table()->cellWidget( row(), col() );
if ( w )
setContentFromEditor( w );
}
void ConnectionItem::setSender( SenderItem *i )
{
- connect( i, SIGNAL( currentSenderChanged( QObject * ) ),
- this, SLOT( senderChanged( QObject * ) ) );
+ connect( i, TQT_SIGNAL( currentSenderChanged( TQObject * ) ),
+ this, TQT_SLOT( senderChanged( TQObject * ) ) );
}
void ConnectionItem::setReceiver( ReceiverItem *i )
{
- connect( i, SIGNAL( currentReceiverChanged( QObject * ) ),
- this, SLOT( receiverChanged( QObject * ) ) );
+ connect( i, TQT_SIGNAL( currentReceiverChanged( TQObject * ) ),
+ this, TQT_SLOT( receiverChanged( TQObject * ) ) );
}
void ConnectionItem::setSignal( SignalItem *i )
{
- connect( i, SIGNAL( currentSignalChanged( const QString & ) ),
- this, SLOT( signalChanged( const QString & ) ) );
+ connect( i, TQT_SIGNAL( currentSignalChanged( const TQString & ) ),
+ this, TQT_SLOT( signalChanged( const TQString & ) ) );
}
void ConnectionItem::setSlot( SlotItem *i )
{
- connect( i, SIGNAL( currentSlotChanged( const QString & ) ),
- this, SLOT( slotChanged( const QString & ) ) );
+ connect( i, TQT_SIGNAL( currentSlotChanged( const TQString & ) ),
+ this, TQT_SLOT( slotChanged( const TQString & ) ) );
}
-void ConnectionItem::paint( QPainter *p, const QColorGroup &cg,
- const QRect &cr, bool selected )
+void ConnectionItem::paint( TQPainter *p, const TQColorGroup &cg,
+ const TQRect &cr, bool selected )
{
p->fillRect( 0, 0, cr.width(), cr.height(),
- selected ? cg.brush( QColorGroup::Highlight )
- : cg.brush( QColorGroup::Base ) );
+ selected ? cg.brush( TQColorGroup::Highlight )
+ : cg.brush( TQColorGroup::Base ) );
int w = cr.width();
int h = cr.height();
@@ -157,14 +157,14 @@ void ConnectionItem::paint( QPainter *p, const QColorGroup &cg,
int x = 0;
if ( currentText()[0] == '<' )
- p->setPen( QObject::red );
+ p->setPen( TQObject::red );
else if ( selected )
p->setPen( cg.highlightedText() );
else
p->setPen( cg.text() );
- QFont f( p->font() );
- QFont oldf( p->font() );
+ TQFont f( p->font() );
+ TQFont oldf( p->font() );
if ( conn && conn->isModified() ) {
f.setBold( TRUE );
p->setFont( f );
@@ -181,29 +181,29 @@ void ConnectionItem::setConnection( ConnectionContainer *c )
// ------------------------------------------------------------------
-static void appendChildActions( QAction *action, QStringList &lst )
+static void appendChildActions( TQAction *action, TQStringList &lst )
{
- QObjectListIt it( *action->children() );
+ TQObjectListIt it( *action->children() );
while ( it.current() ) {
- QObject *o = it.current();
+ TQObject *o = it.current();
++it;
- if ( !::qt_cast<QAction*>(o) )
+ if ( !::qt_cast<TQAction*>(o) )
continue;
lst << o->name();
- if ( o->children() && ::qt_cast<QActionGroup*>(o) )
- appendChildActions( (QAction*)o, lst );
+ if ( o->children() && ::qt_cast<TQActionGroup*>(o) )
+ appendChildActions( (TQAction*)o, lst );
}
}
-static QStringList flatActions( const QPtrList<QAction> &l )
+static TQStringList flatActions( const TQPtrList<TQAction> &l )
{
- QStringList lst;
+ TQStringList lst;
- QPtrListIterator<QAction> it( l );
+ TQPtrListIterator<TQAction> it( l );
while ( it.current() ) {
- QAction *action = it.current();
+ TQAction *action = it.current();
lst << action->name();
- if ( action->children() && ::qt_cast<QActionGroup*>(action) )
+ if ( action->children() && ::qt_cast<TQActionGroup*>(action) )
appendChildActions( action, lst );
++it;
}
@@ -213,18 +213,18 @@ static QStringList flatActions( const QPtrList<QAction> &l )
// ------------------------------------------------------------------
-SenderItem::SenderItem( QTable *table, FormWindow *fw )
+SenderItem::SenderItem( TQTable *table, FormWindow *fw )
: ConnectionItem( table, fw )
{
- QStringList lst;
+ TQStringList lst;
- QPtrDictIterator<QWidget> it( *formWindow->widgets() );
+ TQPtrDictIterator<TQWidget> it( *formWindow->widgets() );
while ( it.current() ) {
if ( lst.find( it.current()->name() ) != lst.end() ) {
++it;
continue;
}
- if ( !QString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
!::qt_cast<QLayoutWidget*>(it.current()) &&
!::qt_cast<Spacer*>(it.current()) &&
!::qt_cast<SizeHandle*>(it.current()) &&
@@ -241,24 +241,24 @@ SenderItem::SenderItem( QTable *table, FormWindow *fw )
setStringList( lst );
}
-QWidget *SenderItem::createEditor() const
+TQWidget *SenderItem::createEditor() const
{
- QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
- connect( cb, SIGNAL( activated( const QString & ) ),
- this, SLOT( senderChanged( const QString & ) ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( senderChanged( const TQString & ) ) );
return cb;
}
-void SenderItem::setSenderEx( QObject *sender )
+void SenderItem::setSenderEx( TQObject *sender )
{
setCurrentItem( sender->name() );
emit currentSenderChanged( sender );
}
-void SenderItem::senderChanged( const QString &sender )
+void SenderItem::senderChanged( const TQString &sender )
{
- QObject *o = formWindow->child( sender, "QObject" );
+ TQObject *o = formWindow->child( sender, "TQObject" );
if ( !o )
o = formWindow->findAction( sender );
if ( !o )
@@ -270,18 +270,18 @@ void SenderItem::senderChanged( const QString &sender )
// ------------------------------------------------------------------
-ReceiverItem::ReceiverItem( QTable *table, FormWindow *fw )
+ReceiverItem::ReceiverItem( TQTable *table, FormWindow *fw )
: ConnectionItem( table, fw )
{
- QStringList lst;
+ TQStringList lst;
- QPtrDictIterator<QWidget> it( *formWindow->widgets() );
+ TQPtrDictIterator<TQWidget> it( *formWindow->widgets() );
while ( it.current() ) {
if ( lst.find( it.current()->name() ) != lst.end() ) {
++it;
continue;
}
- if ( !QString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
!::qt_cast<QLayoutWidget*>(it.current()) &&
!::qt_cast<Spacer*>(it.current()) &&
!::qt_cast<SizeHandle*>(it.current()) &&
@@ -298,24 +298,24 @@ ReceiverItem::ReceiverItem( QTable *table, FormWindow *fw )
setStringList( lst );
}
-QWidget *ReceiverItem::createEditor() const
+TQWidget *ReceiverItem::createEditor() const
{
- QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
- connect( cb, SIGNAL( activated( const QString & ) ),
- this, SLOT( receiverChanged( const QString & ) ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( receiverChanged( const TQString & ) ) );
return cb;
}
-void ReceiverItem::setReceiverEx( QObject *receiver )
+void ReceiverItem::setReceiverEx( TQObject *receiver )
{
setCurrentItem( receiver->name() );
emit currentReceiverChanged( receiver );
}
-void ReceiverItem::receiverChanged( const QString &receiver )
+void ReceiverItem::receiverChanged( const TQString &receiver )
{
- QObject *o = formWindow->child( receiver, "QObject" );
+ TQObject *o = formWindow->child( receiver, "TQObject" );
if ( !o )
o = formWindow->findAction( receiver );
if ( !o )
@@ -327,34 +327,34 @@ void ReceiverItem::receiverChanged( const QString &receiver )
// ------------------------------------------------------------------
-SignalItem::SignalItem( QTable *table, FormWindow *fw )
+SignalItem::SignalItem( TQTable *table, FormWindow *fw )
: ConnectionItem( table, fw )
{
- QStringList lst;
+ TQStringList lst;
lst << "<No Signal>";
lst.sort();
setStringList( lst );
}
-void SignalItem::senderChanged( QObject *sender )
+void SignalItem::senderChanged( TQObject *sender )
{
- QStrList sigs = sender->metaObject()->signalNames( TRUE );
+ TQStrList sigs = sender->metaObject()->signalNames( TRUE );
sigs.remove( "destroyed()" );
- sigs.remove( "destroyed(QObject*)" );
+ sigs.remove( "destroyed(TQObject*)" );
sigs.remove( "accessibilityChanged(int)" );
sigs.remove( "accessibilityChanged(int,int)" );
- QStringList lst = QStringList::fromStrList( sigs );
+ TQStringList lst = TQStringList::fromStrList( sigs );
if ( ::qt_cast<CustomWidget*>(sender) ) {
MetaDataBase::CustomWidget *w = ( (CustomWidget*)sender )->customWidget();
- for ( QValueList<QCString>::Iterator it = w->lstSignals.begin();
+ for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin();
it != w->lstSignals.end(); ++it )
lst << MetaDataBase::normalizeFunction( *it );
}
if ( sender == formWindow->mainContainer() ) {
- QStringList extra = MetaDataBase::signalList( formWindow );
+ TQStringList extra = MetaDataBase::signalList( formWindow );
if ( !extra.isEmpty() )
lst += extra;
}
@@ -367,21 +367,21 @@ void SignalItem::senderChanged( QObject *sender )
ConnectionItem::senderChanged( sender );
}
-QWidget *SignalItem::createEditor() const
+TQWidget *SignalItem::createEditor() const
{
- QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
- connect( cb, SIGNAL( activated( const QString & ) ),
- this, SIGNAL( currentSignalChanged( const QString & ) ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SIGNAL( currentSignalChanged( const TQString & ) ) );
return cb;
}
// ------------------------------------------------------------------
-SlotItem::SlotItem( QTable *table, FormWindow *fw )
+SlotItem::SlotItem( TQTable *table, FormWindow *fw )
: ConnectionItem( table, fw )
{
- QStringList lst;
+ TQStringList lst;
lst << "<No Slot>";
lst.sort();
setStringList( lst );
@@ -390,14 +390,14 @@ SlotItem::SlotItem( QTable *table, FormWindow *fw )
lastSignal = "<No Signal>";
}
-void SlotItem::receiverChanged( QObject *receiver )
+void SlotItem::receiverChanged( TQObject *receiver )
{
lastReceiver = receiver;
updateSlotList();
ConnectionItem::receiverChanged( receiver );
}
-void SlotItem::signalChanged( const QString &signal )
+void SlotItem::signalChanged( const TQString &signal )
{
lastSignal = signal;
updateSlotList();
@@ -408,7 +408,7 @@ bool SlotItem::ignoreSlot( const char* slot ) const
{
#ifndef QT_NO_SQL
if ( qstrcmp( slot, "update()" ) == 0 &&
- ::qt_cast<QDataBrowser*>(lastReceiver) )
+ ::qt_cast<TQDataBrowser*>(lastReceiver) )
return FALSE;
#endif
@@ -417,14 +417,14 @@ bool SlotItem::ignoreSlot( const char* slot ) const
return TRUE;
}
- if ( !formWindow->isMainContainer( (QWidget*)lastReceiver ) ) {
+ if ( !formWindow->isMainContainer( (TQWidget*)lastReceiver ) ) {
if ( qstrcmp( slot, "close()" ) == 0 )
return TRUE;
}
if ( qstrcmp( slot, "setFocus()" ) == 0 )
if ( lastReceiver->isWidgetType() &&
- ( (QWidget*)lastReceiver )->focusPolicy() == QWidget::NoFocus )
+ ( (TQWidget*)lastReceiver )->focusPolicy() == TQWidget::NoFocus )
return TRUE;
return FALSE;
@@ -432,7 +432,7 @@ bool SlotItem::ignoreSlot( const char* slot ) const
void SlotItem::updateSlotList()
{
- QStringList lst;
+ TQStringList lst;
if ( !lastReceiver || lastSignal == "<No Signal>" ) {
lst << "<No Slot>";
lst.sort();
@@ -440,15 +440,15 @@ void SlotItem::updateSlotList()
return;
}
- QString signal = MetaDataBase::normalizeFunction( lastSignal );
+ TQString signal = MetaDataBase::normalizeFunction( lastSignal );
int n = lastReceiver->metaObject()->numSlots( TRUE );
- QStringList slts;
+ TQStringList slts;
for( int i = 0; i < n; ++i ) {
// accept only public slots. For the form window, also accept protected slots
const QMetaData* md = lastReceiver->metaObject()->slot( i, TRUE );
if ( ( (lastReceiver->metaObject()->slot( i, TRUE )->access == QMetaData::Public) ||
- (formWindow->isMainContainer( (QWidget*)lastReceiver ) &&
+ (formWindow->isMainContainer( (TQWidget*)lastReceiver ) &&
lastReceiver->metaObject()->slot(i, TRUE)->access ==
QMetaData::Protected) ) &&
!ignoreSlot( md->name ) &&
@@ -460,12 +460,12 @@ void SlotItem::updateSlotList()
LanguageInterface *iface =
MetaDataBase::languageInterface( formWindow->project()->language() );
if ( !iface || iface->supports( LanguageInterface::ConnectionsToCustomSlots ) ) {
- if ( formWindow->isMainContainer( (QWidget*)lastReceiver ) ) {
- QValueList<MetaDataBase::Function> moreSlots = MetaDataBase::slotList( formWindow );
+ if ( formWindow->isMainContainer( (TQWidget*)lastReceiver ) ) {
+ TQValueList<MetaDataBase::Function> moreSlots = MetaDataBase::slotList( formWindow );
if ( !moreSlots.isEmpty() ) {
- for ( QValueList<MetaDataBase::Function>::Iterator it = moreSlots.begin();
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = moreSlots.begin();
it != moreSlots.end(); ++it ) {
- QCString s = (*it).function;
+ TQCString s = (*it).function;
if ( !s.data() )
continue;
s = MetaDataBase::normalizeFunction( s );
@@ -480,9 +480,9 @@ void SlotItem::updateSlotList()
if ( ::qt_cast<CustomWidget*>(lastReceiver) ) {
MetaDataBase::CustomWidget *w = ( (CustomWidget*)lastReceiver )->customWidget();
- for ( QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin();
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin();
it != w->lstSlots.end(); ++it ) {
- QCString s = (*it).function;
+ TQCString s = (*it).function;
if ( !s.data() )
continue;
s = MetaDataBase::normalizeFunction( s );
@@ -498,18 +498,18 @@ void SlotItem::updateSlotList()
setStringList( lst );
}
-QWidget *SlotItem::createEditor() const
+TQWidget *SlotItem::createEditor() const
{
- QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
- connect( cb, SIGNAL( activated( const QString & ) ),
- this, SIGNAL( currentSlotChanged( const QString & ) ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SIGNAL( currentSlotChanged( const TQString & ) ) );
return cb;
}
void SlotItem::customSlotsChanged()
{
- QString currSlot = currentText();
+ TQString currSlot = currentText();
updateSlotList();
setCurrentItem( "<No Slot>" );
setCurrentItem( currSlot );