I am currently using Eclipse 3.5.2 and Qt Jambi 4.7.2 in Ubuntu 11.04 Natty Narwhal
I am trying to use stylesheets to customize my QCheckBox. I have found examples for C++ but I cannot find equivalents for Java. I am wanting to do something similar to the following using stylesheets.
QCheckBox::indicator {
width: 13px;
height: 13px;
}
QCheckBox::indicator:unchecked {
image: url(:/images/checkbox_unchecked.png);
}
QCheckBox::indicator:unchecked:hover {
image: url(:/images/checkbox_unchecked_hover.png);
}
QCheckBox::indicator:unchecked:pressed {
image: url(:/images/checkbox_unchecked_pressed.png);
}
QCheckBox::indicator:checked {
image: url(:/images/checkbox_checked.png);
}
QCheckBox::indicator:checked:hover {
image: url(:/images/checkbox_checked_hover.png);
}
QCheckBox::indicator:checked:pressed {
image: url(:/images/checkbox_checked_pressed.png);
}
If anyone could help me out, it would be much appreciated. Thanks in advance!
Also, does anyone know how to make a QCheckBox bigger?
Judging this page, you can set stylesheets into use with QApplication::setStyleSheet() and QWidget::setStyleSheet(). Neither of those is static function, so something like
Note that I haven’t myself tried those stylesheets, as a developer of Jambi I’d be interested if those styleheets actually work and if they could be fixed then.
EDIT: And for making check boxes bigger, maybe easiest way is to wrap them into layouts and let layouts to populate whole widget size -> with one item in a layout the widget in layout would be as big as the widget where the layout is attached to.