Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
235d5917
Commit
235d5917
authored
Sep 22, 2010
by
Max-Wilhelm Bruker
Browse files
sideboarding crash fix
parent
79a3a1a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractgraphicsitem.h
View file @
235d5917
...
...
@@ -8,7 +8,8 @@ enum GraphicsItemType {
typeCardDrag
=
QGraphicsItem
::
UserType
+
2
,
typeZone
=
QGraphicsItem
::
UserType
+
3
,
typePlayerTarget
=
QGraphicsItem
::
UserType
+
4
,
typeOther
=
QGraphicsItem
::
UserType
+
5
typeDeckViewCardContainer
=
QGraphicsItem
::
UserType
+
5
,
typeOther
=
QGraphicsItem
::
UserType
+
6
};
class
AbstractGraphicsItem
:
public
QGraphicsItem
{
...
...
cockatrice/src/deckview.cpp
View file @
235d5917
...
...
@@ -5,9 +5,10 @@
#include
"carddatabase.h"
#include
"settingscache.h"
#include
"main.h"
#include
<QDebug>
DeckViewCardDragItem
::
DeckViewCardDragItem
(
DeckViewCard
*
_item
,
const
QPointF
&
_hotSpot
,
AbstractCardDragItem
*
parentDrag
)
:
AbstractCardDragItem
(
_item
,
_hotSpot
,
parentDrag
)
:
AbstractCardDragItem
(
_item
,
_hotSpot
,
parentDrag
)
,
currentZone
(
0
)
{
}
...
...
@@ -22,6 +23,7 @@ void DeckViewCardDragItem::updatePosition(const QPointF &cursorScenePos)
if
(
!
cursorZone
)
return
;
currentZone
=
cursorZone
;
qDebug
()
<<
currentZone
;
QPointF
newPos
=
cursorScenePos
;
if
(
newPos
!=
pos
())
{
...
...
@@ -119,6 +121,7 @@ void DeckViewCard::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
DeckViewCardContainer
::
DeckViewCardContainer
(
const
QString
&
_name
)
:
QGraphicsItem
(),
name
(
_name
),
width
(
0
),
height
(
0
),
maxWidth
(
0
)
{
qDebug
()
<<
"CardContainer constructor: name="
<<
_name
<<
"; this="
<<
this
;
QString
bgPath
=
settingsCache
->
getTableBgPath
();
if
(
!
bgPath
.
isEmpty
())
bgPixmap
.
load
(
bgPath
);
...
...
cockatrice/src/deckview.h
View file @
235d5917
...
...
@@ -49,6 +49,8 @@ private:
QPixmap
bgPixmap
;
static
const
int
rowSpacing
=
5
;
public:
enum
{
Type
=
typeDeckViewCardContainer
};
int
type
()
const
{
return
Type
;
}
DeckViewCardContainer
(
const
QString
&
_name
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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