Qt Virtual Chart Table (QVCT)
COverlayObjectDetailView.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( _pqParent )
33  , poOverlayObject( 0 )
34 {
35  QWidget::setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
36 }
37 
38 
39 //------------------------------------------------------------------------------
40 // METHODS
41 //------------------------------------------------------------------------------
42 
43 //
44 // SLOTS
45 //
46 
47 void COverlayObjectDetailView::slotDestroyed( QObject* _pqObject )
48 {
49  if( !_pqObject || (QObject*)poOverlayObject != _pqObject ) return;
51 }
52 
53 //
54 // SETTERS
55 //
56 
58 {
59  if( poOverlayObject == _poOverlayObject ) return;
61  poOverlayObject = _poOverlayObject;
62  QObject::connect( poOverlayObject, SIGNAL( destroyed(QObject*) ), this, SLOT( slotDestroyed(QObject*) ) );
63  enableContent();
64 }
65 
67 {
68  if( poOverlayObject )
69  {
71  QObject::disconnect( (QObject*)poOverlayObject, 0, this, 0 );
72  }
73  poOverlayObject = 0;
74  resetContent();
75 }
COverlayObjectDetailView(QWidget *_pqParent=0)
virtual void resetContent()=0
Resets (clears) the content of the underlying widget.
virtual void disableContent()
Disables the content (controls) of the underlying widget.
void slotDestroyed(QObject *_pqObject)
Slot to handle object destruction.
void resetOverlayObject()
Resets (clears) the overlay object being displayed (and clears the underlying widget)
void setOverlayObject(COverlayObject *_poOverlayObject)
Sets the overlay object to be displayed (and refreshes the underlying widget)
virtual void enableContent()
Enables the content (controls) of the underlying widget.
COverlayObject * poOverlayObject
Overlay object being displayed.
Generic overlay object.