Commit 5e08573a authored by LE BRETON Come's avatar LE BRETON Come

Adds an example.

parent fbdb249b
......@@ -14,11 +14,12 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/examples)
add_subdirectory(dtkWidgetsLayout)
add_subdirectory(dtkWidgetsOverlayPaneItems)
add_subdirectory(dtkWidgetsOverlayPaneItemsManager)
add_subdirectory(dtkWidgetsStylesheetParser)
add_subdirectory(dtkWidgetsParameter)
add_subdirectory(dtkWidgetsScroller)
add_subdirectory(dtkWidgetsLayout)
add_subdirectory(dtkWidgetsStylesheetParser)
######################################################################
### CMakeLists.txt ends here
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
project(dtkWidgetsParameter)
## #################################################################
## Sources
## #################################################################
set(${PROJECT_NAME}_SOURCES main.cpp)
## #################################################################
## Build rules
## #################################################################
add_executable(${PROJECT_NAME}
${${PROJECT_NAME}_SOURCES})
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
######################################################################
### CMakeLists.txt ends here
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#include <QtWidgets>
#include <dtkWidgets>
#include <dtkCore/dtkCoreParameter>
#include <dtkWidgets/dtkWidgetsParameter>
// ///////////////////////////////////////////////////////////////////
//
// ///////////////////////////////////////////////////////////////////
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;
});
dtkWidgetsParameterDouble *real_parameter_widget = dtk::widgets::parameterDouble::pluginFactory().create("dtkWidgetsParameterDoubleSpinBoxPlugin");
real_parameter_widget->connect(&real_parameter);
window->setCentralWidget(real_parameter_widget);
window->show();
window->raise();
return application.exec();
}
//
// main.cpp ends here
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