| 98 | } |
| 99 | |
| 100 | void DockWidget::updateExpandability(const QList<DockWidget *> &tabs) { |
| 101 | bool expandable = false; |
| 102 | for (DockWidget *tab : tabs) { |
| 103 | if (tab->isExpandable()) { |
| 104 | expandable = true; |
| 105 | break; |
| 106 | } |
| 107 | } |
| 108 | DockWidget *other = tabs.last(); |
| 109 | for (DockWidget *tab : tabs) { |
| 110 | if (QWidget *widget = tab->widget()) { |
| 111 | if (expandable || tab->isExpandable()) { |
| 112 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); |
| 113 | } else { |
| 114 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); |
| 115 | } |
| 116 | } |
| 117 | tab->m_tabs = other; |
| 118 | other = tab; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | void DockWidget::makeCloseableFloat(bool state) { |
| 123 | m_closeablefloat = state; |