diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /kommander/editor/connectioneditorimpl.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/connectioneditorimpl.cpp')
-rw-r--r-- | kommander/editor/connectioneditorimpl.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/kommander/editor/connectioneditorimpl.cpp b/kommander/editor/connectioneditorimpl.cpp index dafae5a7..a430290e 100644 --- a/kommander/editor/connectioneditorimpl.cpp +++ b/kommander/editor/connectioneditorimpl.cpp @@ -23,9 +23,9 @@ #include "command.h" #include "widgetfactory.h" #include "pixmapchooser.h" -#include <qmetaobject.h> -#include <qlabel.h> -#include <qregexp.h> +#include <tqmetaobject.h> +#include <tqlabel.h> +#include <tqregexp.h> #include <klistbox.h> #include <klistview.h> @@ -35,23 +35,23 @@ 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)", "repaint(int,int,int,int)", - "repaint(const QRect&)", - "repaint(const QRegion&)", + "repaint(const TQRect&)", + "repaint(const TQRegion&)", //"show()", //"hide()", "iconify()", @@ -63,17 +63,17 @@ 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()", @@ -82,14 +82,14 @@ static const char *const ignore_slots[] = { static const char *const ignore_signals[] = { "destroyed()", - "destroyed(QObject*)", + "destroyed(TQObject*)", "accessibilityChanged(int)", "accessibilityChanged(int,int)", 0 }; -ConnectionEditor::ConnectionEditor(QWidget* parent, QObject* sndr, QObject* rcvr, FormWindow* fw) +ConnectionEditor::ConnectionEditor(TQWidget* parent, TQObject* sndr, TQObject* rcvr, FormWindow* fw) : ConnectionEditorBase(parent, 0, true), m_formWindow(fw) { if (!rcvr || rcvr == m_formWindow) @@ -100,9 +100,9 @@ ConnectionEditor::ConnectionEditor(QWidget* parent, QObject* sndr, QObject* rcvr m_receiver = rcvr; /* Create widget list */ - QStringList lst; + TQStringList lst; lst << m_formWindow->name(); - for (QPtrDictIterator<QWidget> it(*m_formWindow->widgets()); it.current(); ++it) + for (TQPtrDictIterator<TQWidget> it(*m_formWindow->widgets()); it.current(); ++it) { if (it.current()->isVisibleTo(this) && !it.current()->inherits("QLayoutWidget") && @@ -117,7 +117,7 @@ ConnectionEditor::ConnectionEditor(QWidget* parent, QObject* sndr, QObject* rcvr // fillWidgetList(comboReceiver, lst, m_receiver->name()); // Fill receiver combos with widget and action list - for (QPtrListIterator<QAction> it(m_formWindow->actionList()); it.current(); ++it) + for (TQPtrListIterator<TQAction> it(m_formWindow->actionList()); it.current(); ++it) lst << it.current()->name(); lst.sort(); fillWidgetList(comboReceiver, lst, m_receiver->name()); @@ -128,16 +128,16 @@ ConnectionEditor::ConnectionEditor(QWidget* parent, QObject* sndr, QObject* rcvr updateDisconnectButton(); // Connections - connect(comboSender, SIGNAL(activated(const QString&)), SLOT(senderChanged(const QString&))); - connect(comboReceiver, SIGNAL(activated(const QString&)), SLOT(receiverChanged(const QString&))); - connect(signalBox, SIGNAL(selectionChanged()), SLOT(updateConnectButton())); - connect(slotBox, SIGNAL(selectionChanged()), SLOT(updateConnectButton())); - connect(connectButton, SIGNAL(clicked()), SLOT(connectClicked())); - connect(disconnectButton, SIGNAL(clicked()), SLOT(disconnectClicked())); - connect(okButton, SIGNAL(clicked()), SLOT(okClicked())); - connect(cancelButton, SIGNAL(clicked()), SLOT(cancelClicked())); - connect(signalBox, SIGNAL(doubleClicked(QListBoxItem*)), SLOT(connectClicked())); - connect(slotBox, SIGNAL(doubleClicked(QListBoxItem*)), SLOT(connectClicked())); + connect(comboSender, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(senderChanged(const TQString&))); + connect(comboReceiver, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(receiverChanged(const TQString&))); + connect(signalBox, TQT_SIGNAL(selectionChanged()), TQT_SLOT(updateConnectButton())); + connect(slotBox, TQT_SIGNAL(selectionChanged()), TQT_SLOT(updateConnectButton())); + connect(connectButton, TQT_SIGNAL(clicked()), TQT_SLOT(connectClicked())); + connect(disconnectButton, TQT_SIGNAL(clicked()), TQT_SLOT(disconnectClicked())); + connect(okButton, TQT_SIGNAL(clicked()), TQT_SLOT(okClicked())); + connect(cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(cancelClicked())); + connect(signalBox, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), TQT_SLOT(connectClicked())); + connect(slotBox, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), TQT_SLOT(connectClicked())); } ConnectionEditor::~ConnectionEditor() @@ -155,15 +155,15 @@ bool ConnectionEditor::isSignalIgnored(const char *signal) const bool ConnectionEditor::isSlotIgnored(const QMetaData* md) { if (md->access != QMetaData::Public && (md->access != QMetaData::Protected || - !m_formWindow->isMainContainer((QWidget*)m_receiver))) + !m_formWindow->isMainContainer((TQWidget*)m_receiver))) return true; for (int i = 0; ignore_slots[i]; i++) if (!qstrcmp(md->name, ignore_slots[i])) return true; - if (!m_formWindow->isMainContainer((QWidget *)m_receiver) && !qstrcmp(md->name, "close()")) + if (!m_formWindow->isMainContainer((TQWidget *)m_receiver) && !qstrcmp(md->name, "close()")) return true; if (!qstrcmp(md->name, "setFocus()") && m_receiver->isWidgetType() && - ((QWidget*)m_receiver)->focusPolicy() == QWidget::NoFocus) + ((TQWidget*)m_receiver)->focusPolicy() == TQWidget::NoFocus) return true; for (int i = 0; i<comboSender->count(); i++) if (checkConnectArgs(MetaDataBase::normalizeSlot(signalBox->text(i)).latin1(), m_receiver, md->name)) @@ -171,14 +171,14 @@ bool ConnectionEditor::isSlotIgnored(const QMetaData* md) return true; } -QObject* ConnectionEditor::objectByName(const QString& s) const +TQObject* ConnectionEditor::objectByName(const TQString& s) const { - for (QPtrDictIterator <QWidget> it(*m_formWindow->widgets()); it.current(); ++it) - if (QString(it.current()->name()) == s) + for (TQPtrDictIterator <TQWidget> it(*m_formWindow->widgets()); it.current(); ++it) + if (TQString(it.current()->name()) == s) return it.current(); - for (QPtrListIterator<QAction> it(m_formWindow->actionList()); it.current(); ++it) - if (QString(it.current()->name()) == s) + for (TQPtrListIterator<TQAction> it(m_formWindow->actionList()); it.current(); ++it) + if (TQString(it.current()->name()) == s) return it.current(); return 0; @@ -209,11 +209,11 @@ void ConnectionEditor::connectClicked() void ConnectionEditor::disconnectClicked() { - QListViewItem *p_item = connectionView->currentItem(); + TQListViewItem *p_item = connectionView->currentItem(); if (!p_item) return; - QMap <QListViewItem*, MetaDataBase::Connection>::Iterator it = m_connections.find(p_item); + TQMap <TQListViewItem*, MetaDataBase::Connection>::Iterator it = m_connections.find(p_item); if (it != m_connections.end()) m_connections.remove(it); delete p_item; @@ -226,20 +226,20 @@ void ConnectionEditor::disconnectClicked() void ConnectionEditor::okClicked() { MacroCommand* rmConn = 0, *addConn = 0; - QString n = i18n("Connect/Disconnect the signals and slots of '%1' and '%2'").arg(m_sender->name()). + TQString n = i18n("Connect/Disconnect the signals and slots of '%1' and '%2'").arg(m_sender->name()). arg(m_receiver->name()); - QValueList <MetaDataBase::Connection>::Iterator cit; + TQValueList <MetaDataBase::Connection>::Iterator cit; if (!m_oldConnections.isEmpty()) { - QPtrList <Command> commands; + TQPtrList <Command> commands; for (cit = m_oldConnections.begin(); cit != m_oldConnections.end(); ++cit) commands.append(new RemoveConnectionCommand(i18n("Remove Connection"), m_formWindow, *cit)); rmConn = new MacroCommand(i18n("Remove Connections"), m_formWindow, commands); } if (!m_connections.isEmpty()) { - QMap<QListViewItem*, MetaDataBase::Connection>::Iterator it = m_connections.begin(); - QPtrList<Command> commands; + TQMap<TQListViewItem*, MetaDataBase::Connection>::Iterator it = m_connections.begin(); + TQPtrList<Command> commands; for (; it != m_connections.end(); ++it) { MetaDataBase::Connection conn = *it; @@ -250,7 +250,7 @@ void ConnectionEditor::okClicked() if (rmConn || addConn) { - QPtrList < Command > commands; + TQPtrList < Command > commands; if (rmConn) commands.append(rmConn); if (addConn) @@ -268,15 +268,15 @@ void ConnectionEditor::cancelClicked() reject(); } -void ConnectionEditor::senderChanged(const QString& s) +void ConnectionEditor::senderChanged(const TQString& s) { - QObject* p_object = objectByName(s); + TQObject* p_object = objectByName(s); if (!p_object) return; m_sender = p_object; - QStrList p_sigs = m_sender->metaObject()->signalNames(true); + TQStrList p_sigs = m_sender->metaObject()->signalNames(true); signalBox->clear(); - for (QStrListIterator it(p_sigs); it.current(); ++it) + for (TQStrListIterator it(p_sigs); it.current(); ++it) if (!isSignalIgnored(it.current()) && !signalBox->findItem(it.current(), Qt::ExactMatch)) signalBox->insertItem(it.current()); if (m_sender == m_formWindow->mainContainer()) @@ -287,9 +287,9 @@ void ConnectionEditor::senderChanged(const QString& s) receiverChanged(m_receiver->name()); } -void ConnectionEditor::receiverChanged(const QString& s) +void ConnectionEditor::receiverChanged(const TQString& s) { - QObject* p_object = objectByName(s); + TQObject* p_object = objectByName(s); if (!p_object) return; m_receiver = p_object; @@ -321,10 +321,10 @@ void ConnectionEditor::updateDisconnectButton() disconnectButton->setEnabled((connectionView->currentItem())); } -bool ConnectionEditor::hasConnection(const QString& snder, const QString& signal, - const QString& rcvr, const QString& slot) const +bool ConnectionEditor::hasConnection(const TQString& snder, const TQString& signal, + const TQString& rcvr, const TQString& slot) const { - for (QListViewItemIterator it(connectionView); it.current(); ++it) + for (TQListViewItemIterator it(connectionView); it.current(); ++it) if (it.current()->text(0) == snder && it.current()->text(1) == signal && it.current()->text(2) == rcvr && it.current()->text(3) == slot) @@ -339,10 +339,10 @@ void ConnectionEditor::fillConnectionsList() m_oldConnections = MetaDataBase::connections(m_formWindow); if (!m_oldConnections.isEmpty()) { - QValueList <MetaDataBase::Connection>::Iterator it = m_oldConnections.begin(); + TQValueList <MetaDataBase::Connection>::Iterator it = m_oldConnections.begin(); for (; it != m_oldConnections.end(); ++it) { - if (m_formWindow->isMainContainer((QWidget*)(*it).receiver) && + if (m_formWindow->isMainContainer((TQWidget*)(*it).receiver) && !MetaDataBase::hasSlot(m_formWindow, MetaDataBase::normalizeSlot((*it).slot).latin1())) continue; MetaDataBase::Connection conn = *it; @@ -357,7 +357,7 @@ void ConnectionEditor::fillConnectionsList() connectionView->setSelected(connectionView->currentItem(), true); } -void ConnectionEditor::fillWidgetList(KComboBox* a_combo, const QStringList& items, const QString& defaultWidget) +void ConnectionEditor::fillWidgetList(KComboBox* a_combo, const TQStringList& items, const TQString& defaultWidget) { a_combo->insertStringList(items); for (int i = 0; i < a_combo->count(); ++i) |