Qt Virtual Chart Table (QVCT)
CInstrument.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 <QWidget>
21 
22 // QVCT
23 #include "QVCTRuntime.hpp"
25 
26 
27 //------------------------------------------------------------------------------
28 // CONSTRUCTORS / DESTRUCTOR
29 //------------------------------------------------------------------------------
30 
32  : QWidget( _poVesselCockpit )
33 {}
34 
35 
36 //------------------------------------------------------------------------------
37 // METHODS: QWidget (OVERRIDE)
38 //------------------------------------------------------------------------------
39 
40 void CInstrument::paintEvent( QPaintEvent* _pqPaintEvent )
41 {
42  draw();
43 }
44 
45 
46 //------------------------------------------------------------------------------
47 // METHODS
48 //------------------------------------------------------------------------------
49 
50 //
51 // GETTER
52 //
53 
55 {
56  return ((CVesselCockpit*)QWidget::parent())->poVesselPoint;
57 }
CInstrument(CVesselCockpit *_poVesselCockpit)
Definition: CInstrument.cpp:31
virtual void paintEvent(QPaintEvent *_pqPaintEvent)
Definition: CInstrument.cpp:40
CVesselPoint * useVesselPoint()
Returns parent cockpit's associated vessel (0 if the vessel is undefined)
Definition: CInstrument.cpp:54
virtual void draw()=0
Draws the instrument (resets if the vessel is undefined)
[UI] Generic vessel's cockpit view (window)
[UI] Vessel overlay point (item) / vessel