Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
ee7fa32d
Commit
ee7fa32d
authored
May 11, 2011
by
CGoGN GIT Supervisor
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of /home/kraemer/CGoGN
* 'master' of /home/kraemer/CGoGN: ajout cb_wheelEvent
parents
eb4c4e01
ceb16a9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
include/Utils/qtSimple.h
include/Utils/qtSimple.h
+5
-1
src/Utils/qtgl.cpp
src/Utils/qtgl.cpp
+5
-2
No files found.
include/Utils/qtSimple.h
View file @
ee7fa32d
...
...
@@ -291,6 +291,11 @@ public:
*/
virtual
void
cb_mouseMove
(
int
button
,
int
x
,
int
y
)
{}
/**
* the mouse has been move (with button still pressed)
*/
virtual
void
cb_wheelEvent
(
int
delta
,
int
x
,
int
y
)
{}
/**
* key press CB (context is ok)
*/
...
...
@@ -365,7 +370,6 @@ public:
*/
std
::
string
selectFileSave
(
const
std
::
string
&
title
=
"open file"
,
const
std
::
string
&
dir
=
"."
,
const
std
::
string
&
filters
=
"all (*.*)"
);
public
slots
:
virtual
void
cb_New
()
{
std
::
cerr
<<
"callback not implemented"
<<
std
::
endl
;
}
virtual
void
cb_Open
()
{
std
::
cerr
<<
"callback not implemented"
<<
std
::
endl
;
}
...
...
src/Utils/qtgl.cpp
View file @
ee7fa32d
...
...
@@ -292,7 +292,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent* event)
m_cbs
->
cb_mouseMove
(
event
->
button
(),
event
->
x
(),
getHeight
()
-
event
->
y
());
}
void
GLWidget
::
wheelEvent
(
QWheelEvent
*
event
)
void
GLWidget
::
wheelEvent
(
QWheelEvent
*
event
)
{
float
wl
=
-
0.05
f
*
FAR_PLANE
/
foc
;
...
...
@@ -303,9 +303,12 @@ void GLWidget::wheelEvent ( QWheelEvent * event )
newModel
=
1
;
updateGL
();
if
(
m_cbs
)
m_cbs
->
cb_wheelEvent
(
event
->
delta
(),
event
->
x
(),
getHeight
()
-
event
->
y
());
}
void
GLWidget
::
keyPressEvent
(
QKeyEvent
*
event
)
void
GLWidget
::
keyPressEvent
(
QKeyEvent
*
event
)
{
if
(
event
->
key
()
==
Qt
::
Key_Escape
)
close
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment