diff options
author | Shyamnath Premnadh <[email protected]> | 2022-10-05 11:12:41 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <[email protected]> | 2022-10-06 06:34:00 +0000 |
commit | d157e66967f5749ee9bf207223566215c070217e (patch) | |
tree | b7420e3d34288a880b604b438cf6e939bde2cd88 | |
parent | c27712c48fead285a57bb0ba24186f28f21bcbe0 (diff) |
examples: fix errors on sql and charts
- examples/sql/books/bookdelegate.py - removed drawFocus(). No such
attribute exists for the base classes.
- examples/charts/lineandbar/lineandbar.py - setAxisX() and setAxisY()
are deprecated. The example is now aligned more with the C++ example.
Pick-to: 6.3
Change-Id: Iddf4f27db06ee574e1e849c753577c43224a9dc7
Reviewed-by: Cristian Maureira-Fredes <[email protected]>
-rw-r--r-- | examples/charts/lineandbar/lineandbar.py | 10 | ||||
-rw-r--r-- | examples/sql/books/bookdelegate.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/charts/lineandbar/lineandbar.py b/examples/charts/lineandbar/lineandbar.py index 142d011d6..62721c763 100644 --- a/examples/charts/lineandbar/lineandbar.py +++ b/examples/charts/lineandbar/lineandbar.py @@ -51,13 +51,15 @@ class TestChart(QMainWindow): self.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] self._axis_x = QBarCategoryAxis() self._axis_x.append(self.categories) - self.chart.setAxisX(self._axis_x, self._line_series) - self.chart.setAxisX(self._axis_x, self._bar_series) + self.chart.addAxis(self._axis_x, Qt.AlignBottom) + self._line_series.attachAxis(self._axis_x) + self._bar_series.attachAxis(self._axis_x) self._axis_x.setRange("Jan", "Jun") self._axis_y = QValueAxis() - self.chart.setAxisY(self._axis_y, self._line_series) - self.chart.setAxisY(self._axis_y, self._bar_series) + self.chart.addAxis(self._axis_x, Qt.AlignLeft) + self._line_series.attachAxis(self._axis_y) + self._bar_series.attachAxis(self._axis_y) self._axis_y.setRange(0, 20) self.chart.legend().setVisible(True) diff --git a/examples/sql/books/bookdelegate.py b/examples/sql/books/bookdelegate.py index 584203561..1d1dba86e 100644 --- a/examples/sql/books/bookdelegate.py +++ b/examples/sql/books/bookdelegate.py @@ -53,8 +53,6 @@ class BookDelegate(QSqlRelationalDelegate): painter.drawPixmap(x, y, self.star) x += width - # Since we draw the grid ourselves: - self.drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1)) pen = painter.pen() painter.setPen(option.palette.color(QPalette.Mid)) |