Files
GoldenCheetah/qwt/examples/svgmap/main.cpp
Damien 2f9130cd76 Qwt 6.0.1 Support
Upgrade to QWT 6.0.1, but still uses a locally patched copy
since support for 8 axes has not been included, despite it
being a relatively simple patch.

Fixes #634.
Fixes #567.
2012-02-12 10:43:15 +00:00

50 lines
987 B
C++

#include <qapplication.h>
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include "plot.h"
class MainWindow: public QMainWindow
{
public:
MainWindow(const QString &fileName)
{
Plot *plot = new Plot(this);
if ( !fileName.isEmpty() )
plot->loadSVG(fileName);
setCentralWidget(plot);
#ifndef QT_NO_FILEDIALOG
QToolBar *toolBar = new QToolBar(this);
QToolButton *btnLoad = new QToolButton(toolBar);
btnLoad->setText("Load SVG");
btnLoad->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnLoad);
addToolBar(toolBar);
connect(btnLoad, SIGNAL(clicked()), plot, SLOT(loadSVG()));
#endif
}
};
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QString fileName;
if ( argc > 1 )
fileName = argv[1];
MainWindow w(fileName);
w.resize(600,400);
w.show();
int rv = a.exec();
return rv;
}