Fix detachments
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user