@@ -190,20 +190,20 @@ class DockContainerWidgetPrivate
190190 * Creates a new tab for a widget dropped into the center of a section
191191 */
192192 void dropIntoCenterOfSection (CFloatingDockContainer* FloatingWidget,
193- CDockAreaWidget* TargetArea, int TabIndex = - 2 );
193+ CDockAreaWidget* TargetArea, int TabIndex = 0 );
194194
195195 /* *
196196 * Drop floating widget into dock area
197197 */
198198 void dropIntoSection (CFloatingDockContainer* FloatingWidget,
199- CDockAreaWidget* TargetArea, DockWidgetArea area, int TabIndex = - 2 );
199+ CDockAreaWidget* TargetArea, DockWidgetArea area, int TabIndex = 0 );
200200
201201 /* *
202202 * Moves the dock widget or dock area given in Widget parameter to a
203203 * new dock widget area
204204 */
205205 void moveToNewSection (QWidget* Widget, CDockAreaWidget* TargetArea, DockWidgetArea area,
206- int TabIndex = - 2 );
206+ int TabIndex = 0 );
207207
208208 /* *
209209 * Moves the dock widget or dock area given in Widget parameter to a
@@ -214,13 +214,13 @@ class DockContainerWidgetPrivate
214214 /* *
215215 * Creates a new tab for a widget dropped into the center of a section
216216 */
217- void moveIntoCenterOfSection (QWidget* Widget, CDockAreaWidget* TargetArea, int TabIndex = - 2 );
217+ void moveIntoCenterOfSection (QWidget* Widget, CDockAreaWidget* TargetArea, int TabIndex = 0 );
218218
219219 /* *
220220 * Moves the dock widget or dock area given in Widget parameter to
221221 * a auto hide sidebar area
222222 */
223- void moveToAutoHideSideBar (QWidget* Widget, DockWidgetArea area, int TabIndex = - 2 );
223+ void moveToAutoHideSideBar (QWidget* Widget, DockWidgetArea area, int TabIndex = TabDefaultInsertIndex );
224224
225225
226226 /* *
@@ -543,7 +543,7 @@ void DockContainerWidgetPrivate::dropIntoCenterOfSection(
543543 auto NewDockWidgets = FloatingContainer->dockWidgets ();
544544 auto TopLevelDockArea = FloatingContainer->topLevelDockArea ();
545545 int NewCurrentIndex = -1 ;
546- TabIndex = (TabIndex < 0 ) ? 0 : TabIndex;
546+ TabIndex = qMax ( 0 , TabIndex) ;
547547
548548 // If the floating widget contains only one single dock are, then the
549549 // current dock widget of the dock area will also be the future current
@@ -675,7 +675,7 @@ void DockContainerWidgetPrivate::moveIntoCenterOfSection(QWidget* Widget, CDockA
675675 auto DroppedDockWidget = qobject_cast<CDockWidget*>(Widget);
676676 auto DroppedArea = qobject_cast<CDockAreaWidget*>(Widget);
677677
678- TabIndex = (TabIndex < 0 ) ? 0 : TabIndex;
678+ TabIndex = qMax ( 0 , TabIndex) ;
679679 if (DroppedDockWidget)
680680 {
681681 CDockAreaWidget* OldDockArea = DroppedDockWidget->dockAreaWidget ();
@@ -1493,7 +1493,6 @@ CAutoHideDockContainer* CDockContainerWidget::createAndSetupAutoHideContainer(
14931493 DockWidget->setDockManager (d->DockManager ); // Auto hide Dock Container needs a valid dock manager
14941494 }
14951495
1496- qDebug () << " CDockContainerWidget::createAndSetupAutoHideContainer TabIndex: " << TabIndex;
14971496 return autoHideSideBar (area)->insertDockWidget (TabIndex, DockWidget);
14981497}
14991498
0 commit comments