ayanda83
13th March 2014, 11:27
Hi everyone, i am working on an app that reads data from a database and displays the data on a QGraphicsRectItem (at least that is whats the app is suppose to do). My problem is that i am clueless as to how to implement the above. I am able to add a simple rectangular item in the QGraphacsView using QGraphicsRectItem and QGraphicsScene but beyond that i am clueless. I have read the Qt documentation but there is not enough information for me to realize my goal or maybe i'm just not understanding the Qt documentation. OK, NOW THIS IS WHAT I WANT TO ACHIEVE, the app must read a person's name and surname from the database and then display that information in a rectangular item in the GraphicsView. The rect item must be aligned to the top left-hand corner of the GraphicsView and scaling the whole width of the GraphicsView and only 10mm in height. If an extra name and surname is read from the database another identical rectItem is to be created and placed below the previous one, hence forming some kind of an array like structure. NB: When GraphicsView is scaled up, down, left or right the rectItems are to scale with the graphicsView. I DON'T EXPECT SOMEBODY TO RIGHT THE CODE FOR ME but i would appreciate it if somebody can tell me which Class objects I can use for all the above. THANKING YOU IN ADVANCE.