diff --git a/CMakeLists.txt b/CMakeLists.txt index e066e104d..4dc9d028e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,6 @@ endif() # Add external folders add_subdirectory(cmake/vatsimauth) -add_subdirectory(cmake/qwt_plot) add_subdirectory(cmake/dbus) add_subdirectory(cmake/sodium) add_subdirectory(cmake/msgpack) diff --git a/cmake/qwt_plot/CMakeLists.txt b/cmake/qwt_plot/CMakeLists.txt deleted file mode 100644 index c2de5e96d..000000000 --- a/cmake/qwt_plot/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors -# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -add_library(externals_qwt_plot SHARED IMPORTED GLOBAL) - -target_include_directories(externals_qwt_plot INTERFACE ${PROJECT_SOURCE_DIR}/third_party/externals/common/include/qwt) - -if(UNIX AND NOT APPLE) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/third_party/externals/linux-g++/64/lib/libqwt.so) -elseif(APPLE) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/third_party/externals/macx-clang/64/lib/qwt.framework/qwt) -elseif(SWIFT_WIN32) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/third_party/externals/win32-msvc/32/lib/qwt.lib) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/third_party/externals/win32-msvc/32/lib/qwt.dll) -elseif(SWIFT_WIN64) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/third_party/externals/win32-msvc/64/lib/qwt.lib) - set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/third_party/externals/win32-msvc/64/lib/qwt.dll) -endif() - -target_link_libraries(externals_qwt_plot INTERFACE Qt::OpenGL) - -if(APPLE) - # Special handling for qwt.framework - install(DIRECTORY ${PROJECT_SOURCE_DIR}/third_party/externals/macx-clang/64/lib/qwt.framework DESTINATION lib) -else() - install(IMPORTED_RUNTIME_ARTIFACTS externals_qwt_plot - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin - ) -endif() diff --git a/installer/installbuilder/swift-externals.xml b/installer/installbuilder/swift-externals.xml index faacf154b..a99b041d9 100644 --- a/installer/installbuilder/swift-externals.xml +++ b/installer/installbuilder/swift-externals.xml @@ -28,9 +28,6 @@ 1 ../../dist/bin/libsodium*.dll - - ../../dist/bin/qwt.dll - 1 ../../dist/bin/SimConnect*.dll @@ -86,9 +83,6 @@ ../../dist/lib/libvatsimauth.so - - ../../dist/lib/libqwt.so - 1 ../../dist/lib/libsodium.so.* @@ -110,9 +104,6 @@ ../../dist/lib/libvatsimauth.dylib - - ../../dist/lib/qwt.framework - diff --git a/resources/share/legal/3rdparty.html b/resources/share/legal/3rdparty.html index b76a418fe..baaddb294 100644 --- a/resources/share/legal/3rdparty.html +++ b/resources/share/legal/3rdparty.html @@ -21,7 +21,6 @@
  • Qt5
  • SpeexDSP
  • vatlib
  • -
  • Qwt
  • QtWebApp
  • Boost

    @@ -664,47 +663,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    -

    Qwt

    - - - - - - - - - -
    Project websitehttps://qwt.sourceforge.io/
    Source codehttps://qwt.sourceforge.io/
    -
    -                             Qwt License
    -                      Version 1.0, January 1, 2003
    -The Qwt library and included programs are provided under the terms
    -of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) with the following
    -exceptions:
    -    1. Widgets that are subclassed from Qwt widgets do not
    -       constitute a derivative work.
    -    2. Static linking of applications and widgets to the
    -       Qwt library does not constitute a derivative work
    -       and does not require the author to provide source
    -       code for the application or widget, use the shared
    -       Qwt libraries, or link their applications or
    -       widgets against a user-supplied version of Qwt.
    -       If you link the application or widget to a modified
    -       version of Qwt, then the changes to Qwt must be 
    -       provided under the terms of the LGPL in sections
    -       1, 2, and 4.
    -    3. You do not have to provide a copy of the Qwt license
    -       with programs that are linked to the Qwt library, nor
    -       do you have to identify the Qwt license in your
    -       program or documentation as required by section 6
    -       of the LGPL.
    -       However, programs must still identify their use of Qwt.
    -       The following example statement can be included in user
    -       documentation to satisfy this requirement:
    -           [program/widget] is based in part on the work of
    -           the Qwt project (http://qwt.sf.net).
    -	
    -

    QtWebApp

    diff --git a/src/blackgui/CMakeLists.txt b/src/blackgui/CMakeLists.txt index 3544c3360..bf820f254 100644 --- a/src/blackgui/CMakeLists.txt +++ b/src/blackgui/CMakeLists.txt @@ -285,9 +285,6 @@ add_library(gui SHARED loadindicator.h pluginselector.h infoarea.cpp - graphs - graphs/barchart.h - graphs/barchart.cpp overlaymessagesframe.cpp managedstatusbar.h lineedithistory.cpp @@ -944,11 +941,9 @@ target_link_libraries(gui core Qt::Widgets Qt::Svg - externals_qwt_plot ) target_compile_definitions(gui PRIVATE BUILD_BLACKGUI_LIB) -target_compile_definitions(gui PRIVATE QWT_DLL) target_precompile_headers(gui PRIVATE diff --git a/src/blackgui/graphs/barchart.cpp b/src/blackgui/graphs/barchart.cpp deleted file mode 100644 index 1ccde943e..000000000 --- a/src/blackgui/graphs/barchart.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "barchart.h" -#include -#include -#include -#include -#include -#include -#include - -namespace BlackGui::Graphs -{ - CBarChart::CBarChart(QWidget *parent) : QwtPlot(parent) - { - this->setAutoFillBackground(true); - this->setPalette(Qt::white); - this->canvas()->setPalette(QColor("LemonChiffon")); - - this->setTitle("Bar Chart"); - // setAxisTitle(QwtPlot::yLeft, "Whatever"); - // setAxisTitle(QwtPlot::xBottom, "Whatever"); - - m_barChartItem.reset(new QwtPlotMultiBarChart("Bar Chart ")); - m_barChartItem->setLayoutPolicy(QwtPlotMultiBarChart::AutoAdjustSamples); - m_barChartItem->setSpacing(5); - m_barChartItem->setMargin(3); - m_barChartItem->attach(this); - - // this->insertLegend(new QwtLegend()); - // this->setAutoReplot(true); - // this->setOrientation(Qt::Vertical); - } - - void CBarChart::setStyle(QwtPlotMultiBarChart::ChartStyle style) - { - m_barChartItem->setStyle(style); - } - - void CBarChart::setOrientation(Qt::Orientation orientation, const QStringList &labels) - { - QwtPlot::Axis axis1, axis2; - CTextScaleDraw *scaleDraw = labels.isEmpty() ? nullptr : new CTextScaleDraw(labels); - - if (orientation == Qt::Vertical) - { - axis1 = QwtPlot::xBottom; - axis2 = QwtPlot::yLeft; - - m_barChartItem->setOrientation(Qt::Vertical); - if (scaleDraw) - { - scaleDraw->setLabelRotation(90); - scaleDraw->setLabelAlignment(Qt::AlignRight); - } - } - else - { - axis1 = QwtPlot::yLeft; - axis2 = QwtPlot::xBottom; - - m_barChartItem->setOrientation(Qt::Horizontal); - if (scaleDraw) - { - scaleDraw->setLabelRotation(0); - scaleDraw->setLabelAlignment(Qt::AlignLeft); - } - } - - setAxisScale(axis1, 0, m_barChartItem->dataSize() - 1, 1.0); - setAxisAutoScale(axis2); - - QwtScaleDraw *scaleDraw1 = axisScaleDraw(axis1); - scaleDraw1->enableComponent(QwtScaleDraw::Backbone, true); - scaleDraw1->enableComponent(QwtScaleDraw::Ticks, false); - - QwtScaleDraw *scaleDraw2 = axisScaleDraw(axis2); - scaleDraw2->enableComponent(QwtScaleDraw::Backbone, true); - scaleDraw2->enableComponent(QwtScaleDraw::Ticks, false); - - this->setAxisScaleDraw(axis1, scaleDraw ? scaleDraw : new QwtScaleDraw()); - this->setAxisScaleDraw(axis2, new QwtScaleDraw()); - - plotLayout()->setAlignCanvasToScale(axis1, true); - plotLayout()->setAlignCanvasToScale(axis2, true); - - plotLayout()->setCanvasMargin(0); - this->updateCanvasMargins(); - - this->replot(); - } - - void CBarChart::setSymbols(const QString &title, const QString &color) - { - const QStringList titles({ title }); - const QStringList colors({ color }); - this->setSymbols(titles, colors); - } - - void CBarChart::setSymbols(const QStringList &titles, const QStringList &colors) - { - Q_ASSERT_X(!titles.isEmpty(), Q_FUNC_INFO, "Need titles"); - Q_ASSERT_X(titles.size() == colors.size(), Q_FUNC_INFO, "Need same size"); - - int i = 0; - m_barChartItem->resetSymbolMap(); - for (const QString &color : colors) - { - QwtColumnSymbol *symbol = new QwtColumnSymbol(QwtColumnSymbol::Box); - symbol->setLineWidth(2); - symbol->setFrameStyle(QwtColumnSymbol::Raised); - symbol->setPalette(QPalette(color)); - m_barChartItem->setSymbol(i++, symbol); - } - - QList qwtTitles; - for (const QString &title : titles) - { - qwtTitles << title; - } - m_barChartItem->setBarTitles(qwtTitles); - m_barChartItem->setLegendIconSize(QSize(10, 14)); - } - - void CBarChart::setSamples1Bar(const QList &samples, const QStringList &labels, Qt::Orientation orientation) - { - QVector> series; - for (double d : samples) - { - series << QVector { d }; - } - - if (orientation == Qt::Vertical) - { - int w = samples.size() * 10; - if (w < 200) w = 200; - this->setMinimumWidth(w); - this->setMinimumHeight(0); - } - else - { - int h = samples.size() * 10; - if (h < 200) h = 200; - this->setMinimumHeight(h); - this->setMinimumWidth(0); - } - - m_barChartItem->setSamples(series); - this->setOrientation(orientation, labels); - } - - CTextScaleDraw::CTextScaleDraw(const QStringList &texts) : m_labels(texts) - { - this->setLabelRotation(0); - this->setLabelAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - this->setSpacing(5); - } - - QwtText CTextScaleDraw::label(double v) const - { - if (m_labels.isEmpty()) { return QString::number(v); } - const int i = qRound(v); - if (i < 0 || m_labels.size() <= i) { return QwtText("invalid"); } - return m_labels.at(i); - } - -} // ns diff --git a/src/blackgui/graphs/barchart.h b/src/blackgui/graphs/barchart.h deleted file mode 100644 index 8007b4fe4..000000000 --- a/src/blackgui/graphs/barchart.h +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKGUI_GRAPH_BARCHART_H -#define BLACKGUI_GRAPH_BARCHART_H - -#include "blackgui/blackguiexport.h" - -#include -#include -#include - -#include -#include -#include - -namespace BlackGui::Graphs -{ - /*! - * For axis labels - */ - class CTextScaleDraw : public QwtScaleDraw - { - public: - //! Constructorxs - CTextScaleDraw(const QStringList &texts); - - //! Value to label - virtual QwtText label(double v) const override; - - //! Labels - void setLabels(const QStringList &labels) { m_labels = labels; } - - //! Any labels? - bool hasLabels() const { return !m_labels.isEmpty(); } - - private: - QStringList m_labels; - }; - - /*! - * Bar chart, modified version of QWT examples - */ - class BLACKGUI_EXPORT CBarChart : public QwtPlot - { - public: - //! Constructor - CBarChart(QWidget * = nullptr); - - //! Style - void setStyle(QwtPlotMultiBarChart::ChartStyle style); - - //! Set number of symbols - void setSymbols(const QString &title, const QString &color); - - //! Set number of symbols - void setSymbols(const QStringList &titles, const QStringList &colors); - - //! Samples with 1 bar per sample - void setSamples1Bar(const QList &samples, const QStringList &labels, Qt::Orientation orientation); - - private: - //! Orientation - void setOrientation(Qt::Orientation, const QStringList &labels); - - QScopedPointer m_barChartItem; - }; -} // ns - -#endif diff --git a/src/blackgui/views/aircraftmodelstatisticsdialog.cpp b/src/blackgui/views/aircraftmodelstatisticsdialog.cpp index aae8ab72a..a3cebb829 100644 --- a/src/blackgui/views/aircraftmodelstatisticsdialog.cpp +++ b/src/blackgui/views/aircraftmodelstatisticsdialog.cpp @@ -27,7 +27,6 @@ namespace BlackGui::Views this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); connect(ui->pb_GenerateMatrix, &QPushButton::released, this, &CAircraftModelStatisticsDialog::displayHTMLMatrix); - connect(ui->pb_ShowChart, &QPushButton::released, this, &CAircraftModelStatisticsDialog::showChart); } CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog() @@ -45,75 +44,4 @@ namespace BlackGui::Views if (file.isEmpty()) { return; } QDesktopServices::openUrl(QUrl::fromLocalFile(file)); } - - void CAircraftModelStatisticsDialog::showChart() - { - if (ui->rb_Distributors->isChecked()) - { - this->chartDistributors(); - return; - } - if (ui->rb_AircraftIcao->isChecked()) - { - this->chartAircraftIcao(); - return; - } - } - - void CAircraftModelStatisticsDialog::chartDistributors() - { - const QMap distributors = m_models.countPerDistributor(); - QStringList distributorsForAxis; - - QList series; - CDistributorList distributorList(distributors.keys()); - distributorList.sortByKey(); - for (const CDistributor &distributor : std::as_const(distributorList)) - { - const int c = distributors[distributor]; - if (c < 1) { continue; } - distributorsForAxis << (distributor.getDbKey() % u" (" % QString::number(c) % u")"); - series << c; - } - - QwtText title("distributor"); - title.setRenderFlags(Qt::AlignLeft); - ui->qwt_Chart->setSymbols("distributors", "white"); - ui->qwt_Chart->setTitle(title); - ui->qwt_Chart->setSamples1Bar(series, distributorsForAxis, this->getOrientation()); - } - - void CAircraftModelStatisticsDialog::chartAircraftIcao() - { - const QMap icaos = m_models.countPerAircraftIcao(); - QStringList icaosForAxis; - - QList series; - CAircraftIcaoCodeList icaoList(icaos.keys()); - icaoList.sortByDesignatorAndRank(); - - for (const CAircraftIcaoCode &icao : std::as_const(icaoList)) - { - const int c = icaos[icao]; - if (c < 1) { continue; } - if (!icao.hasKnownDesignator()) - { - continue; - } - icaosForAxis << (icao.getDesignatorDbKey() % u" (" % QString::number(c) % u")"); - series << c; - } - - QwtText title("aircraft ICAO"); - title.setRenderFlags(Qt::AlignLeft); - ui->qwt_Chart->setSymbols("aircraft", "white"); - ui->qwt_Chart->setTitle(title); - ui->qwt_Chart->setSamples1Bar(series, icaosForAxis, this->getOrientation()); - } - - Qt::Orientation CAircraftModelStatisticsDialog::getOrientation() const - { - return ui->rb_Vertical->isChecked() ? Qt::Vertical : Qt::Horizontal; - } - } // ns diff --git a/src/blackgui/views/aircraftmodelstatisticsdialog.h b/src/blackgui/views/aircraftmodelstatisticsdialog.h index a606f3359..2a988049c 100644 --- a/src/blackgui/views/aircraftmodelstatisticsdialog.h +++ b/src/blackgui/views/aircraftmodelstatisticsdialog.h @@ -40,18 +40,6 @@ namespace BlackGui::Views //! Display the HTML matrix void displayHTMLMatrix(); - //! Chart - void showChart(); - - //! Chart for distributors - void chartDistributors(); - - //! Chart for aircraft ICAO - void chartAircraftIcao(); - - //! Orientation - Qt::Orientation getOrientation() const; - QScopedPointer ui; BlackMisc::Simulation::CAircraftModelList m_models; }; diff --git a/src/blackgui/views/aircraftmodelstatisticsdialog.ui b/src/blackgui/views/aircraftmodelstatisticsdialog.ui index c935c06dc..05f834e87 100644 --- a/src/blackgui/views/aircraftmodelstatisticsdialog.ui +++ b/src/blackgui/views/aircraftmodelstatisticsdialog.ui @@ -42,132 +42,6 @@ - - - Charts - - - - - - - 0 - 25 - - - - - 1 - - - 1 - - - 1 - - - 1 - - - - - distributors - - - true - - - bg_Chart - - - - - - - aircraft - - - bg_Chart - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - horizontal - - - true - - - bg_Layout - - - - - - - vertical - - - bg_Layout - - - - - - - show - - - - - - - - - - true - - - - - 0 - 0 - 370 - 161 - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - Matrix @@ -204,12 +78,6 @@ - - BlackGui::Graphs::CBarChart - QFrame -
    blackgui/graphs/barchart.h
    - 1 -