mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Merged #518 - Add more options to determine the minimum size of a dock widget
This commit is contained in:
parent
f9b5ef8d89
commit
87954e4459
@ -622,6 +622,13 @@ void CDockWidget::setMinimumSizeHintMode(eMinimumSizeHintMode Mode)
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
CDockWidget::eMinimumSizeHintMode CDockWidget::minimumSizeHintMode() const
|
||||
{
|
||||
return d->MinimumSizeHintMode;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
bool CDockWidget::isCentralWidget() const
|
||||
{
|
||||
@ -990,14 +997,20 @@ void CDockWidget::setClosedState(bool Closed)
|
||||
//============================================================================
|
||||
QSize CDockWidget::minimumSizeHint() const
|
||||
{
|
||||
if (d->MinimumSizeHintMode == CDockWidget::MinimumSizeHintFromDockWidget || !d->Widget)
|
||||
if (!d->Widget)
|
||||
{
|
||||
return QSize(60, 40);
|
||||
}
|
||||
else
|
||||
|
||||
switch (d->MinimumSizeHintMode)
|
||||
{
|
||||
return d->Widget->minimumSizeHint();
|
||||
case MinimumSizeHintFromDockWidget: return QSize(60, 40);
|
||||
case MinimumSizeHintFromContent: return d->Widget->minimumSizeHint();
|
||||
case MinimumSizeHintFromDockWidgetMinimumSize: return minimumSize();
|
||||
case MinimumSizeHintFromContentMinimumSize: return d->Widget->minimumSize();
|
||||
}
|
||||
|
||||
return d->Widget->minimumSizeHint();
|
||||
}
|
||||
|
||||
|
||||
|
@ -208,12 +208,17 @@ public:
|
||||
* reimplements minimumSizeHint() function to return a very small minimum
|
||||
* size hint. If you would like to adhere the minimumSizeHint() from the
|
||||
* content widget, then set the minimumSizeHintMode() to
|
||||
* MinimumSizeHintFromContent.
|
||||
* MinimumSizeHintFromContent. If you would like to use the minimumSize()
|
||||
* value of the content widget or the dock widget, then you can use the
|
||||
* MinimumSizeHintFromDockWidgetMinimumSize or
|
||||
* MinimumSizeHintFromContentMinimumSize modes.
|
||||
*/
|
||||
enum eMinimumSizeHintMode
|
||||
{
|
||||
MinimumSizeHintFromDockWidget,
|
||||
MinimumSizeHintFromContent
|
||||
MinimumSizeHintFromContent,
|
||||
MinimumSizeHintFromDockWidgetMinimumSize,
|
||||
MinimumSizeHintFromContentMinimumSize,
|
||||
};
|
||||
|
||||
|
||||
@ -411,6 +416,11 @@ public:
|
||||
*/
|
||||
void setMinimumSizeHintMode(eMinimumSizeHintMode Mode);
|
||||
|
||||
/**
|
||||
* Get the minimum size hint mode configured by setMinimumSizeHintMode
|
||||
*/
|
||||
eMinimumSizeHintMode minimumSizeHintMode() const;
|
||||
|
||||
/**
|
||||
* Returns true if the dock widget is set as central widget of it's dock manager
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user