本文整理汇总了C++中ColorListBox类的典型用法代码示例。如果您正苦于以下问题:C++ ColorListBox类的具体用法?C++ ColorListBox怎么用?C++ ColorListBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ColorListBox类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertItems
void ColorCombo::insertItems(ColorList& list)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if (!clb)
return;
clb->insertItems(list);
}
示例2: QComboBox
ColorCombo::ColorCombo( bool rw, QWidget* parent ) : QComboBox(parent)
{
#ifdef Q_WS_MAC
// setStyle( new ColorCombo::ScMacStyle() );
#endif
setEditable(rw);
ColorListBox* lb = new ColorListBox(this);
setModel( lb->model() );
setItemDelegate( lb->itemDelegate() );
setView( lb );
}
示例3: if
void ColorCombo::insertItems(ColorList& list, ColorCombo::PixmapType pixType)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if ( clb )
{
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);
}
}
示例4: if
void ColorCombo::setPixmapType(ColorCombo::PixmapType type)
{
ColorListBox* clb = dynamic_cast<ColorListBox*>(view());
if (!clb)
return;
if (type == ColorCombo::smallPixmaps)
clb->setPixmapType(ColorListBox::smallPixmap);
else if (type == ColorCombo::widePixmaps)
clb->setPixmapType(ColorListBox::widePixmap);
else if (type == ColorCombo::fancyPixmaps)
clb->setPixmapType(ColorListBox::fancyPixmap);
}
示例5: updateBox
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);
}
示例6: setEditable
ColorCombo::ColorCombo(ColorCombo::PixmapType type, QWidget* parent)
{
#ifdef Q_OS_MAC
// setStyle( new ColorCombo::ScMacStyle() );
#endif
setEditable(false);
ColorListBox::PixmapType clbType = ColorListBox::smallPixmap;
if (type == ColorCombo::widePixmaps)
clbType = ColorListBox::widePixmap;
else if (type == ColorCombo::fancyPixmaps)
clbType = ColorListBox::fancyPixmap;
ColorListBox* lb = new ColorListBox(clbType, this);
setModel( lb->model() );
setItemDelegate( lb->itemDelegate() );
setView( lb );
}
示例7: if
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);
clb->item(0)->setData(Qt::UserRole, CommonStrings::None);
}
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);
}
}
示例8: ColorPixmapItem
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 );
}