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
f3a449f5
Commit
f3a449f5
authored
Aug 06, 2012
by
Yimgo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics in UBGrahicsWebView and UBGraphicsWidgetItem classes.
parent
4cbdf772
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
591 additions
and
746 deletions
+591
-746
UBGraphicsWebView.cpp
src/domain/UBGraphicsWebView.cpp
+10
-28
UBGraphicsWebView.h
src/domain/UBGraphicsWebView.h
+0
-3
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+483
-536
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+98
-179
No files found.
src/domain/UBGraphicsWebView.cpp
View file @
f3a449f5
...
@@ -13,20 +13,18 @@
...
@@ -13,20 +13,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "UBGraphicsWebView.h"
#include <QtGui>
#include <QtGui>
#include <QtWebKit>
#include <QtWebKit>
#include "UBGraphicsWebView.h"
#include "UBGraphicsScene.h"
#include "UBGraphicsScene.h"
#include "UBGraphicsItemDelegate.h"
#include "UBGraphicsItemDelegate.h"
#include "UBGraphicsDelegateFrame.h"
#include "UBGraphicsDelegateFrame.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
UBGraphicsWebView
::
UBGraphicsWebView
(
QGraphicsItem
*
parent
)
:
UBGraphicsWebView
::
UBGraphicsWebView
(
QGraphicsItem
*
parent
)
QGraphicsWebView
(
parent
)
:
QGraphicsWebView
(
parent
)
{
{
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
Object
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
Object
);
...
@@ -68,30 +66,17 @@ void UBGraphicsWebView::setUuid(const QUuid &pUuid)
...
@@ -68,30 +66,17 @@ void UBGraphicsWebView::setUuid(const QUuid &pUuid)
void
UBGraphicsWebView
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
void
UBGraphicsWebView
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
{
if
(
mDelegate
->
mousePressEvent
(
event
))
if
(
!
mDelegate
->
mousePressEvent
(
event
))
{
setSelected
(
true
);
/* forcing selection */
//NOOP
}
else
{
// QT Proxy Widget is a bit lazy, we force the selection ...
setSelected
(
true
);
}
QGraphicsWebView
::
mousePressEvent
(
event
);
QGraphicsWebView
::
mousePressEvent
(
event
);
}
}
void
UBGraphicsWebView
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
void
UBGraphicsWebView
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
{
if
(
mDelegate
->
mouseMoveEvent
(
event
))
if
(
!
mDelegate
->
mouseMoveEvent
(
event
))
{
// NOOP;
}
else
{
QGraphicsWebView
::
mouseMoveEvent
(
event
);
QGraphicsWebView
::
mouseMoveEvent
(
event
);
}
}
}
...
@@ -103,7 +88,7 @@ void UBGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
...
@@ -103,7 +88,7 @@ void UBGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void
UBGraphicsWebView
::
wheelEvent
(
QGraphicsSceneWheelEvent
*
event
)
void
UBGraphicsWebView
::
wheelEvent
(
QGraphicsSceneWheelEvent
*
event
)
{
{
if
(
mDelegate
->
weelEvent
(
event
)
)
if
(
mDelegate
->
weelEvent
(
event
)
)
{
{
QGraphicsWebView
::
wheelEvent
(
event
);
QGraphicsWebView
::
wheelEvent
(
event
);
event
->
accept
();
event
->
accept
();
...
@@ -113,20 +98,18 @@ void UBGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent *event)
...
@@ -113,20 +98,18 @@ void UBGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent *event)
void
UBGraphicsWebView
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
void
UBGraphicsWebView
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
{
Q_UNUSED
(
event
)
Q_UNUSED
(
event
)
// NOOP
/* NOOP */
}
}
void
UBGraphicsWebView
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
void
UBGraphicsWebView
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
{
Q_UNUSED
(
event
)
Q_UNUSED
(
event
)
// NOOP
/* NOOP */
}
}
void
UBGraphicsWebView
::
setDelegate
(
UBGraphicsItemDelegate
*
pDelegate
)
void
UBGraphicsWebView
::
setDelegate
(
UBGraphicsItemDelegate
*
pDelegate
)
{
{
if
(
mDelegate
)
if
(
mDelegate
)
{
delete
mDelegate
;
delete
mDelegate
;
}
mDelegate
=
pDelegate
;
mDelegate
=
pDelegate
;
}
}
...
@@ -140,8 +123,7 @@ void UBGraphicsWebView::resize(qreal w, qreal h)
...
@@ -140,8 +123,7 @@ void UBGraphicsWebView::resize(qreal w, qreal h)
void
UBGraphicsWebView
::
resize
(
const
QSizeF
&
pSize
)
void
UBGraphicsWebView
::
resize
(
const
QSizeF
&
pSize
)
{
{
if
(
pSize
!=
size
())
if
(
pSize
!=
size
())
{
{
QGraphicsWebView
::
setMaximumSize
(
pSize
.
width
(),
pSize
.
height
());
QGraphicsWebView
::
setMaximumSize
(
pSize
.
width
(),
pSize
.
height
());
QGraphicsWebView
::
resize
(
pSize
.
width
(),
pSize
.
height
());
QGraphicsWebView
::
resize
(
pSize
.
width
(),
pSize
.
height
());
if
(
mDelegate
)
if
(
mDelegate
)
...
...
src/domain/UBGraphicsWebView.h
View file @
f3a449f5
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include <QtGui>
#include <QtGui>
#include <QtWebKit>
#include <QtWebKit>
#include "UBItem.h"
#include "UBItem.h"
#include "UBResizableGraphicsItem.h"
#include "UBResizableGraphicsItem.h"
...
@@ -56,8 +55,6 @@ class UBGraphicsWebView: public QGraphicsWebView, public UBItem, public UBResiza
...
@@ -56,8 +55,6 @@ class UBGraphicsWebView: public QGraphicsWebView, public UBItem, public UBResiza
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
bool
event
(
QEvent
*
event
);
virtual
bool
event
(
QEvent
*
event
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
};
};
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
f3a449f5
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsWidgetItem.h
View file @
f3a449f5
This diff is collapsed.
Click to expand it.
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