Qt Virtual Chart Table (QVCT)
CTimeView.hpp
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 #ifndef QVCT_CTIMEVIEW_HPP
20 #define QVCT_CTIMEVIEW_HPP
21 
22 // QT
23 #include <QBoxLayout>
24 #include <QDockWidget>
25 #include <QLabel>
26 #include <QWidget>
27 
28 
30 
35 class CTimeView: public QDockWidget
36 {
37  Q_OBJECT
38 
39 
40  //------------------------------------------------------------------------------
41  // FIELDS
42  //------------------------------------------------------------------------------
43 
44 private:
46  QWidget* pqWidget;
48  QBoxLayout* pqBoxLayout;
49 
51  QLabel* pqLabelDate;
53  QLabel* pqLabelTime;
55  QLabel* pqLabelTime2;
56 
57 
58  //------------------------------------------------------------------------------
59  // CONSTRUCTORS / DESTRUCTOR
60  //------------------------------------------------------------------------------
61 
62 public:
63  CTimeView( QWidget* _pqParent = 0 );
64  virtual ~CTimeView() {};
65 
66 private:
68  void constructLayout();
69 
70 
71  //------------------------------------------------------------------------------
72  // METHODS: QWidget (override)
73  //------------------------------------------------------------------------------
74 
75 protected slots:
76  virtual void resizeEvent( QResizeEvent* _pqResizeEvent );
77 
78 
79  //------------------------------------------------------------------------------
80  // METHODS
81  //------------------------------------------------------------------------------
82 
83  // SLOTS
84 private slots:
86  void slotLocationChanged( Qt::DockWidgetArea _qDockWidgetArea );
88  void slotTopLevelChanged( bool _bTopLevel );
89 
90  // OTHER
91 public:
93  void refreshContent();
94 
95 };
96 
97 #endif // QVCT_CTIMEVIEW_HPP
[UI] Time view (dock widget)
Definition: CTimeView.hpp:36
void refreshContent()
Refreshes the content of the underlying widget.
Definition: CTimeView.cpp:134
QLabel * pqLabelTime
[UI:Label] Time
Definition: CTimeView.hpp:53
virtual ~CTimeView()
Definition: CTimeView.hpp:64
CTimeView(QWidget *_pqParent=0)
Definition: CTimeView.cpp:38
QWidget * pqWidget
[UI:Widget] Container widget
Definition: CTimeView.hpp:46
QBoxLayout * pqBoxLayout
[UI:Layout] Layout
Definition: CTimeView.hpp:48
void slotLocationChanged(Qt::DockWidgetArea _qDockWidgetArea)
Slot to handle dock area change.
Definition: CTimeView.cpp:107
void constructLayout()
Constructs the layout of the user-interface.
Definition: CTimeView.cpp:48
void slotTopLevelChanged(bool _bTopLevel)
Slot to handle floating change.
Definition: CTimeView.cpp:121
virtual void resizeEvent(QResizeEvent *_pqResizeEvent)
Definition: CTimeView.cpp:81
QLabel * pqLabelTime2
[UI:Label] Time (alternate timezone)
Definition: CTimeView.hpp:55
QLabel * pqLabelDate
[UI:Label] Date
Definition: CTimeView.hpp:51