optimized the plot a bit

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@180 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2013-05-15 12:50:11 +00:00
parent 4fdacefdbe
commit 287a451904
3 changed files with 18 additions and 8 deletions

View File

@ -276,7 +276,11 @@ SlsQt1DPlot::SlsQt1DPlot(QWidget *parent):QwtPlot(parent){
SetupZoom();
// Assign a title
#ifndef IAN
insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
#else
insertLegend(new QwtLegend(), QwtPlot::RightLegend);
#endif
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);

View File

@ -72,11 +72,12 @@ void SlsQt2DPlotLayout::Layout(){
the_layout->addWidget(btnInterpolate,1,1);
the_layout->addWidget(btnContour,1,2);
the_layout->addWidget(btnLogz,1,3);
#endif
the_layout->addWidget(the_plot,2,1,3,3);
the_layout->addWidget(z_range_ne,5,1,1,3);
#ifdef IAN
the_layout->setMargin(12);
#else
the_layout->addWidget(the_plot,2,0,3,3);
the_layout->addWidget(z_range_ne,5,0,1,3);
#endif
}

View File

@ -201,7 +201,7 @@ void qDrawPlot::SetupWidgetWindow(){
histFrameIndexTitle= histFrameIndexTitle = new QLabel("");
boxPlot = new QGroupBox("");
layout->addWidget(boxPlot,1,1);
layout->addWidget(boxPlot,1,0);
boxPlot->setAlignment(Qt::AlignHCenter);
boxPlot->setFont(QFont("Sans Serif",11,QFont::Normal));
boxPlot->setTitle("Sample Plot");
@ -251,8 +251,9 @@ void qDrawPlot::SetupWidgetWindow(){
boxPlot->setContentsMargins(0,15,0,0);
plotLayout = new QGridLayout(boxPlot);
plotLayout->addWidget(plot1D,1,1,1,1);
plotLayout->addWidget(plot2D,1,1,1,1);
plotLayout->setContentsMargins(0,0,0,0);
plotLayout->addWidget(plot1D,0,0,1,1);
plotLayout->addWidget(plot2D,0,0,1,1);
//callbacks
@ -1017,6 +1018,7 @@ void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
boxPlot->setFlat(false);
plot_in_scope=1;
layout->addWidget(histFrameIndexTitle,0,0);
plotLayout->setContentsMargins(10,10,10,10);
}else{
plot2D->SetXTitle(imageXAxisTitle);
plot2D->SetYTitle(imageYAxisTitle);
@ -1027,6 +1029,7 @@ void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
plot_in_scope=2;
histFrameIndexTitle->setText("");
layout->removeWidget(histFrameIndexTitle);
plotLayout->setContentsMargins(0,0,0,0);
}
}
@ -1194,7 +1197,8 @@ void qDrawPlot::ClonePlot(){
plot1D->setFont(QFont("Sans Serif",9,QFont::Normal));
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
plot1D->SetYTitle(histYAxisTitle.toAscii().constData());
plotLayout->addWidget(plot1D,1,1,1,1);
plotLayout->addWidget(plot1D,0,0,1,1);
plotLayout->setContentsMargins(10,10,10,10);
if(running){
// update range
bool found =false;
@ -1222,7 +1226,8 @@ void qDrawPlot::ClonePlot(){
plot2D->SetXTitle(imageXAxisTitle);
plot2D->SetYTitle(imageYAxisTitle);
plot2D->SetZTitle(imageZAxisTitle);
plotLayout->addWidget(plot2D,1,1,1,1);
plotLayout->addWidget(plot2D,0,0,1,1);
plotLayout->setContentsMargins(0,0,0,0);
}
UnlockLastImageArray();