[Rinside-commits] r192 - pkg/inst/examples/qt

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 25 04:30:02 CET 2011


Author: edd
Date: 2011-03-25 04:30:00 +0100 (Fri, 25 Mar 2011)
New Revision: 192

Modified:
   pkg/inst/examples/qt/qtdensity.cpp
   pkg/inst/examples/qt/qtdensity.h
Log:
more cleanup


Modified: pkg/inst/examples/qt/qtdensity.cpp
===================================================================
--- pkg/inst/examples/qt/qtdensity.cpp	2011-03-25 03:08:27 UTC (rev 191)
+++ pkg/inst/examples/qt/qtdensity.cpp	2011-03-25 03:30:00 UTC (rev 192)
@@ -67,13 +67,7 @@
     kernelGroup->addButton(radio5, 4);
     QObject::connect(kernelGroup, SIGNAL(buttonClicked(int)), this, SLOT(getKernel(int)));
 
-    //imageLabel = new QLabel;
-    //imageLabel->setBackgroundRole(QPalette::Base);
-    //imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
-    //imageLabel->setScaledContents(true);
-
-    //image = new QImage(QString(m_tempfile.c_str()));
-    svg = new QSvgWidget();
+    m_svg = new QSvgWidget();
     runRandomDataCmd();	   	// also calls plot()
 
     QGroupBox *estimationBox = new QGroupBox("Density estimation bandwidth (scaled by 100)");
@@ -92,15 +86,11 @@
     upperlayout->addWidget(kernelRadioBox);
     upperlayout->addWidget(estimationBox);
 
-    //QHBoxLayout *lowerlayout = new QHBoxLayout;
-    //lowerlayout->addWidget(imageLabel);
-
     QHBoxLayout *svglayout = new QHBoxLayout;
-    svglayout->addWidget(svg);
+    svglayout->addWidget(m_svg);
 
     QVBoxLayout *outer = new QVBoxLayout;
     outer->addLayout(upperlayout);
-    //outer->addLayout(lowerlayout);
     outer->addLayout(svglayout);
     window->setLayout(outer);
     window->show();
@@ -123,9 +113,7 @@
     std::string cmd = cmd1 + kernelstrings[m_kernel] + cmd2;
     m_R.parseEvalQ(cmd);
     filterFile();
-    //image->load(QString(m_tempfile.c_str()));
-    //imageLabel->setPixmap(QPixmap::fromImage(*image));
-    svg->load(QString(m_svgfile.c_str()));
+    m_svg->load(QString(m_svgfile.c_str()));
 }
 
 void QtDensity::getBandwidth(int bw) {

Modified: pkg/inst/examples/qt/qtdensity.h
===================================================================
--- pkg/inst/examples/qt/qtdensity.h	2011-03-25 03:08:27 UTC (rev 191)
+++ pkg/inst/examples/qt/qtdensity.h	2011-03-25 03:30:00 UTC (rev 192)
@@ -37,9 +37,7 @@
     void plot(void);		// run a density plot in R and update the
     void filterFile(void);	// modify the richer SVG produced by R
 
-    //QLabel *imageLabel;
-    //QImage *image;
-    QSvgWidget *svg;
+    QSvgWidget *m_svg;		// the SVG device
 
     RInside & m_R;		// reference to the R instance passed to constructor
     std::string m_tempfile;	// name of file used by R for plots



More information about the Rinside-commits mailing list