Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. mapToglobal for coordinates of the graph

mapToglobal for coordinates of the graph

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 967 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I wrote:
    I wrote

    QPoint 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

    raven-worxR 1 Reply Last reply
    0
    • ? A Former User

      I wrote:
      I wrote

      QPoint 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

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @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...

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      ? 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @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...

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @raven-worx I would obtain the coordinates on customPlot converted for Mainwindow...only this

        raven-worxR 1 Reply Last reply
        0
        • ? A Former User

          @raven-worx I would obtain the coordinates on customPlot converted for Mainwindow...only this

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @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 and y_widg coordinate are mapped from ui->widget. Are those coordinates coming from this widget?!

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          ? 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @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 and y_widg coordinate are mapped from ui->widget. Are those coordinates coming from this widget?!

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @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

            raven-worxR 1 Reply Last reply
            -1
            • ? A Former User

              @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

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @vale88
              i know! Thats basically the only information that you provided so far.

              Where do the coordinates come from exactly?!

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              ? 1 Reply Last reply
              1
              • raven-worxR raven-worx

                @vale88
                i know! Thats basically the only information that you provided so far.

                Where do the coordinates come from exactly?!

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                @raven-worx coordinates comes from a graph of customPlot

                raven-worxR 1 Reply Last reply
                0
                • ? A Former User

                  @raven-worx coordinates comes from a graph of customPlot

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by raven-worx
                  #8

                  @vale88
                  one last try from my side, since it seems you still try to be as vague as possible.
                  If the coordinates are not from ui->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.

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  ? 1 Reply Last reply
                  1
                  • raven-worxR raven-worx

                    @vale88
                    one last try from my side, since it seems you still try to be as vague as possible.
                    If the coordinates are not from ui->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.

                    ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    @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

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved