kernel/qplatformdrag.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction) -
5 : m_accepted(accepted) -
6 , m_accepted_action(acceptedAction) -
7{ -
8}
never executed: }
0
9 -
10bool QPlatformDropQtResponse::isAccepted() const -
11{ -
12 return m_accepted;
never executed: return m_accepted;
0
13} -
14 -
15Qt::DropAction QPlatformDropQtResponse::acceptedAction() const -
16{ -
17 return m_accepted_action;
never executed: return m_accepted_action;
0
18} -
19 -
20QPlatformDragQtResponse::QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect) -
21 : QPlatformDropQtResponse(accepted,acceptedAction) -
22 , m_answer_rect(answerRect) -
23{ -
24}
never executed: }
0
25 -
26QRect QPlatformDragQtResponse::answerRect() const -
27{ -
28 return m_answer_rect;
never executed: return m_answer_rect;
0
29} -
30 -
31class QPlatformDragPrivate { -
32public: -
33 QPlatformDragPrivate() : cursor_drop_action(Qt::IgnoreAction) {}
executed: }
Execution Count:289
289
34 -
35 Qt::DropAction cursor_drop_action; -
36}; -
37QPlatformDrag::QPlatformDrag() : d_ptr(new QPlatformDragPrivate) -
38{ -
39}
executed: }
Execution Count:289
289
40 -
41QPlatformDrag::~QPlatformDrag() -
42{ -
43 delete d_ptr; -
44}
executed: }
Execution Count:287
287
45 -
46QDrag *QPlatformDrag::currentDrag() const -
47{ -
48 return QDragManager::self()->object();
executed: return QDragManager::self()->object();
Execution Count:64
64
49} -
50 -
51Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions, -
52 Qt::KeyboardModifiers modifiers) const -
53{ -
54 -
55 -
56 -
57 -
58 -
59 Qt::DropAction default_action = Qt::IgnoreAction; -
60 -
61 if (currentDrag()) {
partially evaluated: currentDrag()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
62 default_action = currentDrag()->defaultAction(); -
63 }
never executed: }
0
64 -
65 -
66 if (default_action == Qt::IgnoreAction) {
partially evaluated: default_action == Qt::IgnoreAction
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-27
67 -
68 -
69 default_action = Qt::CopyAction; -
70 }
executed: }
Execution Count:27
27
71 -
72 if (modifiers & Qt::ControlModifier && modifiers & Qt::ShiftModifier)
partially evaluated: modifiers & Qt::ControlModifier
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
never evaluated: modifiers & Qt::ShiftModifier
0-27
73 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
74 else if (modifiers & Qt::ControlModifier)
partially evaluated: modifiers & Qt::ControlModifier
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
75 default_action = Qt::CopyAction;
never executed: default_action = Qt::CopyAction;
0
76 else if (modifiers & Qt::ShiftModifier)
partially evaluated: modifiers & Qt::ShiftModifier
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
77 default_action = Qt::MoveAction;
never executed: default_action = Qt::MoveAction;
0
78 else if (modifiers & Qt::AltModifier)
partially evaluated: modifiers & Qt::AltModifier
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
79 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
80 -
81 -
82 -
83 -
84 -
85 -
86 if (!(possibleActions & default_action)) {
partially evaluated: !(possibleActions & default_action)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
87 if (possibleActions & Qt::CopyAction)
never evaluated: possibleActions & Qt::CopyAction
0
88 default_action = Qt::CopyAction;
never executed: default_action = Qt::CopyAction;
0
89 else if (possibleActions & Qt::MoveAction)
never evaluated: possibleActions & Qt::MoveAction
0
90 default_action = Qt::MoveAction;
never executed: default_action = Qt::MoveAction;
0
91 else if (possibleActions & Qt::LinkAction)
never evaluated: possibleActions & Qt::LinkAction
0
92 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
93 else -
94 default_action = Qt::IgnoreAction;
never executed: default_action = Qt::IgnoreAction;
0
95 } -
96 -
97 -
98 -
99 -
100 -
101 return default_action;
executed: return default_action;
Execution Count:27
27
102} -
103 -
104 -
105 -
106 -
107 -
108void QPlatformDrag::updateAction(Qt::DropAction action) -
109{ -
110 QPlatformDragPrivate * const d = d_func(); -
111 if (d->cursor_drop_action != action) {
never evaluated: d->cursor_drop_action != action
0
112 d->cursor_drop_action = action; -
113 currentDrag()->actionChanged(action); -
114 }
never executed: }
0
115}
never executed: }
0
116 -
117static const char *const default_pm[] = { -
118"13 9 3 1", -
119". c None", -
120" c #000000", -
121"X c #FFFFFF", -
122"X X X X X X X", -
123" X X X X X X ", -
124"X ......... X", -
125" X.........X ", -
126"X ......... X", -
127" X.........X ", -
128"X ......... X", -
129" X X X X X X ", -
130"X X X X X X X", -
131}; -
132 -
133static QPixmap *qt_drag_default_pixmap() { static QGlobalStatic<QPixmap > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QPixmap *x = new QPixmap (default_pm); if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QPixmap > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
never executed: return thisGlobalStatic.pointer.load();
never evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
never evaluated: !thisGlobalStatic.pointer.load()
never evaluated: !thisGlobalStatic.destroyed
0
134 -
135QPixmap QPlatformDrag::defaultPixmap() -
136{ -
137 return *qt_drag_default_pixmap();
never executed: return *qt_drag_default_pixmap();
0
138} -
139 -
140 -
141 -
142 -
143 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial