source: trunk/doc/src/snippets/code/doc_src_stylesheet.qdoc@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 36.7 KB
Line 
1//! [0]
2QLineEdit { background: yellow }
3QCheckBox { color: red }
4//! [0]
5
6
7//! [1]
8QPushButton { color: red }
9//! [1]
10
11
12//! [2]
13QPushButton, QLineEdit, QComboBox { color: red }
14//! [2]
15
16
17//! [3]
18QPushButton { color: red }
19QLineEdit { color: red }
20QComboBox { color: red }
21//! [3]
22
23
24//! [4]
25QPushButton { color: red; background-color: white }
26//! [4]
27
28
29//! [5]
30QComboBox::drop-down { image: url(dropdown.png) }
31//! [5]
32
33
34//! [6]
35QComboBox {
36 margin-right: 20px;
37}
38QComboBox::drop-down {
39 subcontrol-origin: margin;
40}
41//! [6]
42
43
44//! [7]
45QComboBox::down-arrow {
46 image: url(down_arrow.png);
47}
48QComboBox::down-arrow:pressed {
49 position: relative;
50 top: 1px; left: 1px;
51}
52//! [7]
53
54
55//! [8]
56QPushButton:hover { color: white }
57//! [8]
58
59
60//! [9]
61QRadioButton:!hover { color: red }
62//! [9]
63
64
65//! [10]
66QCheckBox:hover:checked { color: white }
67//! [10]
68
69
70//! [11]
71QPushButton:hover:!pressed { color: blue; }
72//! [11]
73
74
75//! [12]
76QCheckBox:hover, QCheckBox:checked { color: white }
77//! [12]
78
79
80//! [13]
81QComboBox::drop-down:hover { image: url(dropdown_bright.png) }
82//! [13]
83
84
85//! [14]
86QPushButton#okButton { color: gray }
87QPushButton { color: red }
88//! [14]
89
90
91//! [15]
92QPushButton:hover { color: white }
93QPushButton { color: red }
94//! [15]
95
96
97//! [16]
98QPushButton:hover { color: white }
99QPushButton:enabled { color: red }
100//! [16]
101
102
103//! [17]
104QPushButton:enabled { color: red }
105QPushButton:hover { color: white }
106//! [17]
107
108
109//! [18]
110QPushButton:hover:enabled { color: white }
111QPushButton:enabled { color: red }
112//! [18]
113
114
115//! [19]
116QPushButton { color: red }
117QAbstractButton { color: gray }
118//! [19]
119
120
121//! [20]
122* {} /* a=0 b=0 c=0 -> specificity = 0 */
123LI {} /* a=0 b=0 c=1 -> specificity = 1 */
124UL LI {} /* a=0 b=0 c=2 -> specificity = 2 */
125UL OL+LI {} /* a=0 b=0 c=3 -> specificity = 3 */
126H1 + *[REL=up]{} /* a=0 b=1 c=1 -> specificity = 11 */
127UL OL LI.red {} /* a=0 b=1 c=3 -> specificity = 13 */
128LI.red.level {} /* a=0 b=2 c=1 -> specificity = 21 */
129#x34y {} /* a=1 b=0 c=0 -> specificity = 100 */
130//! [20]
131
132
133//! [21]
134qApp->setStyleSheet("QPushButton { color: white }");
135//! [21]
136
137
138//! [22]
139myPushButton->setStyleSheet("* { color: blue }");
140//! [22]
141
142
143//! [23]
144myPushButton->setStyleSheet("color: blue");
145//! [23]
146
147
148//! [24]
149qApp->setStyleSheet("QGroupBox { color: red; } ");
150//! [24]
151
152
153//! [25]
154qApp->setStyleSheet("QGroupBox, QGroupBox * { color: red; }");
155//! [25]
156
157
158//! [26]
159class MyPushButton : public QPushButton {
160 // ...
161}
162
163// ...
164qApp->setStyleSheet("MyPushButton { background: yellow; }");
165//! [26]
166
167
168//! [27]
169namespace ns {
170 class MyPushButton : public QPushButton {
171 // ...
172 }
173}
174
175// ...
176qApp->setSytleSheet("ns--MyPushButton { background: yellow; }");
177//! [27]
178
179
180//! [28]
181MyLabel { qproperty-pixmap: url(pixmap.png); }
182MyGroupBox { qproperty-titleColor: rgb(100, 200, 100); }
183QPushButton { qproperty-iconSize: 20px 20px; }
184//! [28]
185
186
187//! [30]
188QPushButton { background-color: red; border: none; }
189//! [30]
190
191
192//! [31]
193QToolButton { background-color: red; border: none; }
194//! [31]
195
196
197//! [32]
198void CustomWidget::paintEvent(QPaintEvent *)
199{
200 QStyleOption opt;
201 opt.init(this);
202 QPainter p(this);
203 style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
204}
205//! [32]
206
207
208//! [33]
209QTreeView {
210 alternate-background-color: blue;
211 background: yellow;
212}
213//! [33]
214
215
216//! [34]
217QTextEdit { background: yellow }
218//! [34]
219
220
221//! [35]
222QLabel {
223 background-image: url(dense6pattern.png);
224 background-repeat: repeat-xy;
225}
226//! [35]
227
228
229//! [36]
230QLabel { background-color: yellow }
231QLineEdit { background-color: rgb(255, 0, 0) }
232//! [36]
233
234
235//! [37]
236QFrame { background-image: url(:/images/hydro.png) }
237//! [37]
238
239
240//! [38]
241QFrame {
242 background: white url(:/images/ring.png);
243 background-repeat: repeat-y;
244 background-position: left;
245}
246//! [38]
247
248
249//! [39]
250QFrame {
251 background: url(:/images/footer.png);
252 background-position: bottom left;
253}
254//! [39]
255
256
257//! [40]
258QTextEdit {
259 background-image: url("leaves.png");
260 background-attachment: fixed;
261}
262//! [40]
263
264
265//! [41]
266QFrame {
267 background-image: url(:/images/header.png);
268 background-position: top left;
269 background-origin: content;
270 background-clip: padding;
271}
272//! [41]
273
274
275//! [42]
276QFrame {
277 background-image: url(:/images/header.png);
278 background-position: top left;
279 background-origin: content;
280}
281//! [42]
282
283
284//! [43]
285QLineEdit { border: 1px solid white }
286//! [43]
287
288
289//! [44]
290QLineEdit {
291 border-width: 1px;
292 border-style: solid;
293 border-color: white;
294}
295//! [44]
296
297
298//! [45]
299QLineEdit {
300 border-width: 1px;
301 border-style: solid;
302 border-radius: 4px;
303}
304//! [45]
305
306
307//! [46]
308QLineEdit {
309 border-width: 1px;
310 border-style: solid;
311 border-color: blue;
312}
313//! [46]
314
315
316//! [47]
317QLineEdit {
318 border-width: 2px;
319 border-style: solid;
320 border-color: darkblue;
321}
322//! [47]
323
324
325//! [48]
326QSpinBox::down-button { bottom: 2px }
327//! [48]
328
329
330//! [49]
331* { button-layout: 2 }
332//! [49]
333
334
335//! [50]
336QPushButton { color: red }
337//! [50]
338
339
340//! [51]
341QDialogButtonBox { dialogbuttonbox-buttons-have-icons: 1; }
342//! [51]
343
344
345//! [52]
346* { etch-disabled-text: 1 }
347//! [52]
348
349
350//! [53]
351QCheckBox { font: bold italic large "Times New Roman" }
352//! [53]
353
354
355//! [54]
356QCheckBox { font-family: "New Century Schoolbook" }
357//! [54]
358
359
360//! [55]
361QTextEdit { font-size: 12px }
362//! [55]
363
364
365//! [56]
366QTextEdit { font-style: italic }
367//! [56]
368
369
370//! [57]
371* { gridline-color: gray }
372//! [57]
373
374
375//! [58]
376QSpinBox::down-button { height: 10px }
377//! [58]
378
379
380//! [59]
381/* implicitly sets the size of down-button to the size of spindown.png */
382QSpinBox::down-button { image: url(:/images/spindown.png) }
383
384QTextEdit { image: url(x1.png) url(x2.png) }
385QTextEdit { image: url(pic1.svg) }
386//! [59]
387
388
389//! [60]
390QSpinBox::down-button { left: 2px }
391//! [60]
392
393
394//! [61]
395* { lineedit-password-character: 9679 }
396//! [61]
397
398
399//! [62]
400QLineEdit { margin: 2px }
401//! [62]
402
403
404//! [63]
405QSpinBox { max-height: 24px }
406//! [63]
407
408
409//! [64]
410QComboBox { max-width: 72px }
411//! [64]
412
413
414//! [65]
415QMessageBox { messagebox-text-interaction-flags: 5 }
416//! [65]
417
418
419//! [66]
420QComboBox { min-height: 24px }
421//! [66]
422
423
424//! [67]
425QComboBox { min-width: 72px }
426//! [67]
427
428
429//! [68]
430QToolTip { opacity: 223 }
431//! [68]
432
433
434//! [69]
435QLineEdit { padding: 3px }
436//! [69]
437
438
439//! [70]
440QSpinBox::down-button { right: 2px }
441//! [70]
442
443
444//! [71]
445QTextEdit { selection-background-color: darkblue }
446//! [71]
447
448
449//! [72]
450QTextEdit { selection-color: white }
451//! [72]
452
453
454//! [73]
455* { show-decoration-selected: 1 }
456//! [73]
457
458
459//! [74]
460QMenuBar { spacing: 10 }
461//! [74]
462
463
464//! [75]
465QSpinBox::up-button {
466 image: url(:/images/spinup.png);
467 subcontrol-origin: content;
468 subcontrol-position: right top;
469}
470//! [75]
471
472
473//! [76]
474QSpinBox::down-button {
475 image: url(:/images/spindown.png);
476 subcontrol-origin: padding;
477 subcontrol-position: right bottom;
478}
479//! [76]
480
481
482//! [77]
483QPushButton {
484 text-align: left;
485}
486//! [77]
487
488
489//! [78]
490QSpinBox::up-button { top: 2px }
491//! [78]
492
493
494//! [79]
495QSpinBox::up-button { width: 12px }
496//! [79]
497
498
499//! [80]
500QTextEdit { background-position: bottom center }
501//! [80]
502
503
504//! [81]
505QDialog { etch-disabled-text: 1 }
506//! [81]
507
508
509//! [82]
510QLabel { border-color: red } /* red red red red */
511QLabel { border-color: red blue } /* red blue red blue */
512QLabel { border-color: red blue green } /* red blue green blue */
513QLabel { border-color: red blue green yellow } /* red blue green yellow */
514//! [82]
515
516
517//! [83]
518QLabel { border-width: 1px } /* 1px 1px 1px 1px */
519QLabel { border-width: 1px 2px } /* 1px 2px 1px 2px */
520QLabel { border-width: 1px 2px 3px } /* 1px 2px 3px 2px */
521QLabel { border-width: 1px 2px 3px 4px } /* 1px 2px 3px 4px */
522//! [83]
523
524
525//! [84]
526QLabel { border-color: red } /* opaque red */
527QLabel { border-color: #FF0000 } /* opaque red */
528QLabel { border-color: rgba(255, 0, 0, 75%) } /* 75% opaque red */
529QLabel { border-color: rgb(255, 0, 0) } /* opaque red */
530QLabel { border-color: rgb(100%, 0%, 0%) } /* opaque red */
531QLabel { border-color: hsv(60, 255, 255) } /* opaque yellow */
532QLabel { border-color: hsva(240, 255, 255, 75%) } /* 75% blue */
533//! [84]
534
535
536//! [85]
537/* linear gradient from white to green */
538QTextEdit {
539 background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
540 stop:0 white, stop: 0.4 gray, stop:1 green)
541}
542
543/* linear gradient from white to green */
544QTextEdit {
545 background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
546 stop:0 white, stop: 0.4 rgba(10, 20, 30, 40), stop:1 rgb(0, 200, 230, 200))
547}
548
549
550/* conical gradient from white to green */
551QTextEdit {
552 background: qconicalgradient(cx:0.5, cy:0.5, angle:30,
553 stop:0 white, stop:1 #00FF00)
554}
555
556/* radial gradient from white to green */
557QTextEdit {
558 background: qradialgradient(cx:0, cy:0, radius: 1,
559 fx:0.5, fy:0.5, stop:0 white, stop:1 green)
560}
561//! [85]
562
563
564//! [86]
565* {
566 file-icon: url(file.png),
567 url(file_selected.png) selected;
568 }
569
570QMessageBox {
571 dialogbuttonbox-buttons-have-icons: true;
572 dialog-ok-icon: url(ok.svg);
573 dialog-cancel-icon: url(cancel.png), url(grayed_cancel.png) disabled;
574}
575//! [86]
576
577
578//! [87]
579QPushButton { color: palette(dark); }
580//! [87]
581
582
583//! [88]
584qApp->setStyleSheet("QLineEdit { background-color: yellow }");
585//! [88]
586
587
588//! [89]
589myDialog->setStyleSheet("QLineEdit { background-color: yellow }");
590//! [89]
591
592
593//! [90]
594myDialog->setStyleSheet("QLineEdit#nameEdit { background-color: yellow }");
595//! [90]
596
597
598//! [91]
599nameEdit->setStyleSheet("background-color: yellow");
600//! [91]
601
602
603//! [92]
604nameEdit->setStyleSheet("color: blue; background-color: yellow");
605//! [92]
606
607
608//! [93]
609nameEdit->setStyleSheet("color: blue;"
610 "background-color: yellow;"
611 "selection-color: yellow;"
612 "selection-background-color: blue;");
613//! [93]
614
615
616//! [94]
617*[mandatoryField="true"] { background-color: yellow }
618//! [94]
619
620
621//! [95]
622QLineEdit *nameEdit = new QLineEdit(this);
623nameEdit->setProperty("mandatoryField", true);
624
625QLineEdit *emailEdit = new QLineEdit(this);
626emailEdit->setProperty("mandatoryField", true);
627
628QSpinBox *ageSpinBox = new QSpinBox(this);
629ageSpinBox->setProperty("mandatoryField", true);
630//! [95]
631
632
633//! [96]
634QPushButton#evilButton { background-color: red }
635//! [96]
636
637
638//! [97]
639QPushButton#evilButton {
640 background-color: red;
641 border-style: outset;
642 border-width: 2px;
643 border-color: beige;
644}
645//! [97]
646
647
648//! [98]
649QPushButton#evilButton {
650 background-color: red;
651 border-style: outset;
652 border-width: 2px;
653 border-radius: 10px;
654 border-color: beige;
655 font: bold 14px;
656 min-width: 10em;
657 padding: 6px;
658}
659//! [98]
660
661
662//! [99]
663QPushButton#evilButton {
664 background-color: red;
665 border-style: outset;
666 border-width: 2px;
667 border-radius: 10px;
668 border-color: beige;
669 font: bold 14px;
670 min-width: 10em;
671 padding: 6px;
672}
673QPushButton#evilButton:pressed {
674 background-color: rgb(224, 0, 0);
675 border-style: inset;
676}
677//! [99]
678
679
680//! [100]
681QPushButton#evilButton::menu-indicator {
682 image: url(myindicator.png);
683}
684//! [100]
685
686
687//! [101]
688QPushButton::menu-indicator {
689 image: url(myindicator.png);
690 subcontrol-position: right center;
691 subcontrol-origin: padding;
692 left: -2px;
693}
694//! [101]
695
696
697//! [102]
698QLineEdit { color: red }
699//! [102]
700
701
702//! [103]
703QLineEdit { color: red }
704QLineEdit[readOnly="true"] { color: gray }
705//! [103]
706
707
708//! [104]
709QLineEdit { color: red }
710QLineEdit[readOnly="true"] { color: gray }
711#registrationDialog QLineEdit { color: brown }
712//! [104]
713
714
715//! [105]
716QLineEdit { color: red }
717QLineEdit[readOnly="true"] { color: gray }
718QDialog QLineEdit { color: brown }
719//! [105]
720
721
722//! [106]
723QTextEdit, QListView {
724 background-color: white;
725 background-image: url(draft.png);
726 background-attachment: scroll;
727}
728//! [106]
729
730
731//! [107]
732QTextEdit, QListView {
733 background-color: white;
734 background-image: url(draft.png);
735 background-attachment: fixed;
736}
737//! [107]
738
739
740//! [108]
741QCheckBox {
742 spacing: 5px;
743}
744
745QCheckBox::indicator {
746 width: 13px;
747 height: 13px;
748}
749
750QCheckBox::indicator:unchecked {
751 image: url(:/images/checkbox_unchecked.png);
752}
753
754QCheckBox::indicator:unchecked:hover {
755 image: url(:/images/checkbox_unchecked_hover.png);
756}
757
758QCheckBox::indicator:unchecked:pressed {
759 image: url(:/images/checkbox_unchecked_pressed.png);
760}
761
762QCheckBox::indicator:checked {
763 image: url(:/images/checkbox_checked.png);
764}
765
766QCheckBox::indicator:checked:hover {
767 image: url(:/images/checkbox_checked_hover.png);
768}
769
770QCheckBox::indicator:checked:pressed {
771 image: url(:/images/checkbox_checked_pressed.png);
772}
773
774QCheckBox::indicator:indeterminate:hover {
775 image: url(:/images/checkbox_indeterminate_hover.png);
776}
777
778QCheckBox::indicator:indeterminate:pressed {
779 image: url(:/images/checkbox_indeterminate_pressed.png);
780}
781//! [108]
782
783
784//! [109]
785QComboBox {
786 border: 1px solid gray;
787 border-radius: 3px;
788 padding: 1px 18px 1px 3px;
789 min-width: 6em;
790}
791
792QComboBox:editable {
793 background: white;
794}
795
796QComboBox:!editable, QComboBox::drop-down:editable {
797 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
798 stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
799 stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
800}
801
802/* QComboBox gets the "on" state when the popup is open */
803QComboBox:!editable:on, QComboBox::drop-down:editable:on {
804 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
805 stop: 0 #D3D3D3, stop: 0.4 #D8D8D8,
806 stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1);
807}
808
809QComboBox:on { /* shift the text when the popup opens */
810 padding-top: 3px;
811 padding-left: 4px;
812}
813
814QComboBox::drop-down {
815 subcontrol-origin: padding;
816 subcontrol-position: top right;
817 width: 15px;
818
819 border-left-width: 1px;
820 border-left-color: darkgray;
821 border-left-style: solid; /* just a single line */
822 border-top-right-radius: 3px; /* same radius as the QComboBox */
823 border-bottom-right-radius: 3px;
824}
825
826QComboBox::down-arrow {
827 image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png);
828}
829
830QComboBox::down-arrow:on { /* shift the arrow when popup is open */
831 top: 1px;
832 left: 1px;
833}
834//! [109]
835
836
837//! [110]
838QComboBox QAbstractItemView {
839 border: 2px solid darkgray;
840 selection-background-color: lightgray;
841}
842//! [110]
843
844
845//! [111]
846QDockWidget {
847 border: 1px solid lightgray;
848 titlebar-close-icon: url(close.png);
849 titlebar-normal-icon: url(undock.png);
850}
851
852QDockWidget::title {
853 text-align: left; /* align the text to the left */
854 background: lightgray;
855 padding-left: 5px;
856}
857
858QDockWidget::close-button, QDockWidget::float-button {
859 border: 1px solid transparent;
860 background: darkgray;
861 padding: 0px;
862}
863
864QDockWidget::close-button:hover, QDockWidget::float-button:hover {
865 background: gray;
866}
867
868QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
869 padding: 1px -1px -1px 1px;
870}
871//! [111]
872
873
874//! [112]
875QDockWidget {
876 border: 1px solid lightgray;
877 titlebar-close-icon: url(close.png);
878 titlebar-normal-icon: url(float.png);
879}
880
881QDockWidget::title {
882 text-align: left;
883 background: lightgray;
884 padding-left: 35px;
885}
886
887QDockWidget::close-button, QDockWidget::float-button {
888 background: darkgray;
889 padding: 0px;
890 icon-size: 14px; /* maximum icon size */
891}
892
893QDockWidget::close-button:hover, QDockWidget::float-button:hover {
894 background: gray;
895}
896
897QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
898 padding: 1px -1px -1px 1px;
899}
900
901QDockWidget::close-button {
902 subcontrol-position: top left;
903 subcontrol-origin: margin;
904 position: absolute;
905 top: 0px; left: 0px; bottom: 0px;
906 width: 14px;
907}
908
909QDockWidget::float-button {
910 subcontrol-position: top left;
911 subcontrol-origin: margin;
912 position: absolute;
913 top: 0px; left: 16px; bottom: 0px;
914 width: 14px;
915}
916//! [112]
917
918
919//! [113]
920QFrame, QLabel, QToolTip {
921 border: 2px solid green;
922 border-radius: 4px;
923 padding: 2px;
924 background-image: url(images/welcome.png);
925}
926//! [113]
927
928
929//! [114]
930QGroupBox {
931 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
932 stop: 0 #E0E0E0, stop: 1 #FFFFFF);
933 border: 2px solid gray;
934 border-radius: 5px;
935 margin-top: 1ex; /* leave space at the top for the title */
936}
937
938QGroupBox::title {
939 subcontrol-origin: margin;
940 subcontrol-position: top center; /* position at the top center */
941 padding: 0 3px;
942 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
943 stop: 0 #FFOECE, stop: 1 #FFFFFF);
944}
945//! [114]
946
947
948//! [115]
949QGroupBox::indicator {
950 width: 13px;
951 height: 13px;
952}
953
954QGroupBox::indicator:unchecked {
955 image: url(:/images/checkbox_unchecked.png);
956}
957
958/* proceed with styling just like QCheckBox */
959//! [115]
960
961
962//! [116]
963QHeaderView::section {
964 background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
965 stop:0 #616161, stop: 0.5 #505050,
966 stop: 0.6 #434343, stop:1 #656565);
967 color: white;
968 padding-left: 4px;
969 border: 1px solid #6c6c6c;
970}
971
972/* style the sort indicator */
973QHeaderView::down-arrow {
974 image: url(down_arrow.png);
975}
976
977QHeaderView::up-arrow {
978 image: url(up_arrow.png);
979}
980//! [116]
981
982
983//! [117]
984QLineEdit {
985 border: 2px solid gray;
986 border-radius: 10px;
987 padding: 0 8px;
988 background: yellow;
989 selection-background-color: darkgray;
990}
991//! [117]
992
993
994//! [118]
995QLineEdit[echoMode="2"] {
996 lineedit-password-character: 9679;
997}
998//! [118]
999
1000
1001//! [119]
1002QLineEdit:read-only {
1003 background: lightblue;
1004//! [119]
1005
1006
1007//! [120]
1008QListView {
1009 alternate-background-color: yellow;
1010}
1011//! [120]
1012
1013
1014//! [121]
1015QListView {
1016 show-decoration-selected: 1; /* make the selection span the entire width of the view */
1017}
1018
1019QListView::item:alternate {
1020 background: #EEEEEE;
1021}
1022
1023QListView::item:selected {
1024 border: 1px solid #6a6ea9;
1025}
1026
1027QListView::item:selected:!active {
1028 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1029 stop: 0 #ABAFE5, stop: 1 #8588B2);
1030}
1031
1032QListView::item:selected:active {
1033 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1034 stop: 0 #6a6ea9, stop: 1 #888dd9);
1035}
1036
1037QListView::item:hover {
1038 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1039 stop: 0 #FAFBFE, stop: 1 #DCDEF1);
1040}
1041//! [121]
1042
1043
1044//! [122]
1045QMainWindow::separator {
1046 background: yellow;
1047 width: 10px; /* when vertical */
1048 height: 10px; /* when horizontal */
1049}
1050
1051QMainWindow::separator:hover {
1052 background: red;
1053}
1054//! [122]
1055
1056
1057//! [123]
1058QMenu {
1059 background-color: #ABABAB; /* sets background of the menu */
1060 border: 1px solid black;
1061}
1062
1063QMenu::item {
1064 /* sets background of menu item. set this to something non-transparent
1065 if you want menu color and menu item color to be different */
1066 background-color: transparent;
1067}
1068
1069QMenu::item:selected { /* when user selects item using mouse or keyboard */
1070 background-color: #654321;
1071}
1072//! [123]
1073
1074
1075//! [124]
1076QMenu {
1077 background-color: white;
1078 margin: 2px; /* some spacing around the menu */
1079}
1080
1081QMenu::item {
1082 padding: 2px 25px 2px 20px;
1083 border: 1px solid transparent; /* reserve space for selection border */
1084}
1085
1086QMenu::item:selected {
1087 border-color: darkblue;
1088 background: rgba(100, 100, 100, 150);
1089}
1090
1091QMenu::icon:checked { /* appearance of a 'checked' icon */
1092 background: gray;
1093 border: 1px inset gray;
1094 position: absolute;
1095 top: 1px;
1096 right: 1px;
1097 bottom: 1px;
1098 left: 1px;
1099}
1100
1101QMenu::separator {
1102 height: 2px;
1103 background: lightblue;
1104 margin-left: 10px;
1105 margin-right: 5px;
1106}
1107
1108QMenu::indicator {
1109 width: 13px;
1110 height: 13px;
1111}
1112
1113/* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */
1114QMenu::indicator:non-exclusive:unchecked {
1115 image: url(:/images/checkbox_unchecked.png);
1116}
1117
1118QMenu::indicator:non-exclusive:unchecked:selected {
1119 image: url(:/images/checkbox_unchecked_hover.png);
1120}
1121
1122QMenu::indicator:non-exclusive:checked {
1123 image: url(:/images/checkbox_checked.png);
1124}
1125
1126QMenu::indicator:non-exclusive:checked:selected {
1127 image: url(:/images/checkbox_checked_hover.png);
1128}
1129
1130/* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */
1131QMenu::indicator:exclusive:unchecked {
1132 image: url(:/images/radiobutton_unchecked.png);
1133}
1134
1135QMenu::indicator:exclusive:unchecked:selected {
1136 image: url(:/images/radiobutton_unchecked_hover.png);
1137}
1138
1139QMenu::indicator:exclusive:checked {
1140 image: url(:/images/radiobutton_checked.png);
1141}
1142
1143QMenu::indicator:exclusive:checked:selected {
1144 image: url(:/images/radiobutton_checked_hover.png);
1145}
1146
1147//! [124]
1148
1149
1150//! [125]
1151QMenuBar {
1152 background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
1153 stop:0 lightgray, stop:1 darkgray);
1154}
1155
1156QMenuBar::item {
1157 spacing: 3px; /* spacing between menu bar items */
1158 padding: 1px 4px;
1159 background: transparent;
1160 border-radius: 4px;
1161}
1162
1163QMenuBar::item:selected { /* when selected using mouse or keyboard */
1164 background: #a8a8a8;
1165}
1166
1167QMenuBar::item:pressed {
1168 background: #888888;
1169}
1170//! [125]
1171
1172
1173//! [126]
1174QProgressBar {
1175 border: 2px solid grey;
1176 border-radius: 5px;
1177}
1178
1179QProgressBar::chunk {
1180 background-color: #05B8CC;
1181 width: 20px;
1182}
1183//! [126]
1184
1185
1186//! [127]
1187QProgressBar {
1188 border: 2px solid grey;
1189 border-radius: 5px;
1190 text-align: center;
1191}
1192//! [127]
1193
1194
1195//! [128]
1196QProgressBar::chunk {
1197 background-color: #CD96CD;
1198 width: 10px;
1199 margin: 0.5px;
1200}
1201//! [128]
1202
1203
1204//! [129]
1205QPushButton {
1206 border: 2px solid #8f8f91;
1207 border-radius: 6px;
1208 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1209 stop: 0 #f6f7fa, stop: 1 #dadbde);
1210 min-width: 80px;
1211}
1212
1213QPushButton:pressed {
1214 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1215 stop: 0 #dadbde, stop: 1 #f6f7fa);
1216}
1217
1218QPushButton:flat {
1219 border: none; /* no border for a flat push button */
1220}
1221
1222QPushButton:default {
1223 border-color: navy; /* make the default button prominent */
1224}
1225//! [129]
1226
1227
1228//! [130]
1229QPushButton:open { /* when the button has its menu open */
1230 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1231 stop: 0 #dadbde, stop: 1 #f6f7fa);
1232}
1233
1234QPushButton::menu-indicator {
1235 image: url(menu_indicator.png);
1236 subcontrol-origin: padding;
1237 subcontrol-position: bottom right;
1238}
1239
1240QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
1241 position: relative;
1242 top: 2px; left: 2px; /* shift the arrow by 2 px */
1243}
1244//! [130]
1245
1246
1247//! [131]
1248QRadioButton::indicator {
1249 width: 13px;
1250 height: 13px;
1251}
1252
1253QRadioButton::indicator::unchecked {
1254 image: url(:/images/radiobutton_unchecked.png);
1255}
1256
1257QRadioButton::indicator:unchecked:hover {
1258 image: url(:/images/radiobutton_unchecked_hover.png);
1259}
1260
1261QRadioButton::indicator:unchecked:pressed {
1262 image: url(:/images/radiobutton_unchecked_pressed.png);
1263}
1264
1265QRadioButton::indicator::checked {
1266 image: url(:/images/radiobutton_checked.png);
1267}
1268
1269QRadioButton::indicator:checked:hover {
1270 image: url(:/images/radiobutton_checked_hover.png);
1271}
1272
1273QRadioButton::indicator:checked:pressed {
1274 image: url(:/images/radiobutton_checked_pressed.png);
1275}
1276//! [131]
1277
1278
1279//! [132]
1280QScrollBar:horizontal {
1281 border: 2px solid grey;
1282 background: #32CC99;
1283 height: 15px;
1284 margin: 0px 20px 0 20px;
1285}
1286//! [132]
1287
1288
1289//! [133]
1290QScrollBar::handle:horizontal {
1291 background: white;
1292 min-width: 20px;
1293}
1294//! [133]
1295
1296
1297//! [134]
1298QScrollBar::add-line:horizontal {
1299 border: 2px solid grey;
1300 background: #32CC99;
1301 width: 20px;
1302 subcontrol-position: right;
1303 subcontrol-origin: margin;
1304}
1305
1306QScrollBar::sub-line:horizontal {
1307 border: 2px solid grey;
1308 background: #32CC99;
1309 width: 20px;
1310 subcontrol-position: left;
1311 subcontrol-origin: margin;
1312}
1313//! [134]
1314
1315
1316//! [135]
1317QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
1318 border: 2px solid grey;
1319 width: 3px;
1320 height: 3px;
1321 background: white;
1322}
1323
1324QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
1325 background: none;
1326}
1327//! [135]
1328
1329
1330//! [136]
1331QScrollBar:horizontal {
1332 border: 2px solid green;
1333 background: cyan;
1334 height: 15px;
1335 margin: 0px 40px 0 0px;
1336}
1337
1338QScrollBar::handle:horizontal {
1339 background: gray;
1340 min-width: 20px;
1341}
1342
1343QScrollBar::add-line:horizontal {
1344 background: blue;
1345 width: 16px;
1346 subcontrol-position: right;
1347 subcontrol-origin: margin;
1348 border: 2px solid black;
1349}
1350
1351QScrollBar::sub-line:horizontal {
1352 background: magenta;
1353 width: 16px;
1354 subcontrol-position: top right;
1355 subcontrol-origin: margin;
1356 border: 2px solid black;
1357 position: absolute;
1358 right: 20px;
1359}
1360
1361QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {
1362 width: 3px;
1363 height: 3px;
1364 background: pink;
1365}
1366
1367QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
1368 background: none;
1369}
1370
1371//! [136]
1372
1373
1374//! [137]
1375 QScrollBar:vertical {
1376 border: 2px solid grey;
1377 background: #32CC99;
1378 width: 15px;
1379 margin: 22px 0 22px 0;
1380 }
1381 QScrollBar::handle:vertical {
1382 background: white;
1383 min-height: 20px;
1384 }
1385 QScrollBar::add-line:vertical {
1386 border: 2px solid grey;
1387 background: #32CC99;
1388 height: 20px;
1389 subcontrol-position: bottom;
1390 subcontrol-origin: margin;
1391 }
1392
1393 QScrollBar::sub-line:vertical {
1394 border: 2px solid grey;
1395 background: #32CC99;
1396 height: 20px;
1397 subcontrol-position: top;
1398 subcontrol-origin: margin;
1399 }
1400 QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
1401 border: 2px solid grey;
1402 width: 3px;
1403 height: 3px;
1404 background: white;
1405 }
1406
1407 QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
1408 background: none;
1409 }
1410//! [137]
1411
1412
1413//! [138]
1414QSizeGrip {
1415 image: url(:/images/sizegrip.png);
1416 width: 16px;
1417 height: 16px;
1418}
1419//! [138]
1420
1421
1422//! [139]
1423QSlider::groove:horizontal {
1424 border: 1px solid #999999;
1425 height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
1426 background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);
1427 margin: 2px 0;
1428}
1429
1430QSlider::handle:horizontal {
1431 background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
1432 border: 1px solid #5c5c5c;
1433 width: 18px;
1434 margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
1435 border-radius: 3px;
1436}
1437//! [139]
1438
1439
1440//! [140]
1441QSlider::groove:vertical {
1442 background: red;
1443 position: absolute; /* absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... */
1444 left: 4px; right: 4px;
1445}
1446
1447QSlider::handle:vertical {
1448 height: 10px;
1449 background: green;
1450 margin: 0 -4px; /* expand outside the groove */
1451}
1452
1453QSlider::add-page:vertical {
1454 background: white;
1455}
1456
1457QSlider::sub-page:vertical {
1458 background: pink;
1459}
1460//! [140]
1461
1462
1463//! [141]
1464QSpinBox {
1465 padding-right: 15px; /* make room for the arrows */
1466 border-image: url(:/images/frame.png) 4;
1467 border-width: 3;
1468}
1469
1470QSpinBox::up-button {
1471 subcontrol-origin: border;
1472 subcontrol-position: top right; /* position at the top right corner */
1473
1474 width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
1475 border-image: url(:/images/spinup.png) 1;
1476 border-width: 1px;
1477}
1478
1479QSpinBox::up-button:hover {
1480 border-image: url(:/images/spinup_hover.png) 1;
1481}
1482
1483QSpinBox::up-button:pressed {
1484 border-image: url(:/images/spinup_pressed.png) 1;
1485}
1486
1487QSpinBox::up-arrow {
1488 image: url(:/images/up_arrow.png);
1489 width: 7px;
1490 height: 7px;
1491}
1492
1493QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off { /* off state when value is max */
1494 image: url(:/images/up_arrow_disabled.png);
1495}
1496
1497QSpinBox::down-button {
1498 subcontrol-origin: border;
1499 subcontrol-position: bottom right; /* position at bottom right corner */
1500
1501 width: 16px;
1502 border-image: url(:/images/spindown.png) 1;
1503 border-width: 1px;
1504 border-top-width: 0;
1505}
1506
1507QSpinBox::down-button:hover {
1508 border-image: url(:/images/spindown_hover.png) 1;
1509}
1510
1511QSpinBox::down-button:pressed {
1512 border-image: url(:/images/spindown_pressed.png) 1;
1513}
1514
1515QSpinBox::down-arrow {
1516 image: url(:/images/down_arrow.png);
1517 width: 7px;
1518 height: 7px;
1519}
1520
1521QSpinBox::down-arrow:disabled,
1522QSpinBox::down-arrow:off { /* off state when value in min */
1523 image: url(:/images/down_arrow_disabled.png);
1524}
1525
1526//! [141]
1527
1528
1529//! [142]
1530QSplitter::handle {
1531 image: url(images/splitter.png);
1532}
1533
1534QSplitter::handle:horizontal {
1535 width: 2px;
1536}
1537
1538QSplitter::handle:vertical {
1539 height: 2px;
1540}
1541//! [142]
1542
1543
1544//! [143]
1545QStatusBar {
1546 background: brown;
1547}
1548
1549QStatusBar::item {
1550 border: 1px solid red;
1551 border-radius: 3px;
1552}
1553//! [143]
1554
1555
1556//! [144]
1557QStatusBar QLabel {
1558 border: 3px solid white;
1559}
1560//! [144]
1561
1562
1563//! [145]
1564QTabWidget::pane { /* The tab widget frame */
1565 border-top: 2px solid #C2C7CB;
1566}
1567
1568QTabWidget::tab-bar {
1569 left: 5px; /* move to the right by 5px */
1570}
1571
1572/* Style the tab using the tab sub-control. Note that
1573 it reads QTabBar _not_ QTabWidget */
1574QTabBar::tab {
1575 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1576 stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
1577 stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
1578 border: 2px solid #C4C4C3;
1579 border-bottom-color: #C2C7CB; /* same as the pane color */
1580 border-top-left-radius: 4px;
1581 border-top-right-radius: 4px;
1582 min-width: 8ex;
1583 padding: 2px;
1584}
1585
1586QTabBar::tab:selected, QTabBar::tab:hover {
1587 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1588 stop: 0 #fafafa, stop: 0.4 #f4f4f4,
1589 stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
1590}
1591
1592QTabBar::tab:selected {
1593 border-color: #9B9B9B;
1594 border-bottom-color: #C2C7CB; /* same as pane color */
1595}
1596
1597QTabBar::tab:!selected {
1598 margin-top: 2px; /* make non-selected tabs look smaller */
1599}
1600//! [145]
1601
1602
1603//! [146]
1604QTabWidget::pane { /* The tab widget frame */
1605 border-top: 2px solid #C2C7CB;
1606}
1607
1608QTabWidget::tab-bar {
1609 left: 5px; /* move to the right by 5px */
1610}
1611
1612/* Style the tab using the tab sub-control. Note that
1613 it reads QTabBar _not_ QTabWidget */
1614QTabBar::tab {
1615 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1616 stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
1617 stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
1618 border: 2px solid #C4C4C3;
1619 border-bottom-color: #C2C7CB; /* same as the pane color */
1620 border-top-left-radius: 4px;
1621 border-top-right-radius: 4px;
1622 min-width: 8ex;
1623 padding: 2px;
1624}
1625
1626QTabBar::tab:selected, QTabBar::tab:hover {
1627 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1628 stop: 0 #fafafa, stop: 0.4 #f4f4f4,
1629 stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
1630}
1631
1632QTabBar::tab:selected {
1633 border-color: #9B9B9B;
1634 border-bottom-color: #C2C7CB; /* same as pane color */
1635}
1636
1637QTabBar::tab:!selected {
1638 margin-top: 2px; /* make non-selected tabs look smaller */
1639}
1640
1641/* make use of negative margins for overlapping tabs */
1642QTabBar::tab:selected {
1643 /* expand/overlap to the left and right by 4px */
1644 margin-left: -4px;
1645 margin-right: -4px;
1646}
1647
1648QTabBar::tab:first:selected {
1649 margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
1650}
1651
1652QTabBar::tab:last:selected {
1653 margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
1654}
1655
1656QTabBar::tab:only-one {
1657 margin: 0; /* if there is only one tab, we don't want overlapping margins */
1658}
1659//! [146]
1660
1661
1662//! [147]
1663QTabWidget::pane { /* The tab widget frame */
1664 border-top: 2px solid #C2C7CB;
1665 position: absolute;
1666 top: -0.5em;
1667}
1668
1669QTabWidget::tab-bar {
1670 alignment: center;
1671}
1672
1673/* Style the tab using the tab sub-control. Note that
1674 it reads QTabBar _not_ QTabWidget */
1675QTabBar::tab {
1676 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1677 stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
1678 stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
1679 border: 2px solid #C4C4C3;
1680 border-bottom-color: #C2C7CB; /* same as the pane color */
1681 border-top-left-radius: 4px;
1682 border-top-right-radius: 4px;
1683 min-width: 8ex;
1684 padding: 2px;
1685}
1686
1687QTabBar::tab:selected, QTabBar::tab:hover {
1688 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1689 stop: 0 #fafafa, stop: 0.4 #f4f4f4,
1690 stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
1691}
1692
1693QTabBar::tab:selected {
1694 border-color: #9B9B9B;
1695 border-bottom-color: #C2C7CB; /* same as pane color */
1696}
1697//! [147]
1698
1699
1700//! [148]
1701QTabBar::tear {
1702 image: url(tear_indicator.png);
1703}
1704
1705QTabBar::scroller { /* the width of the scroll buttons */
1706 width: 20px;
1707}
1708
1709QTabBar QToolButton { /* the scroll buttons are tool buttons */
1710 border-image: url(scrollbutton.png) 2;
1711 border-width: 2px;
1712}
1713
1714QTabBar QToolButton::right-arrow { /* the arrow mark in the tool buttons */
1715 image: url(rightarrow.png);
1716}
1717
1718QTabBar QToolButton::left-arrow {
1719 image: url(leftarrow.png);
1720}
1721//! [148]
1722
1723
1724//! [149]
1725QTableView {
1726 selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,
1727 stop: 0 #FF92BB, stop: 1 white);
1728}
1729//! [149]
1730
1731
1732//! [150]
1733QTableView QTableCornerButton::section {
1734 background: red;
1735 border: 2px outset red;
1736}
1737//! [150]
1738
1739
1740//! [151]
1741QToolBar {
1742 background: red;
1743 spacing: 3px; /* spacing between items in the tool bar */
1744}
1745
1746QToolBar::handle {
1747 image: url(handle.png);
1748}
1749//! [151]
1750
1751
1752//! [152]
1753QToolBox::tab {
1754 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1755 stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
1756 stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
1757 border-radius: 5px;
1758 color: darkgray;
1759}
1760
1761QToolBox::tab:selected { /* italicize selected tabs */
1762 font: italic;
1763 color: white;
1764}
1765//! [152]
1766
1767
1768//! [153]
1769QToolButton { /* all types of tool button */
1770 border: 2px solid #8f8f91;
1771 border-radius: 6px;
1772 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1773 stop: 0 #f6f7fa, stop: 1 #dadbde);
1774}
1775
1776QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
1777 padding-right: 20px; /* make way for the popup button */
1778}
1779
1780QToolButton:pressed {
1781 background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1782 stop: 0 #dadbde, stop: 1 #f6f7fa);
1783}
1784
1785/* the subcontrols below are used only in the MenuButtonPopup mode */
1786QToolButton::menu-button {
1787 border: 2px solid gray;
1788 border-top-right-radius: 6px;
1789 border-bottom-right-radius: 6px;
1790 /* 16px width + 4px for border = 20px allocated above */
1791 width: 16px;
1792}
1793
1794QToolButton::menu-arrow {
1795 image: url(downarrow.png);
1796}
1797
1798QToolButton::menu-arrow:open {
1799 top: 1px; left: 1px; /* shift it a bit */
1800}
1801//! [153]
1802
1803
1804//! [154]
1805QToolTip {
1806 border: 2px solid darkkhaki;
1807 padding: 5px;
1808 border-radius: 3px;
1809 opacity: 200;
1810}
1811//! [154]
1812
1813
1814//! [155]
1815QTreeView {
1816 alternate-background-color: yellow;
1817}
1818//! [155]
1819
1820
1821//! [156]
1822QTreeView {
1823 show-decoration-selected: 1;
1824}
1825
1826QTreeView::item {
1827 border: 1px solid #d9d9d9;
1828 border-top-color: transparent;
1829 border-bottom-color: transparent;
1830}
1831
1832QTreeView::item:hover {
1833 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
1834 border: 1px solid #bfcde4;
1835}
1836
1837QTreeView::item:selected {
1838 border: 1px solid #567dbc;
1839}
1840
1841QTreeView::item:selected:active{
1842 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
1843}
1844
1845QTreeView::item:selected:!active {
1846 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf);
1847}
1848//! [156]
1849
1850
1851//! [157]
1852QTreeView::branch {
1853 background: palette(base);
1854}
1855
1856QTreeView::branch:has-siblings:!adjoins-item {
1857 background: cyan;
1858}
1859
1860QTreeView::branch:has-siblings:adjoins-item {
1861 background: red;
1862}
1863
1864QTreeView::branch:!has-children:!has-siblings:adjoins-item {
1865 background: blue;
1866}
1867
1868QTreeView::branch:closed:has-children:has-siblings {
1869 background: pink;
1870}
1871
1872QTreeView::branch:has-children:!has-siblings:closed {
1873 background: gray;
1874}
1875
1876QTreeView::branch:open:has-children:has-siblings {
1877 background: magenta;
1878}
1879
1880QTreeView::branch:open:has-children:!has-siblings {
1881 background: green;
1882}
1883
1884//! [157]
1885
1886
1887//! [158]
1888QTreeView::branch:has-siblings:!adjoins-item {
1889 border-image: url(vline.png) 0;
1890}
1891
1892QTreeView::branch:has-siblings:adjoins-item {
1893 border-image: url(branch-more.png) 0;
1894}
1895
1896QTreeView::branch:!has-children:!has-siblings:adjoins-item {
1897 border-image: url(branch-end.png) 0;
1898}
1899
1900QTreeView::branch:has-children:!has-siblings:closed,
1901QTreeView::branch:closed:has-children:has-siblings {
1902 border-image: none;
1903 image: url(branch-closed.png);
1904}
1905
1906QTreeView::branch:open:has-children:!has-siblings,
1907QTreeView::branch:open:has-children:has-siblings {
1908 border-image: none;
1909 image: url(branch-open.png);
1910}
1911//! [158]
Note: See TracBrowser for help on using the repository browser.