@@ -231,8 +231,7 @@ void MainWindow::showImageAndFFT(Eigen::MatrixXcd &image)
231
231
}
232
232
catch (const std::exception & e)
233
233
{
234
- QMessageBox messageBox;
235
- messageBox.critical (nullptr ," Error" , e.what ());
234
+ QMessageBox::critical (nullptr ," Error" , e.what ());
236
235
return ;
237
236
}
238
237
@@ -243,8 +242,7 @@ void MainWindow::showImageAndFFT(Eigen::MatrixXcd &image)
243
242
}
244
243
catch (const std::exception & e)
245
244
{
246
- QMessageBox messageBox;
247
- messageBox.critical (nullptr ," Error" , e.what ());
245
+ QMessageBox::critical (nullptr ," Error" , e.what ());
248
246
return ;
249
247
}
250
248
@@ -381,8 +379,7 @@ void MainWindow::clickBraggSpot(QMouseEvent *event)
381
379
}
382
380
catch (const std::exception & e)
383
381
{
384
- QMessageBox messageBox;
385
- messageBox.critical (nullptr ," Error" , e.what ());
382
+ QMessageBox::critical (nullptr ," Error" , e.what ());
386
383
return ;
387
384
}
388
385
@@ -405,8 +402,7 @@ void MainWindow::continuePhase()
405
402
}
406
403
catch (const std::exception & e)
407
404
{
408
- QMessageBox messageBox;
409
- messageBox.critical (nullptr ," Error" , e.what ());
405
+ QMessageBox::critical (nullptr ," Error" , e.what ());
410
406
return ;
411
407
}
412
408
@@ -557,8 +553,7 @@ void MainWindow::doRefinement(double top, double left, double bottom, double rig
557
553
}
558
554
catch (const std::exception & e)
559
555
{
560
- QMessageBox messageBox;
561
- messageBox.critical (nullptr , " Error" , e.what ());
556
+ QMessageBox::critical (nullptr , " Error" , e.what ());
562
557
return ;
563
558
}
564
559
@@ -865,18 +860,18 @@ void MainWindow::on_angleSpin_editingFinished()
865
860
// These are to account for the size of the text
866
861
// there might be a better way using rects and setting the alignment to centre
867
862
// but I can't be botthered to work it out
868
- QPoint ysz (-3 , 4.5 );
869
- QPoint xsz (-3 , 3 );
863
+ QPointF ysz (-3 , 4.5 );
864
+ QPointF xsz (-3 , 3 );
870
865
// This is the size of our area to draw in
871
866
QSize size (100 , 100 );
872
867
// This is the pixmap that will eventually be shown, we start with it transparent
873
868
QPixmap newmap (size);
874
869
newmap.fill (Qt::transparent);
875
870
// this is the midpoint of our image (so we can rotate around it)
876
- QPoint mid (size.height ()/2 , size.width ()/2 );
871
+ QPointF mid (size.height ()/2 . , size.width ()/2 . );
877
872
// this is the position of our labels
878
- QPoint xp (65 , 65 );
879
- QPoint yp (35 , 35 );
873
+ QPointF xp (65 , 65 );
874
+ QPointF yp (35 , 35 );
880
875
881
876
// here we rotate these positions about the mid point
882
877
xp = xp - mid;
@@ -904,9 +899,9 @@ void MainWindow::on_angleSpin_editingFinished()
904
899
p->setPen (yPen);
905
900
p->drawText (yp + ysz, " y" );
906
901
// now rotate the svg about hte mid point and draw it
907
- p->translate (size.height ()/2 ,size.height ()/2 );
902
+ p->translate (size.height ()/2 . ,size.height ()/2 . );
908
903
p->rotate (-angle);
909
- p->translate (-size.height ()/2 ,-size.height ()/2 );
904
+ p->translate (-size.height ()/2 . ,-size.height ()/2 . );
910
905
renderer.render (p);
911
906
// done, phew...
912
907
p->end ();
0 commit comments