Skip to content

Commit

Permalink
threaded control panel fix when missing Qwt
Browse files Browse the repository at this point in the history
  • Loading branch information
bobke committed May 8, 2024
1 parent f0c0c1d commit 116860b
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/plugins/be_plugin_app_critterding_threads/control_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,26 @@
}

// ROW WQT
m_qwt_curve_critters = 0;
m_qwt_curve_food = 0;
layout_H_row = layout_V->addChild( "QT HBoxlayout", "QHBoxLayout" );
layout_H = layout_H_row->addChild( "graph layout", "QHBoxLayout" );
{
auto qwt_plot = layout_H->addChild( "plot", "QwtPlot" );

{
m_qwt_curve_critters = qwt_plot->addChild( "curve", "QwtCurve" );
auto qpen = m_qwt_curve_critters->addChild( "pen", "QPen" );
qpen->set( "color_r", Buint(50) );
qpen->set( "color_g", Buint(50) );
qpen->set( "color_b", Buint(255) );
}
if ( qwt_plot )
{
m_qwt_curve_food = qwt_plot->addChild( "curve", "QwtCurve" );
auto qpen = m_qwt_curve_food->addChild( "pen", "QPen" );
qpen->set( "color_g", Buint(200) );
{
m_qwt_curve_critters = qwt_plot->addChild( "curve", "QwtCurve" );
auto qpen = m_qwt_curve_critters->addChild( "pen", "QPen" );
qpen->set( "color_r", Buint(50) );
qpen->set( "color_g", Buint(50) );
qpen->set( "color_b", Buint(255) );
}
{
m_qwt_curve_food = qwt_plot->addChild( "curve", "QwtCurve" );
auto qpen = m_qwt_curve_food->addChild( "pen", "QPen" );
qpen->set( "color_g", Buint(200) );
}
}
}
}
Expand All @@ -329,7 +333,10 @@
}

m_line_edit_food->set( (float)total_food );
m_qwt_curve_food->set( total_food );
if ( m_qwt_curve_food )
{
m_qwt_curve_food->set( total_food );
}

// CRITTERS
unsigned int total_critters(0);
Expand All @@ -340,7 +347,10 @@
}
}
m_line_edit_critters->set( total_critters );
m_qwt_curve_critters->set( total_critters );
if ( m_qwt_curve_critters )
{
m_qwt_curve_critters->set( total_critters );
}

unsigned int total_adam_distance(0);
{
Expand Down

0 comments on commit 116860b

Please sign in to comment.