mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
This commit is based on https://github.com/GoldenCheetah/GoldenCheetah/pull/3956 with the following additions / changes: * Upgraded to the latest version of the multiaxes-branch, thus eliminating crashes of GoldenCheetah on startup * Disabled the emitting of Layout Requests on geometry changes of QwtScaleWidget - without this, CPU utilization was up to 100% on one core * Added the class SplineLookup, reusing small portions of code from Qwt 6.1 * Re-added the splines in WPrime and RideFile (resampling), using the new interface of QwtSpline * Appveyor: qwt in cache-section now depends on qwt/qwtconfig.prin.in for refresh on version change
60 lines
1.7 KiB
C++
60 lines
1.7 KiB
C++
/*****************************************************************************
|
|
* Qwt Examples - Copyright (C) 2002 Uwe Rathmann
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
*****************************************************************************/
|
|
|
|
#include "TVPlot.h"
|
|
|
|
#include <QApplication>
|
|
#include <QMainWindow>
|
|
#include <QToolBar>
|
|
#include <QToolButton>
|
|
#include <QComboBox>
|
|
|
|
namespace
|
|
{
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
public:
|
|
MainWindow()
|
|
{
|
|
TVPlot* plot = new TVPlot();
|
|
setCentralWidget( plot );
|
|
|
|
QComboBox* typeBox = new QComboBox();
|
|
typeBox->addItem( "Outline" );
|
|
typeBox->addItem( "Columns" );
|
|
typeBox->addItem( "Lines" );
|
|
typeBox->addItem( "Column Symbol" );
|
|
typeBox->setCurrentIndex( typeBox->count() - 1 );
|
|
typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
|
|
|
QToolButton* btnExport = new QToolButton();
|
|
btnExport->setText( "Export" );
|
|
btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
|
|
connect( btnExport, SIGNAL(clicked()), plot, SLOT(exportPlot()) );
|
|
|
|
QToolBar* toolBar = new QToolBar( this );
|
|
toolBar->addWidget( typeBox );
|
|
toolBar->addWidget( btnExport );
|
|
addToolBar( toolBar );
|
|
|
|
plot->setMode( typeBox->currentIndex() );
|
|
connect( typeBox, SIGNAL(currentIndexChanged(int)),
|
|
plot, SLOT(setMode(int)) );
|
|
}
|
|
};
|
|
}
|
|
|
|
int main( int argc, char* argv[] )
|
|
{
|
|
QApplication app( argc, argv );
|
|
|
|
MainWindow window;
|
|
|
|
window.resize( 600, 400 );
|
|
window.show();
|
|
|
|
return app.exec();
|
|
}
|