PDA

View Full Version : QButton losses round edges when it has focus under Fedora Linux



bob2oneil
10th February 2011, 17:36
I have a highly stylized application based on widgets in C++. Under Windows, when a QPushButton is selected and has the focus, while the gradient changes to an orange, the edges of the button remain round. Under Linux, when the button is selected, the gradient color is correct, but the button losses it's roundness.

The style sheet for the button is as follows:

QPushButton
{
color: rgb(35, 35, 35);
border: 1px solid rgb(75, 75, 75);
border-radius: 6px;
background-color: qlineargradient(spread:reflect, x1:0.500299, y1:0, x2:0.5, y2:0.66, stop:0 rgba(240, 240, 240, 255), stop:1 rgba(120, 120, 120, 255));
}

QPushButton:pressed, QPushButton:checked, QPushButton:selected
{
background-color:qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:0.685, stop:0.0170455 rgba(255, 173, 19, 255), stop:0.988701 rgba(223, 93, 0, 255))
}

If have the following general style setting in the application, attempting to have some
uniformity between Linux and Windows.


// Set style to Windows so that under Ubuntu Linux GTK+ style, group boxes
// will have borders, and the default button will not have a red hue. This
// will cause the Linux build to look more consistently like the Windows.
qApp->setStyle(new QWindowsStyle);