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
a5bdc4f5
Commit
a5bdc4f5
authored
Feb 08, 2012
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enter and Leave events for Maxim
parent
c4e771c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
UBGraphicsProxyWidget.cpp
src/domain/UBGraphicsProxyWidget.cpp
+10
-0
UBGraphicsProxyWidget.h
src/domain/UBGraphicsProxyWidget.h
+2
-0
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+24
-0
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+8
-0
No files found.
src/domain/UBGraphicsProxyWidget.cpp
View file @
a5bdc4f5
...
@@ -111,6 +111,16 @@ void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
...
@@ -111,6 +111,16 @@ void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
}
}
}
}
void
UBGraphicsProxyWidget
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
Q_UNUSED
(
event
)
// NOOP
}
void
UBGraphicsProxyWidget
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
Q_UNUSED
(
event
)
// NOOP
}
void
UBGraphicsProxyWidget
::
setDelegate
(
UBGraphicsItemDelegate
*
pDelegate
)
void
UBGraphicsProxyWidget
::
setDelegate
(
UBGraphicsItemDelegate
*
pDelegate
)
{
{
...
...
src/domain/UBGraphicsProxyWidget.h
View file @
a5bdc4f5
...
@@ -51,6 +51,8 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
...
@@ -51,6 +51,8 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
wheelEvent
(
QGraphicsSceneWheelEvent
*
event
);
virtual
void
wheelEvent
(
QGraphicsSceneWheelEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
a5bdc4f5
...
@@ -78,6 +78,16 @@ void UBGraphicsWidgetItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
...
@@ -78,6 +78,16 @@ void UBGraphicsWidgetItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
UBGraphicsProxyWidget
::
mouseReleaseEvent
(
event
);
UBGraphicsProxyWidget
::
mouseReleaseEvent
(
event
);
}
}
void
UBGraphicsWidgetItem
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
sendJSEnterEvent
();
UBGraphicsProxyWidget
::
hoverEnterEvent
(
event
);
}
void
UBGraphicsWidgetItem
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
sendJSLeaveEvent
();
UBGraphicsProxyWidget
::
hoverLeaveEvent
(
event
);
}
bool
UBGraphicsWidgetItem
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
bool
UBGraphicsWidgetItem
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
{
...
@@ -247,6 +257,20 @@ void UBGraphicsWidgetItem::removeScript()
...
@@ -247,6 +257,20 @@ void UBGraphicsWidgetItem::removeScript()
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onremove) { widget.onremove();}"
);
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onremove) { widget.onremove();}"
);
}
}
}
}
void
UBGraphicsWidgetItem
::
sendJSEnterEvent
()
{
if
(
mWebKitWidget
&&
mWebKitWidget
->
page
()
&&
mWebKitWidget
->
page
()
->
mainFrame
())
{
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onenter) { widget.onenter();}"
);
}
}
void
UBGraphicsWidgetItem
::
sendJSLeaveEvent
()
{
if
(
mWebKitWidget
&&
mWebKitWidget
->
page
()
&&
mWebKitWidget
->
page
()
->
mainFrame
())
{
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onleave) { widget.onleave();}"
);
}
}
void
UBGraphicsWidgetItem
::
clearSource
()
void
UBGraphicsWidgetItem
::
clearSource
()
{
{
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
a5bdc4f5
...
@@ -66,6 +66,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
...
@@ -66,6 +66,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual
void
remove
();
virtual
void
remove
();
void
removeScript
();
void
removeScript
();
QString
downloadUrl
(
const
QString
&
fileUrl
,
const
QString
&
extention
);
QString
downloadUrl
(
const
QString
&
fileUrl
,
const
QString
&
extention
);
QString
downloadWeb
(
const
QString
&
fileUrl
);
QString
downloadWeb
(
const
QString
&
fileUrl
);
void
processDropEvent
(
QDropEvent
*
event
);
void
processDropEvent
(
QDropEvent
*
event
);
...
@@ -77,13 +78,20 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
...
@@ -77,13 +78,20 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual
void
clearSource
();
virtual
void
clearSource
();
protected
:
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
virtual
void
sendJSEnterEvent
();
virtual
void
sendJSLeaveEvent
();
UBAbstractWidget
*
mWebKitWidget
;
UBAbstractWidget
*
mWebKitWidget
;
QMap
<
QString
,
QString
>
mPreferences
;
QMap
<
QString
,
QString
>
mPreferences
;
...
...
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