Das K Desktop Environment

6.3. Properties of Qt supported Widgets

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:

6.3.1. QWidget Properties

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.

6.3.2. QButton inherited widgets

QButton is an abstract widget class that provides properties common to buttons.

Inherits QWidget

Inherited by QCheckBox, QPushButton and QRadioButton inherit QButton.

6.3.2.1. QCheckBox Properties

Inherits QWidget and QButton

  • General:

    • isChecked: (setChecked) defines is the checkbox is set checked on construction

6.3.2.2. QPushButton Properties

Inherits QWidget and QButton

  • 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.

6.3.2.3. QRadioButton Properties

Inherits QWidget and QButton

  • General:

    • isChecked: (setChecked) defines is the radio button is set checked on construction

6.3.3. QComboBox Properties

Inherits QWidget

( no additional properties for now)

6.3.4. QFrame inherited widgets

Inherits QWidget

For now only used as an abstract class.

6.3.4.1. QGroupBox Properties

Inherits QWidget and QFrame

  • General:

    • Title: (setTitle) sets the group box title that is displayed in the box frame.

6.3.4.2. QLCDNumber Properties

Inherits QWidget and QFrame

  • General:

    • NumDigits:(setNumDigits) sets the number of digits displayed in QLCDNumber

    • Value: (display) (public slot) sets the initial value for QLCDNumber

6.3.4.3. QLabel Properties

Inherits QWidget and QFrame

  • 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.

6.3.4.4. QProgressBar Properties

Inherits QWidget and QFrame

  • 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).

6.3.4.5. QScrollView

Inherits QWidget and QFrame

Inherited by QListBox (abstract for now)

Provides a scrollable widget that manages the display of a child widget by a vertical and horizontal scrollbar.

6.3.4.5.1. QListView

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:

6.3.4.6. QSpinBox Properties

Inherits QWidget and QFrame

  • 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:

6.3.4.7. QTableView inherited widgets

Inherits QWidget, QFrame and QTableView

Inherited by QListBox and QMultiLineEdit

6.3.4.7.1. QListBox Properties

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.

6.3.4.7.2. QMultiLineEdit Properties

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.

6.3.5. QLineEdit Properties

Inherits QWidget

6.3.6. QScrollBar Properties

Inherits QWidget and QRangeControl.

6.3.7. QSlider Properties

Inherits QWidget and QRangeControl.