Skip to main content

QCustomGanttChart

Pro widget

QCustomGanttChart ships in Custom Widgets Pro. It is not part of the free GPLv3 package from 2.6.0 onward — the free package keeps the import path so Qt Designer forms still load, and installing Pro activates the widget with no code change. Releases up to 2.5.0 included it under the GPLv3.

Pro is licensed software and is not installable from PyPI — the name there is a pointer package with no widgets in it. Licence holders download the wheel from their account:

# https://portal.customwidgets.org/downloads
pip install <the downloaded .whl>

See plans

QCustomGanttChart

A horizontal timeline / gantt of rounded pill bars.

Every ROW is one rounded "pill" bar placed on a shared numeric x-axis by its start and length; the row LABEL (e.g. a date) sits on the left, the row VALUE is printed at the right end of the bar, and an optional leading circular ICON (a QPixmap clipped to a circle) or coloured dot marks the bar's start. Bars are coloured by CATEGORY (colorsCsv). A light x-grid with tick labels runs underneath. This is the "projects timeline" viz. Painted (no QtCharts) so it is crisp and self-contained.

Give rows in code with setData([...]) — each row a dict {"label","start","length","category","value","icon"} (icon = a path or QPixmap, optional) — or in Qt Designer with dataCsv (rows by ';', fields "label,start,length,category,value"). xMax/gridStep set the axis; colours are qproperties so a theme flips them on switch.

At a glance​

TierPro
Importfrom Custom_Widgets.QCustomGanttChart import QCustomGanttChart
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomGanttChart import QCustomGanttChart

widget = QCustomGanttChart()

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomGanttChart in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
dataCsvstring—
colorsCsvstring#8fe36b,#f6912b,#ffffff
textColorsCsvstring#1c1c20,#1c1c20,#1c1c20
xMaxfloat30.0
gridStepfloat5.0
barHeightint30
labelColorcolor#c7c9cf
axisTextColorcolor#7d7f88
gridColorcolor#2f2f35
showGridboolTrue
showMarkersboolTrue

Methods​

MethodDescription
axisTextColor(*args, **kwargs)Axis text color.
barHeight(*args, **kwargs)Bar height.
colorsCsv(*args, **kwargs)Colors csv.
data()Data.
dataCsv(*args, **kwargs)Data csv.
gridColor(*args, **kwargs)Grid color.
gridStep(*args, **kwargs)Grid step.
labelColor(*args, **kwargs)Label color.
setColors(fills, texts=None)Set the colors.
setData(rows)Set the data.
showGrid(*args, **kwargs)Show the grid.
showMarkers(*args, **kwargs)Show the markers.
textColorsCsv(*args, **kwargs)Text colors csv.
xMax(*args, **kwargs)X max.

QCustomAreaChart · QCustomBarChart · QCustomBeeswarm · QCustomBubbleChart · QCustomCandlestickChart · QCustomCompass · QCustomCompassDial · QCustomDivergingBarChart