filemanager/src/filemanager/src/components/fmtimequery.cpp
author hgs
Thu, 05 Aug 2010 11:30:07 +0800
changeset 33 328cf6fbe40c
parent 25 b7bfdea70ca2
child 40 4167eb56f30d
permissions -rw-r--r--
201031

/*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 * 
 * Contributors:
 *
 * 
 * Description:
 *     The source file of the time query of file manager
 */

#include "fmtimequery.h"

#include <QGraphicsItem>
#include <QGraphicsLinearLayout>

#include <hbdatetimeedit.h>


FmTimeQuery::FmTimeQuery( QGraphicsItem *parent ) : FmDialog( parent )
{
    setObjectName( "timeQueryDialog" );
    mContentWidget = new QGraphicsWidget();
	setContentWidget(mContentWidget);
	mContentWidget->setObjectName( "timeQueryContentWidget" );
	QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
    vLayout->setOrientation( Qt::Vertical );

    mTimeWidget = new HbDateTimeEdit();
    mTimeWidget->setObjectName( "timeQueryTimeWidget" );
	vLayout->addItem( mTimeWidget );

    mTimeWidget->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
    mTimeWidget->setDisplayFormat( "hh:mm" );
    mTimeWidget->setDateTime( QDateTime::currentDateTime() );

	this->setTimeout( NoTimeout );
	mContentWidget->setLayout( vLayout );
}

FmTimeQuery::~FmTimeQuery(void)
{
}

void FmTimeQuery::setTime( const QTime &time )
{
    QDateTime dateTime = QDateTime::currentDateTime();
    dateTime.setTime( time );
    mTimeWidget->setDateTime( dateTime );
}

QTime FmTimeQuery::getTime()
{
    return mTimeWidget->dateTime().time();
}