mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 19:32:57 +00:00
optimize some QMainWindowLayoutState methods
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
c546a576f0
commit
0c430fd6c5
1 changed files with 12 additions and 16 deletions
|
@ -167,39 +167,36 @@ QMainWindowLayoutState::QMainWindowLayoutState(QMainWindow *win)
|
||||||
|
|
||||||
QSize QMainWindowLayoutState::sizeHint() const
|
QSize QMainWindowLayoutState::sizeHint() const
|
||||||
{
|
{
|
||||||
|
|
||||||
QSize result(0, 0);
|
|
||||||
|
|
||||||
#ifndef QT_NO_DOCKWIDGET
|
#ifndef QT_NO_DOCKWIDGET
|
||||||
result = dockAreaLayout.sizeHint();
|
QSize result(dockAreaLayout.sizeHint());
|
||||||
#else
|
#else
|
||||||
|
QSize result(0, 0);
|
||||||
if (centralWidgetItem != 0)
|
if (centralWidgetItem != 0)
|
||||||
result = centralWidgetItem->sizeHint();
|
result = centralWidgetItem->sizeHint();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_TOOLBAR
|
#ifndef QT_NO_TOOLBAR
|
||||||
result = toolBarAreaLayout.sizeHint(result);
|
return toolBarAreaLayout.sizeHint(result);
|
||||||
#endif // QT_NO_TOOLBAR
|
#else
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
#endif // QT_NO_TOOLBAR
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QMainWindowLayoutState::minimumSize() const
|
QSize QMainWindowLayoutState::minimumSize() const
|
||||||
{
|
{
|
||||||
QSize result(0, 0);
|
|
||||||
|
|
||||||
#ifndef QT_NO_DOCKWIDGET
|
#ifndef QT_NO_DOCKWIDGET
|
||||||
result = dockAreaLayout.minimumSize();
|
QSize result(dockAreaLayout.minimumSize());
|
||||||
#else
|
#else
|
||||||
|
QSize result(0, 0);
|
||||||
if (centralWidgetItem != 0)
|
if (centralWidgetItem != 0)
|
||||||
result = centralWidgetItem->minimumSize();
|
result = centralWidgetItem->minimumSize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_TOOLBAR
|
#ifndef QT_NO_TOOLBAR
|
||||||
result = toolBarAreaLayout.minimumSize(result);
|
return toolBarAreaLayout.minimumSize(result);
|
||||||
#endif // QT_NO_TOOLBAR
|
#else
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
#endif // QT_NO_TOOLBAR
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMainWindowLayoutState::apply(bool animated)
|
void QMainWindowLayoutState::apply(bool animated)
|
||||||
|
@ -222,12 +219,11 @@ void QMainWindowLayoutState::apply(bool animated)
|
||||||
|
|
||||||
void QMainWindowLayoutState::fitLayout()
|
void QMainWindowLayoutState::fitLayout()
|
||||||
{
|
{
|
||||||
QRect r;
|
|
||||||
#ifdef QT_NO_TOOLBAR
|
#ifdef QT_NO_TOOLBAR
|
||||||
r = rect;
|
QRect r(rect);
|
||||||
#else
|
#else
|
||||||
toolBarAreaLayout.rect = rect;
|
toolBarAreaLayout.rect = rect;
|
||||||
r = toolBarAreaLayout.fitLayout();
|
QRect r(toolBarAreaLayout.fitLayout());
|
||||||
#endif // QT_NO_TOOLBAR
|
#endif // QT_NO_TOOLBAR
|
||||||
|
|
||||||
#ifndef QT_NO_DOCKWIDGET
|
#ifndef QT_NO_DOCKWIDGET
|
||||||
|
|
Loading…
Add table
Reference in a new issue