void ColorCombo::updateBox(ColorList& list, bool insertNone) { ColorListBox* clb = dynamic_cast<ColorListBox*>(view()); if (!clb) return; clb->clear(); if (insertNone) { clb->addItem(CommonStrings::tr_NoneColor); clb->item(0)->setData(Qt::UserRole, CommonStrings::None); } clb->insertItems(list); }
void ColorCombo::updateBox(ColorList& list, ColorCombo::PixmapType pixType , bool insertNone) { ColorListBox* clb = dynamic_cast<ColorListBox*>(view()); if ( clb ) { clb->clear(); if ( insertNone ) clb->addItem(CommonStrings::tr_NoneColor); if ( pixType == ColorCombo::fancyPixmaps ) clb->insertItems(list, ColorListBox::fancyPixmap); else if ( pixType == ColorCombo::widePixmaps ) clb->insertItems(list, ColorListBox::widePixmap); else if ( pixType == ColorCombo::smallPixmaps ) clb->insertItems(list, ColorListBox::smallPixmap); } }
void ColorCombo::insertFancyItem( const ScColor& col, ScribusDoc* doc, const QString& colName ) { ColorListBox* clb = dynamic_cast<ColorListBox*>(view()); if ( clb ) clb->addItem( new ColorPixmapItem(ColorPixmapValue(col, doc, colName)), ColorListBox::fancyPixmap ); }