activityfw/testapplications/newtestappset/acttestdebugger/activitydebugerconsole.cpp
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "activitydebugerconsole.h"
       
    19 #include <hbscrollarea.h>
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 ActivityDebugerConsole::ActivityDebugerConsole(QGraphicsItem *parent):HbTextEdit(parent) 
       
    26 {
       
    27     setScrollable(true);
       
    28     setReadOnly(true);
       
    29     clearContextMenuFlag(Hb::ShowTextContextMenuOnLongPress);
       
    30     clearContextMenuFlag(Hb::ShowTextContextMenuOnSelectionClicked);
       
    31     connect( this, SIGNAL(contentsChanged()), this, SLOT(scrollToBotton()));
       
    32 }
       
    33 
       
    34 ActivityDebugerConsole::~ActivityDebugerConsole()
       
    35 {
       
    36 
       
    37 }
       
    38 
       
    39 
       
    40 void ActivityDebugerConsole::scrollToBotton()
       
    41     {
       
    42     HbScrollArea* scrollarea = scrollArea();
       
    43     QSizeF size = scrollarea->contentWidget()->size();
       
    44     QPointF point( 0, size.height() );
       
    45     scrollarea->scrollContentsTo(point);
       
    46     scrollarea->ensureVisible(point);
       
    47     }
       
    48 
       
    49 void ActivityDebugerConsole::appendText(const QString& text)
       
    50     {
       
    51     setPlainText(toPlainText()+text);
       
    52     }
       
    53 
       
    54 void ActivityDebugerConsole::clear()
       
    55     {
       
    56     setPlainText(QString());
       
    57     }
       
    58 
       
    59 void ActivityDebugerConsole::mousePressEvent(QGraphicsSceneMouseEvent */*event*/)
       
    60     {
       
    61     
       
    62     }
       
    63 
       
    64 void ActivityDebugerConsole::focusInEvent(QFocusEvent */*event*/)
       
    65     {
       
    66     
       
    67     }