将信号和槽绑定
connect(&p->palette, &ColorPalette::colorsChanged, this, &Swatch::paletteModified);
发射信号
emit colorsChanged(p->colors);
信号
signals:
/**
* \brief Emitted when all the colors have changed
*/
void colorsChanged(const QVector<QPair<QColor,QString> >&);
槽
protected slots:
/**
* \brief Connected to the internal palette object to keep eveything consistent
*/
void paletteModified();