From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: 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 --- src/newui/button.cpp | 64 +++++++++++++++++++++++----------------------- src/newui/button.h | 9 ++++--- src/newui/buttonbar.cpp | 34 ++++++++++++------------ src/newui/buttonbar.h | 13 +++++----- src/newui/ddockwindow.cpp | 36 +++++++++++++------------- src/newui/ddockwindow.h | 3 ++- src/newui/dmainwindow.cpp | 44 +++++++++++++++---------------- src/newui/dmainwindow.h | 5 ++-- src/newui/docksplitter.cpp | 28 ++++++++++---------- src/newui/docksplitter.h | 7 ++--- src/newui/dtabwidget.cpp | 10 ++++---- src/newui/dtabwidget.h | 3 ++- 12 files changed, 131 insertions(+), 125 deletions(-) (limited to 'src/newui') diff --git a/src/newui/button.cpp b/src/newui/button.cpp index 0631510e..1795b18a 100644 --- a/src/newui/button.cpp +++ b/src/newui/button.cpp @@ -39,32 +39,32 @@ namespace Ideal { -Button::Button(ButtonBar *parent, const TQString text, const TQIconSet &icon, +Button::Button(ButtonBar *tqparent, const TQString text, const TQIconSet &icon, const TQString &description) - :TQPushButton(icon, text, parent), m_buttonBar(parent), m_description(description), - m_place(parent->place()), m_realText(text), m_realIconSet(icon) + :TQPushButton(icon, text, tqparent), m_buttonBar(tqparent), m_description(description), + m_place(tqparent->place()), m_realText(text), m_realIconSet(icon) { hide(); setFlat(true); setToggleButton(true); - setFocusPolicy(NoFocus); + setFocusPolicy(TQ_NoFocus); setDescription(m_description); - setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); - resize(sizeHint()); + tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + resize(tqsizeHint()); fixDimensions(Ideal::Bottom); TQToolTip::add(this, m_realText); m_assignAccelAction = new KAction(i18n("Assign Accelerator..."), 0, - this, TQT_SLOT(assignAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(assignAccel()), TQT_TQOBJECT(this)); m_clearAccelAction = new KAction(i18n("Clear Accelerator"), 0, - this, TQT_SLOT(clearAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(clearAccel()), TQT_TQOBJECT(this)); KConfig *config = kapp->config(); config->setGroup("UI"); - TQString accel = config->readEntry(TQString("button_%1").arg(text), ""); + TQString accel = config->readEntry(TQString("button_%1").tqarg(text), ""); if (!accel.isEmpty()) - setRealText(TQString("&%1 %2").arg(accel).arg(m_realText)); + setRealText(TQString("&%1 %2").tqarg(accel).tqarg(m_realText)); } Button::~Button() @@ -78,13 +78,13 @@ Button::~Button() if (r.search(m_realText) > -1) { TQString text = m_realText; - if (text.contains(r2)) + if (text.tqcontains(r2)) text.remove(r2); - config->writeEntry(TQString("button_%1").arg(text), r.cap(1)); + config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1)); } else { - config->writeEntry(TQString("button_%1").arg(m_realText), ""); + config->writeEntry(TQString("button_%1").tqarg(m_realText), ""); } } @@ -131,11 +131,11 @@ void Button::drawButton(TQPainter *p) pm.fill(eraseColor()); TQPainter p2(&pm); - style().drawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), colorGroup(),flags); + tqstyle().tqdrawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), tqcolorGroup(),flags); - style().drawControl(TQStyle::CE_PushButtonLabel, &p2, this, + tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel, &p2, this, TQRect(0,0,pm.width(),pm.height()), - colorGroup(), flags, TQStyleOption()); + tqcolorGroup(), flags, TQStyleOption()); switch (m_place) { @@ -178,7 +178,7 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top)) { setFixedWidth(height()); - setMinimumHeight(sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); setMaximumHeight(32767); } break; @@ -187,19 +187,19 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right)) { setFixedHeight(width()); - setMinimumWidth(sizeHint().height()); + setMinimumWidth(tqsizeHint().height()); setMaximumWidth(32767); } break; } } -TQSize Button::sizeHint() const +TQSize Button::tqsizeHint() const { - return sizeHint(text()); + return tqsizeHint(text()); } -TQSize Button::sizeHint(const TQString &text) const +TQSize Button::tqsizeHint(const TQString &text) const { constPolish(); int w = 0, h = 0; @@ -208,10 +208,10 @@ TQSize Button::sizeHint(const TQString &text) const int iw = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; int ih = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).height(); w += iw; - h = QMAX( h, ih ); + h = TQMAX( h, ih ); } if ( isMenuButton() ) - w += style().pixelMetric(TQStyle::PM_MenuButtonIndicator, this); + w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this); if ( pixmap() ) { TQPixmap *pm = (TQPixmap *)pixmap(); w += pm->width(); @@ -220,16 +220,16 @@ TQSize Button::sizeHint(const TQString &text) const TQString s( text ); bool empty = s.isEmpty(); if ( empty ) - s = TQString::fromLatin1("XXXX"); + s = TQString::tqfromLatin1("XXXX"); TQFontMetrics fm = fontMetrics(); TQSize sz = fm.size( ShowPrefix, s ); if(!empty || !w) w += sz.width(); if(!empty || !h) - h = QMAX(h, sz.height()); + h = TQMAX(h, sz.height()); } - return (style().sizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). + return (tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). expandedTo(TQApplication::globalStrut())); } @@ -239,12 +239,12 @@ void Button::updateSize() { case Ideal::Left: case Ideal::Right: - setMinimumHeight(sizeHint().width()); - resize(sizeHint().height(), sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); + resize(tqsizeHint().height(), tqsizeHint().width()); break; case Ideal::Top: case Ideal::Bottom: - resize(sizeHint().width(), sizeHint().height()); + resize(tqsizeHint().width(), tqsizeHint().height()); break; } } @@ -304,7 +304,7 @@ void Button::contextMenuEvent(TQContextMenuEvent *e) TQPopupMenu menu; m_assignAccelAction->plug(&menu); - if (m_realText.contains(TQRegExp("^&[0-9]\\s"))) + if (m_realText.tqcontains(TQRegExp("^&[0-9]\\s"))) m_clearAccelAction->plug(&menu); emit contextMenu( &menu ); @@ -319,7 +319,7 @@ void Button::assignAccel() if (ok) { TQString text = realTextWithoutAccel(); - text = TQString("&%1 %2").arg(num).arg(text); + text = TQString("&%1 %2").tqarg(num).tqarg(text); setRealText(text); } } @@ -340,7 +340,7 @@ TQString Button::realTextWithoutAccel() const { TQString text = m_realText; TQRegExp r("^&[0-9]\\s"); - if (text.contains(r)) + if (text.tqcontains(r)) text.remove(r); return text; } diff --git a/src/newui/button.h b/src/newui/button.h index 86e7dbed..3dbc63ca 100644 --- a/src/newui/button.h +++ b/src/newui/button.h @@ -39,9 +39,10 @@ A TQPushButton derivative with a size of a TQToolBar. Button can be rotated */ class Button : public TQPushButton { Q_OBJECT + TQ_OBJECT public: - Button(ButtonBar *parent, const TQString text, const TQIconSet &icon = TQIconSet(), - const TQString &description = TQString::null); + Button(ButtonBar *tqparent, const TQString text, const TQIconSet &icon = TQIconSet(), + const TQString &description = TQString()); /**Sets the description used as a tooltip.*/ void setDescription(const TQString &description); @@ -53,8 +54,8 @@ public: /**Sets the mode of a button.*/ void setMode(Ideal::ButtonMode mode); - TQSize sizeHint() const; - TQSize sizeHint(const TQString &text) const; + TQSize tqsizeHint() const; + TQSize tqsizeHint(const TQString &text) const; /**Updates size of a widget. Used after squeezing button's text.*/ void updateSize(); diff --git a/src/newui/buttonbar.cpp b/src/newui/buttonbar.cpp index b2a3b47c..342e3491 100644 --- a/src/newui/buttonbar.cpp +++ b/src/newui/buttonbar.cpp @@ -32,14 +32,14 @@ namespace Ideal { //ButtonLayout class -ButtonLayout::ButtonLayout(ButtonBar *parent, Direction d, int margin, int spacing, const char *name) - :TQBoxLayout(parent, d, margin, spacing, name), m_buttonBar(parent) +ButtonLayout::ButtonLayout(ButtonBar *tqparent, Direction d, int margin, int spacing, const char *name) + :TQBoxLayout(tqparent, d, margin, spacing, name), m_buttonBar(tqparent) { } -TQSize ButtonLayout::minimumSize() const +TQSize ButtonLayout::tqminimumSize() const { - TQSize size = TQBoxLayout::minimumSize(); + TQSize size = TQBoxLayout::tqminimumSize(); if (!m_buttonBar->autoResize()) return size; @@ -54,7 +54,7 @@ TQSize ButtonLayout::minimumSize() const case Ideal::Bottom: return TQSize(0,size.height()); } - return TQBoxLayout::minimumSize(); + return TQBoxLayout::tqminimumSize(); } @@ -62,8 +62,8 @@ TQSize ButtonLayout::minimumSize() const //ButtonBar class -ButtonBar::ButtonBar(Place place, ButtonMode mode, TQWidget *parent, const char *name) - :TQWidget(parent, name), m_place(place), l(0), m_shrinked(false), m_autoResize(true) +ButtonBar::ButtonBar(Place place, ButtonMode mode, TQWidget *tqparent, const char *name) + :TQWidget(tqparent, name), m_place(place), l(0), m_shrinked(false), m_autoResize(true) { switch (m_place) { @@ -128,14 +128,14 @@ void ButtonBar::fixDimensions() { case Ideal::Left: case Ideal::Right: - setFixedWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); + setFixedWidth(tqsizeHint().width()); + setMinimumHeight(tqsizeHint().height()); setMaximumHeight(32767); break; case Ideal::Top: case Ideal::Bottom: - setFixedHeight(sizeHint().height()); - setMinimumWidth(sizeHint().width()); + setFixedHeight(tqsizeHint().height()); + setMinimumWidth(tqsizeHint().width()); setMaximumWidth(32767); break; } @@ -156,13 +156,13 @@ void ButtonBar::resizeEvent(TQResizeEvent *ev) { case Ideal::Left: case Ideal::Right: - preferredDimension = l->TQBoxLayout::minimumSize().height(); + preferredDimension = l->TQBoxLayout::tqminimumSize().height(); actualDimension = size().height(); oldDimension = ev->oldSize().height(); break; case Ideal::Top: case Ideal::Bottom: - preferredDimension = l->TQBoxLayout::minimumSize().width(); + preferredDimension = l->TQBoxLayout::tqminimumSize().width(); actualDimension = size().width(); oldDimension = ev->oldSize().width(); break; @@ -249,7 +249,7 @@ void ButtonBar::deshrink(int preferredDimension, int actualDimension) int i = 0; for (TQValueList::iterator it = texts.begin(); it != texts.end(); ++it, i++) { - if (m_buttons[i]->text().contains("...")) + if (m_buttons[i]->text().tqcontains("...")) (*it)++; newTextLength += *it; } @@ -285,7 +285,7 @@ int ButtonBar::originalDimension() int size = 0; for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it) { - size += (*it)->sizeHint((*it)->realText()).width(); + size += (*it)->tqsizeHint((*it)->realText()).width(); } return size; } @@ -309,7 +309,7 @@ Button *ButtonBar::firstButton() Button *ButtonBar::nextTo(Button *button) { - ButtonList::iterator it = m_buttons.find(button); + ButtonList::iterator it = m_buttons.tqfind(button); Button *next = 0; if ((*it) == m_buttons.last()) next = m_buttons.first(); @@ -326,7 +326,7 @@ Button *ButtonBar::nextTo(Button *button) Button *ButtonBar::prevTo(Button *button) { - ButtonList::iterator it = m_buttons.find(button); + ButtonList::iterator it = m_buttons.tqfind(button); Button *prev = 0; if (it == m_buttons.begin()) prev = m_buttons.last(); diff --git a/src/newui/buttonbar.h b/src/newui/buttonbar.h index ad1cf5b6..f8f13868 100644 --- a/src/newui/buttonbar.h +++ b/src/newui/buttonbar.h @@ -32,14 +32,14 @@ namespace Ideal { class Button; class ButtonBar; -/**@short A layout for a ButtonBar class. +/**@short A tqlayout for a ButtonBar class. -Overrides minimumSize method to allow shrinking button bar buttons.*/ -class ButtonLayout: public QBoxLayout{ +Overrides tqminimumSize method to allow shrinking button bar buttons.*/ +class ButtonLayout: public TQBoxLayout{ public: - ButtonLayout(ButtonBar *parent, Direction d, int margin = 0, int spacing = -1, const char * name = 0); + ButtonLayout(ButtonBar *tqparent, Direction d, int margin = 0, int spacing = -1, const char * name = 0); - virtual TQSize minimumSize() const; + virtual TQSize tqminimumSize() const; private: ButtonBar *m_buttonBar; @@ -53,9 +53,10 @@ placing on the left(right, bottom, top) corners of a window as a bar with slider */ class ButtonBar : public TQWidget { Q_OBJECT + TQ_OBJECT public: ButtonBar(Place place, ButtonMode mode = IconsAndText, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); virtual ~ButtonBar(); /**Adds a button to the bar.*/ diff --git a/src/newui/ddockwindow.cpp b/src/newui/ddockwindow.cpp index 5f11425d..95b36eab 100644 --- a/src/newui/ddockwindow.cpp +++ b/src/newui/ddockwindow.cpp @@ -39,9 +39,9 @@ #include "button.h" #include "dmainwindow.h" -DDockWindow::DDockWindow(DMainWindow *parent, Position position) - :TQDockWindow(TQDockWindow::InDock, parent), m_position(position), m_visible(false), - m_mainWindow(parent), m_doNotCloseActiveWidget(false), m_toggledButton(0), m_lastContextMenuButton(0) +DDockWindow::DDockWindow(DMainWindow *tqparent, Position position) + :TQDockWindow(TQDockWindow::InDock, tqparent), m_position(position), m_visible(false), + m_mainWindow(tqparent), m_doNotCloseActiveWidget(false), m_toggledButton(0), m_lastContextMenuButton(0) { setMovingEnabled(false); setResizeEnabled(true); @@ -85,9 +85,9 @@ DDockWindow::DDockWindow(DMainWindow *parent, Position position) m_widgetStack = new TQWidgetStack(this); m_internalLayout->addWidget(m_widgetStack); - m_moveToDockLeft = new KAction( i18n("Move to left dock"), 0, this, TQT_SLOT(moveToDockLeft()), this ); - m_moveToDockRight = new KAction( i18n("Move to right dock"), 0, this, TQT_SLOT(moveToDockRight()), this ); - m_moveToDockBottom = new KAction( i18n("Move to bottom dock"), 0, this, TQT_SLOT(moveToDockBottom()), this ); + m_moveToDockLeft = new KAction( i18n("Move to left dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockLeft()), TQT_TQOBJECT(this) ); + m_moveToDockRight = new KAction( i18n("Move to right dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockRight()), TQT_TQOBJECT(this) ); + m_moveToDockBottom = new KAction( i18n("Move to bottom dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockBottom()), TQT_TQOBJECT(this) ); setVisible(m_visible); @@ -104,7 +104,7 @@ void DDockWindow::setVisible(bool v) { //write dock width to the config file KConfig *config = kapp->config(); - TQString group = TQString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); config->setGroup(group); if (m_visible) @@ -115,13 +115,13 @@ void DDockWindow::setVisible(bool v) v ? m_widgetStack->show() : m_widgetStack->hide(); m_visible = v; - m_internalLayout->invalidate(); + m_internalLayout->tqinvalidate(); if (!m_visible) { if (m_position == DDockWindow::Bottom) - setFixedExtentHeight(m_internalLayout->sizeHint().height()); + setFixedExtentHeight(m_internalLayout->tqsizeHint().height()); else - setFixedExtentWidth(m_internalLayout->sizeHint().width()); + setFixedExtentWidth(m_internalLayout->tqsizeHint().width()); emit hidden(); } else @@ -130,12 +130,12 @@ void DDockWindow::setVisible(bool v) int size = 0; if (m_position == DDockWindow::Bottom) { - size = config->readNumEntry("ViewWidth", m_internalLayout->sizeHint().height()); + size = config->readNumEntry("ViewWidth", m_internalLayout->tqsizeHint().height()); setFixedExtentHeight(size); } else { - size = config->readNumEntry("ViewWidth", m_internalLayout->sizeHint().width()); + size = config->readNumEntry("ViewWidth", m_internalLayout->tqsizeHint().width()); setFixedExtentWidth(size); } } @@ -148,7 +148,7 @@ void DDockWindow::loadSettings() void DDockWindow::saveSettings() { KConfig *config = kapp->config(); - TQString group = TQString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); int invisibleWidth = 0; config->setGroup(group); if (config->hasKey("ViewWidth")) @@ -200,7 +200,7 @@ void DDockWindow::addWidget(const TQString &title, TQWidget *widget, bool skipAc //if the widget was selected last time the dock is deleted //we need to show it KConfig *config = kapp->config(); - TQString group = TQString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); config->setGroup(group); if (config->readEntry("ViewLastWidget") == title) { @@ -338,7 +338,7 @@ bool DDockWindow::isActive() { if (m_toggledButton) { - TQWidget *w = qApp->focusWidget(); + TQWidget *w = tqApp->tqfocusWidget(); if (!w) return false; TQWidget *toolWidget = m_widgets[m_toggledButton]; @@ -347,7 +347,7 @@ bool DDockWindow::isActive() else { do { - w = (TQWidget*)w->parent(); + w = (TQWidget*)w->tqparent(); if (w && (w == toolWidget)) return true; } while (w); } @@ -375,7 +375,7 @@ void DDockWindow::selectPrevWidget() void DDockWindow::contextMenu(TQPopupMenu * menu) { - m_lastContextMenuButton = static_cast( const_cast( sender() ) ); + m_lastContextMenuButton = static_cast( TQT_TQWIDGET(const_cast( sender() )) ); menu->insertSeparator(); @@ -404,7 +404,7 @@ void DDockWindow::moveToDockBottom() void DDockWindow::moveToDock(DDockWindow::Position position ) { - if ( m_widgets.contains( m_lastContextMenuButton ) ) + if ( m_widgets.tqcontains( m_lastContextMenuButton ) ) { mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() ); } diff --git a/src/newui/ddockwindow.h b/src/newui/ddockwindow.h index 7653bff9..e9850d2f 100644 --- a/src/newui/ddockwindow.h +++ b/src/newui/ddockwindow.h @@ -40,10 +40,11 @@ namespace Ideal { class DDockWindow : public TQDockWindow { Q_OBJECT + TQ_OBJECT public: enum Position { Bottom, Left, Right }; - DDockWindow(DMainWindow *parent, Position position); + DDockWindow(DMainWindow *tqparent, Position position); virtual ~DDockWindow(); virtual void setVisible(bool v); diff --git a/src/newui/dmainwindow.cpp b/src/newui/dmainwindow.cpp index 6e6a63d4..fb7dd14a 100644 --- a/src/newui/dmainwindow.cpp +++ b/src/newui/dmainwindow.cpp @@ -29,8 +29,8 @@ #include "dtabwidget.h" #include "docksplitter.h" -DMainWindow::DMainWindow(TQWidget *parent, const char *name) - :KParts::MainWindow(parent, name), m_firstRemoved(false), m_currentWidget(0) +DMainWindow::DMainWindow(TQWidget *tqparent, const char *name) + :KParts::MainWindow(tqparent, name), m_firstRemoved(false), m_currentWidget(0) { loadSettings(); createToolWindows(); @@ -74,16 +74,16 @@ DDockWindow *DMainWindow::toolWindow(DDockWindow::Position position) const void DMainWindow::createToolWindows() { m_bottomDock = new DDockWindow(this, DDockWindow::Bottom); - moveDockWindow(m_bottomDock, Qt::DockBottom); + moveDockWindow(m_bottomDock, TQt::DockBottom); m_leftDock = new DDockWindow(this, DDockWindow::Left); - moveDockWindow(m_leftDock, Qt::DockLeft); + moveDockWindow(m_leftDock, TQt::DockLeft); m_rightDock = new DDockWindow(this, DDockWindow::Right); - moveDockWindow(m_rightDock, Qt::DockRight); + moveDockWindow(m_rightDock, TQt::DockRight); } void DMainWindow::addWidget(TQWidget *widget, const TQString &title) { -// invalidateActiveTabWidget(); +// tqinvalidateActiveTabWidget(); if (m_firstRemoved && m_activeTabWidget == m_tabs.first()) { m_central->addDock(0, 0, m_activeTabWidget); @@ -116,10 +116,10 @@ void DMainWindow::addWidget(DTabWidget *tab, TQWidget *widget, const TQString &t void DMainWindow::removeWidget(TQWidget *widget) { - if (!m_widgets.contains(widget)) + if (!m_widgets.tqcontains(widget)) return; //not a widget in main window - if (m_widgetTabs.contains(widget)) + if (m_widgetTabs.tqcontains(widget)) { DTabWidget *tab = m_widgetTabs[widget]; if (tab->indexOf(widget) >= 0) @@ -133,7 +133,7 @@ void DMainWindow::removeWidget(TQWidget *widget) //remove and delete tabwidget if it is not the first one if (tab != m_tabs.first()) { - QPair idx = m_central->indexOf(tab); + TQPair idx = m_central->indexOf(tab); m_tabs.remove(tab); m_activeTabWidget = m_tabs.first(); m_central->removeDock(idx.first, idx.second, true); @@ -175,25 +175,25 @@ DTabWidget *DMainWindow::splitHorizontal() DTabWidget *DMainWindow::splitVertical() { -// invalidateActiveTabWidget(); +// tqinvalidateActiveTabWidget(); int row = m_central->indexOf(m_activeTabWidget).first; m_activeTabWidget = createTab(); m_central->addDock(row, m_central->numCols(row), m_activeTabWidget); return m_activeTabWidget; } -void DMainWindow::invalidateActiveTabWidget() +void DMainWindow::tqinvalidateActiveTabWidget() { -/* TQWidget *focused = m_central->focusWidget(); - kdDebug(9000) << "invalidate: " << focused << endl; +/* TQWidget *focused = m_central->tqfocusWidget(); + kdDebug(9000) << "tqinvalidate: " << focused << endl; if (focused == 0) return; - if (!m_widgets.contains(focused)) + if (!m_widgets.tqcontains(focused)) { kdDebug(9000) << " focused is not in m_widgets" << endl; return; } - if (m_widgetTabs.contains(focused)) + if (m_widgetTabs.tqcontains(focused)) { kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl; DTabWidget *tab = m_widgetTabs[focused]; @@ -218,7 +218,7 @@ DTabWidget *DMainWindow::createTab() bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev) { TQWidget *w = (TQWidget*)obj; - if (!m_widgets.contains(w)) + if (!m_widgets.tqcontains(w)) return KParts::MainWindow::eventFilter(obj, ev); if ((m_currentWidget != w) && (ev->type() == TQEvent::FocusIn)) @@ -228,7 +228,7 @@ bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev) } else if (ev->type() == TQEvent::IconChange) { - if (m_widgetTabs.contains(w)) + if (m_widgetTabs.tqcontains(w)) { DTabWidget *tab = m_widgetTabs[w]; tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : TQPixmap()); @@ -261,7 +261,7 @@ void DMainWindow::closeTab(TQWidget *) void DMainWindow::moveWidget(DDockWindow::Position position, TQWidget * view, const TQString & title) { - if (m_docks.contains(view)) + if (m_docks.tqcontains(view)) { toolWindow(m_docks[view])->removeWidget(view); @@ -285,7 +285,7 @@ void DMainWindow::removeDockWidget(TQWidget *view) bool DMainWindow::hasDockWidget(TQWidget *view) { - return m_docks.contains(view); + return m_docks.tqcontains(view); } DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view) @@ -295,9 +295,9 @@ DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view) void DMainWindow::widgetDestroyed() { - TQWidget *w = static_cast(const_cast(sender())); + TQWidget *w = TQT_TQWIDGET(const_cast(sender())); - if (m_docks.contains(w)) + if (m_docks.tqcontains(w)) { kdError() << "Widget destroyed before being removed from UI!" << endl; m_docks.remove(w); @@ -306,4 +306,4 @@ void DMainWindow::widgetDestroyed() #include "dmainwindow.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 diff --git a/src/newui/dmainwindow.h b/src/newui/dmainwindow.h index ae757678..dc7b1c42 100644 --- a/src/newui/dmainwindow.h +++ b/src/newui/dmainwindow.h @@ -33,8 +33,9 @@ namespace Ideal { /**Main window which provides simplified IDEA mode.*/ class DMainWindow: public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: - DMainWindow(TQWidget *parent = 0, const char *name = 0); + DMainWindow(TQWidget *tqparent = 0, const char *name = 0); virtual ~DMainWindow(); /**@return The tool window in given @p position.*/ @@ -106,7 +107,7 @@ protected: TQWidget *m_currentWidget; private slots: - void invalidateActiveTabWidget(); + void tqinvalidateActiveTabWidget(); }; diff --git a/src/newui/docksplitter.cpp b/src/newui/docksplitter.cpp index 0dc55453..c22f2723 100644 --- a/src/newui/docksplitter.cpp +++ b/src/newui/docksplitter.cpp @@ -23,16 +23,16 @@ namespace Ideal { -DockSplitter::DockSplitter(Orientation orientation, TQWidget *parent, const char *name) - :TQSplitter(parent, name), m_orientation(orientation) +DockSplitter::DockSplitter(Qt::Orientation orientation, TQWidget *tqparent, const char *name) + :TQSplitter(tqparent, name), m_orientation(orientation) { switch (m_orientation) { - case Horizontal: - setOrientation(Vertical); + case Qt::Horizontal: + setOrientation(Qt::Vertical); break; - case Vertical: - setOrientation(Horizontal); + case Qt::Vertical: + setOrientation(Qt::Horizontal); break; } setOpaqueResize(true); @@ -73,11 +73,11 @@ void DockSplitter::appendSplitter() { switch (m_orientation) { - case Horizontal: - m_splitters.append(new TQSplitter(Horizontal, this)); + case Qt::Horizontal: + m_splitters.append(new TQSplitter(Qt::Horizontal, this)); break; - case Vertical: - m_splitters.append(new TQSplitter(Vertical, this)); + case Qt::Vertical: + m_splitters.append(new TQSplitter(Qt::Vertical, this)); break; } m_splitters[m_splitters.size()-1]->setOpaqueResize(true); @@ -113,7 +113,7 @@ void DockSplitter::removeDock(uint row, uint col, bool alsoDelete) w->hide(); } - m_splitters[row]->setMinimumSize(m_splitters[row]->minimumSizeHint()); + m_splitters[row]->setMinimumSize(m_splitters[row]->tqminimumSizeHint()); if (isRowEmpty(row)) { @@ -161,13 +161,13 @@ int DockSplitter::numCols(int row) const return 0; } -QPair DockSplitter::indexOf(TQWidget *dock) +TQPair DockSplitter::indexOf(TQWidget *dock) { for (uint i = 0; i < m_docks.count(); ++i) for (uint j = 0; j < m_docks[i].count(); ++j) if (dock == m_docks[i][j]) - return qMakePair(i, j); - return qMakePair(0u, 0u); + return tqMakePair(i, j); + return tqMakePair(0u, 0u); } } diff --git a/src/newui/docksplitter.h b/src/newui/docksplitter.h index c25dd495..c5450b1a 100644 --- a/src/newui/docksplitter.h +++ b/src/newui/docksplitter.h @@ -32,14 +32,15 @@ class DockWidget; */ class DockSplitter: public TQSplitter { Q_OBJECT + TQ_OBJECT public: - DockSplitter(Orientation orientation, TQWidget *parent = 0, const char *name = 0); + DockSplitter(Qt::Orientation orientation, TQWidget *tqparent = 0, const char *name = 0); ~DockSplitter(); void addDock(uint row, uint col, TQWidget *dock); void removeDock(uint row, uint col, bool alsoDelete = false); - QPair indexOf(TQWidget *dock); + TQPair indexOf(TQWidget *dock); int numRows() const; int numCols(int row) const; @@ -52,7 +53,7 @@ protected: bool isRowEmpty(int row); private: - Orientation m_orientation; + Qt::Orientation m_orientation; TQValueList m_splitters; TQValueList > m_docks; }; diff --git a/src/newui/dtabwidget.cpp b/src/newui/dtabwidget.cpp index db2e4c4e..7ee27915 100644 --- a/src/newui/dtabwidget.cpp +++ b/src/newui/dtabwidget.cpp @@ -26,10 +26,10 @@ #include #include -DTabWidget::DTabWidget(TQWidget *parent, const char *name) - :KTabWidget(parent, name), m_closeButton(0) +DTabWidget::DTabWidget(TQWidget *tqparent, const char *name) + :KTabWidget(tqparent, name), m_closeButton(0) { - setFocusPolicy(NoFocus); + setFocusPolicy(TQ_NoFocus); setMargin(0); loadSettings(); @@ -85,7 +85,7 @@ void DTabWidget::insertTab(TQWidget *child, const TQString &label, int index) if (m_closeButton && m_closeButtonShown) m_closeButton->show(); KTabWidget::insertTab(child, label, index); - if (index != -1) tabBar()->repaint(); + if (index != -1) tabBar()->tqrepaint(); } void DTabWidget::insertTab(TQWidget *child, const TQIconSet &iconset, @@ -94,7 +94,7 @@ void DTabWidget::insertTab(TQWidget *child, const TQIconSet &iconset, if (m_closeButton && m_closeButtonShown) m_closeButton->show(); KTabWidget::insertTab(child, iconset, label, index); - if (index != -1) tabBar()->repaint(); + if (index != -1) tabBar()->tqrepaint(); } /*void DTabWidget::updateHistory(TQWidget *w) diff --git a/src/newui/dtabwidget.h b/src/newui/dtabwidget.h index beb0a466..fd480c73 100644 --- a/src/newui/dtabwidget.h +++ b/src/newui/dtabwidget.h @@ -26,8 +26,9 @@ class TQToolButton; class DTabWidget: public KTabWidget { Q_OBJECT + TQ_OBJECT public: - DTabWidget(TQWidget *parent=0, const char *name=0); + DTabWidget(TQWidget *tqparent=0, const char *name=0); /**@return The close button at the top right corner. May be 0 if the configuration do not allow close buttons or the tabbar.*/ -- cgit v1.2.1