summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/cmdiarea.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 17:31:58 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 17:31:58 +0000
commitb6027ae3f71e2c1961357500b9da203e3a04a194 (patch)
treef6e7cbb9ad81542a6287c7c60602d5a38cf24457 /bibletime/frontend/cmdiarea.cpp
parent1ed307edd091effc390a7b98986fccb0f8307582 (diff)
downloadbibletime-b6027ae3f71e2c1961357500b9da203e3a04a194.tar.gz
bibletime-b6027ae3f71e2c1961357500b9da203e3a04a194.zip
TQt4 port Bibletime
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1232459 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'bibletime/frontend/cmdiarea.cpp')
-rw-r--r--bibletime/frontend/cmdiarea.cpp61
1 files changed, 17 insertions, 44 deletions
diff --git a/bibletime/frontend/cmdiarea.cpp b/bibletime/frontend/cmdiarea.cpp
index 4da250f..5f4c164 100644
--- a/bibletime/frontend/cmdiarea.cpp
+++ b/bibletime/frontend/cmdiarea.cpp
@@ -28,17 +28,13 @@
#include <tqtimer.h>
#include <tqevent.h>
#include <tqtimer.h>
-#if QT_VERSION < 0x030200
-//We need this to close all windows with Qt < 3.2
-#include <tqwidgetlist.h>
-#endif
-CMDIArea::CMDIArea(TQWidget *parent, const char *name )
-: TQWorkspace(parent, name),
+CMDIArea::CMDIArea(TQWidget *tqparent, const char *name )
+: TQWorkspace(tqparent, name),
m_guiOption(Nothing),
m_childEvent(false),
-m_appCaption(TQString::null) {
+m_appCaption(TQString()) {
initView();
initConnections();
readSettings();
@@ -47,7 +43,7 @@ m_appCaption(TQString::null) {
/** Initializes the view of the MDI area */
void CMDIArea::initView() {
- setPaletteBackgroundColor( parentWidget()->paletteBackgroundColor() ); //work around a KDE bug (IMHO was in KDE 2.x)
+ setPaletteBackgroundColor( tqparentWidget()->paletteBackgroundColor() ); //work around a KDE bug (IMHO was in KDE 2.x)
}
/** Initilizes the connectiosn to SIGNALS */
@@ -93,7 +89,7 @@ void CMDIArea::childEvent( TQChildEvent * e ) {
m_childEvent = true;
if (!windowList().count()) {
- m_appCaption = TQString::null;
+ m_appCaption = TQString();
emit sigSetToplevelCaption( KApplication::kApplication()->makeStdCaption(m_appCaption) );
emit sigLastPresenterClosed();
}
@@ -129,15 +125,7 @@ void CMDIArea::readSettings() {}
/** Deletes all the presenters in the MDI area. */
void CMDIArea::deleteAll() {
-#if QT_VERSION >= 0x030200
closeAllWindows();
-#else
- TQWidgetListIt it(windowList());
- while (it.current() != 0){
- it.current()->close();
- ++it;
- }
-#endif
}
/** Enable / disable autoCascading */
@@ -176,7 +164,7 @@ void CMDIArea::myTileHorizontal() {
if ((windows.count() == 1) && windows.at(0)) {
m_appCaption = windows.at(0)->caption();
- windows.at(0)/*->parentWidget()*/->showMaximized();
+ windows.at(0)/*->tqparentWidget()*/->showMaximized();
}
else {
@@ -191,13 +179,13 @@ void CMDIArea::myTileHorizontal() {
int y = 0;
for ( int i = 0; i < int(windows.count()); ++i ) {
TQWidget *window = windows.at(i);
- window->parentWidget()->showNormal();
- qApp->sendPostedEvents( 0, TQEvent::ShowNormal );
+ window->tqparentWidget()->showNormal();
+ tqApp->sendPostedEvents( 0, TQEvent::ShowNormal );
- const int preferredHeight = window->minimumHeight() + window->parentWidget()->baseSize().height();
- const int actHeight = QMAX(heightForEach, preferredHeight);
+ const int preferredHeight = window->minimumHeight() + window->tqparentWidget()->baseSize().height();
+ const int actHeight = TQMAX(heightForEach, preferredHeight);
- window->parentWidget()->setGeometry( 0, y, width(), actHeight );
+ window->tqparentWidget()->setGeometry( 0, y, width(), actHeight );
y += actHeight;
}
@@ -221,7 +209,7 @@ void CMDIArea::myCascade() {
if ((windows.count() == 1) && windows.at(0)) {
m_appCaption = windows.at(0)->caption();
- windows.at(0)->parentWidget()->showMaximized();
+ windows.at(0)->tqparentWidget()->showMaximized();
}
else {
const int offsetX = 40;
@@ -248,8 +236,8 @@ void CMDIArea::myCascade() {
window->setUpdatesEnabled(false);
- window->parentWidget()->raise(); //make it the on-top-of-window-stack window to make sure they're in the right order
- window->parentWidget()->setGeometry(x, y, windowWidth, windowHeight);
+ window->tqparentWidget()->raise(); //make it the on-top-of-window-stack window to make sure they're in the right order
+ window->tqparentWidget()->setGeometry(x, y, windowWidth, windowHeight);
x += offsetX;
y += offsetY;
@@ -258,8 +246,8 @@ void CMDIArea::myCascade() {
setUpdatesEnabled(true);
- active->parentWidget()->setGeometry(x, y, windowWidth, windowHeight);
- active->parentWidget()->raise();
+ active->tqparentWidget()->setGeometry(x, y, windowWidth, windowHeight);
+ active->tqparentWidget()->raise();
active->setActiveWindow();
blockSignals(false);
@@ -303,9 +291,8 @@ bool CMDIArea::eventFilter( TQObject *o, TQEvent *e ) {
TQWidget* w = dynamic_cast<TQWidget*>( o );
bool ret = TQWorkspace::eventFilter(o,e);
-#if QT_VERSION >= 0x030300
if ( w && (e->type() == TQEvent::WindowStateChange) ) {
- if (o->inherits("CDisplayWindow") && ((w->windowState() & Qt::WindowMinimized) || w->isHidden())) { //window was minimized, trigger a tile/cascade update if necessary
+ if (o->inherits("CDisplayWindow") && ((w->windowState() & TQt::WindowMinimized) || w->isHidden())) { //window was minimized, trigger a tile/cascade update if necessary
triggerWindowUpdate();
ret = false;
}
@@ -315,20 +302,6 @@ bool CMDIArea::eventFilter( TQObject *o, TQEvent *e ) {
//o->dumpObjectTree();
}
}
-#else
- if (w && o->inherits("CDisplayWindow")){
- if ((e->type() == TQEvent::ShowMinimized) ||
- (e->type() == TQEvent::Hide)){
- triggerWindowUpdate();
- ret = false;
- }
- }
- else if (!o->inherits("CDisplayWindow")){
- qDebug("bad mdi child classname: %s", o->className());
- //o->dumpObjectInfo();
- //o->dumpObjectTree();
- }
-#endif
return ret; // standard event processing
}