When there are several buttons in a strip of gradient buttons on OS X, they have a single-line frame between them. Because of that, they look like segments of a single control.
To make this kind of buttons, I used QToolButton (not a QToolBar, just buttons in layouts), and styled them.
I used 4 styles:
the first (left) button in a strip.
buttons in the middle in a strip.
the last (right) button in a strip.
a standalone button.
These 4 styles draw different frames.
This is what I did:
A fragment of the style that I assign to the instance of QApplication (these styles use stretchable images that you need to draw or grab from OS X)
@//
// == QToolButton: segmented
//
"QToolButton[sgm_single="true"] { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrSUp.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_single="true"]:pressed { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrSDown.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_left="true"] { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrLUp.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_left="true"]:pressed { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrLDown.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_left="true"]:checked { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrLChecked.png) 4 4 4 4 ; "
" color: white; "
"} "
"QToolButton[sgm_middle="true"] { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrMUp.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_middle="true"]:pressed { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrMDown.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_middle="true"]:checked { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrMChecked.png) 4 4 4 4 ; "
" color: white; "
"} "
"QToolButton[sgm_right="true"] { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrRUp.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_right="true"]:pressed { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrRDown.png) 4 4 4 4 ; "
"} "
"QToolButton[sgm_right="true"]:checked { "
" border-width: 4px; "
" border-image: url(:/img/BPicTbrRChecked.png) 4 4 4 4 ; "
" color: white; "
"} "
@
In a constructor of a dialog with these special buttons
@
// a single button
ui->btnWkPerfInfo->setProperty("sgm_single", true);
//
// 3 buttons in a strip
ui->btnDayAdd->setProperty("sgm_left", true);
ui->btnDayCopy->setProperty("sgm_middle", true);
ui->btnDayDelete->setProperty("sgm_right", true);
@