continuous line drawing in QT - qt

I need to draw line continuously on the screen, output should be as it is in the video. Please check this link: http://www.youtube.com/watch?v=sYNIm210mJY.
Please suggest me which is the best method to implement it.

Please check the scribble example (located in Qt examples/widgets/scribble/) provided by Qt.
You'll find everything you need to get what you want !

Related

Qt: How to implement a class for an image with properties

I have dared to start learning Qt with very basic C++ knowledge. I am asked to implement a class for image in Qt.
In my application whenever I will select a picture it will have some properties, such as, when I will move the window the QLabel that is containing my image will also increase in size of width and height without loosing the aspect ratio.
I do not expect some finished code. But I want to know how to think for that. I am having problem to make an algorithm.
I am expecting some help to solve this problem. Thanks in advance!
You should begin by running some sample code and seeing how they work. There are lots of examples that display images in various ways. Step through them to see if you can understand what each step does.
Try to write a simple "Hello world!" app in Qt. Then try adding an image display to it. The solution to the task you describe should become straightforward as you develop knowledge of Qt.

How to Record an Audio and Play in QML?

I am trying an application where i kept three buttons one for play,record and stop.
When i press the record button,it should start record the audio by me. and after stopping it,when i play it.it should retrieve the recorded audio from the file,where it is stored.
I have tried using this link below,but could not find any solution.
https://projects.developer.nokia.com/audiorecorder/changeset/67519324bc6ea96ef956dec1b494eb3a5417402b
Can anyone find me a solution for this.I am badly in need of this solution!!!
Thanks in Advance!!!
As far as I know, you should call the phonon's MediaSource/MediaObject classes to do it inthe back end.
#include <phonon/MediaObject>
#include <phonon/MediaSource>
Phonon::MediaObject *mobj....;
I dont know how QML is written but this is how you get to play media files in Qt.
Your link seems to have a solution for Symbian only.
One general thing: There is no recording API for QML. But there are C++ classes in QtMobility Multimedia which do what you want to do, you just need to export APIs to QML (that's what you can learn from the example in your link)

How to use custom widget in Qt-Designer

I want to use a custom widget in the GUI-Designer of Qt-Creator IDE.
So i created a class which inherits from Qt's QWidget. It worked to place
it on a QMainWindow programaticaly, but have to do my work in the desiger
where it does not appear as an option in the kist of components.
I googled to find a solution for problem an found an manual on, who guesses, the
Qt doc page ( https://doc.qt.io/archives/qt-4.7/designer-creating-custom-widgets.html
and https://doc.qt.io/archives/qt-4.7/designer-creating-custom-widgets.html).
I tried to follow it but doesn't work.
Does someone know an other way to do this or can give a hint where i can search
for problems following this tutorial?
Thanks in advance.
Codierknecht
There is a different example in the examples section of the Qt documentation that I think is a lot clearer.
Custom Widget Plugin Example
It was a little unclear to me when reading the tutorial where the Q_EXPORT_PLUGIN2() macro goes, but having full example code and project alleviates that.
If you are like me, the analog clock example didn't do it for you, in which case I found just one better tutorial. It may be on the kde site but I you dont need kde to do it, it just explains how to make the custom widget a plugin so you can add it into Qt Designer, rather than having to code it in, which is the norm when you just add a widget to your project and customize the class. I hope this page helps you like it helped me, get in the right direction of writing a single Qt Designer (or multiple) plugin:
Writing Qt Designer Plugins
If this link ever becomes dead, just do a search for the link itself, usually that will turn up the original page in someone's cache, as they do in the other examples above (the dead links in the above answers that just take you to main area and not to the pages originally intended).

Picture control in QT

i am learning QT, i am not getting how to get the picture control in QT?.
in .net we have picture control right same way i need in QT.
i know text edit support pictures but is there any alternatives.
please tell if so.
Thanks
I assume that you mean a control for showing pictures. In that case, simply use a QLabel and call setPixmap. There is a more versatile, but less polished picture widget here.

How to bind texture image on Wired sphere using jogl?

I can able to create Wired Sphere using GLUT ,Now i want to bind one texture image on the sphere,can any one tell me how to do it.If u can pls provide me some code snippet?
regards,
s.kumaran.
For all who may later find this the same way I did...
Excellent tutorial here: http://www.land-of-kain.de/docs/jogl/

Resources