f36f7e4
diff -up svm-toy/qt/Makefile.orig svm-toy/qt/Makefile
a906061
--- svm-toy/qt/Makefile.orig	2023-02-28 01:31:32.000000000 -0700
a906061
+++ svm-toy/qt/Makefile	2023-02-28 14:19:22.252890728 -0700
e6b06f5
@@ -1,13 +1,14 @@
e6b06f5
 # use  ``export QT_SELECT=qt5'' in a command window for using qt5
e6b06f5
 # may need to adjust the path of header files
e6b06f5
 CXX? = g++
e6b06f5
-INCLUDE = /usr/include/x86_64-linux-gnu/qt5
e6b06f5
-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=c++11
a906061
-LIB = -lQt5Widgets -lQt5Gui -lQt5Core
a906061
-MOC = /usr/bin/moc
e6b06f5
+INCLUDE = /usr/include/qt5
e6b06f5
+CPP_STD ?= c++11
e6b06f5
+CFLAGS = ${RPM_CFLAGS} -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=${CPP_STD}
a906061
+LIB = -fopenmp -lQt5Widgets -lQt5Gui -lQt5Core
e6b06f5
+MOC ?= /usr/bin/moc-qt5
f36f7e4
 
e6b06f5
 svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o
e6b06f5
-	$(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB)
e6b06f5
+	$(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt $(LIB)
f36f7e4
 
e6b06f5
 svm-toy.moc: svm-toy.cpp
e6b06f5
 	$(MOC) svm-toy.cpp -o svm-toy.moc
e6b06f5
@@ -16,4 +17,4 @@ svm-toy.moc: svm-toy.cpp
e6b06f5
 	make -C ../.. svm.o
f36f7e4
 
e6b06f5
 clean:
e6b06f5
-	rm -f *~ svm-toy svm-toy.moc ../../svm.o
e6b06f5
+	rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o
f36f7e4
diff -up svm-toy/qt/svm-toy.cpp.orig svm-toy/qt/svm-toy.cpp
a906061
--- svm-toy/qt/svm-toy.cpp.orig	2023-02-28 01:31:32.000000000 -0700
a906061
+++ svm-toy/qt/svm-toy.cpp	2023-02-28 14:19:03.158156750 -0700
f36f7e4
@@ -326,12 +326,12 @@ private slots:
f36f7e4
 					double x,y;
f36f7e4
 					if(sscanf(buf,"%d%*d:%lf%*d:%lf",&v,&x,&y)==3)
f36f7e4
 					{
f36f7e4
-						point p = {x,y,v};
f36f7e4
+						point p = {x,y,(signed char) v};
f36f7e4
 						point_list.push_back(p);
f36f7e4
 					}
f36f7e4
 					else if(sscanf(buf,"%lf%*d:%lf",&y,&x)==2)
f36f7e4
 					{
f36f7e4
-						point p = {x,y,current_value};
f36f7e4
+						point p = {x,y,(signed char) current_value};
f36f7e4
 						point_list.push_back(p);
f36f7e4
 					}
f36f7e4
 					else
f36f7e4
@@ -375,7 +375,7 @@ SvmToyWindow::SvmToyWindow()
f36f7e4
 			 SLOT(button_run_clicked()));
f36f7e4
 
f36f7e4
   	// don't blank the window before repainting
f36f7e4
-	setAttribute(Qt::WA_NoBackground);
f36f7e4
+	setAttribute(Qt::WA_OpaquePaintEvent);
f36f7e4
 
f36f7e4
 	icon1 = QPixmap(4,4);
f36f7e4
 	icon2 = QPixmap(4,4);
f36f7e4
@@ -413,7 +413,7 @@ SvmToyWindow::~SvmToyWindow()
f36f7e4
 
f36f7e4
 void SvmToyWindow::mousePressEvent( QMouseEvent* event )
f36f7e4
 {
f36f7e4
-	point p = {(double)event->x()/XLEN, (double)event->y()/YLEN, current_value};
f36f7e4
+	point p = {(double)event->x()/XLEN, (double)event->y()/YLEN,(signed char) current_value};
f36f7e4
 	point_list.push_back(p);
f36f7e4
 	draw_point(p);
f36f7e4
 }