comparison widgets/PropertyBox.cpp @ 287:cd2492c5fe45

* Add SingleColourLayer to manage colours for layers that have a single predominant colour (i.e. most of them).
author Chris Cannam
date Thu, 12 Jul 2007 16:14:59 +0000
parents 9dd432665059
children 3101c68a00c1
comparison
equal deleted inserted replaced
286:7554ae119882 287:cd2492c5fe45
46 46
47 #include <cassert> 47 #include <cassert>
48 #include <iostream> 48 #include <iostream>
49 #include <cmath> 49 #include <cmath>
50 50
51 #define DEBUG_PROPERTY_BOX 1 51 //#define DEBUG_PROPERTY_BOX 1
52 52
53 PropertyBox::PropertyBox(PropertyContainer *container) : 53 PropertyBox::PropertyBox(PropertyContainer *container) :
54 m_container(container), 54 m_container(container),
55 m_showButton(0), 55 m_showButton(0),
56 m_playButton(0) 56 m_playButton(0)
445 } else { // ColourProperty 445 } else { // ColourProperty
446 446
447 ColourDatabase *db = ColourDatabase::getInstance(); 447 ColourDatabase *db = ColourDatabase::getInstance();
448 for (size_t i = 0; i < db->getColourCount(); ++i) { 448 for (size_t i = 0; i < db->getColourCount(); ++i) {
449 QString name = db->getColourName(i); 449 QString name = db->getColourName(i);
450 QColor colour = db->getColour(i); 450 cb->addItem(db->getExamplePixmap(i, QSize(12, 12)), name);
451 QPixmap pmap(12, 12);
452 pmap.fill(colour);
453 cb->addItem(pmap, name);
454 } 451 }
455 cb->addItem(tr("Add New Colour...")); 452 cb->addItem(tr("Add New Colour..."));
456 } 453 }
457 454
458 cb->blockSignals(false); 455 cb->blockSignals(false);