diff --git a/src/gui/src/chartsWidget.cpp b/src/gui/src/chartsWidget.cpp index dc066f0be3b..8c5104c6b8e 100644 --- a/src/gui/src/chartsWidget.cpp +++ b/src/gui/src/chartsWidget.cpp @@ -32,11 +32,11 @@ #include "chartsWidget.h" -#include #ifdef ENABLE_CHARTS #include #include #include +#include #include #include #include @@ -47,9 +47,10 @@ #include "sta/MinMax.hh" #include "sta/Units.hh" #include "staGuiInterface.h" +#endif namespace gui { - +#ifdef ENABLE_CHARTS ChartsWidget::ChartsWidget(QWidget* parent) : QDockWidget("Charts", parent), logger_(nullptr), @@ -261,13 +262,8 @@ ChartsWidget::ChartsWidget(QWidget* parent) { setObjectName("charts_widget"); // for settings - QWidget* container = new QWidget(this); - container->addWidget(label_); - - label_->setText("QtCharts is not installed.") - label_->setAlignment(Qt::AlignCenter); - - setWidget(container); + label_->setText("QtCharts is not installed."); + label_->setAlignment(Qt::AlignCenter); } #endif diff --git a/src/gui/src/chartsWidget.h b/src/gui/src/chartsWidget.h index 76bcd94c606..1e3a3afab36 100644 --- a/src/gui/src/chartsWidget.h +++ b/src/gui/src/chartsWidget.h @@ -46,9 +46,10 @@ namespace sta { class dbSta; } +#endif namespace gui { - +#ifdef ENABLE_CHARTS class ChartsWidget : public QDockWidget { Q_OBJECT