diff --git a/CHANGELOG.md b/CHANGELOG.md index eaeb94f58..285c736ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Dev: Added tools to help debug image GC. (#4578) - Dev: Removed duplicate license when having plugins enabled. (#4665) - Dev: Replace our QObjectRef class with Qt's QPointer class. (#4666) +- Dev: Fixed warnings about QWidgets already having a QLayout. (#4672) - Dev: Fixed undefined behavior when loading non-existant credentials. (#4673) ## 2.4.4 diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index 12f605838..efcd33d4e 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -152,7 +152,7 @@ void Window::closeEvent(QCloseEvent *) void Window::addLayout() { - QVBoxLayout *layout = new QVBoxLayout(this); + auto *layout = new QVBoxLayout(); layout->addWidget(this->notebook_); this->getLayoutContainer()->setLayout(layout); diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index c81abd04d..8a096e27d 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -209,7 +209,7 @@ EmotePopup::EmotePopup(QWidget *parent) this->setStayInScreenRect(true); this->moveTo(this, getApp()->windows->emotePopupPos(), false); - auto *layout = new QVBoxLayout(this); + auto *layout = new QVBoxLayout(); this->getLayoutContainer()->setLayout(layout); QRegularExpression searchRegex("\\S*"); @@ -218,7 +218,7 @@ EmotePopup::EmotePopup(QWidget *parent) layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); - auto *layout2 = new QHBoxLayout(this); + auto *layout2 = new QHBoxLayout(); layout2->setContentsMargins(8, 8, 8, 8); layout2->setSpacing(8); diff --git a/src/widgets/helper/EditableModelView.cpp b/src/widgets/helper/EditableModelView.cpp index 649f85775..97c6840b8 100644 --- a/src/widgets/helper/EditableModelView.cpp +++ b/src/widgets/helper/EditableModelView.cpp @@ -32,7 +32,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable) vbox->setContentsMargins(0, 0, 0, 0); // create button layout - QHBoxLayout *buttons = new QHBoxLayout(this); + auto *buttons = new QHBoxLayout(); this->buttons_ = buttons; vbox->addLayout(buttons); diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index 7879e3b92..6f0f55119 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -280,7 +280,7 @@ void SearchPopup::initLayout() // HBOX { - auto *layout2 = new QHBoxLayout(this); + auto *layout2 = new QHBoxLayout(); layout2->setContentsMargins(8, 8, 8, 8); layout2->setSpacing(8); diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index a6ae50dae..5b9941ef1 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -1124,7 +1124,7 @@ void Split::showViewerList() viewerDock->move(0, this->header_->height()); auto multiWidget = new QWidget(viewerDock); - auto dockVbox = new QVBoxLayout(viewerDock); + auto *dockVbox = new QVBoxLayout(); auto searchBar = new QLineEdit(viewerDock); auto chattersList = new QListWidget();