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. QDockWidget::geometry() ???
Forum Updated to NodeBB v4.3 + New Features

QDockWidget::geometry() ???

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 936 Views
  • 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.
  • N Offline
    N Offline
    nen777w
    wrote on last edited by
    #1

    I have a two dock widgets, which is docked and tabbed.
    I need to get geometry each of them:

    typedef std::vector<QRect> v_QRect;
    v_QRect dockwnds;
    
    const QObjectList &lst = m_main_window->children();
    std::for_each(lst.begin(), lst.end(), [&dockwnds](const QObject *obj)
    	{
    		const QDockWidget *dw = qobject_cast<const QDockWidget*>(obj);
    		if (nullptr != dw && dw->isVisible()) 
    		{
    			dockwnds.push_back(dw->geometry());
    		}
    	}
    );
    

    The front dock widget has a normal geometry, but "hiden" dock widget has a negative X,Y position.
    How to get a normal geometry in this case?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      What do you mean by Normal Geometry ?
      Since the widget is not is not displayed it is not drawn on the screen. So it has default value x=0;y=0; This is the default value.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      4

      • Login

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