Fix detachments

This commit is contained in:
Sergio Martins
2020-05-17 19:14:50 +01:00
parent d613d25ef5
commit 8477fdc7e1
5 changed files with 6 additions and 6 deletions

View File

@@ -521,7 +521,7 @@ void LayoutSaver::Frame::fromVariantMap(const QVariantMap &map)
options = map.value(QStringLiteral("options")).toUInt();
currentTabIndex = map.value(QStringLiteral("currentTabIndex")).toInt();
QVariantList dockWidgetsV = map.value(QStringLiteral("dockWidgets")).toList();
const QVariantList dockWidgetsV = map.value(QStringLiteral("dockWidgets")).toList();
dockWidgets.clear();
dockWidgets.reserve(dockWidgetsV.size());

View File

@@ -69,7 +69,7 @@ bool DockRegistry::isEmpty() const
void DockRegistry::checkSanityAll(bool dumpLayout)
{
for (auto layout : m_layouts) {
for (auto layout : qAsConst(m_layouts)) {
layout->checkSanity();
if (dumpLayout)
layout->dumpDebug();

View File

@@ -378,7 +378,7 @@ void FloatingWindow::onCloseEvent(QCloseEvent *e)
e->accept(); // Accepted by default (will close unless ignored)
Frame::List frames = this->frames();
const Frame::List frames = this->frames();
for (Frame *frame : frames) {
qApp->sendEvent(frame, e);
if (!e->isAccepted())

View File

@@ -305,7 +305,7 @@ void Frame::onCloseEvent(QCloseEvent *e)
{
qCDebug(closing) << "Frame::closeEvent";
e->accept(); // Accepted by default (will close unless ignored)
DockWidgetBase::List docks = dockWidgets();
const DockWidgetBase::List docks = dockWidgets();
for (DockWidgetBase *dock : docks) {
qApp->sendEvent(dock, e);
if (!e->isAccepted())

View File

@@ -1855,7 +1855,7 @@ void ItemContainer::dumpLayout(int level)
: QString();
const QString typeStr = isRoot() ? QStringLiteral("* Root: ")
: "* Layout: ";
: QStringLiteral("* Layout: ");
qDebug().noquote() << indent << typeStr << m_orientation
<< m_sizingInfo.geometry /*<< "r=" << m_geometry.right() << "b=" << m_geometry.bottom()*/
@@ -1883,7 +1883,7 @@ void ItemContainer::updateChildPercentages()
return;
const int usable = usableLength();
for (Item *item : m_children) {
for (Item *item : qAsConst(m_children)) {
if (item->isVisible() && !item->isBeingInserted()) {
item->m_sizingInfo.percentageWithinParent = (1.0 * item->length(m_orientation)) / usable;
auto p = item->m_sizingInfo.percentageWithinParent;