~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to examples/friedberg/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2011-06-10 11:22:47 UTC
  • mfrom: (1.1.6 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110610112247-0i1019vvmzaq6p86
Tags: 6.0.0-1
* New upstream release (Closes: #624107):
  - drop Qt3 support. (Closes: #604379, #626868)
* Register documentation with doc-base. (Closes: #626567)
* Drop patches:
  - 01_makefiles.diff
  - 02_add_missing_warnings.diff
  - 03_qwt_branch_pull_r544.diff
* Add qwt_install_paths.patch to fix the hardcoded installation paths.
* Update debian/control:
  - drop libqt3-mt-dev build dependency.
  - bump Standards-Version to 3.9.2 (no changes).
  - drop Qt3 related packages.
  - due to bump soname (and as we dropper Qt3 support):
    - libqwt5-qt4-dev -> libqwt-dev
    - libqwt5-qt4 -> libqwt6
    - libqwt5-doc -> libqwt-doc
* Update debian/copyright file.
* Update debian/rules: drop Qt3 packages support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <qapplication.h>
 
2
#include <qmainwindow.h>
 
3
#include <qcombobox.h>
 
4
#include <qlayout.h>
 
5
#include <qtextstream.h>
 
6
#include <qtoolbar.h>
 
7
#include <qtoolbutton.h>
 
8
#include "plot.h"
 
9
 
 
10
class MainWindow: public QMainWindow
 
11
{
 
12
public:
 
13
    MainWindow( QWidget * = NULL );
 
14
 
 
15
private:
 
16
    Plot *d_plot;
 
17
};
 
18
 
 
19
MainWindow::MainWindow( QWidget *parent ):
 
20
    QMainWindow( parent )
 
21
{
 
22
    d_plot = new Plot( this );
 
23
    setCentralWidget( d_plot );
 
24
 
 
25
    QToolBar *toolBar = new QToolBar( this );
 
26
 
 
27
    QComboBox *typeBox = new QComboBox( toolBar );
 
28
    typeBox->addItem( "Bars" );
 
29
    typeBox->addItem( "Tube" );
 
30
    typeBox->setCurrentIndex( 1 );
 
31
    typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
 
32
 
 
33
    QToolButton *btnExport = new QToolButton( toolBar );
 
34
    btnExport->setText( "Export" );
 
35
    btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
 
36
    connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) );
 
37
 
 
38
    toolBar->addWidget( typeBox );
 
39
    toolBar->addWidget( btnExport );
 
40
    addToolBar( toolBar );
 
41
 
 
42
    d_plot->setMode( typeBox->currentIndex() );
 
43
    connect( typeBox, SIGNAL( currentIndexChanged( int ) ),
 
44
             d_plot, SLOT( setMode( int ) ) );
 
45
}
 
46
 
 
47
int main( int argc, char **argv )
 
48
{
 
49
    QApplication a( argc, argv );
 
50
 
 
51
    MainWindow w;
 
52
    w.setObjectName( "MainWindow" );
 
53
    w.resize( 600, 400 );
 
54
    w.show();
 
55
 
 
56
    return a.exec();
 
57
}