diff --git a/include/ui/wildmonchart.h b/include/ui/wildmonchart.h index a7c56a47..d4e3d83f 100644 --- a/include/ui/wildmonchart.h +++ b/include/ui/wildmonchart.h @@ -4,6 +4,8 @@ #include "encountertablemodel.h" #include + +#if __has_include() #include namespace Ui { @@ -72,4 +74,25 @@ private: void showHelpDialog(); }; +#else + +// As of writing our static Qt build for Windows doesn't include the QtCharts module, so we dummy the class out here. +// The charts module is additionally excluded from Windows in porymap.pro +#define DISABLE_CHARTS_MODULE + +class WildMonChart : public QWidget +{ + Q_OBJECT +public: + explicit WildMonChart(QWidget *, const EncounterTableModel *) {}; + ~WildMonChart() {}; + +public slots: + void setTable(const EncounterTableModel *) {}; + void clearTable() {}; + void refresh() {}; +}; + +#endif // __has_include() + #endif // WILDMONCHART_H diff --git a/porymap.pro b/porymap.pro index a7923595..f36f536f 100644 --- a/porymap.pro +++ b/porymap.pro @@ -4,7 +4,11 @@ # #------------------------------------------------- -QT += core gui qml network charts +QT += core gui qml network + +!win32 { + QT += charts +} greaterThan(QT_MAJOR_VERSION, 4): QT += widgets diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f342396f..00251e6c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -124,6 +124,10 @@ void MainWindow::initWindow() { ui->actionCheck_for_Updates->setVisible(false); #endif +#ifdef DISABLE_CHARTS_MODULE + ui->pushButton_SummaryChart->setVisible(false); +#endif + setWindowDisabled(true); } diff --git a/src/ui/wildmonchart.cpp b/src/ui/wildmonchart.cpp index 011dc326..4594e2bd 100644 --- a/src/ui/wildmonchart.cpp +++ b/src/ui/wildmonchart.cpp @@ -1,3 +1,4 @@ +#if __has_include() #include "wildmonchart.h" #include "ui_wildmonchart.h" #include "config.h" @@ -447,3 +448,5 @@ void WildMonChart::closeEvent(QCloseEvent *event) { porymapConfig.wildMonChartGeometry = saveGeometry(); QWidget::closeEvent(event); } + +#endif // __has_include()