As I program the tablet environment, some widgets are too small for touch interaction. I want to do more QSpinBox buttons.
After some searching, I found that the only way is the setStyleSheet function, but then it is not very well explained how to use it. This link to the Qt link describes what I should pass to the setStyleSheet function, but it is not clear if I can use part of it or should I use all of this, even if I only want to change one thing.
In any case, using part of this or all the text, my QDoubleSpinBox looks by default after applying these settings. This was even more since I am drawing a miii file than now. Of course, he does not color his yellow background (only to test its operation) or makes the buttons larger.
I am using this function:
customizeSpinBox(ui.doubleSpinBoxDistanciaLocalizador); ui.doubleSpinBoxDistanciaLocalizador->setVisible(true); void MyClass::customizeSpinBox(QDoubleSpinBox *spinBox){ qApp->setStyleSheet("QSpinBox { border: 3px solid red; border-radius: 5px; background-color: yellow; }" "QSpinBox::up-arrow { border-left: 17px solid none;" "border-right: 17px solid none; border-bottom: 17px solid black; width: 0px; height: 0px; }" "QSpinBox::up-arrow:hover { border-left: 17px solid none;" "border-right: 17px solid none; border-bottom: 17px solid black; width: 0px; height: 0px; }" "QSpinBox::up-button { width: 80px; height: 77px; background-color: yellow; }" "QSpinBox::up-button:hover { width: 80px; height: 77px; background-color: yellow; }" "QSpinBox::down-arrow { border-left: 17px solid none;" "border-right: 17px solid none; border-top: 17px solid black; width: 0px; height: 0px; }" "QSpinBox::down-arrow:hover { border-left: 17px solid none;" "border-right: 17px solid none; border-top: 17px solid black; width: 0px; height: 0px; }" "QSpinBox::down-button { width: 80px; height: 77px; background-color: yellow; }" "QSpinBox::down-button:hover { width: 80px; height: 77px; background-color: yellow; }" );
}
Any help?
source share