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. How to reuse widget dimesions ?
Forum Updated to NodeBB v4.3 + New Features

How to reuse widget dimesions ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 211 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
    Anonymous_Banned275
    wrote on last edited by
    #1

    This should be part of C++ philosophy to "code once , use many times ".
    BUT QRect is "private " in widget.

    Any reasonable answers to the question are welcome.

        Form_Widget *FW = new Form_Widget();
        QRect dimensions = FW->geometry();
        int start_X = dimensions.x2; //can't do, its private 
        
    
    J.HilkJ 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      QRect is a class, not a struct so you should use it's members to get the values you want.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • A Anonymous_Banned275

        This should be part of C++ philosophy to "code once , use many times ".
        BUT QRect is "private " in widget.

        Any reasonable answers to the question are welcome.

            Form_Widget *FW = new Form_Widget();
            QRect dimensions = FW->geometry();
            int start_X = dimensions.x2; //can't do, its private 
            
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @AnneRanch

        void QRect::getCoords(int *x1, int *y1, int *x2, int *y2) const

        QPoint QRect::bottomRight() const
        &
        int QPoint::x() const


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        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