Omnidome
Fulldome Mapping Software Toolkit
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
omni
ui
AbstractInputWidget.h
Go to the documentation of this file.
1
/* Copyright (c) 2014-2015 "Omnidome" by cr8tr
2
* Dome Mapping Projection Software (http://omnido.me).
3
* Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4
*
5
* This file is part of Omnidome.
6
*
7
* Omnidome is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Affero General Public License as
9
* published by the Free Software Foundation, either version 3 of the
10
* License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU Affero General Public License for more details.
16
* You should have received a copy of the GNU Affero General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef OMNI_UI_ABSTRACTINPUTWIDGET_H_
21
#define OMNI_UI_ABSTRACTINPUTWIDGET_H_
22
23
#include <QLayout>
24
#include <
omni/ui/mixin/Editor.h
>
25
#include "
Widget.h
"
26
27
namespace
omni {
28
namespace
ui {
29
/// Input widget with an editor widget
30
class
AbstractInputWidget
:
31
public
Widget
,
32
protected
mixin::Editor
<AbstractInputWidget, QWidget>{
33
Q_OBJECT
34
35
public
:
36
typedef
mixin::Editor<AbstractInputWidget, QWidget>
mixin_editor_type
;
37
AbstractInputWidget
(QWidget * =
nullptr
);
38
virtual
~AbstractInputWidget
() {}
39
40
public
slots:
41
/// Set editor visible
42
virtual
void
setEditorVisible
(
bool
);
43
44
/// Show editor
45
void
showEditor
();
46
47
/// Hide editor
48
void
hideEditor
();
49
50
signals:
51
/// Value changed event
52
void
valueChanged
();
53
54
protected
:
55
/// Show editor on double click
56
virtual
void
mouseDoubleClickEvent
(QMouseEvent *);
57
58
/// Hide editor and set focus on click
59
virtual
void
mousePressEvent
(QMouseEvent *);
60
61
/// Show editor when enter key is pressed
62
virtual
void
keyPressEvent
(QKeyEvent *);
63
64
/// Draw slider handle
65
void
drawHandle
(QPainter& _p,
66
double
_pos,
67
double
_heightFactor = 1.0)
const
;
68
69
void
drawTrack
(QPainter& _p,
70
double
_pos)
const
;
71
72
void
drawTrack
(QPainter& _p,
73
double
_left,
74
double
_right)
const
;
75
76
void
init
();
77
78
QLabel *
valueLabel_
=
nullptr
;
79
};
80
}
81
}
82
83
#endif
/* OMNI_UI_ABSTRACTINPUTWIDGET_H_ */
omni::ui::AbstractInputWidget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *)
Hide editor and set focus on click.
Definition:
AbstractInputWidget.cpp:68
omni::ui::AbstractInputWidget
Input widget with an editor widget.
Definition:
AbstractInputWidget.h:30
omni::ui::AbstractInputWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *)
Show editor on double click.
Definition:
AbstractInputWidget.cpp:74
omni::ui::AbstractInputWidget::~AbstractInputWidget
virtual ~AbstractInputWidget()
Definition:
AbstractInputWidget.h:38
omni::ui::AbstractInputWidget::showEditor
void showEditor()
Show editor.
Definition:
AbstractInputWidget.cpp:58
omni::ui::AbstractInputWidget::mixin_editor_type
mixin::Editor< AbstractInputWidget, QWidget > mixin_editor_type
Definition:
AbstractInputWidget.h:36
omni::ui::AbstractInputWidget::valueChanged
void valueChanged()
Value changed event.
omni::ui::Widget
A single parameter widget with a label and color set.
Definition:
Widget.h:31
Editor.h
omni::ui::AbstractInputWidget::hideEditor
void hideEditor()
Hide editor.
Definition:
AbstractInputWidget.cpp:63
omni::ui::AbstractInputWidget::drawHandle
void drawHandle(QPainter &_p, double _pos, double _heightFactor=1.0) const
Draw slider handle.
Definition:
AbstractInputWidget.cpp:87
omni::ui::AbstractInputWidget::setEditorVisible
virtual void setEditorVisible(bool)
Set editor visible.
Definition:
AbstractInputWidget.cpp:45
Widget.h
omni::ui::AbstractInputWidget::AbstractInputWidget
AbstractInputWidget(QWidget *=nullptr)
Definition:
AbstractInputWidget.cpp:28
omni::ui::AbstractInputWidget::init
void init()
Definition:
AbstractInputWidget.cpp:35
omni::ui::AbstractInputWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *)
Show editor when enter key is pressed.
Definition:
AbstractInputWidget.cpp:79
omni::ui::AbstractInputWidget::valueLabel_
QLabel * valueLabel_
Definition:
AbstractInputWidget.h:78
omni::ui::AbstractInputWidget::drawTrack
void drawTrack(QPainter &_p, double _pos) const
Definition:
AbstractInputWidget.cpp:119
omni::ui::mixin::Editor
Mixin for a widget that holds an editor widget.
Definition:
Editor.h:30
Generated on Fri May 20 2016 13:38:19 for Omnidome by
1.8.6