PDA

View Full Version : displaying text



me_here_me
13th September 2007, 15:39
Hi,
I have a QTGLWdiget that I use as canvas for drawing. Now i want to add the following functionality:
when user clicks on some location over the camvas, a small text area appears over the canvas, containing some information about the drawing and the location where the user clicked.

I am a novoice to the QT, so I am not sure what widgets do i look into to make this popup text area possible.

thanks in advance

wysota
13th September 2007, 15:48
You don't need any widgets. Either use a tooltip or implement drawing of the tip in the paint event of the GL widget (you'll have to do some 3D math there anyway to do the proper projection).

me_here_me
14th September 2007, 10:48
thanks for the help, another question though :)

I have a main window where I am placing a QTextEdit as below:


Window::Window(QWidget *parent) : QWidget(parent) {

// code here

QTextEdit *metaDataText = new QTextEdit;
metaDataText->setText(str);

// code here

}


I want that the string "str" is modified in another class and updated in the Window automatically. I am not sure how to implement this?

which signal should be emitted by the class that is modifying the string?

secondly, how should I implemented the slot in the main window?

regards