PDA

View Full Version : QCheckBox styling problem on Windows Mobile



hubbobubbo
27th April 2010, 16:01
Hi

I have a QTreeView that is checkable so there are checkboxes to the left. My background is black so I need the checkboxes to be of another color to be visible (non black).

On Win32 everything looks great. The background is black and the checkboxes in the tree are white.

However the same code executed on Windows Mobile, the checkboxes have black background with black borders so they are not visible until I select an element in the tree and the selection color makes the black checkbox visible.

I tried to use a stylesheet but that did not make a difference, please see below. Any ideas on how to handle this problem?


QTreeView {
background-color: black;
color: white;
}

QTreeView::item:selected{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
}

QCheckBox {
border-color: white;
background-color:white;
color:white;
}

QLineEdit {
padding: 1px;
border-style: solid;
border: 2px solid gray;
border-radius: 8px;
color: black;
}


QMainWindow{
background-color: black;
color: white;
}

hubbobubbo
27th April 2010, 17:56
I found some info in QStyledItemDelegate that checkboxes are styled according to the current style. Maybe that is the key, I still do not know how to make the checkbox white in Windows Mobile though.