comparison view/PaneStack.cpp @ 247:0e9f59f991aa

...
author Chris Cannam
date Mon, 30 Apr 2007 09:07:08 +0000
parents d9a01a817e8b
children 1a49bd0d8375
comparison
equal deleted inserted replaced
246:d9a01a817e8b 247:0e9f59f991aa
28 #include <QLabel> 28 #include <QLabel>
29 #include <QSplitter> 29 #include <QSplitter>
30 #include <QStackedWidget> 30 #include <QStackedWidget>
31 31
32 #include <iostream> 32 #include <iostream>
33
34 //#define DEBUG_PANE_STACK 1
33 35
34 PaneStack::PaneStack(QWidget *parent, ViewManager *viewManager) : 36 PaneStack::PaneStack(QWidget *parent, ViewManager *viewManager) :
35 QFrame(parent), 37 QFrame(parent),
36 m_currentPane(0), 38 m_currentPane(0),
37 m_splitter(new QSplitter), 39 m_splitter(new QSplitter),
422 424
423 if (m_propertyStackMinWidth > 0) maxMinWidth = m_propertyStackMinWidth; 425 if (m_propertyStackMinWidth > 0) maxMinWidth = m_propertyStackMinWidth;
424 426
425 for (size_t i = 0; i < m_panes.size(); ++i) { 427 for (size_t i = 0; i < m_panes.size(); ++i) {
426 if (!m_panes[i].propertyStack) continue; 428 if (!m_panes[i].propertyStack) continue;
429 #ifdef DEBUG_PANE_STACK
427 std::cerr << "PaneStack::sizePropertyStacks: " << i << ": min " 430 std::cerr << "PaneStack::sizePropertyStacks: " << i << ": min "
428 << m_panes[i].propertyStack->minimumSizeHint().width() << ", hint " 431 << m_panes[i].propertyStack->minimumSizeHint().width() << ", hint "
429 << m_panes[i].propertyStack->sizeHint().width() << ", current " 432 << m_panes[i].propertyStack->sizeHint().width() << ", current "
430 << m_panes[i].propertyStack->width() << std::endl; 433 << m_panes[i].propertyStack->width() << std::endl;
434 #endif
431 435
432 if (m_panes[i].propertyStack->sizeHint().width() > maxMinWidth) { 436 if (m_panes[i].propertyStack->sizeHint().width() > maxMinWidth) {
433 maxMinWidth = m_panes[i].propertyStack->sizeHint().width(); 437 maxMinWidth = m_panes[i].propertyStack->sizeHint().width();
434 } 438 }
435 } 439 }
436 440
437 // std::cerr << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << std::endl; 441 #ifdef DEBUG_PANE_STACK
442 std::cerr << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << std::endl;
443 #endif
438 444
439 //#ifdef Q_WS_MAC 445 //#ifdef Q_WS_MAC
440 // This is necessary to compensate for cb->setMinimumSize(10, 10) 446 // This is necessary to compensate for cb->setMinimumSize(10, 10)
441 // in PropertyBox in the Mac version (to avoid a mysterious crash) 447 // in PropertyBox in the Mac version (to avoid a mysterious crash)
442 448 // ... no longer necessary with qt4.2
443 //!!! is this still necessary with qt4.2?
444 // int setWidth = maxMinWidth * 3 / 2; 449 // int setWidth = maxMinWidth * 3 / 2;
445 //#else 450 //#else
446 int setWidth = maxMinWidth; 451 int setWidth = maxMinWidth;
447 //#endif 452 //#endif
448 453