Previous topic

qarbon.qt.gui.color

Next topic

qarbon.qt.gui.icon

This Page

qarbon.qt.gui.groupbox

A colapsable container widget with (optional) title.

Here is a simple example that shows how to create a GroupBox with some content inside:

from qarbon.external.qt import QtGui
from qarbon.qt.gui.application import Application
from qarbon.qt.gui.icon import Icon
from qarbon.qt.gui.groupbox import GroupBox

app = Application()
panel = QtGui.QWidget()
layout = QtGui.QVBoxLayout()
panel.setLayout(layout)
gb = GroupBox()
layout.addWidget(gb)

gb.title = "Configuration"
gb.icon = Icon("applications-accessories")

content = QtGui.QWidget()
gb.setContent(content)
contentLayout = QtGui.QHBoxLayout()
content.setLayout(contentLayout)
label = QtGui.QLabel("File:")
edit = QtGui.QLineEdit()
button = QtGui.QPushButton(Icon("folder-open"), "Open a file...")
contentLayout.addWidget(label)
contentLayout.addWidget(edit)
contentLayout.addWidget(button)

panel.show()
app.exec_()

Inheritance diagram of GroupBox

Classes

GroupBox An expandable/collapsible container widget
class qarbon.qt.gui.groupbox.GroupBox(parent=None)[source]

Bases: PyQt4.QtGui.QWidget

An expandable/collapsible container widget

DefaultContentVisible = True
DefaultTitleBarVisible = True
DefaultTitleBarHeight = 16
DefaultStyle = {'content_start_color': 'rgb(224, 224, 224)', 'content_border_radius': '4px', 'title_stop_color': 'rgb(0, 65, 200)', 'title_border_radius': '4px', 'title_font_color': 'white', 'title_start_color': 'rgb(60, 150, 255)', 'content_stop_color': 'rgb(255, 255, 255)'}
content()[source]

Returns the contents widget

Returns:the current content widget or None if no content is set
Return type:QWidget
setContent(qwidget)[source]

Sets the content widget

Parameters:qwidget (QWidget) – the content widget or None
titleBar()[source]

Returns the title bar widget

Returns:the title bar widget
Return type:QFrame
titleButton()[source]

Returns the title button widget

Returns:the title button widget
Return type:QToolButton
collapseButton()[source]

Returns the collapse button widget

Returns:the collapse button widget
Return type:QToolButton
setTitle(title)[source]

Sets this widget’s title

:param title:the new widget title :type title: str

getTitle()[source]

Returns this widget’s title

Returns:this widget’s title
Return type:str
setTitleIcon(icon)[source]

Sets this widget’s title icon

Parameters:icon – (Qt.QIcon) the new widget title icon
getTitleIcon()[source]

Returns this widget’s title icon

Returns:this widget’s title icon
Return type:QIcon
switchContentVisible()[source]

Switches this widget’s contents visibility

isContentVisible()[source]

Returns this widget’s contents visibility

Returns:this widget’s contents visibility
Return type:bool
resetContentVisible()[source]

Resets this widget’s contents visibility

setContentVisible(show)[source]

Sets this widget’s contents visibility

Parameters:show (bool) – the new widget contents visibility
isTitleVisible()[source]

Returns this widget’s title visibility

Returns:this widget’s title visibility
Return type:bool
resetTitleVisible()[source]

Resets this widget’s title visibility

setTitleVisible(show)[source]

Sets this widget’s title visibility

Parameters:show (bool) – the new widget title visibility
getTitleHeight()[source]

Returns this widget’s title height

Returns:this widget’s title height
Return type:int
setTitleHeight(height)[source]

Sets this widget’s title height

Parameters:height (int) – the new widget title height
resetTitleHeight()[source]

Resets this widget’s title height

getStyleMap()[source]

Returns this widget’s style

Returns:this widget’s style
Return type:dict
setStyleMap(style_map)[source]

Sets this widget’s title style Used key/values for style_map:

  • ‘title_start_color’ : brush (Ex.: ‘#E0E0E0’)
  • ‘title_stop_color’ : brush (Ex.: ‘#E0E0E0’)
  • ‘title_font_color’ : brush (Ex.: ‘#E0E0E0’)
  • ‘title_border_radius’: radius (Ex.: ‘5px’)
  • ‘content_start_color’ : brush (Ex.: ‘#E0E0E0’)
  • ‘content_stop_color’ : brush (Ex.: ‘#E0E0E0’)
  • ‘content_border_radius’: radius (Ex.: ‘5px’)
Parameters:style_map (dict) – the new widget title style
resetStyleMap()[source]

Resets this widget’s title style

classmethod getQtDesignerPluginInfo()[source]
title = <PyQt4.QtCore.pyqtProperty object at 0x36d26d0>

This property contains the widget’s title

Access functions:

titleIcon = <PyQt4.QtCore.pyqtProperty object at 0x36d2710>

This property contains the widget’s title icon

Access functions:

titleHeight = <PyQt4.QtCore.pyqtProperty object at 0x36d2750>

This property contains the widget’s title height

Access functions:

titleVisible = <PyQt4.QtCore.pyqtProperty object at 0x36d2790>

This property contains the widget’s title visibility

Access functions:

styleMap = <PyQt4.QtCore.pyqtProperty object at 0x36d27d0>

This property contains the widget’s style map

Access functions:

contentVisible = <PyQt4.QtCore.pyqtProperty object at 0x36d2810>

This property contains the widget’s content’s visibility

Access functions: