Das KDevelop-Programmierhandbuch: Leitfaden zur C++-Anwendungsentwicklung für das K Desktop Environment (KDE) mit Hilfe der KDevelop-IDE in der Version 1.2 | ||
---|---|---|
Zurück | Kapitel 6. The Dialogeditor: Where your Dialogs are Build | Vor |
The following chapter gives a complete overview over the currently supported widgets of the Qt toolkit. To achieve a better understanding of the properties, these are separated to their inheritance. As all of them inherit QWidget, this class is described first. All QWidget properties are available for all other widgets as well, so these are not listed for them again. For widget groups that inherit an abstract subclass of QWidget as their base-class, the base-classes' properties are listed first (though this class does not provide a widget in the dialogeditor itself). Then the widget properties for the available widget of the group contains the properties that are specific to it. For a better understanding the inheritance tree of the available widgets is listed below:
QButton (abstract)
QFrame (abstract for now)
QScrollView (abstract for now)
QTableView (abstract)
QWidget is the base class for almost all widgets in Qt and KDE. Therefore widgets that inherit QWidget will allow to use the same settings in most cases.
Appearance:
BgColor: Background color of the widget
BgMode: Background mode of the widget
BgPalColor: Color pallette for the background
BgPixmap: filename for a background pixmap
Cursor: Cursor over the widget
Font: Font for the widget
MaskBitmap: filename for a masking bitmap.
C++ Code:
AcceptsDrops: if set to true, the widget item will accept drops by drag'n drop mechanisms (Qt drag'n drop protocol, not KDE 1.x !)
Connections: connects the item's signals to slots
FocusProxy: the item that gives its focus to this widget.
HasFocus: sets if the item has the focus by default. Mind that only one item per dialog can have this value as true
ResizeToParent: resizes the widget to its parent's size (not visible in editing mode)
VarName: Variable name of the item. Change this to names that describe the item's purpose.
General:
IsEnabled: sets if the widget will accept user events
IsHidden: sets the item to be visible(false) or hidden(true)
Name: sets the name of the widget. Mind that the name is different from the VarName in C++ Code.
Geometry:
Height: height of the item
IsFixedSize:
MaxHeight: maximum value for Height
MaxWidth: maximum value for Width
MinHeight: minimum value for Height
MinWidth: minimum value for Width
SizeIncX: pixel steps for resize actions to X direction
SizeIncY: pixel steps for resize actions to Y direction
Width: width of the item
X: position horizontal, counted from the left corner
Y: position vertical, counted up to down
QButton is an abstract widget class that provides properties common to buttons.
Inherits QWidget
Inherited by QCheckBox, QPushButton and QRadioButton inherit QButton.
Appearance:
setPixmap: sets the pixmap filename to use
General:
setText: the text on labels, buttons and boxes, also pre-set text for lineedits.
setAutoRepeat: if enabled, the clicked() signal is emitted at regular intervals while the button is down. No effect on toggle buttons.
setAutoResize: Enables auto-resizing if TRUE. When auto-resize is enabled, the button will resizes itself whenever the contents changes.
General:
isChecked: (setChecked) defines is the checkbox is set checked on construction
General:
isAutoDefault: (setAutoDefault) the auto-default button becomes the default push button if it receives the keyboard input focus.
isDefault: (setDefault) there can be only one default button and it is only allowed to use in a dialog (see QDialog). The default button emits clicked() if the user presses the Enter key.
isMenuButton: (setIsMenuButton) tells the button to draw a menu indication triangle if enabled. The menu has to be inserted separately.
isToggleButton::(setToggleButton) makes a push button a toggle button, so the button has a similar state as check boxes.
isToggledOn: (setOn) (public slot) switches a toggle button on.
General:
isChecked: (setChecked) defines is the radio button is set checked on construction
Inherits QWidget
For now only used as an abstract class.
Appearance:
Margin (setMargin): sets the margin, which is the distance from the innermost pixel of the frame and the outermost pixel of the contents.
General:
Title: (setTitle) sets the group box title that is displayed in the box frame.
General:
NumDigits:(setNumDigits) sets the number of digits displayed in QLCDNumber
Value: (display) (public slot) sets the initial value for QLCDNumber
Appearance:
Margin (setMargin): sets the margin, which is for QLabel the distance from the frame to the first letter of the label text, depending on the alignment of the label.
C++ Code:
Buddy: (setBuddy) sets the buddy widget of the label.
General:
Text: (setText) sets the label text.
isAutoResize: (setAutoResize) if TRUE, the label will resize itself if the contents changes. The top left corner is not moved.
General:
TotalSteps: (setTotalSteps) (public slot) sets the total steps of the progress bar. During the iteration of your action to display the progress, you have to call setProgress(int) to advance the progress step displayed to (int).
Inherited by QListBox (abstract for now)
Provides a scrollable widget that manages the display of a child widget by a vertical and horizontal scrollbar.
Inherits QWidget, QFrame and QListView
Provides a list view to display hierarchical data either in a table or a tree. Manages itself by scrollbars through QScrollView.
Appearance:
ListViewFont: (setFont()) Sets the font of the ListView items
ListViewPalette: (setPalette()) Sets the palette of the list view items
TreeStepSize: (setTreeStepSize(int)) Offset of pixels of a child item to its parent item
hScrollBarMode: Scrollbar mode provided by QScrollView for the horizontal scrollbar
isAllColumnsShowFocus: (setAllColumnsShowFocus(bool)) displays focus on all columns of an item.
isMultiSelection: enables multi-selection of list items
isRootDecorated: enables the + and - decoration to open and close trees
vScrollBarMode:Scrollbar mode provided by QScrollView for the vertical scrollbar
General:
Entries: lets you insert a list of entries that are pre-set as QListViewItems.
isAutoUpdate:
General:
MaxValue: the maximum value the user can choose
MinValue: the minimum value the user can choose
Prefix:
Suffix:
Value: the pre-set value when the widget is shown
isWrapping:
Inherits QWidget, QFrame and QTableView
Inherited by QListBox and QMultiLineEdit
Inherits QWidget, QFrame and QTableView
General:
isAutoBottomScrollBar: (setAutoBottomScrollBar)
isAutoScroll: (setAutoScroll)
isAutoScrollBar: (setAutoScrollBar)
isAutoUpdate: (setAutoUpdate)
isBottomScrollBar: (setBottomScrollBar)
isDragSelect: (setDragSelect)
isSmoothScrolling: (setSmoothScrolling)
Geometry:
setFixedVisibleLines: sets a fixed height for the widget so that the given number of text lines are displayed using the current font.
Inherits QWidget, QFrame and QTableView
General:
Text: (setText) (public slot) sets the text of the widget.
isAutoUpdate: (setAutoUpdate) used to avoid flicker during large changes; the view is not updated if disabled.
isOverWriteMode: (setOverwriteMode) (public slot) sets overwrite enabled or disabled.
isReadOnly: (setReadOnly) (public slot) sets the widget text to read only; disables text input.
isTextSelected: (selectAll)(public slot) marks the whole text selected
Geometry:
setFixedVisibleLines: sets a fixed height for the widget so that the given number of text lines are displayed using the current font.
Inherits QWidget
General:
CursorPosition: (setCursorPosition) sets the default cursor position.
MaxLength: (setMaxLength) sets the maximum string length
Text: (setText) (public slot) sets the contents displayed on construction
hasFrame: (setFrame) draws the line edit within a two-pixel frame if enabled.
isTextSelected: (selectAll) (public slot) sets the text to be selected.
Inherits QWidget and QRangeControl.
General:
MaxValue: sets the maximum slider value; used in constructor (optional)
MinValue: sets the minimum slider value; used in constructor (optional)
Orientation: (setOrientation) sets the orientation of the scrollbar to horizontal or vertical.
Value: sets the initial value of the scrollbar in the constructor (optional)
isTracking: (setTracking) if enabled, the scrollbar emits valueChanged() whenever the bar is dragged; otherwise only on mouse release.
Inherits QWidget and QRangeControl.
General:
MaxValue: sets the maximum slider value; used in constructor (optional)
MinValue: sets the minimum slider value; used in constructor (optional)
Orientation: (setOrientation) sets the orientation of the slider to horizontal or vertical.
Value: (setValue) (public slot) uses QRangeControl::setValue() to set the value.
isTracking:(setTracking) if enabled, the slider emits valueChanged() whenever the slider is dragged; otherwise only on mouse release.