What "C/C++ type" ( int, char,QStringe etc ...? ) is "pos()"?
Moved
Unsolved
General and Desktop
-
This post is deleted!
-
@AnneRanch said in What "type" is "pos()"?:
event->pos();
Of what type is event and what Qt version do you use? If you know the type of event and your Qt version you can search the Qt documentation for it.
-
This post is deleted!
-
Hi @AnneRanch,
As @Christian-Ehrlicher replied, it depends on what type
event
is, and the version of Qt.Given you're naming the result
dragStartPosition
, I'm guessingevent
is either derived fromQPointerEvent
,QMouseEvent
, orQDropEvent
(includingQDragEnterEvent
). For all of those,*::pos()
returnsQPoint
on Qt5, but in Qt6 the function is*::position()
instead, and returnsQPointF
. ie#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) const QPoint dragStartPosition = event->pos(); #else const QPointF dragStartPosition = event->position(); #endif
To be any more specific than that, you'll need to tell use what type
event
is, and the Qt version.Cheers.
PS You could also use
auto
.