Commit afba4440 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix crash in customize toolbar dialog.

For some reasons, this doesn't crash on Linux...
(cherry picked from commit 25d37a4930519c5bcabbe2c0fae8c86e38d9ea54)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b36ed57c
...@@ -647,17 +647,15 @@ inline int DroppingController::getParentPosInLayout( QPoint point ) ...@@ -647,17 +647,15 @@ inline int DroppingController::getParentPosInLayout( QPoint point )
QPoint origin = mapToGlobal ( point ); QPoint origin = mapToGlobal ( point );
QWidget *tempWidg = QApplication::widgetAt( origin ); QWidget *tempWidg = QApplication::widgetAt( origin );
if( tempWidg == NULL )
return -1;
int i = -1; int i = controlLayout->indexOf( tempWidg );
if( tempWidg != NULL)
{
i = controlLayout->indexOf( tempWidg );
if( i == -1 ) if( i == -1 )
{ {
i = controlLayout->indexOf( tempWidg->parentWidget() ); i = controlLayout->indexOf( tempWidg->parentWidget() );
tempWidg = tempWidg->parentWidget(); tempWidg = tempWidg->parentWidget();
} }
}
/* Return the nearest position */ /* Return the nearest position */
if( ( point.x() - tempWidg->x() > tempWidg->width() / 2 ) && i != -1 ) if( ( point.x() - tempWidg->x() > tempWidg->width() / 2 ) && i != -1 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment