Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
c51a8159
Commit
c51a8159
authored
Mar 18, 2013
by
Aleksei Kanash
Committed by
Claudio Valerio
Mar 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first cherry-pick for mac os table pressure fix
parent
554ee877
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
5 deletions
+108
-5
UBBoardView.cpp
src/board/UBBoardView.cpp
+66
-1
UBBoardView.h
src/board/UBBoardView.h
+6
-3
UBCachePropertiesWidget.cpp
src/gui/UBCachePropertiesWidget.cpp
+0
-1
UBMainWindow.cpp
src/gui/UBMainWindow.cpp
+32
-0
UBMainWindow.h
src/gui/UBMainWindow.h
+4
-0
No files found.
src/board/UBBoardView.cpp
View file @
c51a8159
...
...
@@ -864,12 +864,77 @@ void UBBoardView::setMultiselection(bool enable)
mMultipleSelectionIsEnabled
=
enable
;
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
bool
UBBoardView
::
directTabletEvent
(
QEvent
*
event
)
{
QTabletEvent
*
tEvent
=
static_cast
<
QTabletEvent
*>
(
event
);
tEvent
=
new
QTabletEvent
(
tEvent
->
type
()
,
mapFromGlobal
(
tEvent
->
pos
())
,
tEvent
->
globalPos
()
,
tEvent
->
hiResGlobalPos
()
,
tEvent
->
device
()
,
tEvent
->
pointerType
()
,
tEvent
->
pressure
()
,
tEvent
->
xTilt
()
,
tEvent
->
yTilt
()
,
tEvent
->
tangentialPressure
()
,
tEvent
->
rotation
()
,
tEvent
->
z
()
,
tEvent
->
modifiers
()
,
tEvent
->
uniqueId
());
if
(
geometry
().
contains
(
tEvent
->
pos
()))
{
if
(
NULL
==
widgetForTabletEvent
(
this
->
parentWidget
(),
tEvent
->
pos
()))
{
tabletEvent
(
tEvent
);
return
true
;
}
}
return
false
;
}
QWidget
*
UBBoardView
::
widgetForTabletEvent
(
QWidget
*
w
,
const
QPoint
&
pos
)
{
Q_ASSERT
(
w
);
UBBoardView
*
board
=
qobject_cast
<
UBBoardView
*>
(
w
);
QWidget
*
childAtPos
=
NULL
;
QList
<
QObject
*>
childs
=
w
->
children
();
foreach
(
QObject
*
child
,
childs
)
{
QWidget
*
childWidget
=
qobject_cast
<
QWidget
*>
(
child
);
if
(
childWidget
)
{
if
(
childWidget
->
isVisible
()
&&
childWidget
->
geometry
().
contains
(
pos
))
{
QWidget
*
lastChild
=
widgetForTabletEvent
(
childWidget
,
pos
);
if
(
board
&&
board
->
viewport
()
==
lastChild
)
continue
;
if
(
NULL
!=
lastChild
)
childAtPos
=
lastChild
;
else
childAtPos
=
childWidget
;
break
;
}
else
childAtPos
=
NULL
;
}
}
return
childAtPos
;
}
#endif
void
UBBoardView
::
longPressEvent
()
{
UBDrawingController
*
drawingController
=
UBDrawingController
::
drawingController
();
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
disconnect
(
&
mLongPressTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
longPressEvent
()));
if
(
UBStylusTool
::
Selector
==
currentTool
)
...
...
src/board/UBBoardView.h
View file @
c51a8159
...
...
@@ -20,7 +20,6 @@
*/
#ifndef UBBOARDVIEW_H_
#define UBBOARDVIEW_H_
...
...
@@ -54,7 +53,11 @@ class UBBoardView : public QGraphicsView
void
setMultiselection
(
bool
enable
);
bool
isMultipleSelectionEnabled
()
{
return
mMultipleSelectionIsEnabled
;
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
bool
directTabletEvent
(
QEvent
*
event
);
QWidget
*
widgetForTabletEvent
(
QWidget
*
w
,
const
QPoint
&
pos
);
#endif
signals
:
void
resized
(
QResizeEvent
*
event
);
...
...
@@ -153,7 +156,7 @@ class UBBoardView : public QGraphicsView
bool
moveRubberBand
;
UBRubberBand
*
mUBRubberBand
;
QList
<
QGraphicsItem
*>
mRubberedItems
;
QSet
<
QGraphicsItem
*>
mJustSelectedItems
;
...
...
src/gui/UBCachePropertiesWidget.cpp
View file @
c51a8159
...
...
@@ -372,4 +372,3 @@ void UBCachePropertiesWidget::onCacheEnabled()
{
emit
showTab
(
this
);
}
src/gui/UBMainWindow.cpp
View file @
c51a8159
...
...
@@ -27,6 +27,10 @@
#include "core/UBApplication.h"
#include "core/UBApplicationController.h"
#include "board/UBBoardController.h"
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#include "board/UBBoardView.h"
#endif
#include "core/memcheck.h"
...
...
@@ -145,6 +149,34 @@ void UBMainWindow::closeEvent(QCloseEvent *event)
emit
closeEvent_Signal
(
event
);
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
bool
UBMainWindow
::
event
(
QEvent
*
event
)
{
bool
bRes
=
QMainWindow
::
event
(
event
);
if
(
NULL
!=
UBApplication
::
boardController
)
{
UBBoardView
*
controlV
=
UBApplication
::
boardController
->
controlView
();
if
(
controlV
&&
controlV
->
isVisible
())
{
switch
(
event
->
type
())
{
case
QEvent
:
:
TabletEnterProximity
:
case
QEvent
:
:
TabletLeaveProximity
:
case
QEvent
:
:
TabletMove
:
case
QEvent
:
:
TabletPress
:
case
QEvent
:
:
TabletRelease
:
{
return
controlV
->
directTabletEvent
(
event
);
}
}
}
}
return
bRes
;
}
#endif
void
UBMainWindow
::
onExportDone
()
{
// HACK : When opening the file save dialog during the document exportation,
...
...
src/gui/UBMainWindow.h
View file @
c51a8159
...
...
@@ -83,6 +83,10 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
QWidget
*
mDocumentsWidget
;
private
:
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
bool
event
(
QEvent
*
event
);
#endif
UBDownloadWidget
*
mpDownloadWidget
;
};
...
...
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