aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/charts/lineandbar/lineandbar.py10
-rw-r--r--examples/sql/books/bookdelegate.py2
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))