Mercurial > minori
diff src/gui/pages/anime_list.cpp @ 68:2417121d894e
*: normalize usage of layouts
before, I used them two ways, once was by setting the layout later
by using setLayout(QWidget), and the other was just using the constructor.
I find the constructor to be easier to read, so I chose that one.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 02 Oct 2023 21:33:25 -0400 |
parents | 26721c28bf22 |
children | 27a19dd6cba1 |
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cpp Mon Oct 02 07:06:44 2023 -0400 +++ b/src/gui/pages/anime_list.cpp Mon Oct 02 21:33:25 2023 -0400 @@ -451,10 +451,9 @@ } tree_view->setModel(sort_models[0]); - QHBoxLayout* layout = new QHBoxLayout; + QHBoxLayout* layout = new QHBoxLayout(tree_widget); layout->addWidget(tree_view); layout->setContentsMargins(0, 0, 0, 0); - tree_widget->setLayout(layout); /* Double click stuff */ connect(tree_view, &QAbstractItemView::doubleClicked, this, &AnimeListPage::ItemDoubleClicked);