mapToglobal for coordinates of the graph
-
I wrote:
I wroteQPoint coord(ui->widget->mapToGlobal(QPoint(x_widg,y_widg)));
QToolTip::showText(coord,line9);
ui->widget_2->graph(4)->setData(qv_x2,qv_y2);but I don't obtain the point I want
-
@vale88 said in mapToglobal for coordinates of the graph:
but I don't obtain the point I want
and what is the point you want?
Sorry but it's pretty hard to guess with arbitrary widget and coordinates what you are trying to achieve... -
@raven-worx I would obtain the coordinates on customPlot converted for Mainwindow...only this
-
@vale88 said in mapToglobal for coordinates of the graph:
I would obtain the coordinates on customPlot converted for Mainwindow...only this
ok...back to the start.
mapToGlobal() maps the ccordinate from the local coordinate space to the global space. Means if your
x_widg
andy_widg
coordinate are mapped fromui->widget
. Are those coordinates coming from this widget?! -
@raven-worx the question is this:
I want to have the tip where I have x_widg and y_widg in the graph...so I must convert the coordinates of x_widg and y_widg to global...because customPlot don't use toolTip
-
@vale88
i know! Thats basically the only information that you provided so far.Where do the coordinates come from exactly?!
-
@raven-worx coordinates comes from a graph of customPlot
-
@vale88
one last try from my side, since it seems you still try to be as vague as possible.
If the coordinates are not fromui->widget
but from another widget, you will get an unexpected result.Just to make sure: every widget has it's own coordinate system (relative to it's parent widget). Means (0,0) for one widget is not the same as (0,0) for another widget. Thus the are mapping functions.
-
@raven-worx I want to set a tip on the graph but I have problems with it...so I think I can set the tip using customPlot