|
Lines 226-232
static quintptr tabId(const QDockAreaLayoutItem &item)
Link Here
|
| 226 |
static const int zero = 0; |
226 |
static const int zero = 0; |
| 227 |
|
227 |
|
| 228 |
QDockAreaLayoutInfo::QDockAreaLayoutInfo() |
228 |
QDockAreaLayoutInfo::QDockAreaLayoutInfo() |
| 229 |
: restoredSizeHint(0,0), sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) |
229 |
: sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) |
| 230 |
#if QT_CONFIG(tabbar) |
230 |
#if QT_CONFIG(tabbar) |
| 231 |
, tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth) |
231 |
, tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth) |
| 232 |
#endif |
232 |
#endif |
|
Lines 236-242
QDockAreaLayoutInfo::QDockAreaLayoutInfo()
Link Here
|
| 236 |
QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPosition _dockPos, |
236 |
QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPosition _dockPos, |
| 237 |
Qt::Orientation _o, int tbshape, |
237 |
Qt::Orientation _o, int tbshape, |
| 238 |
QMainWindow *window) |
238 |
QMainWindow *window) |
| 239 |
: restoredSizeHint(0,0), sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window) |
239 |
: sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window) |
| 240 |
#if QT_CONFIG(tabbar) |
240 |
#if QT_CONFIG(tabbar) |
| 241 |
, tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape)) |
241 |
, tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape)) |
| 242 |
#endif |
242 |
#endif |
|
Lines 407-415
QSize QDockAreaLayoutInfo::sizeHint() const
Link Here
|
| 407 |
if (isEmpty()) |
407 |
if (isEmpty()) |
| 408 |
return QSize(0, 0); |
408 |
return QSize(0, 0); |
| 409 |
|
409 |
|
| 410 |
if (!restoredSizeHint.isNull()) |
|
|
| 411 |
return restoredSizeHint; |
| 412 |
|
| 413 |
int a = 0, b = 0; |
410 |
int a = 0, b = 0; |
| 414 |
int min_perp = 0; |
411 |
int min_perp = 0; |
| 415 |
int max_perp = QWIDGETSIZE_MAX; |
412 |
int max_perp = QWIDGETSIZE_MAX; |
|
Lines 2376-2382
bool QDockAreaLayout::restoreState(QDataStream &stream, const QList<QDockWidget*
Link Here
|
| 2376 |
stream >> size; |
2373 |
stream >> size; |
| 2377 |
if (!testing) { |
2374 |
if (!testing) { |
| 2378 |
docks[pos].rect = QRect(QPoint(0, 0), size); |
2375 |
docks[pos].rect = QRect(QPoint(0, 0), size); |
| 2379 |
docks[pos].restoredSizeHint = size; |
|
|
| 2380 |
} |
2376 |
} |
| 2381 |
if (!docks[pos].restoreState(stream, dockwidgets, testing)) { |
2377 |
if (!docks[pos].restoreState(stream, dockwidgets, testing)) { |
| 2382 |
stream.setStatus(QDataStream::ReadCorruptData); |
2378 |
stream.setStatus(QDataStream::ReadCorruptData); |
|
Lines 2678-2685
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
Link Here
|
| 2678 |
center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep); |
2674 |
center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep); |
| 2679 |
|
2675 |
|
| 2680 |
QSize left_hint = docks[QInternal::LeftDock].size(); |
2676 |
QSize left_hint = docks[QInternal::LeftDock].size(); |
| 2681 |
if (!docks[QInternal::LeftDock].restoredSizeHint.isNull()) |
|
|
| 2682 |
left_hint = docks[QInternal::LeftDock].restoredSizeHint; |
| 2683 |
if (left_hint.isNull() || fallbackToSizeHints) |
2677 |
if (left_hint.isNull() || fallbackToSizeHints) |
| 2684 |
left_hint = docks[QInternal::LeftDock].sizeHint(); |
2678 |
left_hint = docks[QInternal::LeftDock].sizeHint(); |
| 2685 |
QSize left_min = docks[QInternal::LeftDock].minimumSize(); |
2679 |
QSize left_min = docks[QInternal::LeftDock].minimumSize(); |
|
Lines 2687-2694
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
Link Here
|
| 2687 |
left_hint = left_hint.boundedTo(left_max).expandedTo(left_min); |
2681 |
left_hint = left_hint.boundedTo(left_max).expandedTo(left_min); |
| 2688 |
|
2682 |
|
| 2689 |
QSize right_hint = docks[QInternal::RightDock].size(); |
2683 |
QSize right_hint = docks[QInternal::RightDock].size(); |
| 2690 |
if (!docks[QInternal::RightDock].restoredSizeHint.isNull()) |
|
|
| 2691 |
right_hint = docks[QInternal::RightDock].restoredSizeHint; |
| 2692 |
if (right_hint.isNull() || fallbackToSizeHints) |
2684 |
if (right_hint.isNull() || fallbackToSizeHints) |
| 2693 |
right_hint = docks[QInternal::RightDock].sizeHint(); |
2685 |
right_hint = docks[QInternal::RightDock].sizeHint(); |
| 2694 |
QSize right_min = docks[QInternal::RightDock].minimumSize(); |
2686 |
QSize right_min = docks[QInternal::RightDock].minimumSize(); |
|
Lines 2696-2703
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
Link Here
|
| 2696 |
right_hint = right_hint.boundedTo(right_max).expandedTo(right_min); |
2688 |
right_hint = right_hint.boundedTo(right_max).expandedTo(right_min); |
| 2697 |
|
2689 |
|
| 2698 |
QSize top_hint = docks[QInternal::TopDock].size(); |
2690 |
QSize top_hint = docks[QInternal::TopDock].size(); |
| 2699 |
if (!docks[QInternal::TopDock].restoredSizeHint.isNull()) |
|
|
| 2700 |
top_hint = docks[QInternal::TopDock].restoredSizeHint; |
| 2701 |
if (top_hint.isNull() || fallbackToSizeHints) |
2691 |
if (top_hint.isNull() || fallbackToSizeHints) |
| 2702 |
top_hint = docks[QInternal::TopDock].sizeHint(); |
2692 |
top_hint = docks[QInternal::TopDock].sizeHint(); |
| 2703 |
QSize top_min = docks[QInternal::TopDock].minimumSize(); |
2693 |
QSize top_min = docks[QInternal::TopDock].minimumSize(); |
|
Lines 2705-2712
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
Link Here
|
| 2705 |
top_hint = top_hint.boundedTo(top_max).expandedTo(top_min); |
2695 |
top_hint = top_hint.boundedTo(top_max).expandedTo(top_min); |
| 2706 |
|
2696 |
|
| 2707 |
QSize bottom_hint = docks[QInternal::BottomDock].size(); |
2697 |
QSize bottom_hint = docks[QInternal::BottomDock].size(); |
| 2708 |
if (!docks[QInternal::BottomDock].restoredSizeHint.isNull()) |
|
|
| 2709 |
bottom_hint = docks[QInternal::BottomDock].restoredSizeHint; |
| 2710 |
if (bottom_hint.isNull() || fallbackToSizeHints) |
2698 |
if (bottom_hint.isNull() || fallbackToSizeHints) |
| 2711 |
bottom_hint = docks[QInternal::BottomDock].sizeHint(); |
2699 |
bottom_hint = docks[QInternal::BottomDock].sizeHint(); |
| 2712 |
QSize bottom_min = docks[QInternal::BottomDock].minimumSize(); |
2700 |
QSize bottom_min = docks[QInternal::BottomDock].minimumSize(); |
|
Lines 3288-3297
int QDockAreaLayout::separatorMove(const QList<int> &separator, const QPoint &or
Link Here
|
| 3288 |
int delta = 0; |
3276 |
int delta = 0; |
| 3289 |
int index = separator.last(); |
3277 |
int index = separator.last(); |
| 3290 |
|
3278 |
|
| 3291 |
for (int i = 0; i < QInternal::DockCount; ++i) |
|
|
| 3292 |
if (!docks[i].restoredSizeHint.isNull()) |
| 3293 |
docks[i].restoredSizeHint = QSize(0, 0); |
| 3294 |
|
| 3295 |
if (separator.count() > 1) { |
3279 |
if (separator.count() > 1) { |
| 3296 |
QDockAreaLayoutInfo *info = this->info(separator); |
3280 |
QDockAreaLayoutInfo *info = this->info(separator); |
| 3297 |
delta = pick(info->o, dest - origin); |
3281 |
delta = pick(info->o, dest - origin); |