Raw -> Smart Pointers for mupp_plotter, qt5/qt6.

This commit is contained in:
suter_a 2023-10-24 16:07:56 +02:00
parent 9911d88889
commit e676d3c045
6 changed files with 48 additions and 160 deletions

View File

@ -58,15 +58,9 @@ ClassImpQ(PMuppCanvas)
PMuppCanvas::PMuppCanvas() PMuppCanvas::PMuppCanvas()
{ {
fFtokName = TString(""); fFtokName = TString("");
fCheckMsgQueue = 0; fImp = nullptr;
fBar = nullptr;
fStyle = 0; fPopupMain = nullptr;
fImp = 0;
fBar = 0;
fPopupMain = 0;
fMainCanvas = 0;
fMultiGraph = 0;
gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling
} }
@ -97,11 +91,10 @@ PMuppCanvas::PMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
fValid = true; fValid = true;
fFtokName = TString(""); fFtokName = TString("");
fCheckMsgQueue = 0;
// install IPC message queue timer // install IPC message queue timer
fCheckMsgQueue = new TTimer(); fCheckMsgQueue = std::make_unique<TTimer>();
if (fCheckMsgQueue == 0) { if (fCheckMsgQueue == nullptr) {
fValid = false; fValid = false;
std::cerr << "**ERROR** couldn't start IPC message queue timer..." << std::endl; std::cerr << "**ERROR** couldn't start IPC message queue timer..." << std::endl;
return; return;
@ -113,25 +106,6 @@ PMuppCanvas::PMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
InitMuppCanvas(title, wtopx, wtopy, ww, wh); InitMuppCanvas(title, wtopx, wtopy, ww, wh);
} }
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
* @brief PMuppCanvas::~PMuppCanvas
*/
PMuppCanvas::~PMuppCanvas()
{
if (fMainCanvas) {
delete fMainCanvas;
}
if (fMultiGraph) {
delete fMultiGraph;
}
if (fStyle) {
delete fStyle;
}
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Done (SIGNAL) // Done (SIGNAL)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -217,7 +191,7 @@ void PMuppCanvas::LastCanvasClosed()
*/ */
void PMuppCanvas::WindowClosed() void PMuppCanvas::WindowClosed()
{ {
gROOT->GetListOfCanvases()->Remove(fMainCanvas); gROOT->GetListOfCanvases()->Remove(fMainCanvas.get());
LastCanvasClosed(); LastCanvasClosed();
} }
@ -230,7 +204,7 @@ void PMuppCanvas::WindowClosed()
void PMuppCanvas::CreateStyle() void PMuppCanvas::CreateStyle()
{ {
TString muppStyle("muppStyle"); TString muppStyle("muppStyle");
fStyle = new TStyle(muppStyle, muppStyle); fStyle = std::make_unique<TStyle>(muppStyle, muppStyle);
fStyle->SetOptStat(0); // no statistics options fStyle->SetOptStat(0); // no statistics options
fStyle->SetOptTitle(0); // no title fStyle->SetOptTitle(0); // no title
// set margins // set margins
@ -257,8 +231,8 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
// invoke canvas // invoke canvas
TString canvasName = TString("fMuppCanvas"); TString canvasName = TString("fMuppCanvas");
fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
if (fMainCanvas == 0) { if (fMainCanvas == nullptr) {
std::cerr << std::endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); std::cerr << std::endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data();
std::cerr << std::endl; std::cerr << std::endl;
return; return;
@ -266,8 +240,6 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
fMainCanvas->SetFillColor(0); fMainCanvas->SetFillColor(0);
fMultiGraph = 0;
fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp(); fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp();
fImp->Connect("CloseWindow()", "PMuppCanvas", this, "WindowClosed()"); fImp->Connect("CloseWindow()", "PMuppCanvas", this, "WindowClosed()");
fBar = fImp->GetMenuBar(); fBar = fImp->GetMenuBar();
@ -536,17 +508,14 @@ void PMuppCanvas::UpdateGraphs()
} }
fGraphE.clear(); fGraphE.clear();
if (fMultiGraph) { fMultiGraph.reset();
delete fMultiGraph;
fMultiGraph = 0;
}
// second: create all the necessary graphs // second: create all the necessary graphs
TGraphAsymmErrors *gg = 0; TGraphAsymmErrors *gg = 0;
UInt_t idxS = 0, idxC = 0; UInt_t idxS = 0, idxC = 0;
Int_t color; Int_t color;
TString str; TString str;
if (fMultiGraph == 0) { // first time called if (fMultiGraph == nullptr) { // first time called
for (UInt_t i=0; i<fPlotData.size(); i++) { // loop over all collections for (UInt_t i=0; i<fPlotData.size(); i++) { // loop over all collections
for (UInt_t j=0; j<fPlotData[i].yValue.size(); j++) { // loop over all graph's within the collection for (UInt_t j=0; j<fPlotData[i].yValue.size(); j++) { // loop over all graph's within the collection
gg = new TGraphAsymmErrors(fPlotData[i].xValue.size()); gg = new TGraphAsymmErrors(fPlotData[i].xValue.size());
@ -594,8 +563,8 @@ void PMuppCanvas::UpdateGraphs()
} }
} }
fMultiGraph = new TMultiGraph(); fMultiGraph = std::make_unique<TMultiGraph>();
if (fMultiGraph == 0) { if (fMultiGraph == nullptr) {
std::cerr << "**ERROR** couldn't create necessary TMultiGraph object." << std::endl; std::cerr << "**ERROR** couldn't create necessary TMultiGraph object." << std::endl;
return; return;
} }

View File

@ -31,6 +31,7 @@
#define _PMUPPCANVAS_H_ #define _PMUPPCANVAS_H_
#include <vector> #include <vector>
#include <memory>
#include <TObject.h> #include <TObject.h>
#include <TQObject.h> #include <TQObject.h>
@ -76,7 +77,6 @@ public:
const PIntVector markerSytleList, const PDoubleVector markerSizeList, const PIntVector markerSytleList, const PDoubleVector markerSizeList,
const PIntVector colorList, const PIntVector colorList,
const int mupp_instance); const int mupp_instance);
virtual ~PMuppCanvas();
virtual Bool_t IsValid() { return fValid; } virtual Bool_t IsValid() { return fValid; }
@ -93,11 +93,11 @@ private:
Int_t fMuppInstance; Int_t fMuppInstance;
TString fFtokName; TString fFtokName;
TTimer *fCheckMsgQueue; ///< timer needed to check if a message in the IPC message queue is pending std::unique_ptr<TTimer> fCheckMsgQueue; ///< timer needed to check if a message in the IPC message queue is pending
std::vector<PDataCollection> fPlotData; std::vector<PDataCollection> fPlotData;
TStyle *fStyle; ///< A collection of all graphics attributes std::unique_ptr<TStyle> fStyle; ///< A collection of all graphics attributes
// canvas menu related variables // canvas menu related variables
TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area
@ -105,8 +105,8 @@ private:
TGPopupMenu *fPopupMain; ///< popup menu mupp in the main menu bar TGPopupMenu *fPopupMain; ///< popup menu mupp in the main menu bar
// canvas related variables // canvas related variables
TCanvas *fMainCanvas; ///< main canvas std::unique_ptr<TCanvas> fMainCanvas; ///< main canvas
TMultiGraph *fMultiGraph; ///< main multi graph std::unique_ptr<TMultiGraph> fMultiGraph; ///< main multi graph
std::vector<TGraphAsymmErrors*> fGraphE; ///< all error graphs std::vector<TGraphAsymmErrors*> fGraphE; ///< all error graphs
// perdefined markers, colors // perdefined markers, colors

View File

@ -28,6 +28,7 @@
***************************************************************************/ ***************************************************************************/
#include <iostream> #include <iostream>
#include <memory>
#include <TApplication.h> #include <TApplication.h>
#include <TSAXParser.h> #include <TSAXParser.h>
@ -55,40 +56,22 @@ int main(int argc, char *argv[])
// read startup file // read startup file
char startup_path_name[128]; char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser(); std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
PMuppStartupHandler *startupHandler = new PMuppStartupHandler(); std::unique_ptr<PMuppStartupHandler> startupHandler = std::make_unique<PMuppStartupHandler>();
if (!startupHandler->StartupFileFound()) { if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data(); std::cerr << std::endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl; std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
} else { } else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data()); strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PMuppStartupHandler", startupHandler); saxParser->ConnectToHandler("PMuppStartupHandler", startupHandler.get());
// parsing the file as above seems to lead to problems in certain environments; // parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PMuppStartupHandler.cpp for the definition) // use the parseXmlFile function instead (see PMuppStartupHandler.cpp for the definition)
Int_t status = parseXmlFile(saxParser, startup_path_name); Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors // check for parse errors
if (status) { // error if (status) { // error
std::cerr << std::endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed."; std::cerr << std::endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed.";
std::cerr << std::endl << ">> Graph will appear with random symbols and colors!"; std::cerr << std::endl << ">> Graph will appear with random symbols and colors!";
std::cerr << std::endl; std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
} else { } else {
startupHandler->CheckLists(); startupHandler->CheckLists();
} }
@ -103,7 +86,7 @@ int main(int argc, char *argv[])
startupHandler->GetColorList(), startupHandler->GetColorList(),
mupp_instance); mupp_instance);
if (muppCanvas != 0) { if (muppCanvas != nullptr) {
if (muppCanvas->IsValid()) { if (muppCanvas->IsValid()) {
// connect signal/slot // connect signal/slot
TQObject::Connect("TCanvas", "Closed()", "PMuppCanvas", muppCanvas, "LastCanvasClosed()"); TQObject::Connect("TCanvas", "Closed()", "PMuppCanvas", muppCanvas, "LastCanvasClosed()");
@ -125,14 +108,6 @@ int main(int argc, char *argv[])
app.Run(true); // true needed that Run will return after quit so that cleanup works app.Run(true); // true needed that Run will return after quit so that cleanup works
// clean up // clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
if (muppCanvas) { if (muppCanvas) {
delete muppCanvas; delete muppCanvas;
muppCanvas = 0; muppCanvas = 0;

View File

@ -58,15 +58,9 @@ ClassImpQ(PMuppCanvas)
PMuppCanvas::PMuppCanvas() PMuppCanvas::PMuppCanvas()
{ {
fFtokName = TString(""); fFtokName = TString("");
fCheckMsgQueue = 0; fImp = nullptr;
fBar = nullptr;
fStyle = 0; fPopupMain = nullptr;
fImp = 0;
fBar = 0;
fPopupMain = 0;
fMainCanvas = 0;
fMultiGraph = 0;
gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling
} }
@ -97,11 +91,10 @@ PMuppCanvas::PMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
fValid = true; fValid = true;
fFtokName = TString(""); fFtokName = TString("");
fCheckMsgQueue = 0;
// install IPC message queue timer // install IPC message queue timer
fCheckMsgQueue = new TTimer(); fCheckMsgQueue = std::make_unique<TTimer>();
if (fCheckMsgQueue == 0) { if (fCheckMsgQueue == nullptr) {
fValid = false; fValid = false;
std::cerr << "**ERROR** couldn't start IPC message queue timer..." << std::endl; std::cerr << "**ERROR** couldn't start IPC message queue timer..." << std::endl;
return; return;
@ -113,25 +106,6 @@ PMuppCanvas::PMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
InitMuppCanvas(title, wtopx, wtopy, ww, wh); InitMuppCanvas(title, wtopx, wtopy, ww, wh);
} }
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
* @brief PMuppCanvas::~PMuppCanvas
*/
PMuppCanvas::~PMuppCanvas()
{
if (fMainCanvas) {
delete fMainCanvas;
}
if (fMultiGraph) {
delete fMultiGraph;
}
if (fStyle) {
delete fStyle;
}
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Done (SIGNAL) // Done (SIGNAL)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -217,7 +191,7 @@ void PMuppCanvas::LastCanvasClosed()
*/ */
void PMuppCanvas::WindowClosed() void PMuppCanvas::WindowClosed()
{ {
gROOT->GetListOfCanvases()->Remove(fMainCanvas); gROOT->GetListOfCanvases()->Remove(fMainCanvas.get());
LastCanvasClosed(); LastCanvasClosed();
} }
@ -230,7 +204,7 @@ void PMuppCanvas::WindowClosed()
void PMuppCanvas::CreateStyle() void PMuppCanvas::CreateStyle()
{ {
TString muppStyle("muppStyle"); TString muppStyle("muppStyle");
fStyle = new TStyle(muppStyle, muppStyle); fStyle = std::make_unique<TStyle>(muppStyle, muppStyle);
fStyle->SetOptStat(0); // no statistics options fStyle->SetOptStat(0); // no statistics options
fStyle->SetOptTitle(0); // no title fStyle->SetOptTitle(0); // no title
// set margins // set margins
@ -257,8 +231,8 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
// invoke canvas // invoke canvas
TString canvasName = TString("fMuppCanvas"); TString canvasName = TString("fMuppCanvas");
fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
if (fMainCanvas == 0) { if (fMainCanvas == nullptr) {
std::cerr << std::endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); std::cerr << std::endl << ">> PMuppCanvas::InitMuppCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data();
std::cerr << std::endl; std::cerr << std::endl;
return; return;
@ -266,8 +240,6 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy,
fMainCanvas->SetFillColor(0); fMainCanvas->SetFillColor(0);
fMultiGraph = 0;
fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp(); fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp();
fImp->Connect("CloseWindow()", "PMuppCanvas", this, "WindowClosed()"); fImp->Connect("CloseWindow()", "PMuppCanvas", this, "WindowClosed()");
fBar = fImp->GetMenuBar(); fBar = fImp->GetMenuBar();
@ -536,17 +508,14 @@ void PMuppCanvas::UpdateGraphs()
} }
fGraphE.clear(); fGraphE.clear();
if (fMultiGraph) { fMultiGraph.reset();
delete fMultiGraph;
fMultiGraph = 0;
}
// second: create all the necessary graphs // second: create all the necessary graphs
TGraphAsymmErrors *gg = 0; TGraphAsymmErrors *gg = 0;
UInt_t idxS = 0, idxC = 0; UInt_t idxS = 0, idxC = 0;
Int_t color; Int_t color;
TString str; TString str;
if (fMultiGraph == 0) { // first time called if (fMultiGraph == nullptr) { // first time called
for (UInt_t i=0; i<fPlotData.size(); i++) { // loop over all collections for (UInt_t i=0; i<fPlotData.size(); i++) { // loop over all collections
for (UInt_t j=0; j<fPlotData[i].yValue.size(); j++) { // loop over all graph's within the collection for (UInt_t j=0; j<fPlotData[i].yValue.size(); j++) { // loop over all graph's within the collection
gg = new TGraphAsymmErrors(fPlotData[i].xValue.size()); gg = new TGraphAsymmErrors(fPlotData[i].xValue.size());
@ -594,8 +563,8 @@ void PMuppCanvas::UpdateGraphs()
} }
} }
fMultiGraph = new TMultiGraph(); fMultiGraph = std::make_unique<TMultiGraph>();
if (fMultiGraph == 0) { if (fMultiGraph == nullptr) {
std::cerr << "**ERROR** couldn't create necessary TMultiGraph object." << std::endl; std::cerr << "**ERROR** couldn't create necessary TMultiGraph object." << std::endl;
return; return;
} }

View File

@ -31,6 +31,7 @@
#define _PMUPPCANVAS_H_ #define _PMUPPCANVAS_H_
#include <vector> #include <vector>
#include <memory>
#include <TObject.h> #include <TObject.h>
#include <TQObject.h> #include <TQObject.h>
@ -76,7 +77,6 @@ public:
const PIntVector markerSytleList, const PDoubleVector markerSizeList, const PIntVector markerSytleList, const PDoubleVector markerSizeList,
const PIntVector colorList, const PIntVector colorList,
const int mupp_instance); const int mupp_instance);
virtual ~PMuppCanvas();
virtual Bool_t IsValid() { return fValid; } virtual Bool_t IsValid() { return fValid; }
@ -93,11 +93,11 @@ private:
Int_t fMuppInstance; Int_t fMuppInstance;
TString fFtokName; TString fFtokName;
TTimer *fCheckMsgQueue; ///< timer needed to check if a message in the IPC message queue is pending std::unique_ptr<TTimer> fCheckMsgQueue; ///< timer needed to check if a message in the IPC message queue is pending
std::vector<PDataCollection> fPlotData; std::vector<PDataCollection> fPlotData;
TStyle *fStyle; ///< A collection of all graphics attributes std::unique_ptr<TStyle> fStyle; ///< A collection of all graphics attributes
// canvas menu related variables // canvas menu related variables
TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area
@ -105,8 +105,8 @@ private:
TGPopupMenu *fPopupMain; ///< popup menu mupp in the main menu bar TGPopupMenu *fPopupMain; ///< popup menu mupp in the main menu bar
// canvas related variables // canvas related variables
TCanvas *fMainCanvas; ///< main canvas std::unique_ptr<TCanvas> fMainCanvas; ///< main canvas
TMultiGraph *fMultiGraph; ///< main multi graph std::unique_ptr<TMultiGraph> fMultiGraph; ///< main multi graph
std::vector<TGraphAsymmErrors*> fGraphE; ///< all error graphs std::vector<TGraphAsymmErrors*> fGraphE; ///< all error graphs
// perdefined markers, colors // perdefined markers, colors

View File

@ -28,6 +28,7 @@
***************************************************************************/ ***************************************************************************/
#include <iostream> #include <iostream>
#include <memory>
#include <TApplication.h> #include <TApplication.h>
#include <TSAXParser.h> #include <TSAXParser.h>
@ -55,40 +56,22 @@ int main(int argc, char *argv[])
// read startup file // read startup file
char startup_path_name[128]; char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser(); std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
PMuppStartupHandler *startupHandler = new PMuppStartupHandler(); std::unique_ptr<PMuppStartupHandler> startupHandler = std::make_unique<PMuppStartupHandler>();
if (!startupHandler->StartupFileFound()) { if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data(); std::cerr << std::endl << ">> mupp_plot **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl; std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
} else { } else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data()); strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PMuppStartupHandler", startupHandler); saxParser->ConnectToHandler("PMuppStartupHandler", startupHandler.get());
// parsing the file as above seems to lead to problems in certain environments; // parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PMuppStartupHandler.cpp for the definition) // use the parseXmlFile function instead (see PMuppStartupHandler.cpp for the definition)
Int_t status = parseXmlFile(saxParser, startup_path_name); Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors // check for parse errors
if (status) { // error if (status) { // error
std::cerr << std::endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed."; std::cerr << std::endl << ">> mupp_plot **WARNING** Reading/parsing mupp_startup.xml failed.";
std::cerr << std::endl << ">> Graph will appear with random symbols and colors!"; std::cerr << std::endl << ">> Graph will appear with random symbols and colors!";
std::cerr << std::endl; std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
} else { } else {
startupHandler->CheckLists(); startupHandler->CheckLists();
} }
@ -103,7 +86,7 @@ int main(int argc, char *argv[])
startupHandler->GetColorList(), startupHandler->GetColorList(),
mupp_instance); mupp_instance);
if (muppCanvas != 0) { if (muppCanvas != nullptr) {
if (muppCanvas->IsValid()) { if (muppCanvas->IsValid()) {
// connect signal/slot // connect signal/slot
TQObject::Connect("TCanvas", "Closed()", "PMuppCanvas", muppCanvas, "LastCanvasClosed()"); TQObject::Connect("TCanvas", "Closed()", "PMuppCanvas", muppCanvas, "LastCanvasClosed()");
@ -125,14 +108,6 @@ int main(int argc, char *argv[])
app.Run(true); // true needed that Run will return after quit so that cleanup works app.Run(true); // true needed that Run will return after quit so that cleanup works
// clean up // clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
if (muppCanvas) { if (muppCanvas) {
delete muppCanvas; delete muppCanvas;
muppCanvas = 0; muppCanvas = 0;