File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,10 @@ QgsMapLayer *QgsMapLayerComboBox::compatibleMapLayerFromMimeData( const QMimeDat
164
164
void QgsMapLayerComboBox::dragEnterEvent ( QDragEnterEvent *event )
165
165
{
166
166
if ( !( event->possibleActions () & Qt::CopyAction ) )
167
+ {
168
+ event->ignore ();
167
169
return ;
170
+ }
168
171
169
172
if ( compatibleMapLayerFromMimeData ( event->mimeData () ) )
170
173
{
@@ -174,23 +177,33 @@ void QgsMapLayerComboBox::dragEnterEvent( QDragEnterEvent *event )
174
177
mDragActive = true ;
175
178
update ();
176
179
}
180
+ else
181
+ {
182
+ event->ignore ();
183
+ }
177
184
}
178
185
179
186
void QgsMapLayerComboBox::dragLeaveEvent ( QDragLeaveEvent *event )
180
187
{
181
- QComboBox::dragLeaveEvent ( event );
182
188
if ( mDragActive )
183
189
{
184
190
event->accept ();
185
191
mDragActive = false ;
186
192
update ();
187
193
}
194
+ else
195
+ {
196
+ event->ignore ();
197
+ }
188
198
}
189
199
190
200
void QgsMapLayerComboBox::dropEvent ( QDropEvent *event )
191
201
{
192
202
if ( !( event->possibleActions () & Qt::CopyAction ) )
203
+ {
204
+ event->ignore ();
193
205
return ;
206
+ }
194
207
195
208
if ( QgsMapLayer *layer = compatibleMapLayerFromMimeData ( event->mimeData () ) )
196
209
{
@@ -201,6 +214,10 @@ void QgsMapLayerComboBox::dropEvent( QDropEvent *event )
201
214
202
215
setLayer ( layer );
203
216
}
217
+ else
218
+ {
219
+ event->ignore ();
220
+ }
204
221
mDragActive = false ;
205
222
update ();
206
223
}
You can’t perform that action at this time.
0 commit comments