comparison view/PaneStack.cpp @ 101:bc5b79e7b1d8

when adding a new pane, the pane stack is divided in equals parts
author lbajardsilogic
date Thu, 12 Jul 2007 07:25:32 +0000
parents 429cfea499ad
children 033a39bff919
comparison
equal deleted inserted replaced
100:133c282edba1 101:bc5b79e7b1d8
83 rec.layout = layout; 83 rec.layout = layout;
84 m_panes.push_back(rec); 84 m_panes.push_back(rec);
85 85
86 frame->setLayout(layout); 86 frame->setLayout(layout);
87 m_splitter->addWidget(frame); 87 m_splitter->addWidget(frame);
88
89 resizePane();
88 90
89 connect(pane, SIGNAL(propertyContainerAdded(PropertyContainer *)), 91 connect(pane, SIGNAL(propertyContainerAdded(PropertyContainer *)),
90 this, SLOT(propertyContainerAdded(PropertyContainer *))); 92 this, SLOT(propertyContainerAdded(PropertyContainer *)));
91 connect(pane, SIGNAL(propertyContainerRemoved(PropertyContainer *)), 93 connect(pane, SIGNAL(propertyContainerRemoved(PropertyContainer *)),
92 this, SLOT(propertyContainerRemoved(PropertyContainer *))); 94 this, SLOT(propertyContainerRemoved(PropertyContainer *)));
440 } 442 }
441 443
442 emit propertyStacksResized(); 444 emit propertyStacksResized();
443 } 445 }
444 446
445 447 void PaneStack::resizePane()
448 {
449 int totalSize = m_splitter->size().height();
450 int nbPane = getPaneCount();
451
452 if (nbPane == 0)
453 return;
454
455 QList<int> newSizes;
456
457 for (int i = 0; i< nbPane; i++)
458 {
459 newSizes.push_back(totalSize/nbPane);
460 }
461
462 m_splitter->setSizes(newSizes);
463 }