Commit 581cd035 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add QListView here too

parent e141ad3a
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "groupmanagementwidgettest.h" #include "groupmanagementwidgettest.h"
#include "groupmanagementwidget.h" #include "groupmanagementwidget.h"
#include <QListView>
#include <QTest> #include <QTest>
#include <QVBoxLayout> #include <QVBoxLayout>
...@@ -36,4 +37,7 @@ void GroupManagementWidgetTest::shouldHaveDefaultValues() ...@@ -36,4 +37,7 @@ void GroupManagementWidgetTest::shouldHaveDefaultValues()
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout); QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), {}); QCOMPARE(mainLayout->contentsMargins(), {});
auto mListView = w.findChild<QListView *>(QStringLiteral("mListView"));
QVERIFY(mListView);
} }
...@@ -20,16 +20,27 @@ ...@@ -20,16 +20,27 @@
#include "groupmanagementwidget.h" #include "groupmanagementwidget.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <QListView>
#include <QVBoxLayout> #include <QVBoxLayout>
GroupManagementWidget::GroupManagementWidget(QWidget *parent) GroupManagementWidget::GroupManagementWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
, mListView(new QListView(this))
{ {
auto mainLayout = new QVBoxLayout(this); auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({}); mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainLayout")); mainLayout->setObjectName(QStringLiteral("mainLayout"));
mListView->setObjectName(QStringLiteral("mListView"));
mainLayout->addWidget(mListView);
init();
} }
GroupManagementWidget::~GroupManagementWidget() GroupManagementWidget::~GroupManagementWidget()
{ {
} }
void GroupManagementWidget::init()
{
//TODO
}
...@@ -24,12 +24,16 @@ ...@@ -24,12 +24,16 @@
#include <QWidget> #include <QWidget>
#include "libkdebugsettings_private_export.h" #include "libkdebugsettings_private_export.h"
class QListView;
class LIBKDEBUGSETTINGS_EXPORT_TEST_EXPORT GroupManagementWidget : public QWidget class LIBKDEBUGSETTINGS_EXPORT_TEST_EXPORT GroupManagementWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit GroupManagementWidget(QWidget *parent = nullptr); explicit GroupManagementWidget(QWidget *parent = nullptr);
~GroupManagementWidget() override; ~GroupManagementWidget() override;
private:
void init();
QListView *const mListView;
}; };
#endif // GROUPMANAGEMENTWIDGET_H #endif // GROUPMANAGEMENTWIDGET_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment