Mercurial > hg > svgui
comparison widgets/PropertyBox.cpp @ 682:1a0dfcbffaf1
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:06:40 +0000 |
parents | eaf4446a1bef |
children | 692a8b9804fe |
comparison
equal
deleted
inserted
replaced
681:eaf4446a1bef | 682:1a0dfcbffaf1 |
---|---|
57 m_container(container), | 57 m_container(container), |
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 cerr << "PropertyBox[" << this << "(\"" << |
63 container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << std::endl; | 63 container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << 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 |
100 | 100 |
101 connect(ColourDatabase::getInstance(), SIGNAL(colourDatabaseChanged()), | 101 connect(ColourDatabase::getInstance(), SIGNAL(colourDatabaseChanged()), |
102 this, SLOT(colourDatabaseChanged())); | 102 this, SLOT(colourDatabaseChanged())); |
103 | 103 |
104 #ifdef DEBUG_PROPERTY_BOX | 104 #ifdef DEBUG_PROPERTY_BOX |
105 std::cerr << "PropertyBox[" << this << "]::PropertyBox returning" << std::endl; | 105 cerr << "PropertyBox[" << this << "]::PropertyBox returning" << endl; |
106 #endif | 106 #endif |
107 } | 107 } |
108 | 108 |
109 PropertyBox::~PropertyBox() | 109 PropertyBox::~PropertyBox() |
110 { | 110 { |
111 #ifdef DEBUG_PROPERTY_BOX | 111 #ifdef DEBUG_PROPERTY_BOX |
112 std::cerr << "PropertyBox[" << this << "]::~PropertyBox" << std::endl; | 112 cerr << "PropertyBox[" << this << "]::~PropertyBox" << endl; |
113 #endif | 113 #endif |
114 } | 114 } |
115 | 115 |
116 void | 116 void |
117 PropertyBox::populateViewPlayFrame() | 117 PropertyBox::populateViewPlayFrame() |
118 { | 118 { |
119 #ifdef DEBUG_PROPERTY_BOX | 119 #ifdef DEBUG_PROPERTY_BOX |
120 std::cerr << "PropertyBox(" << m_container << ")::populateViewPlayFrame" << std::endl; | 120 cerr << "PropertyBox(" << m_container << ")::populateViewPlayFrame" << endl; |
121 #endif | 121 #endif |
122 | 122 |
123 if (m_viewPlayFrame) { | 123 if (m_viewPlayFrame) { |
124 delete m_viewPlayFrame; | 124 delete m_viewPlayFrame; |
125 m_viewPlayFrame = 0; | 125 m_viewPlayFrame = 0; |
272 QString groupName = m_container->getPropertyGroupName(name); | 272 QString groupName = m_container->getPropertyGroupName(name); |
273 QString propertyLabel = m_container->getPropertyLabel(name); | 273 QString propertyLabel = m_container->getPropertyLabel(name); |
274 QString iconName = m_container->getPropertyIconName(name); | 274 QString iconName = m_container->getPropertyIconName(name); |
275 | 275 |
276 #ifdef DEBUG_PROPERTY_BOX | 276 #ifdef DEBUG_PROPERTY_BOX |
277 std::cerr << "PropertyBox[" << this | 277 cerr << "PropertyBox[" << this |
278 << "(\"" << m_container->getPropertyContainerName().toStdString() | 278 << "(\"" << m_container->getPropertyContainerName().toStdString() |
279 << "\")]"; | 279 << "\")]"; |
280 std::cerr << "::updatePropertyEditor(\"" << name << "\"):"; | 280 cerr << "::updatePropertyEditor(\"" << name << "\"):"; |
281 std::cerr << " value " << value << ", have " << have << ", group \"" | 281 cerr << " value " << value << ", have " << have << ", group \"" |
282 << groupName << "\"" << std::endl; | 282 << groupName << "\"" << 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 << "\" and frame for group for \"" << name << "\"" << std::endl; | 291 cerr << "PropertyBox: adding label \"" << groupName << "\" and frame for group for \"" << name << "\"" << 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 << "\"" << std::endl; | 302 cerr << "PropertyBox: adding label \"" << propertyLabel << "\"" << 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 |
314 if (have) { | 314 if (have) { |
315 button = dynamic_cast<QAbstractButton *>(m_propertyControllers[name]); | 315 button = dynamic_cast<QAbstractButton *>(m_propertyControllers[name]); |
316 assert(button); | 316 assert(button); |
317 } else { | 317 } else { |
318 #ifdef DEBUG_PROPERTY_BOX | 318 #ifdef DEBUG_PROPERTY_BOX |
319 std::cerr << "PropertyBox: creating new checkbox" << std::endl; | 319 cerr << "PropertyBox: creating new checkbox" << endl; |
320 #endif | 320 #endif |
321 if (iconName != "") { | 321 if (iconName != "") { |
322 button = new NotifyingPushButton(); | 322 button = new NotifyingPushButton(); |
323 button->setCheckable(true); | 323 button->setCheckable(true); |
324 QIcon icon(IconLoader().load(iconName)); | 324 QIcon icon(IconLoader().load(iconName)); |
368 dial->blockSignals(false); | 368 dial->blockSignals(false); |
369 } | 369 } |
370 | 370 |
371 } else { | 371 } else { |
372 #ifdef DEBUG_PROPERTY_BOX | 372 #ifdef DEBUG_PROPERTY_BOX |
373 std::cerr << "PropertyBox: creating new dial" << std::endl; | 373 cerr << "PropertyBox: creating new dial" << endl; |
374 #endif | 374 #endif |
375 dial = new AudioDial(); | 375 dial = new AudioDial(); |
376 dial->setObjectName(name); | 376 dial->setObjectName(name); |
377 dial->setMinimum(min); | 377 dial->setMinimum(min); |
378 dial->setMaximum(max); | 378 dial->setMaximum(max); |
424 if (have) { | 424 if (have) { |
425 cb = dynamic_cast<NotifyingComboBox *>(m_propertyControllers[name]); | 425 cb = dynamic_cast<NotifyingComboBox *>(m_propertyControllers[name]); |
426 assert(cb); | 426 assert(cb); |
427 } else { | 427 } else { |
428 #ifdef DEBUG_PROPERTY_BOX | 428 #ifdef DEBUG_PROPERTY_BOX |
429 std::cerr << "PropertyBox: creating new combobox" << std::endl; | 429 cerr << "PropertyBox: creating new combobox" << endl; |
430 #endif | 430 #endif |
431 | 431 |
432 cb = new NotifyingComboBox(); | 432 cb = new NotifyingComboBox(); |
433 cb->setObjectName(name); | 433 cb->setObjectName(name); |
434 cb->setDuplicatesEnabled(false); | 434 cb->setDuplicatesEnabled(false); |
559 } | 559 } |
560 | 560 |
561 void | 561 void |
562 PropertyBox::unitDatabaseChanged() | 562 PropertyBox::unitDatabaseChanged() |
563 { | 563 { |
564 std::cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << std::endl; | 564 cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << endl; |
565 blockSignals(true); | 565 blockSignals(true); |
566 | 566 |
567 // std::cerr << "my container is " << m_container << std::endl; | 567 // cerr << "my container is " << m_container << endl; |
568 // std::cerr << "my container's name is... " << std::endl; | 568 // cerr << "my container's name is... " << endl; |
569 // std::cerr << m_container->objectName() << std::endl; | 569 // cerr << m_container->objectName() << 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) { |