Exemple #1
0
void ColorPopup::colorSelected(int id)
{
    if (id == CUSTOM_COLOR){
        emit colorCustom();
    }else{
        emit colorChanged(QColor(colors[id]));
    }
}
Exemple #2
0
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();
}