From d157e66967f5749ee9bf207223566215c070217e Mon Sep 17 00:00:00 2001 From: Shyamnath Premnadh Date: Wed, 5 Oct 2022 11:12:41 +0200 Subject: 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 --- examples/charts/lineandbar/lineandbar.py | 10 ++++++---- examples/sql/books/bookdelegate.py | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') 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)) -- cgit v1.2.3