Fix GitHub workflow broken.

This patch adds the needed QtCharts dependency to GitHub workflow.

Signed-off-by: xSlendiX <slendi@socopon.com>
This commit is contained in:
xSlendiX 2022-11-25 13:55:19 +02:00
parent 3187b5c1c2
commit 91c7a700a9
5 changed files with 21 additions and 14 deletions

View File

@ -26,7 +26,7 @@ jobs:
qt_ver: 6
qt_host: linux
qt_version: '6.2.4'
qt_modules: 'qt5compat qtimageformats'
qt_modules: 'qt5compat qtimageformats qtcharts'
- os: windows-2022
name: "Windows-Legacy"
@ -44,7 +44,7 @@ jobs:
qt_ver: 6
qt_host: mac
qt_version: '6.3.0'
qt_modules: 'qt5compat qtimageformats'
qt_modules: 'qt5compat qtimageformats qtcharts'
- os: macos-12
name: macOS-Legacy
@ -52,7 +52,7 @@ jobs:
qt_ver: 5
qt_host: mac
qt_version: '5.15.2'
qt_modules: ''
qt_modules: 'qtcharts'
runs-on: ${{ matrix.os }}
@ -97,6 +97,7 @@ jobs:
qt${{ matrix.qt_ver }}-base:p
qt${{ matrix.qt_ver }}-svg:p
qt${{ matrix.qt_ver }}-imageformats:p
qt${{ matrix.qt_ver }}-charts:p
quazip-qt${{ matrix.qt_ver }}:p
ccache:p
nsis:p
@ -154,7 +155,7 @@ jobs:
- name: Install Qt (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 6
run: |
sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 libqt5charts5-dev
- name: Install Qt (macOS and AppImage)
if: runner.os == 'Linux' && matrix.qt_ver == 6 || runner.os == 'macOS'

View File

@ -150,7 +150,8 @@ set(Launcher_BUILD_TIMESTAMP "${TODAY}")
include(QtVersionlessBackport)
if(Launcher_QT_VERSION_MAJOR EQUAL 5)
set(QT_VERSION_MAJOR 5)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Concurrent Network Test Xml)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Concurrent Network Test
Xml Charts)
if(NOT Launcher_FORCE_BUNDLED_LIBS)
find_package(QuaZip-Qt5 1.3 QUIET)
@ -164,7 +165,8 @@ if(Launcher_QT_VERSION_MAJOR EQUAL 5)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNICODE -D_UNICODE")
elseif(Launcher_QT_VERSION_MAJOR EQUAL 6)
set(QT_VERSION_MAJOR 6)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Concurrent Network Test Xml Core5Compat)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Concurrent Network Test
Xml Charts Core5Compat)
list(APPEND Launcher_QT_LIBS Qt6::Core5Compat)
if(NOT Launcher_FORCE_BUNDLED_LIBS)

View File

@ -996,7 +996,7 @@ target_link_libraries(Launcher_logic
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}Charts
Qt${QT_VERSION_MAJOR}::Charts
${Launcher_QT_LIBS}
)
target_link_libraries(Launcher_logic

View File

@ -50,11 +50,11 @@ StoragePage::StoragePage(BaseInstance* inst, QWidget* parent) : QWidget(parent),
m_confirmation_box->addButton(QMessageBox::No);
m_confirmation_box->setDefaultButton(QMessageBox::No);
m_series = new QtCharts::QPieSeries(this);
m_series = new QPieSeries(this);
m_series->setLabelsVisible();
m_series->setLabelsPosition(QtCharts::QPieSlice::LabelInsideHorizontal);
m_chart_view = new QtCharts::QChartView(this);
m_chart = new QtCharts::QChart();
m_series->setLabelsPosition(QPieSlice::LabelInsideHorizontal);
m_chart_view = new QChartView(this);
m_chart = new QChart();
m_chart->setParent(this);
m_chart->addSeries(m_series);
m_chart->setBackgroundVisible(false);

View File

@ -31,6 +31,10 @@
#include <Application.h>
#include <qmessagebox.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
using namespace QtCharts;
#endif
namespace Ui
{
class StoragePage;
@ -75,9 +79,9 @@ private:
Ui::StoragePage *ui;
BaseInstance *m_inst;
QtCharts::QPieSeries *m_series;
QtCharts::QChart *m_chart;
QtCharts::QChartView *m_chart_view;
QPieSeries *m_series;
QChart *m_chart;
QChartView *m_chart_view;
QMessageBox *m_confirmation_box;
};