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 ); }
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 ); }