Commit a7ea81b4 authored by Laurent Montel's avatar Laurent Montel 😁

improve autotest

parent 9b8b9eee
......@@ -23,6 +23,8 @@
#include <QTest>
#include <QVBoxLayout>
#include <QStandardPaths>
#include <QFormLayout>
#include <KUrlRequester>
QTEST_MAIN(GrammalecteConfigWidgetTest)
GrammalecteConfigWidgetTest::GrammalecteConfigWidgetTest(QObject *parent)
: QObject(parent)
......@@ -39,4 +41,60 @@ void GrammalecteConfigWidgetTest::shouldHaveDefaultValue()
QTabWidget *mTab = w.findChild<QTabWidget *>(QStringLiteral("mTab"));
QVERIFY(mTab);
QWidget *generalWidget = mTab->findChild<QWidget *>(QStringLiteral("general"));
QVERIFY(generalWidget);
QFormLayout *lay = generalWidget->findChild<QFormLayout *>(QStringLiteral("generallayout"));
QVERIFY(lay);
KUrlRequester *mPythonPath = generalWidget->findChild<KUrlRequester *>(QStringLiteral("pythonpath"));
QVERIFY(mPythonPath);
QVERIFY(mPythonPath->text().isEmpty());
KUrlRequester *mGrammalectePath = generalWidget->findChild<KUrlRequester *>(QStringLiteral("grammalectepath"));
QVERIFY(mGrammalectePath);
QVERIFY(mGrammalectePath->text().isEmpty());
#if 0
return w;
mStackedWidget = new QStackedWidget(this);
mStackedWidget->setObjectName(QStringLiteral("stackedwidget"));
mScrollArea = new QScrollArea(this);
mScrollArea->setObjectName(QStringLiteral("scrollarea"));
mScrollArea->setWidgetResizable(true);
mGrammarTabWidget = new QWidget;
mGrammarTabWidget->setObjectName(QStringLiteral("grammar"));
QVBoxLayout *layout = new QVBoxLayout(mGrammarTabWidget);
layout->setObjectName(QStringLiteral("grammartablayout"));
mScrollArea->setWidget(mGrammarTabWidget);
mStackedWidget->addWidget(mScrollArea);
mReloadSettingsWidget = new QWidget;
mReloadSettingsWidget->setObjectName(QStringLiteral("reloadwidget"));
mStackedWidget->addWidget(mReloadSettingsWidget);
QVBoxLayout *reloadSettingsLayout = new QVBoxLayout(mReloadSettingsWidget);
reloadSettingsLayout->setObjectName(QStringLiteral("reloadSettingsLayout"));
QHBoxLayout *horizontallayout = new QHBoxLayout;
reloadSettingsLayout->addLayout(horizontallayout);
QLabel *label = new QLabel(i18n("Reload Settings"), this);
label->setObjectName(QStringLiteral("label"));
horizontallayout->addWidget(label);
QToolButton *buttonReloadSettings = new QToolButton(this);
buttonReloadSettings->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
buttonReloadSettings->setObjectName(QStringLiteral("buttonReloadSettings"));
horizontallayout->addWidget(buttonReloadSettings);
connect(buttonReloadSettings, &QToolButton::clicked, this, &GrammalecteConfigWidget::loadGrammarSettings);
reloadSettingsLayout->addStretch(1);
return mStackedWidget;
#endif
}
Markdown is supported
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