Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Removing square (objects) from my GUI

$
0
0
Hi everyone. I currently have a .txt file which has a list of (x,y) coordinates. I read this and create square objects and display to the screen. I have a for loop that loops through all the x,y coordinates in the .txt file and generates the objects such as:   for (unsigned int i = 0; i < coordinatesTextFile.size(); i++){         //convert local coordinates to GUI coordinates             DisplayObjects *obstacle = new DisplayObjects(((coordinatesTextFile[i][0]-1)*(screenLength/xSquareSize)),((coordinatesTextFile[i][1]-1)*(screenWidth/ySquareSize)-1));           scene->addItem(obstacle);             } I want to be able to delete/add old/new coordinates from my .txt file and have the square objects show the result dynamically. Currently I have to close the GUI and re-run the program.

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images