you can't do it in the designer. because there is no slot called setRValue() or setGValue() for any widget.
So you have to manipulate the palette of your "color-widget" by your own. Or write your own widget, providing these slots and write a designer plugin for that color-widget.
connect(slider1, SIGNAL(valueChanged(int)), this, slider1changed(int));
//...
...::slider1changed(int i)
{
c.setRed(i);
colorwidget->setPalette(p);
}
connect(slider1, SIGNAL(valueChanged(int)), this, slider1changed(int));
//...
...::slider1changed(int i)
{
QPalette p = colorwidget->palette();
QColor c = p.color(QPalette::Window);
c.setRed(i);
p.setColor(QPalette::Window, c);
colorwidget->setPalette(p);
}
To copy to clipboard, switch view to plain text mode
You can use QSignalMapper to simplyfiy.
Bookmarks