Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QSize size = desktopRect.size() * qreal(0.9); what does it mean?

QSize size = desktopRect.size() * qreal(0.9); what does it mean?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 582 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.
  • A Offline
    A Offline
    Amir Afendin
    wrote on last edited by
    #1

    Just watching some example here and kind of stacked on this line of code

    QSize size = desktopRect.size() * qreal(0.9);
    

    especially why do we need qreal(0.9) here? I know what qreal does but in this very situation i have no idea about purpose of this chunk of code.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by p3c0
      #2

      @Amir-Afendin I think to get 90% of desktopRect's size so that the widget size gets adjusted as per the desktop screen size?
      0.9 = 90/100

      157

      1 Reply Last reply
      2

      • Login

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