summaryrefslogtreecommitdiffstats
path: root/src/simplemainwindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /src/simplemainwindow.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/simplemainwindow.cpp')
-rw-r--r--src/simplemainwindow.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/simplemainwindow.cpp b/src/simplemainwindow.cpp
index 73164f86..bca7766a 100644
--- a/src/simplemainwindow.cpp
+++ b/src/simplemainwindow.cpp
@@ -57,20 +57,20 @@
#include "editorproxy.h"
#include "multibuffer.h"
-SimpleMainWindow::SimpleMainWindow(TQWidget* parent, const char *name)
- :DMainWindow(parent, name)
+SimpleMainWindow::SimpleMainWindow(TQWidget* tqparent, const char *name)
+ :DMainWindow(tqparent, name)
{
resize(800, 600); // starts kdevelop at 800x600 the first time
- m_mainWindowShare = new MainWindowShare(this);
+ m_mainWindowShare = new MainWindowShare(TQT_TQOBJECT(this));
- connect(m_bottomDock, TQT_SIGNAL(hidden()), this, TQT_SLOT(raiseEditor()));
- connect(m_leftDock, TQT_SIGNAL(hidden()), this, TQT_SLOT(raiseEditor()));
- connect(m_rightDock, TQT_SIGNAL(hidden()), this, TQT_SLOT(raiseEditor()));
+ connect(m_bottomDock, TQT_SIGNAL(hidden()), TQT_TQOBJECT(this), TQT_SLOT(raiseEditor()));
+ connect(m_leftDock, TQT_SIGNAL(hidden()), TQT_TQOBJECT(this), TQT_SLOT(raiseEditor()));
+ connect(m_rightDock, TQT_SIGNAL(hidden()), TQT_TQOBJECT(this), TQT_SLOT(raiseEditor()));
}
SimpleMainWindow::~ SimpleMainWindow( )
{
- TopLevel::invalidateInstance( this );
+ TopLevel::tqinvalidateInstance( this );
}
void SimpleMainWindow::init()
@@ -105,19 +105,19 @@ void SimpleMainWindow::init()
i18n("Could Not Find Plugins") );
}
- connect(Core::getInstance(), TQT_SIGNAL(coreInitialized()), this, TQT_SLOT(slotCoreInitialized()));
- connect(Core::getInstance(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(projectOpened()));
- connect(Core::getInstance(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(projectClosed()));
+ connect(Core::getInstance(), TQT_SIGNAL(coreInitialized()), TQT_TQOBJECT(this), TQT_SLOT(slotCoreInitialized()));
+ connect(Core::getInstance(), TQT_SIGNAL(projectOpened()), TQT_TQOBJECT(this), TQT_SLOT(projectOpened()));
+ connect(Core::getInstance(), TQT_SIGNAL(projectClosed()), TQT_TQOBJECT(this), TQT_SLOT(projectClosed()));
connect(Core::getInstance(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)),
- this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)));
+ TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)));
connect(PartController::getInstance(), TQT_SIGNAL(partURLChanged(KParts::ReadOnlyPart *)),
- this, TQT_SLOT(slotPartURLChanged(KParts::ReadOnlyPart * )));
+ TQT_TQOBJECT(this), TQT_SLOT(slotPartURLChanged(KParts::ReadOnlyPart * )));
connect(PartController::getInstance(), TQT_SIGNAL(activePartChanged(KParts::Part*)),
- this, TQT_SLOT(activePartChanged(KParts::Part*)));
+ TQT_TQOBJECT(this), TQT_SLOT(activePartChanged(KParts::Part*)));
connect(PartController::getInstance(),
TQT_SIGNAL(documentChangedState(const KURL &, DocumentState)),
- this, TQT_SLOT(documentChangedState(const KURL&, DocumentState)));
+ TQT_TQOBJECT(this), TQT_SLOT(documentChangedState(const KURL&, DocumentState)));
loadSettings();
}
@@ -182,7 +182,7 @@ void SimpleMainWindow::contextMenu(TQPopupMenu *popupMenu, const Context *contex
bool isOpen = true;
for (KURL::List::const_iterator it = m_splitURLs.begin(); it != m_splitURLs.end(); ++it)
{
- if (!PartController::getInstance()->openURLs().contains(*it) && (*it).isValid())
+ if (!PartController::getInstance()->openURLs().tqcontains(*it) && (*it).isValid())
{
isOpen = false;
break;
@@ -217,7 +217,7 @@ void SimpleMainWindow::embedPartView(TQWidget *view, const TQString &title, cons
return;
TQString shortName = title;
- shortName = shortName.right( shortName.length() - (shortName.findRev('/') +1));
+ shortName = shortName.right( shortName.length() - (shortName.tqfindRev('/') +1));
addWidget(view, title);
view->show();
@@ -322,15 +322,15 @@ void SimpleMainWindow::raiseView(TQWidget *view)
{
//adymo: a workaround to make editor wrappers work:
//editor view is passed to this function but the ui library knows only
- //of its parent which is an editor wrapper, simply replacing the view
+ //of its tqparent which is an editor wrapper, simply replacing the view
//by its wrapper helps here
- if (view->parent())
- kdDebug() << view->parent()->className() << endl;
- if (view->parent() && (view->parent()->isA("EditorWrapper") || view->parent()->isA("MultiBuffer")))
+ if (view->tqparent())
+ kdDebug() << view->tqparent()->className() << endl;
+ if (view->tqparent() && (view->tqparent()->isA("EditorWrapper") || view->tqparent()->isA("MultiBuffer")))
{
-// kdDebug() << "parent is editor wrapper: " <<
-// static_cast<EditorWrapper*>(view->parent()) << endl;
- view = (TQWidget*)view->parent();
+// kdDebug() << "tqparent is editor wrapper: " <<
+// static_cast<EditorWrapper*>(view->tqparent()) << endl;
+ view = (TQWidget*)view->tqparent();
}
if (hasDockWidget(view))
@@ -338,7 +338,7 @@ void SimpleMainWindow::raiseView(TQWidget *view)
DDockWindow *dock = toolWindow(dockWidgetPosition(view));
dock->raiseWidget(view);
}
- else if (m_widgets.contains(view) && m_widgetTabs.contains(view))
+ else if (m_widgets.tqcontains(view) && m_widgetTabs.tqcontains(view))
m_widgetTabs[view]->showPage(view);
}
@@ -403,64 +403,64 @@ void SimpleMainWindow::createFramework()
PartController::createInstance( this );
connect(PartController::getInstance(), TQT_SIGNAL(activePartChanged(KParts::Part*)),
- this, TQT_SLOT(createGUI(KParts::Part*)));
+ TQT_TQOBJECT(this), TQT_SLOT(createGUI(KParts::Part*)));
}
void SimpleMainWindow::createActions()
{
m_raiseEditor = new KAction(i18n("Raise &Editor"), ALT+Key_C,
- this, TQT_SLOT(raiseEditor()), actionCollection(), "raise_editor");
+ TQT_TQOBJECT(this), TQT_SLOT(raiseEditor()), actionCollection(), "raise_editor");
m_raiseEditor->setToolTip(i18n("Raise editor"));
m_raiseEditor->setWhatsThis(i18n("<b>Raise editor</b><p>Focuses the editor."));
m_lowerAllDocks = new KAction(i18n("Lower All Docks"), CTRL+SHIFT+Key_C,
- this, TQT_SLOT(lowerAllDocks()), actionCollection(), "lower_all_docks");
+ TQT_TQOBJECT(this), TQT_SLOT(lowerAllDocks()), actionCollection(), "lower_all_docks");
- new KAction(i18n("Switch to next TabWidget"), 0, this,
+ new KAction(i18n("Switch to next TabWidget"), 0, TQT_TQOBJECT(this),
TQT_SLOT(switchToNextTabWidget()), actionCollection(), "switch_to_next_tabwidget" );
m_splitHor = new KAction(i18n("Split &Horizontal"), CTRL+SHIFT+Key_T,
- this, TQT_SLOT(slotSplitHorizontalBase()), actionCollection(), "split_h");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitHorizontalBase()), actionCollection(), "split_h");
m_splitHor->setIcon("view_top_bottom");
m_splitVer = new KAction(i18n("Split &Vertical"), CTRL+SHIFT+Key_L,
- this, TQT_SLOT(slotSplitVerticalBase()), actionCollection(), "split_v");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitVerticalBase()), actionCollection(), "split_v");
m_splitVer->setIcon("view_left_right");
m_splitHor1 = new KAction(i18n("Split &Horizontal"), 0,
- this, TQT_SLOT(slotSplitHorizontal()), actionCollection(), "split_h1");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitHorizontal()), actionCollection(), "split_h1");
m_splitHor1->setIcon("view_top_bottom");
m_splitVer1 = new KAction(i18n("Split &Vertical"), 0,
- this, TQT_SLOT(slotSplitVertical()), actionCollection(), "split_v1");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitVertical()), actionCollection(), "split_v1");
m_splitVer1->setIcon("view_left_right");
m_splitHor2 = new KAction(i18n("Split &Horizontal and Open"), 0,
- this, TQT_SLOT(slotSplitHorizontal()), actionCollection(), "split_h2");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitHorizontal()), actionCollection(), "split_h2");
m_splitHor2->setIcon("view_top_bottom");
m_splitVer2 = new KAction(i18n("Split &Vertical and Open"), 0,
- this, TQT_SLOT(slotSplitVertical()), actionCollection(), "split_v2");
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitVertical()), actionCollection(), "split_v2");
m_splitVer2->setIcon("view_left_right");
m_raiseLeftDock = new KAction(i18n("Switch Left Dock"), CTRL+SHIFT+ALT+Key_L,
- this, TQT_SLOT(raiseLeftDock()), actionCollection(), "switch_left_dock");
+ TQT_TQOBJECT(this), TQT_SLOT(raiseLeftDock()), actionCollection(), "switch_left_dock");
m_raiseRightDock = new KAction(i18n("Switch Right Dock"), CTRL+SHIFT+ALT+Key_R,
- this, TQT_SLOT(raiseRightDock()), actionCollection(), "switch_right_dock");
+ TQT_TQOBJECT(this), TQT_SLOT(raiseRightDock()), actionCollection(), "switch_right_dock");
m_raiseBottomDock = new KAction(i18n("Switch Bottom Dock"), CTRL+SHIFT+ALT+Key_B,
- this, TQT_SLOT(raiseBottomDock()), actionCollection(), "switch_bottom_dock");
+ TQT_TQOBJECT(this), TQT_SLOT(raiseBottomDock()), actionCollection(), "switch_bottom_dock");
- KStdAction::configureToolbars(this, TQT_SLOT(configureToolbars()),
+ KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configureToolbars()),
actionCollection(), "set_configure_toolbars");
m_mainWindowShare->createActions();
- connect(m_mainWindowShare, TQT_SIGNAL(gotoNextWindow()), this, TQT_SLOT(gotoNextWindow()));
- connect(m_mainWindowShare, TQT_SIGNAL(gotoPreviousWindow()), this, TQT_SLOT(gotoPreviousWindow()));
- connect(m_mainWindowShare, TQT_SIGNAL(gotoFirstWindow()), this, TQT_SLOT(gotoFirstWindow()));
- connect(m_mainWindowShare, TQT_SIGNAL(gotoLastWindow()), this, TQT_SLOT(gotoLastWindow()));
+ connect(m_mainWindowShare, TQT_SIGNAL(gotoNextWindow()), TQT_TQOBJECT(this), TQT_SLOT(gotoNextWindow()));
+ connect(m_mainWindowShare, TQT_SIGNAL(gotoPreviousWindow()), TQT_TQOBJECT(this), TQT_SLOT(gotoPreviousWindow()));
+ connect(m_mainWindowShare, TQT_SIGNAL(gotoFirstWindow()), TQT_TQOBJECT(this), TQT_SLOT(gotoFirstWindow()));
+ connect(m_mainWindowShare, TQT_SIGNAL(gotoLastWindow()), TQT_TQOBJECT(this), TQT_SLOT(gotoLastWindow()));
}
void SimpleMainWindow::raiseEditor()
@@ -522,7 +522,7 @@ void SimpleMainWindow::slotCoreInitialized()
void SimpleMainWindow::projectOpened()
{
- setCaption(TQString::null);
+ setCaption(TQString());
}
void SimpleMainWindow::slotPartURLChanged(KParts::ReadOnlyPart *part)
@@ -577,9 +577,9 @@ void SimpleMainWindow::documentChangedState(const KURL &url, DocumentState state
void SimpleMainWindow::closeTab()
{
// actionCollection()->action("file_close")->activate();
- if (sender()->isA(TQTOOLBUTTON_OBJECT_NAME_STRING) && sender()->parent()->isA("DTabWidget"))
+ if (TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->isA(TQTOOLBUTTON_OBJECT_NAME_STRING) && TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->tqparent()->isA("DTabWidget"))
{
- DTabWidget *tab = (DTabWidget*)sender()->parent();
+ DTabWidget *tab = (DTabWidget*)TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->tqparent();
if (tab && tab->currentPage())
closeTab(tab->currentPage());
}
@@ -587,7 +587,7 @@ void SimpleMainWindow::closeTab()
void SimpleMainWindow::tabContext(TQWidget *w, const TQPoint &p)
{
- DTabWidget *tabWidget = static_cast<DTabWidget*>(const_cast<TQObject*>(sender()));
+ DTabWidget *tabWidget = static_cast<DTabWidget*>(TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender())));
if (!tabWidget)
return;
@@ -595,7 +595,7 @@ void SimpleMainWindow::tabContext(TQWidget *w, const TQPoint &p)
tabMenu.insertTitle(tabWidget->tabLabel(w));
//Find the document on whose tab the user clicked
- m_currentTabURL = TQString::null;
+ m_currentTabURL = TQString();
TQPtrListIterator<KParts::Part> it(*PartController::getInstance()->parts());
while (KParts::Part* part = it.current())
{
@@ -633,7 +633,7 @@ void SimpleMainWindow::tabContext(TQWidget *w, const TQPoint &p)
++it;
}
- connect(&tabMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(tabContextActivated(int)));
+ connect(&tabMenu, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(tabContextActivated(int)));
tabMenu.exec(p);
}
@@ -668,7 +668,7 @@ void SimpleMainWindow::configureToolbars()
{
saveMainWindowSettings(KGlobal::config(), "SimpleMainWindow");
KEditToolbar dlg(factory());
- connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(slotNewToolbarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_TQOBJECT(this), TQT_SLOT(slotNewToolbarConfig()));
dlg.exec();
}
@@ -693,7 +693,7 @@ bool SimpleMainWindow::queryExit()
void SimpleMainWindow::setupWindowMenu()
{
// get the xmlgui created one instead
- m_windowMenu = static_cast<TQPopupMenu*>(main()->child("window", "KPopupMenu"));
+ m_windowMenu = static_cast<TQPopupMenu*>(TQT_TQWIDGET(main()->child("window", "KPopupMenu")));
if (!m_windowMenu)
{
@@ -707,13 +707,13 @@ void SimpleMainWindow::setupWindowMenu()
actionCollection()->action("file_close_all")->plug(m_windowMenu);
actionCollection()->action("file_closeother")->plug(m_windowMenu);
- TQObject::connect(m_windowMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(openURL(int)));
- TQObject::connect(m_windowMenu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(fillWindowMenu()));
+ TQObject::connect(m_windowMenu, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(openURL(int)));
+ TQObject::connect(m_windowMenu, TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(fillWindowMenu()));
}
void SimpleMainWindow::openURL(int w)
{
- TQValueList<QPair<int, KURL> >::ConstIterator it = m_windowList.begin();
+ TQValueList<TQPair<int, KURL> >::ConstIterator it = m_windowList.begin();
while (it != m_windowList.end())
{
if ((*it).first == w)
@@ -732,7 +732,7 @@ void SimpleMainWindow::openURL(int w)
void SimpleMainWindow::fillWindowMenu()
{
// clear menu
- TQValueList< QPair< int, KURL > >::ConstIterator it = m_windowList.begin();
+ TQValueList< TQPair< int, KURL > >::ConstIterator it = m_windowList.begin();
while (it != m_windowList.end())
{
m_windowMenu->removeItem( (*it).first );
@@ -761,12 +761,12 @@ void SimpleMainWindow::fillWindowMenu()
int i = 0;
if (list.count() > 0)
- m_windowList << qMakePair(m_windowMenu->insertSeparator(), KURL());
+ m_windowList << tqMakePair(m_windowMenu->insertSeparator(), KURL());
while (itt != list.end())
{
- temp = m_windowMenu->insertItem( i < 10 ? TQString("&%1 %2").arg(i).arg((*itt).fileName()) : (*itt).fileName() );
- m_windowList << qMakePair(temp, *itt);
+ temp = m_windowMenu->insertItem( i < 10 ? TQString("&%1 %2").tqarg(i).tqarg((*itt).fileName()) : (*itt).fileName() );
+ m_windowList << tqMakePair(temp, *itt);
++i;
++itt;
}
@@ -847,13 +847,13 @@ TQWidget *SimpleMainWindow::widgetForURL(KURL url)
TQWidget *SimpleMainWindow::widgetInTab(TQWidget *w)
{
TQWidget *inTab = 0;
- if (w && w->parent() && w->parent()->isA("EditorProxy"))
- inTab = (TQWidget*)w->parent();
- else if (w && w->parent() && w->parent()->isA("MultiBuffer")
- && w->parent()->parent() && w->parent()->parent()->isA("EditorProxy"))
- inTab = (TQWidget*)w->parent()->parent();
- else if (w && w->parent() && w->parent()->isA("MultiBuffer"))
- inTab = (TQWidget*)w->parent();
+ if (w && w->tqparent() && w->tqparent()->isA("EditorProxy"))
+ inTab = (TQWidget*)w->tqparent();
+ else if (w && w->tqparent() && w->tqparent()->isA("MultiBuffer")
+ && w->tqparent()->tqparent() && w->tqparent()->tqparent()->isA("EditorProxy"))
+ inTab = (TQWidget*)w->tqparent()->tqparent();
+ else if (w && w->tqparent() && w->tqparent()->isA("MultiBuffer"))
+ inTab = (TQWidget*)w->tqparent();
else
inTab = w;
return inTab;
@@ -900,7 +900,7 @@ void SimpleMainWindow::activePartChanged(KParts::Part *part)
void SimpleMainWindow::createGUI(KParts::Part *part) {
if ( !part )
- setCaption( TQString::null );
+ setCaption( TQString() );
DMainWindow::createGUI(part);
m_mainWindowShare->slotGUICreated( part );
@@ -943,7 +943,7 @@ void SimpleMainWindow::switchToNextTabWidget()
TQValueList<DTabWidget*>::iterator it = tabWidgets.begin();
while ( it != tabWidgets.end() )
{
- if ( !reduced.contains( *it ) )
+ if ( !reduced.tqcontains( *it ) )
{
reduced << *it;
}
@@ -1003,9 +1003,9 @@ void SimpleMainWindow::setCaption(const TQString &caption)
void SimpleMainWindow::projectClosed()
{
- DMainWindow::setCaption(TQString::null);
+ DMainWindow::setCaption(TQString());
}
#include "simplemainwindow.moc"
-// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on