Changeset View
Changeset View
Standalone View
Standalone View
app/sidebar.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | |||||
133 | { | 133 | { | ||
134 | widget->setParent(d->mContainer); | 134 | widget->setParent(d->mContainer); | ||
135 | d->mContainer->layout()->addWidget(widget); | 135 | d->mContainer->layout()->addWidget(widget); | ||
136 | } | 136 | } | ||
137 | 137 | | |||
138 | void SideBarGroup::clear() | 138 | void SideBarGroup::clear() | ||
139 | { | 139 | { | ||
140 | if (d->mContainer) { | 140 | if (d->mContainer) { | ||
141 | d->mContainer->hide(); | ||||
huoni: After fixing Problem 1, there were duplicate operations when right clicking because… | |||||
141 | d->mContainer->deleteLater(); | 142 | d->mContainer->deleteLater(); | ||
142 | } | 143 | } | ||
143 | 144 | | |||
144 | d->mContainer = new QFrame(this); | 145 | d->mContainer = new QFrame(this); | ||
145 | QVBoxLayout* containerLayout = new QVBoxLayout(d->mContainer); | 146 | QVBoxLayout* containerLayout = new QVBoxLayout(d->mContainer); | ||
146 | containerLayout->setMargin(0); | 147 | containerLayout->setMargin(0); | ||
147 | containerLayout->setSpacing(0); | 148 | containerLayout->setSpacing(0); | ||
148 | 149 | | |||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |
After fixing Problem 1, there were duplicate operations when right clicking because deleteLater doesn't delete before the context menu is shown. Since the context menu 'pauses' things, we ended up with two mContainer objects until the menu was closed.
This hides the first one so two aren't visible when the context menu is open.