mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4847 Command Line Snapshots : Make sure image size is handled correctly
This commit is contained in:
@@ -20,12 +20,19 @@
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMainWindowBase.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -82,3 +89,30 @@ void RiuMainWindowTools::collapseSiblings( const caf::PdmUiItem* sourceUiItem )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowTools::setWindowSizeOnWidgetsInMdiWindows( RiuMainWindowBase* mainWindow, int width, int height )
|
||||
{
|
||||
if ( mainWindow )
|
||||
{
|
||||
auto widgets = mainWindow->findChildren<QMdiSubWindow*>();
|
||||
for ( auto w : widgets )
|
||||
{
|
||||
if ( w )
|
||||
{
|
||||
w->showNormal();
|
||||
|
||||
auto viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget( w->widget() );
|
||||
|
||||
if ( viewWindow && viewWindow->viewWidget() )
|
||||
{
|
||||
QWidget* viewWidget = viewWindow->viewWidget();
|
||||
|
||||
viewWidget->resize( width, height );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,14 @@ namespace caf
|
||||
class PdmUiItem;
|
||||
} // namespace caf
|
||||
|
||||
class RiuMainWindowBase;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiuMainWindowTools
|
||||
{
|
||||
public:
|
||||
static void collapseSiblings( const caf::PdmUiItem* uiItem );
|
||||
static void setWindowSizeOnWidgetsInMdiWindows( RiuMainWindowBase* mainWindow, int width, int height );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user