diff --git a/src/widgets/autotests/ruqolacentralwidgettest.cpp b/src/widgets/autotests/ruqolacentralwidgettest.cpp index 2ef6cd00..9e513801 100644 --- a/src/widgets/autotests/ruqolacentralwidgettest.cpp +++ b/src/widgets/autotests/ruqolacentralwidgettest.cpp @@ -1,52 +1,54 @@ /* Copyright (c) 2020 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "ruqolacentralwidgettest.h" #include "ruqolacentralwidget.h" #include "channellist/channellistwidget.h" #include "room/roomwidget.h" #include #include #include QTEST_MAIN(RuqolaCentralWidgetTest) RuqolaCentralWidgetTest::RuqolaCentralWidgetTest(QObject *parent) : QObject(parent) { } void RuqolaCentralWidgetTest::shouldHaveDefaultValues() { RuqolaCentralWidget w; QHBoxLayout *mainLayout = w.findChild(QStringLiteral("mainlayout")); QVERIFY(mainLayout); QSplitter *mSplitter = w.findChild(QStringLiteral("mSplitter")); QVERIFY(mSplitter); + QVERIFY(!mSplitter->childrenCollapsible()); + mSplitter->setChildrenCollapsible(false); ChannelListWidget *mChannelList = w.findChild(QStringLiteral("mChannelList")); QVERIFY(mChannelList); RoomWidget *mRoomWidget = w.findChild(QStringLiteral("mRoomWidget")); QVERIFY(mRoomWidget); QVERIFY(mSplitter->indexOf(mChannelList) >= 0); QVERIFY(mSplitter->indexOf(mRoomWidget) >= 0); } diff --git a/src/widgets/ruqolacentralwidget.cpp b/src/widgets/ruqolacentralwidget.cpp index b9546ce6..c7578d8d 100644 --- a/src/widgets/ruqolacentralwidget.cpp +++ b/src/widgets/ruqolacentralwidget.cpp @@ -1,51 +1,52 @@ /* Copyright (c) 2020 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "ruqolacentralwidget.h" #include "channellist/channellistwidget.h" #include "room/roomwidget.h" #include #include #include RuqolaCentralWidget::RuqolaCentralWidget(QWidget *parent) : QWidget(parent) { QHBoxLayout *mainLayout = new QHBoxLayout(this); mainLayout->setObjectName(QStringLiteral("mainlayout")); mSplitter = new QSplitter(this); mSplitter->setObjectName(QStringLiteral("mSplitter")); + mSplitter->setChildrenCollapsible(false); mainLayout->addWidget(mSplitter); mChannelList = new ChannelListWidget(this); mChannelList->setObjectName(QStringLiteral("mChannelList")); mSplitter->addWidget(mChannelList); mRoomWidget = new RoomWidget(this); mRoomWidget->setObjectName(QStringLiteral("mRoomWidget")); mSplitter->addWidget(mRoomWidget); connect(mChannelList, &ChannelListWidget::channelSelected, mRoomWidget, &RoomWidget::channelSelected); } RuqolaCentralWidget::~RuqolaCentralWidget() { }