diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2022-10-05 11:12:41 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-10-07 06:15:35 +0000 |
commit | 59f16a52788476d7e48a3a39af67dcab21076953 (patch) | |
tree | e9243e3e31c02e72465c16d25bc657833b39c867 /examples | |
parent | 284eeb80e29cb346de763dbca1129d88e43e86d3 (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.
Change-Id: Iddf4f27db06ee574e1e849c753577c43224a9dc7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit d157e66967f5749ee9bf207223566215c070217e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-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 bfe699199..cba60e970 100644 --- a/examples/charts/lineandbar/lineandbar.py +++ b/examples/charts/lineandbar/lineandbar.py @@ -89,13 +89,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 1af914d7d..0c3f83f27 100644 --- a/examples/sql/books/bookdelegate.py +++ b/examples/sql/books/bookdelegate.py @@ -90,8 +90,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)) |