Changeset 12302 for trunk/FACT++


Ignore:
Timestamp:
10/27/11 16:45:13 (13 years ago)
Author:
lyard
Message:
added clean destruction of qwt objects
Location:
trunk/FACT++/gui/RawEventsViewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r12301 r12302  
    2323#include <QFileDialog>
    2424
    25 #include <qwt_plot_grid.h>
    2625#include <qwt_symbol.h>
    2726
     
    12421241    show();
    12431242}
    1244 
     1243UIConnector::~UIConnector()
     1244{
     1245    grid1->detach();
     1246    grid2->detach();
     1247    grid3->detach();
     1248    grid4->detach();
     1249    grid5->detach();
     1250    boardsTimeHistoItem.detach();
     1251    startCellHistoItem.detach();
     1252    startTimeMarkHistoItem.detach();
     1253    pixelValueCurveItem.detach();
     1254    aMeanCurveItem.detach();
     1255    vCorrCurveItem.detach();
     1256    meanCurveItem.detach();
     1257}
    12451258void UIConnector::slicesPlusPlus()
    12461259{
     
    18931906//    QwtPlot*     boardsTimeHisto;
    18941907//    QwtPlotHistogram boardsTimeHistoItem;
    1895     QwtPlotGrid* grid = new QwtPlotGrid;
    1896     grid->enableX(false);
    1897     grid->enableY(true);
    1898     grid->enableXMin(false);
    1899     grid->enableYMin(false);
    1900     grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
    1901     grid->attach(boardsTimeHisto);
    1902 
    1903     grid = new QwtPlotGrid;
    1904     grid->enableX(false);
    1905     grid->enableY(true);
    1906     grid->enableXMin(false);
    1907     grid->enableYMin(false);
    1908     grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
    1909     grid->attach(startCellsHisto);
    1910 
    1911     grid = new QwtPlotGrid;
    1912     grid->enableX(false);
    1913     grid->enableY(true);
    1914     grid->enableXMin(false);
    1915     grid->enableYMin(false);
    1916     grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
    1917     grid->attach(startTimeMarkHisto);
    1918 
    1919     grid = new QwtPlotGrid;
    1920     grid->enableX(false);
    1921     grid->enableY(true);
    1922     grid->enableXMin(false);
    1923     grid->enableYMin(false);
    1924     grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
    1925     grid->attach(pixelValueCurve);
    1926 
    1927     grid = new QwtPlotGrid;
    1928     grid->enableX(false);
    1929     grid->enableY(true);
    1930     grid->enableXMin(false);
    1931     grid->enableYMin(false);
    1932     grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
    1933     grid->attach(triggerDelayHisto);
     1908    grid1 = new QwtPlotGrid;
     1909    grid1->enableX(false);
     1910    grid1->enableY(true);
     1911    grid1->enableXMin(false);
     1912    grid1->enableYMin(false);
     1913    grid1->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
     1914    grid1->attach(boardsTimeHisto);
     1915
     1916    grid2 = new QwtPlotGrid;
     1917    grid2->enableX(false);
     1918    grid2->enableY(true);
     1919    grid2->enableXMin(false);
     1920    grid2->enableYMin(false);
     1921    grid2->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
     1922    grid2->attach(startCellsHisto);
     1923
     1924    grid3 = new QwtPlotGrid;
     1925    grid3->enableX(false);
     1926    grid3->enableY(true);
     1927    grid3->enableXMin(false);
     1928    grid3->enableYMin(false);
     1929    grid3->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
     1930    grid3->attach(startTimeMarkHisto);
     1931
     1932    grid4 = new QwtPlotGrid;
     1933    grid4->enableX(false);
     1934    grid4->enableY(true);
     1935    grid4->enableXMin(false);
     1936    grid4->enableYMin(false);
     1937    grid4->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
     1938    grid4->attach(pixelValueCurve);
     1939
     1940    grid5 = new QwtPlotGrid;
     1941    grid5->enableX(false);
     1942    grid5->enableY(true);
     1943    grid5->enableXMin(false);
     1944    grid5->enableYMin(false);
     1945    grid5->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
     1946    grid5->attach(triggerDelayHisto);
    19341947
    19351948    boardsTimeHisto->setAutoReplot(true);
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h

    r12300 r12302  
    3838//#include "qwt_plot_histogram.h"
    3939#include <qwt_plot_curve.h>
    40 
     40#include <qwt_plot_grid.h>
    4141#include <qwt_plot_zoomer.h>
    4242
     
    210210public:
    211211    UIConnector(QWidget *parent = 0);
     212    ~UIConnector();
    212213
    213214public Q_SLOTS:
     
    292293    QwtPlotZoomer* startTimeMarkHistoZoom;
    293294    QwtPlotZoomer* triggerDelayHistoZoom;
     295
     296    //declare the grids here, because I must have access to them to detach them properly at destruction time (bug and crash with "bad" versions of qwt)
     297    QwtPlotGrid* grid1;
     298    QwtPlotGrid* grid2;
     299    QwtPlotGrid* grid3;
     300    QwtPlotGrid* grid4;
     301    QwtPlotGrid* grid5;
    294302};
    295303
Note: See TracChangeset for help on using the changeset viewer.