Qt Virtual Chart Table (QVCT)
CDevice.cpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 // QT
20 #include <QString>
21 
22 // QVCT
23 #include "QVCTRuntime.hpp"
24 #include "devices/CDevice.hpp"
26 
27 
28 //------------------------------------------------------------------------------
29 // CONSTRUCTORS / DESTRUCTOR
30 //------------------------------------------------------------------------------
31 
32 CDevice::CDevice( const QString& _rqsName )
33  : COverlayItem( COverlayObject::ITEM, _rqsName )
34  , eOperatingMode( CDevice::STOP )
35 {
36  QTreeWidgetItem::setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable );
37  QTreeWidgetItem::setText( CDeviceOverlay::NAME, qsName );
38  QTreeWidgetItem::setCheckState( CDeviceOverlay::SELECT, Qt::Unchecked );
39  QObject::connect( this, SIGNAL( signalError(const QString&) ), QVCTRuntime::useMainWindow(), SLOT( slotError(const QString&) ) );
40  QObject::connect( this, SIGNAL( signalOperatingMode(CDevice::EOperatingMode) ), this, SLOT( slotOperatingMode(CDevice::EOperatingMode) ) );
41 }
@ NAME
Device name.
@ SELECT
Device selection status.
Generic navigation device (GPS, speedometer, compass, etc.)
Definition: CDevice.hpp:43
void slotOperatingMode(CDevice::EOperatingMode _eOperatingMode)
[Slot] Slot to handle operating mode changes
Definition: CDevice.hpp:104
EOperatingMode
Device operating mode (stop, start, pause)
Definition: CDevice.hpp:58
void signalError(const QString &_rqsErrorMessage)
Signal emitted by the device when an error occured.
CDevice(const QString &_rqsName)
Definition: CDevice.cpp:32
void signalOperatingMode(CDevice::EOperatingMode _eOperatingMode)
Signal emitted by the device when its operating mode changed.
Generic overlay item.
Generic overlay object.
QString qsName
Object name.
static CMainWindow * useMainWindow()