qplatformdrag.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformdrag.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction)-
11 : m_accepted(accepted)-
12 , m_accepted_action(acceptedAction)-
13{-
14}
never executed: end of block
0
15-
16bool QPlatformDropQtResponse::isAccepted() const-
17{-
18 return
never executed: return m_accepted;
m_accepted;
never executed: return m_accepted;
0
19}-
20-
21Qt::DropAction QPlatformDropQtResponse::acceptedAction() const-
22{-
23 return
never executed: return m_accepted_action;
m_accepted_action;
never executed: return m_accepted_action;
0
24}-
25-
26QPlatformDragQtResponse::QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect)-
27 : QPlatformDropQtResponse(accepted,acceptedAction)-
28 , m_answer_rect(answerRect)-
29{-
30}
never executed: end of block
0
31-
32QRect QPlatformDragQtResponse::answerRect() const-
33{-
34 return
never executed: return m_answer_rect;
m_answer_rect;
never executed: return m_answer_rect;
0
35}-
36-
37class QPlatformDragPrivate {-
38public:-
39 QPlatformDragPrivate() : cursor_drop_action(Qt::IgnoreAction) {}
never executed: end of block
0
40-
41 Qt::DropAction cursor_drop_action;-
42};-
43QPlatformDrag::QPlatformDrag() : d_ptr(new QPlatformDragPrivate)-
44{-
45}
never executed: end of block
0
46-
47QPlatformDrag::~QPlatformDrag()-
48{-
49 delete d_ptr;-
50}
never executed: end of block
0
51-
52QDrag *QPlatformDrag::currentDrag() const-
53{-
54 return
never executed: return QDragManager::self()->object();
QDragManager::self()->object();
never executed: return QDragManager::self()->object();
0
55}-
56-
57Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,-
58 Qt::KeyboardModifiers modifiers) const-
59{-
60-
61-
62-
63-
64 Qt::DropAction default_action = Qt::IgnoreAction;-
65-
66 if (currentDrag()
currentDrag()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
67 default_action = currentDrag()->defaultAction();-
68 }
never executed: end of block
0
69-
70-
71 if (default_action == Qt::IgnoreAction
default_action...::IgnoreActionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
72-
73-
74 default_action = Qt::CopyAction;-
75 }
never executed: end of block
0
76-
77 if (modifiers & Qt::ControlModifier
modifiers & Qt...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
&& modifiers & Qt::ShiftModifier
modifiers & Qt::ShiftModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
78 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
79 else if (modifiers & Qt::ControlModifier
modifiers & Qt...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
80 default_action = Qt::CopyAction;
never executed: default_action = Qt::CopyAction;
0
81 else if (modifiers & Qt::ShiftModifier
modifiers & Qt::ShiftModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
82 default_action = Qt::MoveAction;
never executed: default_action = Qt::MoveAction;
0
83 else if (modifiers & Qt::AltModifier
modifiers & Qt::AltModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
84 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
85-
86-
87-
88-
89-
90-
91 if (!(possibleActions & default_action)
!(possibleActi...efault_action)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
92 if (possibleActions & Qt::CopyAction
possibleAction...Qt::CopyActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
93 default_action = Qt::CopyAction;
never executed: default_action = Qt::CopyAction;
0
94 else if (possibleActions & Qt::MoveAction
possibleAction...Qt::MoveActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
95 default_action = Qt::MoveAction;
never executed: default_action = Qt::MoveAction;
0
96 else if (possibleActions & Qt::LinkAction
possibleAction...Qt::LinkActionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
97 default_action = Qt::LinkAction;
never executed: default_action = Qt::LinkAction;
0
98 else-
99 default_action = Qt::IgnoreAction;
never executed: default_action = Qt::IgnoreAction;
0
100 }-
101-
102-
103-
104-
105-
106 return
never executed: return default_action;
default_action;
never executed: return default_action;
0
107}-
108void QPlatformDrag::cancelDrag()-
109{-
110 QMessageLogger(__FILE__, 174, __PRETTY_FUNCTION__).warning("Unimplemented code.");-
111}
never executed: end of block
0
112-
113-
114-
115-
116-
117void QPlatformDrag::updateAction(Qt::DropAction action)-
118{-
119 QPlatformDragPrivate * const d = d_func();-
120 if (d->cursor_drop_action != action
d->cursor_drop...tion != actionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
121 d->cursor_drop_action = action;-
122 currentDrag()->actionChanged(action);-
123 }
never executed: end of block
0
124}
never executed: end of block
0
125-
126static const char *const default_pm[] = {-
127"13 9 3 1",-
128". c None",-
129" c #000000",-
130"X c #FFFFFF",-
131"X X X X X X X",-
132" X X X X X X ",-
133"X ......... X",-
134" X.........X ",-
135"X ......... X",-
136" X.........X ",-
137"X ......... X",-
138" X X X X X X ",-
139"X X X X X X X",-
140};-
141-
142namespace { namespace Q_QGS_qt_drag_default_pixmap { typedef QPixmap Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type (default_pm))) : value (default_pm) { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QPixmap, Q_QGS_qt_drag_default_pixmap::innerFunction, Q_QGS_qt_drag_default_pixmap::guard> qt_drag_default_pixmap;
0
143-
144QPixmap QPlatformDrag::defaultPixmap()-
145{-
146 return
never executed: return *qt_drag_default_pixmap();
*qt_drag_default_pixmap();
never executed: return *qt_drag_default_pixmap();
0
147}-
148bool QPlatformDrag::ownsDragObject() const-
149{-
150 return
never executed: return false;
false;
never executed: return false;
0
151}-
152-
153-
154-
155-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9