Solved Dentist here. Trying to write a dental software. Some tips?
-
So during the lockdown I started learning C++, and now I'm using QT for almost 2 weeks and I'm having a blast! The patient input form I've made is superb. Now that I'm familiar with forms, I want to continue with the teeth status input. I have to create a widget, which displays teeth images, which are selectable by mouse, or keyboard and changeable on user input. What Qt classes do you recommend? I assume there is more than one way to do it, so any guidance will be highly appreciated - hints, links to tutorials, anything! :)
-
Hi and welcome to the forums
Like such ?
where you can select a teeth top to get info, assign info ?
-
More like this:
Edit: Absolutely necessary for the teeth to be selectable with mouse, with tab key, shift+tab (multi selection) and select rectangle. There are so many dental softwares in my country, and none of those get the tooth status right. Most of the status input is a clicking dungeon and it's terrible, when you waste your time clicking 4 times to enter the status of one tooth, and in the same time there are 3 more patients waiting infront of your office. So it has to be as fast as possible.
-
Hi
There are many ways to do that. :)
You could use 2x listWidget in icon mode
Must the numbers be up there and not say under each tooth ?
The benefit with listWidget/View is that selection and clicking etc comes almost free. just need to hook up the signals.
Select by rectangle you must manually program. maybe use QRubberBand for that.
-
Numbers are just numbers. They can be anywhere. They can be even a non-selectable item. The images of the teeth are important.
-
Hi
There is also
https://doc.qt.io/qt-5/graphicsview.htmlthat can do many things you need but not sure if its overkill.
-
Hi
I think ListWidget with vievMode set to icon mode will work good.What types of other interactions do you need besides, select, select more than one.
btw tab and shift tab is used for keyboard navigation and will jump out of the list.
Does it has to be those keys ? that is very non standard :) -
Since this is just a project, which helps me learn programming, I don't mind being an overkill :P As for the tab - not necessarily, it might be selectable with the arrow keys, and arrow keys with shift for multiselection. Selection rectangle implementation might be problematic, but if done right it can be VERY useful. Also context menu on right clicking each of the teeth would be nice :)
-
@Hristo-Konstantinov
Hi
graphics framework work is very powerful and also supports panning /zoom etc so if that could be useful it might be
ok idea,
Try out
https://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html
(its in Creator)
and see what you think. you can insert images etc and its full objects but has a higher learning curve that the listWidget idea. -
GraphicsView actually looks PRETTY good. An option to have a caries or obturation texture as a sprite and layering it over the tooth would be very nice, instead of having 100 textures for each possible status of one tooth. Again - if dentistry has taught me something, it is that the quickest and lazy solution to a complicated problem is almost never the most optimal one.
-
@Hristo-Konstantinov
Also it can draw thousand items with no issues so you can other info if you wish.
It also supports grouping etc.
You can also make custom items that you draw with QPainter so it can be anything you like. -
@Hristo-Konstantinov said in Dentist here. Trying to write a dental software. Some tips?:
An option to have a caries or obturation texture as a sprite and layering it over the tooth would be very nice
That would be ok easy to do by subclassing the PixmapItem and teach it to draw both the base image and some image over.
https://doc.qt.io/qt-5/qgraphicspixmapitem.html
( just call normal draw and then draw a transparent image over that.)ps. bumped you a bit so you should be able to post faster
-
Thanks for the quick replies mate! Obviously you gave me the direction I wanted. Thank you so much!
-
@Hristo-Konstantinov
Np :)
Make sure to read the docs about coordinate system as its slightly different with both global and local . That can be a bit surprising.
Do note you can set it to start at top, left and not center if you wish.