Commit 1a948634 authored by Stéphane Albert's avatar Stéphane Albert

BUG: MANTIS-1232: Moved ColorDynamicsWidget into QScrollArea; implemented...

BUG: MANTIS-1232: Moved ColorDynamicsWidget into QScrollArea; implemented support to add any widget to scroll-area within dock-widget.
parent a011a76e
......@@ -790,8 +790,7 @@ MainWindow
< HistogramWidget, HistogramController, QDockWidget >
( "HISTOGRAM",
tr( "Histogram" ),
Qt::RightDockWidgetArea,
false
Qt::RightDockWidgetArea
);
tabifyDockWidget( m_QuicklookViewDock, m_HistogramDock );
......@@ -830,7 +829,8 @@ MainWindow
< ColorDynamicsWidget, ColorDynamicsController, QDockWidget >
( "COLOR_DYNAMICS",
tr( "Color dynamics" ),
Qt::RightDockWidgetArea
Qt::RightDockWidgetArea,
I18nMainWindow::DOCK_LAYOUT_SCROLLABLE
);
// Tabify dock-widgets.
......@@ -1553,7 +1553,7 @@ MainWindow
( "APPLICATIONS_BROWSER",
tr( "OTB-Applications browser" ),
Qt::RightDockWidgetArea,
true
I18nMainWindow::DOCK_LAYOUT_FLOATING
);
tabifyDockWidget( m_HistogramDock, m_OtbApplicationsBrowserDock );
......
......@@ -130,7 +130,7 @@ I18nMainWindow
const QString& dockName,
const QString& dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating )
DockLayoutFlags flags )
{
// New dock.
QDockWidget* dockWidget = new QDockWidget( dockTitle, this );
......@@ -140,7 +140,7 @@ I18nMainWindow
dockWidget->setWidget( widget );
// Features.
dockWidget->setFloating( isFloating );
dockWidget->setFloating( flags.testFlag( DOCK_LAYOUT_FLOATING ) );
dockWidget->setFeatures(
QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetFloatable |
......
......@@ -87,6 +87,14 @@ class Monteverdi_EXPORT I18nMainWindow
//
// Public types.
public:
enum DockLayout
{
DOCK_LAYOUT_NONE = 0,
DOCK_LAYOUT_FLOATING = 1,
DOCK_LAYOUT_SCROLLABLE = 2,
};
typedef QFlags< DockLayout > DockLayoutFlags;
//
// Public methods.
......@@ -229,7 +237,7 @@ protected:
const QString& dockName,
const QString& dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating =false );
DockLayoutFlags flags = DOCK_LAYOUT_NONE );
/**
*/
......@@ -239,7 +247,7 @@ protected:
AddDockWidget( const QString& dockName,
const QString& dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating =false );
DockLayoutFlags flags = DOCK_LAYOUT_NONE );
/**
*/
......@@ -249,7 +257,7 @@ protected:
AddDockWidget( const QString& dockName,
const QString& dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating =false );
DockLayoutFlags flags = DOCK_LAYOUT_NONE );
/**
*/
const AbstractModelController *
......@@ -443,20 +451,20 @@ template< typename TWidget, typename TDockWidget >
inline
TDockWidget*
I18nMainWindow
::AddDockWidget( const QString& dockName,
const QString& dockTitle,
::AddDockWidget( const QString & dockName,
const QString & dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating )
DockLayoutFlags flags )
{
TWidget* widget = new TWidget( this );
TWidget * widget = new TWidget( this );
TDockWidget* dockWidget =
TDockWidget * dockWidget =
AddWidgetToDock(
widget,
dockName,
dockTitle,
dockArea,
isFloating
flags
);
return dockWidget;
......@@ -467,20 +475,34 @@ template< typename TWidget, typename TController, typename TDockWidget >
inline
TDockWidget*
I18nMainWindow
::AddDockWidget( const QString& dockName,
const QString& dockTitle,
::AddDockWidget( const QString & dockName,
const QString & dockTitle,
Qt::DockWidgetArea dockArea,
bool isFloating )
DockLayoutFlags flags )
{
TWidget* widget = new TWidget( this );
TWidget * widget = new TWidget( this );
QWidget * pannel = widget;
if( flags.testFlag( DOCK_LAYOUT_SCROLLABLE ) )
{
QScrollArea * scrollArea = new QScrollArea( this );
scrollArea->setWidgetResizable( true );
TDockWidget* dockWidget =
scrollArea->setWidget( widget );
pannel = scrollArea;
}
TDockWidget * dockWidget =
AddWidgetToDock(
widget,
pannel,
dockName,
dockTitle,
dockArea,
isFloating
flags
);
new TController(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment