void ColorPopup::colorSelected(int id) { if (id == CUSTOM_COLOR){ emit colorCustom(); }else{ emit colorChanged(QColor(colors[id])); } }
void ColorToolButton::btnClicked() { m_popup = new ColorPopup(this, m_color); connect(m_popup, SIGNAL(colorChanged(QColor)), this, SLOT(selectColor(QColor))); connect(m_popup, SIGNAL(colorCustom()), this, SLOT(selectCustom())); QPoint p = CToolButton::popupPos(this, m_popup); m_popup->move(p); m_popup->show(); }