Painting App with Qt
-
Hi guys, I'm trying to build a painting app for my thesis that would be more "intuitive". I was introduced to Qt recently and I like it quite a lot, especially how it's cross-platform all using C++ (and QML if one wants). However, even though I'm a computer science graduate, I've always had a love-hate relationship with programming. I understand conceptually a lot of stuff but when it comes to writing it down, it's just a nightmare, unless it's visually explained and I have someone to guide me through. So I have this paintig app I'm trying to make. I was able to do so in QML because that's not even close to hard (still took me a long time ... ) but apparently QML's performance is pretty bad. So I'm trying to do it in C++. I know how events and all work conceptually, but in code I can't seem to make sense of it. To compound the problem, older examples don't work in newer versions of Qt. For example, Finger Paint| Qt 4.8[^] is the only one I found that makes use of touch to paint, but it doesn't compile nor can I seem to implement whatever I learned from it in the current version of Qt. I can certainly continue using mouse events instead of touch for the painting. I have one of those running, but what I want to do is make the painting more realistic. First by making the brush size dynamic (based on finger pressure) without using pressure-sensitive touchscreens and second by more realistic paint behaviour. So the solution to the first problem I thought of was calculating the shape of the contact area of the finger on the screen. The higher the pressure, the larger the brush size. Here is why I can't use mouse gestures because mouse is binary. I was able to find some way to calculate this in Qt but I can't find it anymore so I'm wondering if I made a mistake. I found some reference to do so in Android and Windows Phone as well. But I have no Android experience (only some Java experience) and I have a Windows Phone but I can't ask others to test without physically giving them my phone. For the paint behaviour, I found a few good research papers but considering I'm not even able to implement touch properly, I'm gonna leave that alone for now. But the basic idea would be to make a couple of layers of canvas that would store information like pigments and water and then somehow manipulate them to give watercolour behaviour, for ex