Mouse click event problem
I am programming using Qt-4.2.3 on a "kubuntu7.04" linux distro.
I have MAJOR problems understanding some of the Qt4 documentation where there is no "code examples" of which there are very few in Qt4.
so
I have a drawing area "frmDrawing" with various items on it. I want to get the position of the mouse when I double click the left mouse button.
Do I use !
Code:
globalPos
() const : const QPoint &
if yes, how? or do I use one of the other
Code:
Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers )
type? again if so what does it look like.?
thanks
Re: Mouse click event problem
Within your reimplementation of QWidget::mouseDoubleClickEvent(QMouseEvent*) you should use QMouseEvent::pos() or QMouseEvent::globalPos() depending of what operations you want to perform...
Re: Mouse click event problem
There is an "examples" directory with plenty of examples of how to code in QT4 that should have been part of the Qt package you downloaded.
Re: Mouse click event problem
Thanks I didn't have my e-mail notification set.
I am working alone. I don't know anybody programming except thru these forums.
I have looked at all the examples and demos many times, but they are not "command indexed" As someone trying to learn Ot. I find somthing like this most helpful in addition to the examples.
Quote:
void QList::swap ( int i, int j )
Exchange the item at index position i with the item at index position j.
Example:
QList<QString> list;
list << "A" << "B" << "C" << "D" << "E" << "F";
list.swap(1, 4);
// list: ["A", "E", "C", "D", "B", "F"]
See also move
An example from my code which is basically what I want to do with the QMouseEvent pos(), but am confused with the actual syntex.
Thanks