Commit 03e1f033 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QTreeWidget here

parent 169c7b10
Pipeline #93164 canceled with stage
......@@ -6,6 +6,7 @@
#include "scamconfiguresettingswidgettest.h"
#include "../scamconfiguresettingswidget.h"
#include <QTest>
#include <QTreeWidget>
#include <QVBoxLayout>
QTEST_MAIN(ScamConfigureSettingsWidgetTest)
ScamConfigureSettingsWidgetTest::ScamConfigureSettingsWidgetTest(QObject *parent)
......@@ -19,4 +20,7 @@ void ScamConfigureSettingsWidgetTest::shouldHaveDefaultValues()
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), {});
auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("mTreeWidget"));
QVERIFY(mTreeWidget);
}
......@@ -6,14 +6,19 @@
#include "scamconfiguresettingswidget.h"
#include <KLocalizedString>
#include <QTreeWidget>
#include <QVBoxLayout>
ScamConfigureSettingsWidget::ScamConfigureSettingsWidget(QWidget *parent)
: QWidget{parent}
, mTreeWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
mTreeWidget->setObjectName(QStringLiteral("mTreeWidget"));
mainLayout->addWidget(mTreeWidget);
}
ScamConfigureSettingsWidget::~ScamConfigureSettingsWidget()
......
......@@ -8,10 +8,14 @@
#include "scamconfiguresettings_private_export.h"
#include <QWidget>
class QTreeWidget;
class LIBSCAMCONFIGURESETTINGS_TESTS_EXPORT ScamConfigureSettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit ScamConfigureSettingsWidget(QWidget *parent = nullptr);
~ScamConfigureSettingsWidget() override;
private:
QTreeWidget *const mTreeWidget;
};
......@@ -5,8 +5,7 @@
*/
#include "scamconfigureutils.h"
QString ScamConfigureUtils::convertEnumToString()
QString ScamConfigureUtils::convertEnumToString(MessageViewer::ScamDetectionInfo::ScamDetectionField flag)
{
// TODO
return {};
......
......@@ -6,9 +6,10 @@
#pragma once
#include "scamconfiguresettings_private_export.h"
#include <MessageViewer/ScamDetectionInfo>
#include <QString>
namespace ScamConfigureUtils
{
Q_REQUIRED_RESULT QString convertEnumToString();
Q_REQUIRED_RESULT QString convertEnumToString(MessageViewer::ScamDetectionInfo::ScamDetectionField flag);
};
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