cleanup regarding DockWidget::show()

This commit is contained in:
Sergio Martins
2022-06-15 05:32:54 +01:00
parent de917f103a
commit 29c675661f
3 changed files with 3 additions and 9 deletions

View File

@@ -387,7 +387,6 @@ QStringList DockWidget::affinities() const
void DockWidget::show()
{
// TODOm2: show wont be called. move to view instead.
if (view()->isRootView() && (d->m_lastPosition->wasFloating() || !d->m_lastPosition->isValid())) {
// Create the FloatingWindow already, instead of waiting for the show event.
// This reduces flickering on some platforms
@@ -665,7 +664,7 @@ void DockWidget::Private::toggle(bool enabled)
} else {
// The most common case. The dock widget is not in the sidebar. just close or open it.
if (enabled) {
show();
q->show();
} else {
q->view()->close();
}
@@ -813,12 +812,6 @@ void DockWidget::Private::saveTabIndex()
m_lastPosition->saveTabIndex(currentTabIndex(), q->isFloating());
}
void DockWidget::Private::show()
{
// Only show for now
q->show();
}
void DockWidget::onParentChanged()
{
Q_EMIT parentViewChanged();

View File

@@ -123,7 +123,6 @@ public:
void updateFloatAction();
void onDockWidgetShown();
void onDockWidgetHidden();
void show();
void close();
bool restoreToPreviousPosition();
void maybeRestoreToPreviousPosition();

View File

@@ -70,6 +70,8 @@ public:
*/
void setWidget(QWidget *widget);
// TODOm2: Add show to the views
protected:
void init() override;
bool event(QEvent *) override;