main.cpp 1.11 KB
Newer Older
LE BRETON Come's avatar
LE BRETON Come committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// Version: $Id$
//
//

// Commentary:
//
//

// Change Log:
//
//

// Code:

#include  <QtWidgets>
#include <dtkWidgets>

#include <dtkCore/dtkCoreParameter>
#include <dtkWidgets/dtkWidgetsParameter>
20
#include <dtkWidgets/dtkWidgetsParameterFactory>
LE BRETON Come's avatar
LE BRETON Come committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

// ///////////////////////////////////////////////////////////////////
//
// ///////////////////////////////////////////////////////////////////

int main(int argc, char **argv)
{
    dtk::widgets::initialize("");

    QApplication application(argc, argv);

    QMainWindow *window = new QMainWindow;

    dtk::d_real real_parameter = 0.;
    real_parameter.setDocumentation("A real parameter.");

    QObject::connect(&real_parameter, &dtk::d_real::valueChanged, [=] (QVariant v) {
            double value = v.value<dtk::d_real>().value();
            qDebug() << value;
        });

42
    dtkWidgetsParameter *real_parameter_widget = dtk::widgets::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBoxPlugin");
LE BRETON Come's avatar
LE BRETON Come committed
43 44 45 46 47 48 49 50 51 52 53 54

    window->setCentralWidget(real_parameter_widget);

    window->show();
    window->raise();


    return application.exec();
}

//
// main.cpp ends here