VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrfGuiObjectInformationQt
levelBar.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2013 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
8
9
#pragma once
10
11
#include <QStyledItemDelegate>
12
#include <QProgressBar>
13
14
#include <
vrfGuiObjectInformationQt/vrfGuiObjectInformationQt.h
>
15
namespace
makVrf
16
{
17
namespace
makVrfGuiObjectInformationQt
18
{
21
class
DT_DLL_VRFGUIOBJECTINFORMATIONQT
DtLevelBar
:
public
QProgressBar
22
{
23
public
:
24
DtLevelBar
(QWidget* parent = 0);
25
26
~
DtLevelBar
();
27
29
virtual
void
setText(
const
QString& text);
30
32
virtual
QString text()
const
;
33
34
protected
:
35
37
QString
myText
;
38
};
39
40
typedef
QString (*
DtLevelBarTextFunction
)(
double
level
,
double
max);
41
typedef
void (*
DtLevelBarValuesFunction
)(
int
& outLevel,
int
& outMax,
double
level
,
double
max);
42
typedef
DtLevelBarTextFunction
DtLevelBarToolTipFunction
;
43
46
class
DtLevelBarDelegate
:
public
QStyledItemDelegate
47
{
48
public
:
49
50
DtLevelBarDelegate
(QWidget *parent = 0);
51
~DtLevelBarDelegate
();
52
53
void
paint
(QPainter *painter,
const
QStyleOptionViewItem &option,
54
const
QModelIndex &index)
const
;
55
QSize
sizeHint
(
const
QStyleOptionViewItem &option,
56
const
QModelIndex &index)
const
;
57
61
void
setTextFunction
(
DtLevelBarTextFunction
func);
62
64
virtual
void
setText
(
DtLevelBar
& bar,
double
level
,
double
max)
const
;
65
70
void
setValuesFunction
(
DtLevelBarValuesFunction
func);
71
73
virtual
void
setValues
(
DtLevelBar
& bar,
double
level,
double
max)
const
;
74
78
void
setToolTipFunction
(
DtLevelBarTextFunction
func);
79
81
virtual
QWidget *
createEditor
(QWidget *parent,
const
QStyleOptionViewItem &option,
82
const
QModelIndex &index)
const
{
return
0; }
83
virtual
void
setEditorData
(QWidget *editor,
const
QModelIndex &index)
const
{}
84
virtual
void
setModelData
(QWidget *editor,
QAbstractItemModel
*model,
85
const
QModelIndex &index)
const
{}
86
87
protected
:
88
90
static
QString
defaultTextFunction
(
double
level,
double
max);
91
93
static
void
defaultValuesFunction
(
int
& outLevel,
int
& outMax,
double
level,
double
max);
94
95
DtLevelBarTextFunction
myTextFunction
;
96
DtLevelBarValuesFunction
myValuesFunction
;
97
DtLevelBarToolTipFunction
myToolTipFunction
;
98
};
99
}
100
}
101
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)