diff options
Diffstat (limited to 'src/widgets/widgets/qdockarealayout.cpp')
-rw-r--r-- | src/widgets/widgets/qdockarealayout.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 8c79425e44..07efbafb31 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -1677,9 +1677,9 @@ void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem) QDockAreaLayoutInfo *new_info = new QDockAreaLayoutInfo(sep, dockPos, o, tabBarShape, mainWindow); item_list[index].subinfo = new_info; - new_info->item_list.append(item_list.at(index).widgetItem); + new_info->item_list.append(QDockAreaLayoutItem(item_list.at(index).widgetItem)); item_list[index].widgetItem = 0; - new_info->item_list.append(dockWidgetItem); + new_info->item_list.append(QDockAreaLayoutItem(dockWidgetItem)); new_info->tabbed = true; new_info->updateTabBar(); new_info->setCurrentTab(dockWidgetItem->widget()); @@ -1699,9 +1699,9 @@ void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation, QDockAreaLayoutInfo *new_info = new QDockAreaLayoutInfo(sep, dockPos, orientation, tabBarShape, mainWindow); item_list[index].subinfo = new_info; - new_info->item_list.append(item_list.at(index).widgetItem); + new_info->item_list.append(QDockAreaLayoutItem(item_list.at(index).widgetItem)); item_list[index].widgetItem = 0; - new_info->item_list.append(dockWidgetItem); + new_info->item_list.append(QDockAreaLayoutItem(dockWidgetItem)); } } @@ -1802,9 +1802,9 @@ void QDockAreaLayoutInfo::saveState(QDataStream &stream) const stream << (uchar) WidgetMarker; QWidget *w = item.widgetItem->widget(); QString name = w->objectName(); - if (name.isEmpty()) { - qWarning("QMainWindow::saveState(): 'objectName' not set for QDockWidget %p '%s;", - w, qPrintable(w->windowTitle())); + if (Q_UNLIKELY(name.isEmpty())) { + qWarning("QMainWindow::saveState(): 'objectName' not set for QDockWidget %p '%ls;", + w, qUtf16Printable(w->windowTitle())); } stream << name; @@ -3082,8 +3082,8 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do int tbshape = 0; #endif QDockAreaLayoutInfo new_info(&sep, pos, orientation, tbshape, mainWindow); - new_info.item_list.append(new QDockAreaLayoutInfo(info)); - new_info.item_list.append(dockWidgetItem); + new_info.item_list.append(QDockAreaLayoutItem(new QDockAreaLayoutInfo(info))); + new_info.item_list.append(QDockAreaLayoutItem(dockWidgetItem)); info = new_info; } @@ -3110,7 +3110,7 @@ void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second) void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks, const QList<int> &sizes, Qt::Orientation o) { - if (docks.count() != sizes.count()) { + if (Q_UNLIKELY(docks.count() != sizes.count())) { qWarning("QMainWidget::resizeDocks: size of the lists are not the same"); return; } @@ -3118,12 +3118,12 @@ void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks, fallbackToSizeHints = false; for (int i = 0; i < count; ++i) { QList<int> path = indexOf(docks[i]); - if (path.isEmpty()) { + if (Q_UNLIKELY(path.isEmpty())) { qWarning("QMainWidget::resizeDocks: one QDockWidget is not part of the layout"); continue; } int size = sizes[i]; - if (size <= 0) { + if (Q_UNLIKELY(size <= 0)) { qWarning("QMainWidget::resizeDocks: all sizes need to be larger than 0"); size = 1; } |