diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-28 16:02:03 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-28 16:02:03 (GMT) |
commit | 1ff83d2b44fe07d1bc6b243fad270dfa7d860dc7 (patch) | |
tree | d5f4f61cf81707bcba37febe68ef0d35a69ca7fe | |
parent | 0a4440ae092058fd1fd4cd8df3908bc8d3cabfee (diff) | |
download | Qt-1ff83d2b44fe07d1bc6b243fad270dfa7d860dc7.zip Qt-1ff83d2b44fe07d1bc6b243fad270dfa7d860dc7.tar.gz Qt-1ff83d2b44fe07d1bc6b243fad270dfa7d860dc7.tar.bz2 |
Removed trace statements from QtGui
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 64 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 197 |
2 files changed, 9 insertions, 252 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 50d87a9..2996bf3 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -77,10 +77,6 @@ #include <hal.h> #include <hal_data.h> -#ifdef DEBUG_QSYMBIANCONTROL -#include <QDebug> -#endif - QT_BEGIN_NAMESPACE #if defined(QT_DEBUG) @@ -345,16 +341,6 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop) // the control's window qwidget->d_func()->createExtra(); -#ifdef DEBUG_QSYMBIANCONTROL - qDebug() << "QSymbianControl::ConstructL [" << this - << "] widget" << qwidget - << "isWindowOwning" << isWindowOwning - << "parentWidget" << qwidget->parentWidget() - << "OwnsWindow" << OwnsWindow() - << "Window.ClientHandle" << reinterpret_cast<const void*>(DrawableWindow()->ClientHandle()) - << "WindowGroupId" << DrawableWindow()->WindowGroupId(); -#endif - SetFocusing(true); m_longTapDetector = QLongTapTimer::NewL(this); } @@ -796,17 +782,6 @@ void QSymbianControl::Draw(const TRect& r) const QWindowSurface *surface = qwidget->windowSurface(); QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL; -#ifdef DEBUG_QSYMBIANCONTROL - qDebug() << "QSymbianControl::Draw [" << this << "]" - << "rect " << r.iTl.iX << ',' << r.iTl.iY - << '-' << r.iBr.iX << ',' << r.iBr.iY - << "surface" << surface - << "engine" << engine - << "raster" << (engine ? engine->type() == QPaintEngine::Raster : false) - << "opaque" << (qwidget->d_func()->isOpaque) - << "disableBlit" << (qwidget->d_func()->extraData()->disableBlit); -#endif - if (!engine) return; @@ -815,34 +790,9 @@ void QSymbianControl::Draw(const TRect& r) const CFbsBitmap *bitmap = s60Surface->symbianBitmap(); CWindowGc &gc = SystemGc(); - if(qwidget->d_func()->extraData()->disableBlit) { -#ifdef DEBUG_QSYMBIANCONTROL - const TDisplayMode displayMode = bitmap->DisplayMode(); - qDebug() << "QSymbianControl::Draw [" << this << "]" - << "mode " << displayMode; - - const TUint32 *address = bitmap->DataAddress(); - const int bitmapWidth = bitmap->SizeInPixels().iWidth; - const int bitmapHeight = bitmap->SizeInPixels().iHeight; - - for(int i=0; i<10 and i*10<bitmapWidth and i*10<bitmapHeight; ++i) { - const int coord = i*10; - const TUint32 *ptr = address + (coord * bitmapWidth) + coord; - const TUint32 pixel = *ptr; - qDebug() << " " << i*10 << " : " << ptr << pixel; - } - - for(int i=0; i<10 and i*10<bitmapWidth and i*10<bitmapHeight; ++i) { - TRgb color; - bitmap->GetPixel(color, TPoint(i*10, i*10)); - qDebug() << " " << i*10 << " : " << color.Red() << color.Green() << color.Blue() << color.Alpha(); - } -#endif - } - else { + if(!qwidget->d_func()->extraData()->disableBlit) { if (qwidget->d_func()->isOpaque) gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); - gc.BitBlt(r.iTl, bitmap, r); } } else { @@ -857,12 +807,6 @@ void QSymbianControl::SizeChanged() QSize oldSize = qwidget->size(); QSize newSize(Size().iWidth, Size().iHeight); -#ifdef DEBUG_QSYMBIANCONTROL - qDebug() << "QSymbianControl::SizeChanged [" << this << "]" - << oldSize.width() << 'x' << oldSize.height() - << "-" << newSize.width() << 'x' << newSize.height(); -#endif - if (oldSize != newSize) { QRect cr = qwidget->geometry(); cr.setSize(newSize); @@ -889,12 +833,6 @@ void QSymbianControl::PositionChanged() QPoint oldPos = qwidget->geometry().topLeft(); QPoint newPos(Position().iX, Position().iY); -#ifdef DEBUG_QSYMBIANCONTROL - qDebug() << "QSymbianControl::SizeChanged [" << this << "]" - << oldPos.x() << ',' << oldPos.y() - << "-" << newPos.x() << ',' << newPos.y(); -#endif - if (oldPos != newPos) { QRect cr = qwidget->geometry(); cr.moveTopLeft(newPos); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index d69a5d0..d6e0a97 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -56,10 +56,6 @@ #include <aknappui.h> #endif -#ifdef DEBUG_QWIDGET -#include <QDebug> -#endif - QT_BEGIN_NAMESPACE extern bool qt_nograb(); @@ -91,11 +87,6 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "]" - << "q" << q; -#endif - Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); /* @@ -140,17 +131,8 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (data.wrect.contains(vrect)) { xrect = data.wrect; xrect.translate(data.crect.topLeft()); - if (data.winid) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (1)" - << "control" << data.winid - << "SetExtent" << xrect.x() << ',' << xrect.y() - << xrect.width() << 'x' << xrect.height(); -#endif - + if (data.winid) data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height())); - } return; } } @@ -163,7 +145,6 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) //parent's X coord system is equal to parent's Qt coord //sys, so we don't need to map xrect. } - } // unmap if we are outside the valid window system coord system @@ -172,16 +153,8 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (q->testAttribute(Qt::WA_OutsideWSRange) != outsideRange) { q->setAttribute(Qt::WA_OutsideWSRange, outsideRange); if (outsideRange) { - if (data.winid) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (2)" - << "control" << data.winid - << "SetVisible(EFalse)"; -#endif - + if (data.winid) data.winid->DrawableWindow()->SetVisible(EFalse); - } q->setAttribute(Qt::WA_Mapped, false); } else if (!q->isHidden()) { mapWindow = true; @@ -194,23 +167,13 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) bool jump = (data.wrect != wrect); data.wrect = wrect; - // and now recursively for all children... - // ### can be optimized for (int i = 0; i < children.size(); ++i) { QObject *object = children.at(i); if (object->isWidgetType()) { QWidget *w = static_cast<QWidget *>(object); - if (!w->isWindow() && w->testAttribute(Qt::WA_WState_Created)) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (3)" - << "control" << data.winid - << "child" << w->d_func(); -#endif - + if (!w->isWindow() && w->testAttribute(Qt::WA_WState_Created)) w->d_func()->setWSGeometry(jump); - } } } @@ -221,50 +184,18 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (!parent->internalWinId()) xrect.translate(parent->mapTo(q->nativeParentWidget(), QPoint(0, 0))); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (4)" - << "control" << data.winid - << "SetExtent" << xrect.x() << ',' << xrect.y() - << xrect.width() << 'x' << xrect.height(); -#endif - data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height())); - if(!jump) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (5)" - << "control" << data.winid - << "DrawNow"; -#endif - - data.winid->DrawNow(); - } } if (mapWindow and !dontShow) { q->setAttribute(Qt::WA_Mapped); - if (q->internalWinId()) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (8)" - << "control" << data.winid - << "SetVisible(ETrue)"; -#endif - + if (q->internalWinId()) q->internalWinId()->DrawableWindow()->SetVisible(ETrue); - } } if (jump && data.winid) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (7)" - << "control" << data.winid - << "DrawNow" << wrect.width() << 'x' << wrect.height(); -#endif - - RWindow *const window = static_cast<RWindow *>(data.winid->DrawableWindow()); - window->Invalidate(TRect(0, 0, wrect.width(), wrect.height())); + RWindow *const window = static_cast<RWindow *>(data.winid->DrawableWindow()); + window->Invalidate(TRect(0, 0, wrect.width(), wrect.height())); } } @@ -272,12 +203,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "]" - << "q" << q - << x << ',' << y << w << 'x' << h << isMove; -#endif - Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); if ((q->windowType() == Qt::Desktop)) @@ -311,39 +236,20 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (q->isWindow()) { if (w == 0 || h == 0) { q->setAttribute(Qt::WA_OutsideWSRange, true); - if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (1)" - << "hide"; -#endif - + if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) hide_sys(); - } data.crect = QRect(x, y, w, h); data.window_state &= ~Qt::WindowFullScreen; } else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) { q->setAttribute(Qt::WA_OutsideWSRange, false); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (2)" - << "SetRect, show"; -#endif - // put the window in its place and show it q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h))); data.crect.setRect(x, y, w, h); - show_sys(); } else { QRect r = QRect(x, y, w, h); data.crect = r; - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (3)" - << "SetRect"; -#endif - q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h))); topData()->normalGeometry = data.crect; } @@ -366,15 +272,8 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (inTopLevelResize) tlwExtra->inTopLevelResize = true; } - if (q->testAttribute(Qt::WA_WState_Created)) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (4)" - << "setWSGeometry"; -#endif - + if (q->testAttribute(Qt::WA_WState_Created)) setWSGeometry(); - } } if (q->isVisible()) { @@ -419,19 +318,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de bool desktop = (type == Qt::Desktop); //bool tool = (type == Qt::Tool || type == Qt::Drawer); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::create_sys [" << this << "] " - << "q" << q; - qDebug() << "QWidgetPrivate::create_sys [" << this << "] " - << "type" << type - << "flags" << flags - << "parent" << parentWidget - << "topLevel" << topLevel - << "popup" << popup - << "dialog" << dialog - << "desktop" << desktop; -#endif - WId id = 0; if (popup) @@ -535,11 +421,6 @@ void QWidgetPrivate::show_sys() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::show_sys [" << this << "] " - << "q" << q; -#endif - if (q->testAttribute(Qt::WA_OutsideWSRange)) return; @@ -556,14 +437,6 @@ void QWidgetPrivate::show_sys() WId id = q->internalWinId(); if (!extra->activated) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::show_sys [" << this << "]" - << "id" << id - << "isWindow" << q->isWindow() - << "ActivateL"; -#endif - QT_TRAP_THROWING(id->ActivateL()); extra->activated = 1; } @@ -586,23 +459,11 @@ void QWidgetPrivate::hide_sys() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::hide_sys [" << this << "]" - << "q" << q; -#endif - Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); deactivateWidgetCleanup(); WId id = q->internalWinId(); if (id) { - -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::show_sys [" << this << "]" - << "id" << id - << "MakeVisible(false)"; -#endif - if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged() id->SetFocus(false); id->MakeVisible(false); @@ -628,12 +489,6 @@ void QWidgetPrivate::handleSymbianDeferredFocusChanged() Q_Q(QWidget); WId control = q->internalWinId(); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::handleSymbianDeferredFocusChanged [" << this << "]" - << "q" << q - << "control" << control; -#endif - if (!control) { // This could happen if the widget was reparented, while the focuschange // was in the event queue. @@ -662,11 +517,6 @@ void QWidgetPrivate::raise_sys() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::raise_sys [" << this << "]" - << "q" << q; -#endif - Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); if (q->internalWinId()) q->internalWinId()->DrawableWindow()->SetOrdinalPosition(0); @@ -676,11 +526,6 @@ void QWidgetPrivate::lower_sys() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::lower_sys [" << this << "]" - << "q" << q; -#endif - Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); if (q->internalWinId()) q->internalWinId()->DrawableWindow()->SetOrdinalPosition(-1); @@ -713,11 +558,6 @@ void QWidgetPrivate::reparentChildren() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::reparentChildren [" << this << "]" - << "q" << q; -#endif - QObjectList chlist = q->children(); for (int i = 0; i < chlist.size(); ++i) { // reparent children QObject *obj = chlist.at(i); @@ -749,13 +589,6 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::setParent_sys [" << this << "]" - << "q" << q - << "parent" << parent - << "f" << f; -#endif - bool wasCreated = q->testAttribute(Qt::WA_WState_Created); if (q->isVisible() && q->parentWidget() && parent != q->parentWidget()) @@ -819,11 +652,6 @@ void QWidgetPrivate::s60UpdateIsOpaque() { Q_Q(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidgetPrivate::s60UpdateIsOpaque [" << this << "]" - << "q" << q; -#endif - if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground)) return; @@ -1220,11 +1048,6 @@ void QWidget::setWindowState(Qt::WindowStates newstate) { Q_D(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidget::setWindowState [" << this << "]" - << "newstate" << newstate; -#endif - Qt::WindowStates oldstate = windowState(); if (oldstate == newstate) return; @@ -1473,10 +1296,6 @@ void QWidget::activateWindow() { Q_D(QWidget); -#ifdef DEBUG_QWIDGET - qDebug() << "QWidget::activateWindow [" << this << "]"; -#endif - QWidget *tlw = window(); if (tlw->isVisible()) { window()->createWinId(); |