Mercurial > hg > svgui
comparison widgets/PropertyBox.cpp @ 586:1ae54a29e59e
Merge from debug-output branch
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 14:48:29 +0100 |
parents | f4960f8ce798 |
children | 4806715f7a19 |
comparison
equal
deleted
inserted
replaced
583:4c484636d5ec | 586:1ae54a29e59e |
---|---|
58 m_showButton(0), | 58 m_showButton(0), |
59 m_playButton(0) | 59 m_playButton(0) |
60 { | 60 { |
61 #ifdef DEBUG_PROPERTY_BOX | 61 #ifdef DEBUG_PROPERTY_BOX |
62 std::cerr << "PropertyBox[" << this << "(\"" << | 62 std::cerr << "PropertyBox[" << this << "(\"" << |
63 container->getPropertyContainerName().toStdString() << "\" at " << container << ")]::PropertyBox" << std::endl; | 63 container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << std::endl; |
64 #endif | 64 #endif |
65 | 65 |
66 m_mainBox = new QVBoxLayout; | 66 m_mainBox = new QVBoxLayout; |
67 setLayout(m_mainBox); | 67 setLayout(m_mainBox); |
68 | 68 |
146 m_viewPlayFrame->setLayout(layout); | 146 m_viewPlayFrame->setLayout(layout); |
147 | 147 |
148 layout->setMargin(layout->margin() / 2); | 148 layout->setMargin(layout->margin() / 2); |
149 | 149 |
150 #ifdef DEBUG_PROPERTY_BOX | 150 #ifdef DEBUG_PROPERTY_BOX |
151 std::cerr << "PropertyBox::populateViewPlayFrame: container " << m_container << " (name " << m_container->getPropertyContainerName().toStdString() << ") params " << params << std::endl; | 151 DEBUG << "PropertyBox::populateViewPlayFrame: container " << m_container << " (name " << m_container->getPropertyContainerName() << ") params " << params << endl; |
152 #endif | 152 #endif |
153 | 153 |
154 if (layer) { | 154 if (layer) { |
155 QLabel *showLabel = new QLabel(tr("Show")); | 155 QLabel *showLabel = new QLabel(tr("Show")); |
156 layout->addWidget(showLabel); | 156 layout->addWidget(showLabel); |
275 | 275 |
276 #ifdef DEBUG_PROPERTY_BOX | 276 #ifdef DEBUG_PROPERTY_BOX |
277 std::cerr << "PropertyBox[" << this | 277 std::cerr << "PropertyBox[" << this |
278 << "(\"" << m_container->getPropertyContainerName().toStdString() | 278 << "(\"" << m_container->getPropertyContainerName().toStdString() |
279 << "\")]"; | 279 << "\")]"; |
280 std::cerr << "::updatePropertyEditor(\"" << name.toStdString() << "\"):"; | 280 std::cerr << "::updatePropertyEditor(\"" << name << "\"):"; |
281 std::cerr << " value " << value << ", have " << have << ", group \"" | 281 std::cerr << " value " << value << ", have " << have << ", group \"" |
282 << groupName.toStdString() << "\"" << std::endl; | 282 << groupName << "\"" << std::endl; |
283 #endif | 283 #endif |
284 | 284 |
285 bool inGroup = (groupName != QString()); | 285 bool inGroup = (groupName != QString()); |
286 | 286 |
287 if (!have) { | 287 if (!have) { |
288 if (inGroup) { | 288 if (inGroup) { |
289 if (m_groupLayouts.find(groupName) == m_groupLayouts.end()) { | 289 if (m_groupLayouts.find(groupName) == m_groupLayouts.end()) { |
290 #ifdef DEBUG_PROPERTY_BOX | 290 #ifdef DEBUG_PROPERTY_BOX |
291 std::cerr << "PropertyBox: adding label \"" << groupName.toStdString() << "\" and frame for group for \"" << name.toStdString() << "\"" << std::endl; | 291 std::cerr << "PropertyBox: adding label \"" << groupName << "\" and frame for group for \"" << name << "\"" << std::endl; |
292 #endif | 292 #endif |
293 m_layout->addWidget(new QLabel(groupName, m_mainWidget), row, 0); | 293 m_layout->addWidget(new QLabel(groupName, m_mainWidget), row, 0); |
294 QFrame *frame = new QFrame(m_mainWidget); | 294 QFrame *frame = new QFrame(m_mainWidget); |
295 m_layout->addWidget(frame, row, 1, 1, 2); | 295 m_layout->addWidget(frame, row, 1, 1, 2); |
296 m_groupLayouts[groupName] = new QGridLayout; | 296 m_groupLayouts[groupName] = new QGridLayout; |
297 m_groupLayouts[groupName]->setMargin(0); | 297 m_groupLayouts[groupName]->setMargin(0); |
298 frame->setLayout(m_groupLayouts[groupName]); | 298 frame->setLayout(m_groupLayouts[groupName]); |
299 } | 299 } |
300 } else { | 300 } else { |
301 #ifdef DEBUG_PROPERTY_BOX | 301 #ifdef DEBUG_PROPERTY_BOX |
302 std::cerr << "PropertyBox: adding label \"" << propertyLabel.toStdString() << "\"" << std::endl; | 302 std::cerr << "PropertyBox: adding label \"" << propertyLabel << "\"" << std::endl; |
303 #endif | 303 #endif |
304 m_layout->addWidget(new QLabel(propertyLabel, m_mainWidget), row, 0); | 304 m_layout->addWidget(new QLabel(propertyLabel, m_mainWidget), row, 0); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
528 PropertyBox::propertyContainerPropertyChanged(PropertyContainer *pc) | 528 PropertyBox::propertyContainerPropertyChanged(PropertyContainer *pc) |
529 { | 529 { |
530 if (pc != m_container) return; | 530 if (pc != m_container) return; |
531 | 531 |
532 #ifdef DEBUG_PROPERTY_BOX | 532 #ifdef DEBUG_PROPERTY_BOX |
533 std::cerr << "PropertyBox::propertyContainerPropertyChanged" << std::endl; | 533 DEBUG << "PropertyBox::propertyContainerPropertyChanged" << endl; |
534 #endif | 534 #endif |
535 | 535 |
536 PropertyContainer::PropertyList properties = m_container->getProperties(); | 536 PropertyContainer::PropertyList properties = m_container->getProperties(); |
537 size_t i; | 537 size_t i; |
538 | 538 |
564 std::cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << std::endl; | 564 std::cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << std::endl; |
565 blockSignals(true); | 565 blockSignals(true); |
566 | 566 |
567 // std::cerr << "my container is " << m_container << std::endl; | 567 // std::cerr << "my container is " << m_container << std::endl; |
568 // std::cerr << "my container's name is... " << std::endl; | 568 // std::cerr << "my container's name is... " << std::endl; |
569 // std::cerr << m_container->objectName().toStdString() << std::endl; | 569 // std::cerr << m_container->objectName() << std::endl; |
570 | 570 |
571 PropertyContainer::PropertyList properties = m_container->getProperties(); | 571 PropertyContainer::PropertyList properties = m_container->getProperties(); |
572 for (size_t i = 0; i < properties.size(); ++i) { | 572 for (size_t i = 0; i < properties.size(); ++i) { |
573 if (m_container->getPropertyType(properties[i]) == | 573 if (m_container->getPropertyType(properties[i]) == |
574 PropertyContainer::UnitsProperty) { | 574 PropertyContainer::UnitsProperty) { |
606 { | 606 { |
607 QObject *obj = sender(); | 607 QObject *obj = sender(); |
608 QString name = obj->objectName(); | 608 QString name = obj->objectName(); |
609 | 609 |
610 #ifdef DEBUG_PROPERTY_BOX | 610 #ifdef DEBUG_PROPERTY_BOX |
611 std::cerr << "PropertyBox::propertyControllerChanged(" << name.toStdString() | 611 DEBUG << "PropertyBox::propertyControllerChanged(" << name << ", " << value << ")" << endl; |
612 << ", " << value << ")" << std::endl; | |
613 #endif | 612 #endif |
614 | 613 |
615 PropertyContainer::PropertyType type = m_container->getPropertyType(name); | 614 PropertyContainer::PropertyType type = m_container->getPropertyType(name); |
616 | 615 |
617 Command *c = 0; | 616 Command *c = 0; |