QDockWidget::geometry() ???



  • 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?



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.