source: trunk/doc/html/qstyle-h.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 21.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qstyle.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qstyle.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qstyle.h</h1>
33
34<p>This is the verbatim text of the qstyle.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qstyle-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of QStyle class
41**
42** Created : 980616
43**
44** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the kernel module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73#ifndef QSTYLE_H
74#define QSTYLE_H
75
76#ifndef QT_H
77#include "qobject.h"
78#endif // QT_H
79
80
81#ifndef QT_NO_STYLE
82
83class QPopupMenu;
84class QStylePrivate;
85class QMenuItem;
86class QTab;
87class QListViewItem;
88class QCheckListItem;
89
90class QStyleOption {
91public:
92 enum StyleOptionDefault { Default };
93
94 QStyleOption(StyleOptionDefault=Default) : def(TRUE) {}
95
96 // Note: we don't use default arguments since that is unnecessary
97 // initialization.
98 QStyleOption(int in1) :
99 def(FALSE), i1(in1) {}
100 QStyleOption(int in1, int in2) :
101 def(FALSE), i1(in1), i2(in2) {}
102 QStyleOption(int in1, int in2, int in3, int in4) :
103 def(FALSE), i1(in1), i2(in2), i3(in3), i4(in4) {}
104 QStyleOption(QMenuItem* m) : def(FALSE), mi(m) {}
105 QStyleOption(QMenuItem* m, int in1) : def(FALSE), mi(m), i1(in1) {}
106 QStyleOption(QMenuItem* m, int in1, int in2) : def(FALSE), mi(m), i1(in1), i2(in2) {}
107 QStyleOption(const QColor&amp; c) : def(FALSE), cl(&amp;c) {}
108 QStyleOption(QTab* t) : def(FALSE), tb(t) {}
109 QStyleOption(QListViewItem* i) : def(FALSE), li(i) {}
110 QStyleOption(QCheckListItem* i) : def(FALSE), cli(i) {}
111 QStyleOption(Qt::ArrowType a) : def(FALSE), i1((int)a) {}
112 QStyleOption(const QRect&amp; r) : def(FALSE), i1(r.x()), i2(r.y()), i3(r.width()),i4(r.height()){}
113 QStyleOption(QWidget *w) : def(FALSE), p1((void*)w) {}
114
115 bool isDefault() const { return def; }
116
117 int day() const { return i1; }
118
119 int lineWidth() const { return i1; }
120 int midLineWidth() const { return i2; }
121 int frameShape() const { return i3; }
122 int frameShadow() const { return i4; }
123
124 int headerSection() const { return i1; }
125 QMenuItem* menuItem() const { return mi; }
126 int maxIconWidth() const { return i1; }
127 int tabWidth() const { return i2; }
128
129 const QColor&amp; color() const { return *cl; }
130
131 QTab* tab() const { return tb; }
132
133 QCheckListItem* checkListItem() const { return cli; }
134 QListViewItem* listViewItem() const { return li; }
135
136 Qt::ArrowType arrowType() const { return (Qt::ArrowType)i1; }
137 QRect rect() const { return QRect( i1, i2, i3, i4 ); }
138 QWidget* widget() const { return (QWidget*)p1; }
139
140private:
141 // NOTE: none of these components have constructors.
142 bool def;
143 bool b1,b2,b3; // reserved
144 QMenuItem* mi;
145 QTab* tb;
146 QListViewItem* li;
147 const QColor* cl;
148 int i1, i2, i3, i4;
149 int i5, i6; // reserved
150 QCheckListItem* cli;
151 void *p1, *p2, *p3, *p4; // reserved
152 // (padded to 64 bytes on some architectures)
153};
154
155class QStyleHintReturn; // not defined yet
156
157class Q_EXPORT QStyle: public QObject
158{
159 Q_OBJECT
160
161public:
162 QStyle();
163 virtual ~QStyle();
164
165 // New QStyle API - most of these should probably be pure virtual
166
167 virtual void polish( QWidget * );
168 virtual void unPolish( QWidget * );
169
170 virtual void polish( QApplication * );
171 virtual void unPolish( QApplication * );
172
173 virtual void polish( QPalette &amp; );
174
175 virtual void polishPopupMenu( QPopupMenu* ) = 0;
176
177 virtual QRect itemRect( QPainter *p, const QRect &amp;r,
178 int flags, bool enabled,
179 const QPixmap *pixmap,
180 const QString &amp;text, int len = -1 ) const;
181
182 virtual void drawItem( QPainter *p, const QRect &amp;r,
183 int flags, const QColorGroup &amp;g, bool enabled,
184 const QPixmap *pixmap, const QString &amp;text,
185 int len = -1, const QColor *penColor = 0 ) const;
186
187
188 enum PrimitiveElement {
189 PE_ButtonCommand,
190 PE_ButtonDefault,
191 PE_ButtonBevel,
192 PE_ButtonTool,
193 PE_ButtonDropDown,
194
195 PE_FocusRect,
196
197 PE_ArrowUp,
198 PE_ArrowDown,
199 PE_ArrowRight,
200 PE_ArrowLeft,
201
202 PE_SpinWidgetUp,
203 PE_SpinWidgetDown,
204 PE_SpinWidgetPlus,
205 PE_SpinWidgetMinus,
206
207 PE_Indicator,
208 PE_IndicatorMask,
209 PE_ExclusiveIndicator,
210 PE_ExclusiveIndicatorMask,
211
212 PE_DockWindowHandle,
213 PE_DockWindowSeparator,
214 PE_DockWindowResizeHandle,
215
216 PE_Splitter,
217
218 PE_Panel,
219 PE_PanelPopup,
220 PE_PanelMenuBar,
221 PE_PanelDockWindow,
222
223 PE_TabBarBase,
224
225 PE_HeaderSection,
226 PE_HeaderArrow,
227 PE_StatusBarSection,
228
229 PE_GroupBoxFrame,
230
231 PE_Separator,
232
233 PE_SizeGrip,
234
235 PE_CheckMark,
236
237 PE_ScrollBarAddLine,
238 PE_ScrollBarSubLine,
239 PE_ScrollBarAddPage,
240 PE_ScrollBarSubPage,
241 PE_ScrollBarSlider,
242 PE_ScrollBarFirst,
243 PE_ScrollBarLast,
244
245 PE_ProgressBarChunk,
246
247 PE_PanelLineEdit,
248 PE_PanelTabWidget,
249
250 PE_WindowFrame,
251
252 PE_CheckListController,
253 PE_CheckListIndicator,
254 PE_CheckListExclusiveIndicator,
255
256 PE_PanelGroupBox,
257 PE_RubberBand,
258
259 // do not add any values below/greater this
260 PE_CustomBase = 0xf000000
261 };
262
263 enum StyleFlags {
264 Style_Default = 0x00000000,
265 Style_Enabled = 0x00000001,
266 Style_Raised = 0x00000002,
267 Style_Sunken = 0x00000004,
268 Style_Off = 0x00000008,
269 Style_NoChange = 0x00000010,
270 Style_On = 0x00000020,
271 Style_Down = 0x00000040,
272 Style_Horizontal = 0x00000080,
273 Style_HasFocus = 0x00000100,
274 Style_Top = 0x00000200,
275 Style_Bottom = 0x00000400,
276 Style_FocusAtBorder = 0x00000800,
277 Style_AutoRaise = 0x00001000,
278 Style_MouseOver = 0x00002000,
279 Style_Up = 0x00004000,
280 Style_Selected = 0x00008000,
281 Style_Active = 0x00010000,
282 Style_ButtonDefault = 0x00020000
283 };
284 typedef uint SFlags;
285
286 virtual void drawPrimitive( PrimitiveElement pe,
287 QPainter *p,
288 const QRect &amp;r,
289 const QColorGroup &amp;cg,
290 SFlags flags = Style_Default,
291 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
292
293
294 enum ControlElement {
295 CE_PushButton,
296 CE_PushButtonLabel,
297
298 CE_CheckBox,
299 CE_CheckBoxLabel,
300
301 CE_RadioButton,
302 CE_RadioButtonLabel,
303
304 CE_TabBarTab,
305 CE_TabBarLabel,
306
307 CE_ProgressBarGroove,
308 CE_ProgressBarContents,
309 CE_ProgressBarLabel,
310
311 CE_PopupMenuItem,
312 CE_MenuBarItem,
313
314 CE_ToolButtonLabel,
315 CE_MenuBarEmptyArea,
316 CE_PopupMenuScroller,
317 CE_DockWindowEmptyArea,
318 CE_PopupMenuVerticalExtra,
319 CE_PopupMenuHorizontalExtra,
320
321 CE_ToolBoxTab,
322 CE_HeaderLabel,
323
324 // do not add any values below/greater than this
325 CE_CustomBase = 0xf0000000
326 };
327
328 virtual void drawControl( ControlElement element,
329 QPainter *p,
330 const QWidget *widget,
331 const QRect &amp;r,
332 const QColorGroup &amp;cg,
333 SFlags how = Style_Default,
334 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
335 virtual void drawControlMask( ControlElement element,
336 QPainter *p,
337 const QWidget *widget,
338 const QRect &amp;r,
339 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
340
341 enum SubRect {
342 SR_PushButtonContents,
343 SR_PushButtonFocusRect,
344
345 SR_CheckBoxIndicator,
346 SR_CheckBoxContents,
347 SR_CheckBoxFocusRect,
348
349 SR_RadioButtonIndicator,
350 SR_RadioButtonContents,
351 SR_RadioButtonFocusRect,
352
353 SR_ComboBoxFocusRect,
354
355 SR_SliderFocusRect,
356
357 SR_DockWindowHandleRect,
358
359 SR_ProgressBarGroove,
360 SR_ProgressBarContents,
361 SR_ProgressBarLabel,
362
363 SR_ToolButtonContents,
364
365 SR_DialogButtonAccept,
366 SR_DialogButtonReject,
367 SR_DialogButtonApply,
368 SR_DialogButtonHelp,
369 SR_DialogButtonAll,
370 SR_DialogButtonAbort,
371 SR_DialogButtonIgnore,
372 SR_DialogButtonRetry,
373 SR_DialogButtonCustom,
374
375 SR_ToolBoxTabContents,
376
377 // do not add any values below/greater than this
378 SR_CustomBase = 0xf0000000
379 };
380
381 virtual QRect subRect( SubRect r, const QWidget *widget ) const = 0;
382
383
384 enum ComplexControl{
385 CC_SpinWidget,
386 CC_ComboBox,
387 CC_ScrollBar,
388 CC_Slider,
389 CC_ToolButton,
390 CC_TitleBar,
391 CC_ListView,
392
393 // do not add any values below/greater than this
394 CC_CustomBase = 0xf0000000
395 };
396
397 enum SubControl {
398 SC_None = 0x00000000,
399
400 SC_ScrollBarAddLine = 0x00000001,
401 SC_ScrollBarSubLine = 0x00000002,
402 SC_ScrollBarAddPage = 0x00000004,
403 SC_ScrollBarSubPage = 0x00000008,
404 SC_ScrollBarFirst = 0x00000010,
405 SC_ScrollBarLast = 0x00000020,
406 SC_ScrollBarSlider = 0x00000040,
407 SC_ScrollBarGroove = 0x00000080,
408
409 SC_SpinWidgetUp = 0x00000001,
410 SC_SpinWidgetDown = 0x00000002,
411 SC_SpinWidgetFrame = 0x00000004,
412 SC_SpinWidgetEditField = 0x00000008,
413 SC_SpinWidgetButtonField = 0x00000010,
414
415 SC_ComboBoxFrame = 0x00000001,
416 SC_ComboBoxEditField = 0x00000002,
417 SC_ComboBoxArrow = 0x00000004,
418 SC_ComboBoxListBoxPopup = 0x00000008,
419
420 SC_SliderGroove = 0x00000001,
421 SC_SliderHandle = 0x00000002,
422 SC_SliderTickmarks = 0x00000004,
423
424 SC_ToolButton = 0x00000001,
425 SC_ToolButtonMenu = 0x00000002,
426
427 SC_TitleBarLabel = 0x00000001,
428 SC_TitleBarSysMenu = 0x00000002,
429 SC_TitleBarMinButton = 0x00000004,
430 SC_TitleBarMaxButton = 0x00000008,
431 SC_TitleBarCloseButton = 0x00000010,
432 SC_TitleBarNormalButton = 0x00000020,
433 SC_TitleBarShadeButton = 0x00000040,
434 SC_TitleBarUnshadeButton = 0x00000080,
435
436 SC_ListView = 0x00000001,
437 SC_ListViewBranch = 0x00000002,
438 SC_ListViewExpand = 0x00000004,
439
440 SC_All = 0xffffffff
441 };
442 typedef uint SCFlags;
443
444
445 virtual void drawComplexControl( ComplexControl control,
446 QPainter *p,
447 const QWidget *widget,
448 const QRect &amp;r,
449 const QColorGroup &amp;cg,
450 SFlags how = Style_Default,
451#ifdef Q_QDOC
452 SCFlags sub = SC_All,
453#else
454 SCFlags sub = (uint)SC_All,
455#endif
456 SCFlags subActive = SC_None,
457 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
458 virtual void drawComplexControlMask( ComplexControl control,
459 QPainter *p,
460 const QWidget *widget,
461 const QRect &amp;r,
462 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
463
464 virtual QRect querySubControlMetrics( ComplexControl control,
465 const QWidget *widget,
466 SubControl sc,
467 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
468 virtual SubControl querySubControl( ComplexControl control,
469 const QWidget *widget,
470 const QPoint &amp;pos,
471 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
472
473
474 enum PixelMetric {
475 PM_ButtonMargin,
476 PM_ButtonDefaultIndicator,
477 PM_MenuButtonIndicator,
478 PM_ButtonShiftHorizontal,
479 PM_ButtonShiftVertical,
480
481 PM_DefaultFrameWidth,
482 PM_SpinBoxFrameWidth,
483
484 PM_MaximumDragDistance,
485
486 PM_ScrollBarExtent,
487 PM_ScrollBarSliderMin,
488
489 PM_SliderThickness, // total slider thickness
490 PM_SliderControlThickness, // thickness of the business part
491 PM_SliderLength, // total length of slider
492 PM_SliderTickmarkOffset, //
493 PM_SliderSpaceAvailable, // available space for slider to move
494
495 PM_DockWindowSeparatorExtent,
496 PM_DockWindowHandleExtent,
497 PM_DockWindowFrameWidth,
498
499 PM_MenuBarFrameWidth,
500
501 PM_TabBarTabOverlap,
502 PM_TabBarTabHSpace,
503 PM_TabBarTabVSpace,
504 PM_TabBarBaseHeight,
505 PM_TabBarBaseOverlap,
506
507 PM_ProgressBarChunkWidth,
508
509 PM_SplitterWidth,
510 PM_TitleBarHeight,
511
512 PM_IndicatorWidth,
513 PM_IndicatorHeight,
514 PM_ExclusiveIndicatorWidth,
515 PM_ExclusiveIndicatorHeight,
516 PM_PopupMenuScrollerHeight,
517 PM_CheckListButtonSize,
518 PM_CheckListControllerSize,
519 PM_PopupMenuFrameHorizontalExtra,
520 PM_PopupMenuFrameVerticalExtra,
521
522 PM_DialogButtonsSeparator,
523 PM_DialogButtonsButtonWidth,
524 PM_DialogButtonsButtonHeight,
525
526 PM_MDIFrameWidth,
527 PM_MDIMinimizedWidth,
528 PM_HeaderMargin,
529 PM_HeaderMarkSize,
530 PM_HeaderGripMargin,
531 PM_TabBarTabShiftHorizontal,
532 PM_TabBarTabShiftVertical,
533 PM_TabBarScrollButtonWidth,
534
535 PM_MenuBarItemSpacing,
536 PM_ToolBarItemSpacing,
537
538 // do not add any values below/greater than this
539 PM_CustomBase = 0xf0000000
540 };
541
542 virtual int pixelMetric( PixelMetric metric,
543 const QWidget *widget = 0 ) const = 0;
544
545
546 enum ContentsType {
547 CT_PushButton,
548 CT_CheckBox,
549 CT_RadioButton,
550 CT_ToolButton,
551 CT_ComboBox,
552 CT_Splitter,
553 CT_DockWindow,
554 CT_ProgressBar,
555 CT_PopupMenuItem,
556 CT_TabBarTab,
557 CT_Slider,
558 CT_Header,
559 CT_LineEdit,
560 CT_MenuBar,
561 CT_SpinBox,
562 CT_SizeGrip,
563 CT_TabWidget,
564 CT_DialogButtons,
565
566 // do not add any values below/greater than this
567 CT_CustomBase = 0xf0000000
568 };
569
570 virtual QSize sizeFromContents( ContentsType contents,
571 const QWidget *widget,
572 const QSize &amp;contentsSize,
573 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
574
575 enum StyleHint {
576 // ...
577 // the general hints
578 // ...
579 // disabled text should be etched, ala Windows
580 SH_EtchDisabledText,
581
582 // the GUI style enum, argh!
583 SH_GUIStyle,
584
585 // ...
586 // widget specific hints
587 // ...
588 SH_ScrollBar_BackgroundMode,
589 SH_ScrollBar_MiddleClickAbsolutePosition,
590 SH_ScrollBar_ScrollWhenPointerLeavesControl,
591
592 // QEvent::Type - which mouse event to select a tab
593 SH_TabBar_SelectMouseType,
594
595 SH_TabBar_Alignment,
596
597 SH_Header_ArrowAlignment,
598
599 // bool - sliders snap to values while moving, ala Windows
600 SH_Slider_SnapToValue,
601
602 // bool - key presses handled in a sloppy manner - ie. left on a vertical
603 // slider subtracts a line
604 SH_Slider_SloppyKeyEvents,
605
606 // bool - center button on progress dialogs, ala Motif, else right aligned
607 // perhaps this should be a Qt::Alignment value
608 SH_ProgressDialog_CenterCancelButton,
609
610 // Qt::AlignmentFlags - text label alignment in progress dialogs
611 // Center on windows, Auto|VCenter otherwize
612 SH_ProgressDialog_TextLabelAlignment,
613
614 // bool - right align buttons on print dialog, ala Windows
615 SH_PrintDialog_RightAlignButtons,
616
617 // bool - 1 or 2 pixel space between the menubar and the dockarea, ala Windows
618 // this *REALLY* needs a better name
619 SH_MainWindow_SpaceBelowMenuBar,
620
621 // bool - select the text in the line edit about the listbox when selecting
622 // an item from the listbox, or when the line edit receives focus, ala Windows
623 SH_FontDialog_SelectAssociatedText,
624
625 // bool - allows disabled menu items to be active
626 SH_PopupMenu_AllowActiveAndDisabled,
627
628 // bool - pressing space activates item, ala Motif
629 SH_PopupMenu_SpaceActivatesItem,
630
631 // int - number of milliseconds to wait before opening a submenu
632 // 256 on windows, 96 on motif
633 SH_PopupMenu_SubMenuPopupDelay,
634
635 // bool - should scrollviews draw their frame only around contents (ala Motif),
636 // or around contents, scrollbars and corner widgets (ala Windows) ?
637 SH_ScrollView_FrameOnlyAroundContents,
638
639 // bool - menubars items are navigatable by pressing alt, followed by using
640 // the arrow keys to select the desired item
641 SH_MenuBar_AltKeyNavigation,
642
643 // bool - mouse tracking in combobox dropdown lists
644 SH_ComboBox_ListMouseTracking,
645
646 // bool - mouse tracking in popupmenus
647 SH_PopupMenu_MouseTracking,
648
649 // bool - mouse tracking in menubars
650 SH_MenuBar_MouseTracking,
651
652 // bool - gray out selected items when loosing focus
653 SH_ItemView_ChangeHighlightOnFocus,
654
655 // bool - supports shared activation among modeless widgets
656 SH_Widget_ShareActivation,
657
658 // bool - workspace should just maximize the client area
659 SH_Workspace_FillSpaceOnMaximize,
660
661 // bool - supports popup menu comboboxes
662 SH_ComboBox_Popup,
663
664 // bool - titlebar has no border
665 SH_TitleBar_NoBorder,
666
667 // bool - stop scrollbar at mouse
668 SH_ScrollBar_StopMouseOverSlider,
669
670 //bool - blink cursort with selected text
671 SH_BlinkCursorWhenTextSelected,
672
673 //bool - richtext selections extend the full width of the docuemnt
674 SH_RichText_FullWidthSelection,
675
676 //bool - popupmenu supports scrolling instead of multicolumn mode
677 SH_PopupMenu_Scrollable,
678
679 // Qt::AlignmentFlags - text label vertical alignment in groupboxes
680 // Center on windows, Auto|VCenter otherwize
681 SH_GroupBox_TextLabelVerticalAlignment,
682
683 // Qt::QRgb - text label color in groupboxes
684 SH_GroupBox_TextLabelColor,
685
686 // bool - popupmenu supports sloppy submenus
687 SH_PopupMenu_SloppySubMenus,
688
689 // Qt::QRgb - table grid color
690 SH_Table_GridLineColor,
691
692 // QChar - Unicode character for password char
693 SH_LineEdit_PasswordCharacter,
694
695 // QDialogButtons::Button - default button
696 SH_DialogButtons_DefaultButton,
697
698 // QToolBox - Boldness of the selected page title
699 SH_ToolBox_SelectedPageTitleBold,
700
701 //bool - if a tabbar prefers not to have scroller arrows
702 SH_TabBar_PreferNoArrows,
703
704 //bool - if left button should cause an absolute position
705 SH_ScrollBar_LeftClickAbsolutePosition,
706
707 // QEvent::Type - which mouse event to select a list view expansion
708 SH_ListViewExpand_SelectMouseType,
709
710 //bool - if underline for accelerators
711 SH_UnderlineAccelerator,
712
713 // bool - QToolButton - if tool buttons should use a 3D frame
714 // when the mouse is over the button
715 SH_ToolButton_Uses3D,
716
717 // do not add any values below/greater than this
718 SH_CustomBase = 0xf0000000
719 };
720
721 virtual int styleHint( StyleHint stylehint,
722 const QWidget *widget = 0,
723 const QStyleOption&amp; = QStyleOption::Default,
724 QStyleHintReturn* returnData = 0
725 ) const = 0;
726
727
728 enum StylePixmap {
729 SP_TitleBarMinButton,
730 SP_TitleBarMaxButton,
731 SP_TitleBarCloseButton,
732 SP_TitleBarNormalButton,
733 SP_TitleBarShadeButton,
734 SP_TitleBarUnshadeButton,
735 SP_DockWindowCloseButton,
736 SP_MessageBoxInformation,
737 SP_MessageBoxWarning,
738 SP_MessageBoxCritical,
739 SP_MessageBoxQuestion,
740
741 // do not add any values below/greater than this
742 SP_CustomBase = 0xf0000000
743 };
744
745 virtual QPixmap stylePixmap( StylePixmap stylepixmap,
746 const QWidget *widget = 0,
747 const QStyleOption&amp; = QStyleOption::Default ) const = 0;
748
749
750 static QRect visualRect( const QRect &amp;logical, const QWidget *w );
751
752 static QRect visualRect( const QRect &amp;logical, const QRect &amp;bounding );
753
754
755
756
757 // Old 2.x QStyle API
758
759#ifndef QT_NO_COMPAT
760 int defaultFrameWidth() const
761 {
762 return pixelMetric( PM_DefaultFrameWidth );
763 }
764 void tabbarMetrics( const QWidget* t,
765 int&amp; hf, int&amp; vf, int&amp; ov ) const
766 {
767 hf = pixelMetric( PM_TabBarTabHSpace, t );
768 vf = pixelMetric( PM_TabBarTabVSpace, t );
769 ov = pixelMetric( PM_TabBarBaseOverlap, t );
770 }
771 QSize scrollBarExtent() const
772 {
773 return QSize(pixelMetric(PM_ScrollBarExtent),
774 pixelMetric(PM_ScrollBarExtent));
775 }
776#endif
777
778
779private:
780 QStylePrivate * d;
781
782#if defined(Q_DISABLE_COPY)
783 QStyle( const QStyle &amp; );
784 QStyle&amp; operator=( const QStyle &amp; );
785#endif
786};
787
788#endif // QT_NO_STYLE
789#endif // QSTYLE_H
790</pre>
791<!-- eof -->
792<p><address><hr><div align=center>
793<table width=100% cellspacing=0 border=0><tr>
794<td>Copyright &copy; 2007
795<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
796<td align=right><div align=right>Qt 3.3.8</div>
797</table></div></address></body>
798</html>
Note: See TracBrowser for help on using the repository browser.