3

I have implemented some circle shape QToolButtons using stylesheets; everything is working fine, except that I haven't found a way to add an outside border instead. At the moment QT only supports CSS 2 meaning that I'm not able to use the box-shadow property in CSS 3.

Any ideas in how I can make this happen?

Here is a snippet of the stylesheets applied to a QToolButton

QString StyleManager::labelButtonStyle(QString labelColor){
QString style =  QString("QToolButton {"
                         "    border: 1px;"
                         "    width: 26px; min-width: 26px; max-width: 26px;"
                         "    height: 26px; min-height: 26px; max-height: 26px;"
                         "    border-radius: 13px;"
                         "    background-color: %1;"
                         "    color: white;"
                         "    padding: 0;"
                         "    margin: 0;"
                         "    font-size: 12px;"
                         "    font-family: %4;"
                         "}"
                         "QToolButton:checked {"
                         "    border: 2px solid %3; "
                         "}"
                         "QToolButton:disabled {"
                         "    background-color: %2; "
                         "    color: grey; "
                         "}").arg(labelColor).arg(BACKGROUND_GREY).arg(darkColor()).arg("Arial");
return style; }

This is the result so far:

Circle shape QToolButton with current border

But I'm trying to get to this.

Example of what I'm trying to accomplished

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • The images do not help, you can point out what you want, that part of the second image is not in the first. – eyllanesc May 11 '18 at 22:26
  • Thanks, it's basically the blue border that you see around T2. I'll update it and point to it, using the same images for before and after. – Xavier Páez May 14 '18 at 13:42

0 Answers0