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. [Solved] Size of QGraphicview
Forum Updated to NodeBB v4.3 + New Features

[Solved] Size of QGraphicview

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 977 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.
  • S Offline
    S Offline
    silep
    wrote on last edited by
    #1

    Hello,

    I try to get the size of my QGraphicview and I used

    @int sizeX,sizeY;

    sizeX = ui->gvResultGraph->size().width;
    sizeY = ui->gvResultGraph->size().height;@

    But I got an error message like that
    @error C3867: 'QSize::width': function call missing argument list; use '&QSize::width' to create a pointer to member
    error C2440: '=' : cannot convert from 'int (__thiscall QSize::* )(void) const' to 'int'@

    I don't really know what it means.. Would anyone have an idea about what is wrong with the synthax?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Change code like this:
      @int sizeX,sizeY;
      sizeX = ui->gvResultGraph->size().width();
      sizeY = ui->gvResultGraph->size().height();@

      1 Reply Last reply
      0
      • S Offline
        S Offline
        silep
        wrote on last edited by
        #3

        oh yeah I thought they were parameters of size(), not functions. Thank you very much!

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          Intellisense of IDE could be very informative and saves a lot of your time by helping to avoid this kind of mistakes.

          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