Qt Virtual Chart Table (QVCT)
COverlayText.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_COVERLAYTEXT_HPP
20 #define QVCT_COVERLAYTEXT_HPP
21 
22 // QT
23 #include <QLabel>
24 #include <QWidget>
25 
26 
28 
33 class COverlayText: public QLabel
34 {
35 
36  //------------------------------------------------------------------------------
37  // CONSTRUCTORS / DESTRUCTOR
38  //------------------------------------------------------------------------------
39 
40 public:
41  COverlayText( QWidget* _pqParent = 0 );
42  COverlayText( const QString& _rqsText, QWidget* _pqParent = 0 );
43  virtual ~COverlayText() {};
44 
45 
46  //------------------------------------------------------------------------------
47  // METHODS: QLabel (override)
48  //------------------------------------------------------------------------------
49 
50 public:
52  void setText( const QString& _rqsText );
53 
54 
55  //------------------------------------------------------------------------------
56  // METHODS
57  //------------------------------------------------------------------------------
58 
59  // SETTERS
60 public:
62 
65  virtual void setText( const QString& _rqsText, bool _bInvalid );
67  void resetText();
68 
69  // OTHER
70 public:
72  const QString& emptyString();
74  QString formatString( const QString& _rqsString );
75 
76 };
77 
78 #endif // QVCT_COVERLAYTEXT_HPP
[UI] Overlay-specific text label
virtual ~COverlayText()
void setText(const QString &_rqsText)
[override] QLabel::setText( const QString& )
COverlayText(QWidget *_pqParent=0)
QString formatString(const QString &_rqsString)
Returns the string properly formatted if it is undefined (empty)
const QString & emptyString()
Returns the string corresponding to undefined (empty) content ("n/a" in English)
void resetText()
Resets (clears) the underlying QLabel's text.