Commit 84c6d510 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Remove Abstract from class name.

parent 6e2ba0a5
......@@ -265,13 +265,15 @@ dummy::dummy(void) : QMainWindow(0)
// /////////////////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////////////////
this->menubar = new dtkWidgetsMenuBar(this);
dtkWidgetsMenu *menu = this->menubar->addMenu(fa::circlethin, "Group");
menu->addParameter("p1 (intg)", p1, "dtkWidgetsParameterIntSpinBox");
menu->addParameter("p2 (real)", p2, "dtkWidgetsParameterDoubleSpinBox");
menu->addSeparator();
dtkWidgetsMenu *submenu = menu->addMenu(fa::circlethin, "SubGroup");
submenu->addParameter("p31 (intg)", p31, "dtkWidgetsParameterIntSpinBox");
submenu->addParameter("p32 (intg)", p32, "dtkWidgetsParameterIntSpinBox");
......
......@@ -34,8 +34,8 @@ int main(int argc, char **argv)
dtk::d_real real_parameter = 5.;
real_parameter.setDocumentation("A real parameter.");
dtkWidgetsAbstractParameter *first_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsAbstractParameter *second_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *first_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *second_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
real_parameter.connect([=] (QVariant v) {
double value = v.value<dtk::d_real>().value();
qInfo() << value;
......@@ -51,7 +51,7 @@ int main(int argc, char **argv)
inliststring_parameter.setValue(QString("SecondString"));
dtkWidgetsAbstractParameter *inliststring_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&inliststring_parameter, "dtkWidgetsParameterStringListComboBox");
dtkWidgetsParameter *inliststring_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&inliststring_parameter, "dtkWidgetsParameterStringListComboBox");
inliststring_parameter.connect([=] (QVariant v) {
QString value = v.value<dtk::d_inliststring>().value();
qInfo() << value;
......@@ -59,7 +59,7 @@ int main(int argc, char **argv)
dtk::d_bool bool_parameter = true;
dtkWidgetsAbstractParameter *bool_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&bool_parameter, "dtkWidgetsParameterBoolCheckBox");
dtkWidgetsParameter *bool_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&bool_parameter, "dtkWidgetsParameterBoolCheckBox");
bool_parameter.connect([=] (QVariant v) {
bool value = v.value<dtk::d_bool>().value();
qInfo() << value;
......
......@@ -22,8 +22,6 @@ set(${PROJECT_NAME}_HEADERS
dtkApplication.h
dtkWidgets
dtkWidgets.h
dtkWidgetsAbstractParameter
dtkWidgetsAbstractParameter.h
dtkWidgetsColorButton
dtkWidgetsColorButton.h
dtkWidgetsController
......@@ -89,7 +87,6 @@ set(${PROJECT_NAME}_HEADERS
set(${PROJECT_NAME}_SOURCES
dtkApplication.cpp
dtkWidgets.cpp
dtkWidgetsAbstractParameter.cpp
dtkWidgetsColorButton.cpp
dtkWidgetsController.cpp
dtkWidgetsLayout.cpp
......@@ -111,6 +108,7 @@ set(${PROJECT_NAME}_SOURCES
dtkWidgetsOverlayPaneItem.cpp
dtkWidgetsOverlayPaneSlider.cpp
dtkWidgetsOverlayRope.cpp
dtkWidgetsParameter.cpp
dtkWidgetsParameterBoolCheckBox.cpp
dtkWidgetsParameterDoubleSpinBox.cpp
dtkWidgetsParameterIntSpinBox.cpp
......
#include "dtkApplication.h"
#include "dtkWidgets.h"
#include "dtkWidgetsAbstractParameter.h"
#include "dtkWidgetsColorButton.h"
#include "dtkWidgetsController.h"
#include "dtkWidgetsHUD.h"
......
#include "dtkWidgetsAbstractParameter.h"
\ No newline at end of file
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#pragma once
#include <dtkWidgetsExport>
#include <QtWidgets>
class dtkCoreAbstractParameter;
class DTKWIDGETS_EXPORT dtkWidgetsAbstractParameter : public QWidget
{
public:
dtkWidgetsAbstractParameter(QWidget *);
~dtkWidgetsAbstractParameter(void) = default;
public:
virtual bool connect(dtkCoreAbstractParameter *) = 0;
public:
virtual dtkCoreAbstractParameter *parameter(void) const = 0;
};
Q_DECLARE_METATYPE(dtkWidgetsAbstractParameter *);
//
// dtkWidgetsAbstractParameter.h ends here
......@@ -12,7 +12,7 @@
// Code:
#include "dtkWidgetsAbstractParameter.h" // TODO: Rename to dtkWidgetsParameterBase.h
#include "dtkWidgetsParameter.h" // TODO: Rename to dtkWidgetsParameterBase.h
#include "dtkWidgetsMenu+ux.h"
#include "dtkWidgetsParameter.h"
......@@ -57,11 +57,11 @@ void dtkWidgetsMenuNavigationFacade::setMenu(dtkWidgetsMenu *menu)
void dtkWidgetsMenuNavigationFacade::paintEvent(QPaintEvent *event)
{
QFrame::paintEvent(event);
dtkFontAwesome::instance()->setDefaultOption("color", ::fg_color);
QRect rect(5, 10, 28, 32); // qDebug() << Q_FUNC_INFO << rect;
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
painter.setPen(Qt::NoPen);
......@@ -94,9 +94,9 @@ dtkWidgetsMenuHeaderFacade::~dtkWidgetsMenuHeaderFacade(void)
void dtkWidgetsMenuHeaderFacade::paintEvent(QPaintEvent *event)
{
QFrame::paintEvent(event);
dtkFontAwesome::instance()->setDefaultOption("color", ::fg_color);
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
painter.setPen(fg_color);
......@@ -123,9 +123,9 @@ dtkWidgetsMenuInnerFacade::~dtkWidgetsMenuInnerFacade(void)
void dtkWidgetsMenuInnerFacade::paintEvent(QPaintEvent *event)
{
QFrame::paintEvent(event);
dtkFontAwesome::instance()->setDefaultOption("color", ::fg_color);
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
// painter.setPen(::bg_color);
......@@ -166,7 +166,7 @@ void dtkWidgetsMenuItemFacade::paintEvent(QPaintEvent *event)
return;
dtkFontAwesome::instance()->setDefaultOption("color", ::fg_color);
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
// painter.setPen(::bg_color);
......
......@@ -74,7 +74,7 @@ int dtkWidgetsMenuItem::icon(void) const
class dtkWidgetsMenuItemParameterPrivate
{
public:
dtkWidgetsAbstractParameter *widget = nullptr;
dtkWidgetsParameter *widget = nullptr;
};
// ///////////////////////////////////////////////////////////////////
......@@ -88,7 +88,7 @@ dtkWidgetsMenuItemParameter::dtkWidgetsMenuItemParameter(const QString& title, d
d->widget = ::dtk::widgets::parameters::pluginFactory().create(parameter, representation);
}
dtkWidgetsAbstractParameter *dtkWidgetsMenuItemParameter::widget(void)
dtkWidgetsParameter *dtkWidgetsMenuItemParameter::widget(void)
{
return d->widget;
}
......
......@@ -30,7 +30,7 @@ class dtkCoreAbstractParameter;
//
// /////////////////////////////////////////////////////////////////////////////
class dtkWidgetsAbstractParameter;
class dtkWidgetsParameter;
// /////////////////////////////////////////////////////////////////////////////
//
......@@ -74,7 +74,7 @@ public:
bool isParameter(void) const override { return true; }
public:
dtkWidgetsAbstractParameter *widget(void);
dtkWidgetsParameter *widget(void);
private:
class dtkWidgetsMenuItemParameterPrivate *d;
......
......@@ -12,16 +12,16 @@
// Code:
#include "dtkWidgetsAbstractParameter.h"
#include "dtkWidgetsParameter.h"
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsAbstractParameter implementation
// ///////////////////////////////////////////////////////////////////
dtkWidgetsAbstractParameter::dtkWidgetsAbstractParameter(QWidget *p) : QWidget(p)
dtkWidgetsParameter::dtkWidgetsParameter(QWidget *p) : QWidget(p)
{
}
//
// dtkWidgetsAbstractParameter.cpp ends here
// dtkWidgetsParameter.cpp ends here
......@@ -18,19 +18,38 @@
#include <QtWidgets>
#include "dtkWidgetsAbstractParameter.h"
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameter declaration
// dtkWidgetsParameter
// ///////////////////////////////////////////////////////////////////
template <typename T>
class DTKWIDGETS_EXPORT dtkWidgetsParameter : public dtkWidgetsAbstractParameter
class dtkCoreAbstractParameter;
class DTKWIDGETS_EXPORT dtkWidgetsParameter : public QWidget
{
public:
dtkWidgetsParameter(QWidget *);
~dtkWidgetsParameter(void) = default;
public:
virtual bool connect(dtkCoreAbstractParameter *) = 0;
public:
virtual dtkCoreAbstractParameter *parameter(void) const = 0;
};
Q_DECLARE_METATYPE(dtkWidgetsParameter *);
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameterBase declaration
// ///////////////////////////////////////////////////////////////////
template <typename T>
class DTKWIDGETS_EXPORT dtkWidgetsParameterBase : public dtkWidgetsParameter
{
public:
dtkWidgetsParameterBase(QWidget *);
~dtkWidgetsParameterBase(void) = default;
dtkCoreAbstractParameter *parameter(void) const final;
protected:
......@@ -40,13 +59,13 @@ protected:
// ///////////////////////////////////////////////////////////////////
template <typename T>
inline dtkWidgetsParameter<T>::dtkWidgetsParameter(QWidget *p) : dtkWidgetsAbstractParameter(p)
inline dtkWidgetsParameterBase<T>::dtkWidgetsParameterBase(QWidget *p) : dtkWidgetsParameter(p)
{
}
template <typename T>
inline dtkCoreAbstractParameter *dtkWidgetsParameter<T>::parameter(void) const
inline dtkCoreAbstractParameter *dtkWidgetsParameterBase<T>::parameter(void) const
{
return m_parameter;
}
......
......@@ -30,7 +30,7 @@ public:
// dtkWidgetsParameterBoolCheckBox implementation
// ///////////////////////////////////////////////////////////////////
dtkWidgetsParameterBoolCheckBox::dtkWidgetsParameterBoolCheckBox(QWidget* parent) : dtkWidgetsParameter<dtk::d_bool>(parent), d(new dtkWidgetsParameterBoolCheckBoxPrivate)
dtkWidgetsParameterBoolCheckBox::dtkWidgetsParameterBoolCheckBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_bool>(parent), d(new dtkWidgetsParameterBoolCheckBoxPrivate)
{
d->check_box = new QCheckBox;
......
......@@ -16,13 +16,13 @@
#include <dtkWidgetsExport>
#include <QtWidgets>
#include "dtkWidgetsParameter.h"
#include <dtkCore/dtkCoreParameter>
class DTKWIDGETS_EXPORT dtkWidgetsParameterBoolCheckBox : public dtkWidgetsParameter<dtk::d_bool>
#include <QtWidgets>
class DTKWIDGETS_EXPORT dtkWidgetsParameterBoolCheckBox : public dtkWidgetsParameterBase<dtk::d_bool>
{
Q_OBJECT
......@@ -34,14 +34,14 @@ public:
bool connect(dtkCoreAbstractParameter *) override;
private:
using dtkWidgetsParameter<dtk::d_bool>::m_parameter;
using dtkWidgetsParameterBase<dtk::d_bool>::m_parameter;
class dtkWidgetsParameterBoolCheckBoxPrivate *d;
};
// ///////////////////////////////////////////////////////////////////
inline dtkWidgetsAbstractParameter *dtkWidgetsParameterBoolCheckBoxCreator(void)
inline dtkWidgetsParameter *dtkWidgetsParameterBoolCheckBoxCreator(void)
{
return new dtkWidgetsParameterBoolCheckBox();
}
......
......@@ -30,7 +30,7 @@ public:
// dtkWidgetsParameterDoubleSpinBox implementation
// ///////////////////////////////////////////////////////////////////
dtkWidgetsParameterDoubleSpinBox::dtkWidgetsParameterDoubleSpinBox(QWidget* parent) : dtkWidgetsParameter<dtk::d_real>(parent), d(new dtkWidgetsParameterDoubleSpinBoxPrivate)
dtkWidgetsParameterDoubleSpinBox::dtkWidgetsParameterDoubleSpinBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_real>(parent), d(new dtkWidgetsParameterDoubleSpinBoxPrivate)
{
d->spin_box = new QDoubleSpinBox;
......
......@@ -22,7 +22,7 @@
#include <dtkCore/dtkCoreParameter>
class DTKWIDGETS_EXPORT dtkWidgetsParameterDoubleSpinBox : public dtkWidgetsParameter<dtk::d_real>
class DTKWIDGETS_EXPORT dtkWidgetsParameterDoubleSpinBox : public dtkWidgetsParameterBase<dtk::d_real>
{
Q_OBJECT
......@@ -34,14 +34,14 @@ public:
bool connect(dtkCoreAbstractParameter *) override;
private:
using dtkWidgetsParameter<dtk::d_real>::m_parameter;
using dtkWidgetsParameterBase<dtk::d_real>::m_parameter;
class dtkWidgetsParameterDoubleSpinBoxPrivate *d;
};
// ///////////////////////////////////////////////////////////////////
inline dtkWidgetsAbstractParameter *dtkWidgetsParameterDoubleSpinBoxCreator(void)
inline dtkWidgetsParameter *dtkWidgetsParameterDoubleSpinBoxCreator(void)
{
return new dtkWidgetsParameterDoubleSpinBox();
}
......
......@@ -12,7 +12,6 @@
// Code:
#include "dtkWidgetsParameterFactory.h"
#include "dtkWidgets.h"
......@@ -21,9 +20,9 @@
//
// ///////////////////////////////////////////////////////////////////
dtkWidgetsAbstractParameter *dtkWidgetsParameterFactory::create(const QString& key)
dtkWidgetsParameter *dtkWidgetsParameterFactory::create(const QString& key)
{
dtkWidgetsAbstractParameter *widget = dtkCorePluginFactory<dtkWidgetsAbstractParameter>::create(key);
dtkWidgetsParameter *widget = dtkCorePluginFactory<dtkWidgetsParameter>::create(key);
if(!widget) {
qWarning() << Q_FUNC_INFO << "The widget with key :" << key << "could not be instanciated by the factory.";
return nullptr;
......@@ -31,14 +30,14 @@ dtkWidgetsAbstractParameter *dtkWidgetsParameterFactory::create(const QString& k
return widget;
}
dtkWidgetsAbstractParameter *dtkWidgetsParameterFactory::create(dtkCoreAbstractParameter *parameter, const QString& key)
dtkWidgetsParameter *dtkWidgetsParameterFactory::create(dtkCoreAbstractParameter *parameter, const QString& key)
{
if (!parameter) {
qWarning() << Q_FUNC_INFO << "The input parameter is null. Nothing is done. Return nullptr.";
return nullptr;
}
dtkWidgetsAbstractParameter *widget = dtkCorePluginFactory<dtkWidgetsAbstractParameter>::create(key);
dtkWidgetsParameter *widget = dtkCorePluginFactory<dtkWidgetsParameter>::create(key);
if(!widget) {
qWarning() << Q_FUNC_INFO << "The widget with key :" << key << "could not be instanciated by the factory.";
return nullptr;
......
......@@ -18,7 +18,7 @@
#include <dtkCore>
#include "dtkWidgetsAbstractParameter.h"
#include "dtkWidgetsParameter.h"
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameterPlugin declaration
......@@ -39,11 +39,11 @@ class DTKWIDGETS_EXPORT dtkWidgetsParameterPluginManager : public dtkCorePluginM
// dtkWidgetsParameterFactory declaration
// ///////////////////////////////////////////////////////////////////
class DTKWIDGETS_EXPORT dtkWidgetsParameterFactory : public dtkCorePluginFactory<dtkWidgetsAbstractParameter>
class DTKWIDGETS_EXPORT dtkWidgetsParameterFactory : public dtkCorePluginFactory<dtkWidgetsParameter>
{
public:
dtkWidgetsAbstractParameter *create(const QString& key);
dtkWidgetsAbstractParameter *create(dtkCoreAbstractParameter *parameter, const QString& key);
dtkWidgetsParameter *create(const QString& key);
dtkWidgetsParameter *create(dtkCoreAbstractParameter *parameter, const QString& key);
};
// /////////////////////////////////////////////////////////////////
......
......@@ -30,7 +30,7 @@ public:
// dtkWidgetsParameterIntSpinBox implementation
// ///////////////////////////////////////////////////////////////////
dtkWidgetsParameterIntSpinBox::dtkWidgetsParameterIntSpinBox(QWidget* parent) : dtkWidgetsParameter<dtk::d_int>(parent), d(new dtkWidgetsParameterIntSpinBoxPrivate)
dtkWidgetsParameterIntSpinBox::dtkWidgetsParameterIntSpinBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_int>(parent), d(new dtkWidgetsParameterIntSpinBoxPrivate)
{
d->spin_box = new QSpinBox;
......
......@@ -16,13 +16,13 @@
#include <dtkWidgetsExport>
#include <QtWidgets>
#include "dtkWidgetsParameter.h"
#include <dtkCore/dtkCoreParameter>
class DTKWIDGETS_EXPORT dtkWidgetsParameterIntSpinBox : public dtkWidgetsParameter<dtk::d_int>
#include <QtWidgets>
class DTKWIDGETS_EXPORT dtkWidgetsParameterIntSpinBox : public dtkWidgetsParameterBase<dtk::d_int>
{
Q_OBJECT
......@@ -34,14 +34,14 @@ public:
bool connect(dtkCoreAbstractParameter *) override;
private:
using dtkWidgetsParameter<dtk::d_int>::m_parameter;
using dtkWidgetsParameterBase<dtk::d_int>::m_parameter;
class dtkWidgetsParameterIntSpinBoxPrivate *d;
};
// ///////////////////////////////////////////////////////////////////
inline dtkWidgetsAbstractParameter *dtkWidgetsParameterIntSpinBoxCreator(void)
inline dtkWidgetsParameter *dtkWidgetsParameterIntSpinBoxCreator(void)
{
return new dtkWidgetsParameterIntSpinBox();
}
......
......@@ -15,7 +15,7 @@
#include "dtkWidgetsParameterMenuBarGenerator.h"
#include "dtkWidgetsParameterFactory.h"
#include "dtkWidgetsAbstractParameter.h"
#include "dtkWidgetsParameter.h"
#include <dtkCore/dtkCoreParameter>
......@@ -32,7 +32,7 @@ public:
public:
QStringList uids;
QList<dtkCoreAbstractParameter *> parameters;
QList<dtkWidgetsAbstractParameter *> widgets;
QList<dtkWidgetsParameter *> widgets;
};
// ///////////////////////////////////////////////////////////////////
......@@ -46,7 +46,7 @@ void dtkWidgetsParameterMenuBarGeneratorPrivate::parseParameter(const QJsonObjec
map.insert("type", type_string);
dtkCoreAbstractParameter *parameter = dtkCoreAbstractParameter::create(map);
dtkWidgetsAbstractParameter *widget = dtk::widgets::parameters::pluginFactory().create(parameter, widget_string);
dtkWidgetsParameter *widget = dtk::widgets::parameters::pluginFactory().create(parameter, widget_string);
QString parameter_uid = parameter_object["uid"].toString();
bool advanced = parameter_object["advanced"].toBool();
......@@ -150,7 +150,7 @@ QList<dtkCoreAbstractParameter *> dtkWidgetsParameterMenuBarGenerator::parameter
return d->parameters;
}
QList<dtkWidgetsAbstractParameter *> dtkWidgetsParameterMenuBarGenerator::widgets(void) const
QList<dtkWidgetsParameter *> dtkWidgetsParameterMenuBarGenerator::widgets(void) const
{
return d->widgets;
}
......
......@@ -19,7 +19,7 @@
#include <QtCore>
class dtkCoreAbstractParameter;
class dtkWidgetsAbstractParameter;
class dtkWidgetsParameter;
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameterMenuBarGenerator declaration
......@@ -35,7 +35,7 @@ public:
public:
QStringList uids(void) const;
QList<dtkCoreAbstractParameter *> parameters(void) const;
QList<dtkWidgetsAbstractParameter *> widgets(void) const;
QList<dtkWidgetsParameter *> widgets(void) const;
protected:
class dtkWidgetsParameterMenuBarGeneratorPrivate *d;
......
......@@ -30,7 +30,7 @@ public:
// dtkWidgetsParameterStringListComboBox implementation
// ///////////////////////////////////////////////////////////////////
dtkWidgetsParameterStringListComboBox::dtkWidgetsParameterStringListComboBox(QWidget* parent) : dtkWidgetsParameter<dtk::d_inliststring>(parent), d(new dtkWidgetsParameterStringListComboBoxPrivate)
dtkWidgetsParameterStringListComboBox::dtkWidgetsParameterStringListComboBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_inliststring>(parent), d(new dtkWidgetsParameterStringListComboBoxPrivate)
{
d->combo_box = new QComboBox;
......
......@@ -22,7 +22,7 @@
#include <dtkCore/dtkCoreParameter>
class DTKWIDGETS_EXPORT dtkWidgetsParameterStringListComboBox : public dtkWidgetsParameter<dtk::d_inliststring>
class DTKWIDGETS_EXPORT dtkWidgetsParameterStringListComboBox : public dtkWidgetsParameterBase<dtk::d_inliststring>
{
Q_OBJECT
......@@ -34,14 +34,14 @@ public:
bool connect(dtkCoreAbstractParameter *) override;
private:
using dtkWidgetsParameter<dtk::d_inliststring>::m_parameter;
using dtkWidgetsParameterBase<dtk::d_inliststring>::m_parameter;
class dtkWidgetsParameterStringListComboBoxPrivate *d;
};
// ///////////////////////////////////////////////////////////////////
inline dtkWidgetsAbstractParameter *dtkWidgetsParameterStringListComboBoxCreator(void)
inline dtkWidgetsParameter *dtkWidgetsParameterStringListComboBoxCreator(void)
{
return new dtkWidgetsParameterStringListComboBox();
}
......
......@@ -67,7 +67,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_bool bool_parameter = false;
dtkWidgetsAbstractParameter *bool_check_box = dtk::widgets::parameters::pluginFactory().create(&bool_parameter, "dtkWidgetsParameterBoolCheckBox");
dtkWidgetsParameter *bool_check_box = dtk::widgets::parameters::pluginFactory().create(&bool_parameter, "dtkWidgetsParameterBoolCheckBox");
QVERIFY(bool_check_box);
QVERIFY(bool_check_box->parameter() == &bool_parameter);
......@@ -76,7 +76,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_real real_parameter = 0.;
dtkWidgetsAbstractParameter *real_spin_box = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *real_spin_box = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
QVERIFY(real_spin_box);
QVERIFY(real_spin_box->parameter() == &real_parameter);
......@@ -85,14 +85,14 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_int int_parameter = 0.;
dtkWidgetsAbstractParameter *int_spin_box = dtk::widgets::parameters::pluginFactory().create(&int_parameter, "dtkWidgetsParameterIntSpinBox");
dtkWidgetsParameter *int_spin_box = dtk::widgets::parameters::pluginFactory().create(&int_parameter, "dtkWidgetsParameterIntSpinBox");
QVERIFY(int_spin_box);
QVERIFY(int_spin_box->parameter() == &int_parameter);
dtk::d_real wrong_type_parameter = 0.;
dtkWidgetsAbstractParameter *wrong_type_parameter_spin_box = dtk::widgets::parameters::pluginFactory().create(&wrong_type_parameter, "dtkWidgetsParameterIntSpinBox");
dtkWidgetsParameter *wrong_type_parameter_spin_box = dtk::widgets::parameters::pluginFactory().create(&wrong_type_parameter, "dtkWidgetsParameterIntSpinBox");
QVERIFY(wrong_type_parameter_spin_box);
QVERIFY(wrong_type_parameter_spin_box->parameter() == nullptr);
......@@ -106,7 +106,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_inliststring inliststring_parameter("listofstrings", available_strings);
inliststring_parameter.setDocumentation("A inliststring parameter.");
dtkWidgetsAbstractParameter *inliststring_combo_box = dtk::widgets::parameters::pluginFactory().create(&inliststring_parameter, "dtkWidgetsParameterStringListComboBox");
dtkWidgetsParameter *inliststring_combo_box = dtk::widgets::parameters::pluginFactory().create(&inliststring_parameter, "dtkWidgetsParameterStringListComboBox");
QVERIFY(inliststring_combo_box);
QVERIFY(inliststring_combo_box->parameter() == &inliststring_parameter);
......@@ -118,7 +118,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_bool bool_parameter = false;
dtkWidgetsAbstractParameter *bool_check_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterBoolCheckBox");
dtkWidgetsParameter *bool_check_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterBoolCheckBox");
QVERIFY(bool_check_box);
QVERIFY(bool_check_box->connect(&bool_parameter));
......@@ -128,7 +128,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_real real_parameter = 0.;
dtkWidgetsAbstractParameter *spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterDoubleSpinBox");
QVERIFY(spin_box);
QVERIFY(spin_box->connect(&real_parameter));
......@@ -138,7 +138,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_int int_parameter = 0.;
dtkWidgetsAbstractParameter *int_spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterIntSpinBox");
dtkWidgetsParameter *int_spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterIntSpinBox");
QVERIFY(int_spin_box);
QVERIFY(int_spin_box->connect(&int_parameter));
......@@ -146,7 +146,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_real wrong_type_parameter = 0.;
dtkWidgetsAbstractParameter *wrong_type_parameter_spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterIntSpinBox");
dtkWidgetsParameter *wrong_type_parameter_spin_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterIntSpinBox");
QVERIFY(wrong_type_parameter_spin_box);
QVERIFY(!wrong_type_parameter_spin_box->connect(&wrong_type_parameter));
......@@ -161,7 +161,7 @@ void dtkWidgetsParametersTestCase::testBasic(void)
dtk::d_inliststring inliststring_parameter("listofstrings", available_strings);
inliststring_parameter.setDocumentation("A inliststring parameter.");
dtkWidgetsAbstractParameter *inliststring_combo_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterStringListComboBox");
dtkWidgetsParameter *inliststring_combo_box = dtk::widgets::parameters::pluginFactory().create("dtkWidgetsParameterStringListComboBox");
QVERIFY(inliststring_combo_box);
QVERIFY(inliststring_combo_box->connect(&inliststring_parameter));
......
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