radioapp/radiowidgets/src/radiofrequencyitem.cpp
changeset 13 46974bebc798
child 16 f54ebcfc1b80
equal deleted inserted replaced
0:f3d95d9c00ab 13:46974bebc798
       
     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 // System includes
       
    19 
       
    20 // User includes
       
    21 #include "radiofrequencyitem.h"
       
    22 #include "radiofrequencystrip.h"
       
    23 
       
    24 /*!
       
    25  *
       
    26  */
       
    27 RadioFrequencyItem::RadioFrequencyItem( QString frequency ) :
       
    28     mFrequency( frequency.isEmpty() ? 0 : frequency.toInt() * KOneHertz ),
       
    29     mGraphicsItem( 0 )
       
    30 {
       
    31 }
       
    32 
       
    33 /*!
       
    34  *
       
    35  */
       
    36 uint RadioFrequencyItem::frequency() const
       
    37 {
       
    38     return mFrequency;
       
    39 }
       
    40 
       
    41 /*!
       
    42  *
       
    43  */
       
    44 QPixmap RadioFrequencyItem::updatePrimitive( QGraphicsPixmapItem* item )
       
    45 {
       
    46     mGraphicsItem = item;
       
    47     return mPixmap;
       
    48 }
       
    49 
       
    50 /*!
       
    51  *
       
    52  */
       
    53 void RadioFrequencyItem::setPixmap( QPixmap pixmap )
       
    54 {
       
    55     mPixmap = pixmap;
       
    56     if ( mGraphicsItem ) {
       
    57         mGraphicsItem->setPixmap( mPixmap );
       
    58     }
       
    59 }