Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.1, 6.5.2, 6.6.0
-
None
-
Windows, MinGW 11.2.0 64-bit C++
Description
The editable axis labels feature not working.
I only tested 6.5.1, 6.5.2 and 6.6.0; the last working version I tested is 5.15.2
The mouseDoubleClickEvent is not passed to the EditableAxisLabel; Hover and ContextMenu events are passed, as well as Window events.
The bug can be reproduced with the code below (try to double-click on axis labels):
#include <QApplication> #include <QGraphicsScene> #include <QGraphicsView> #include <QtCharts/QChart> #include <QtCharts/QChartView> #include <QtCharts/QLineSeries> #include <QtCharts/QValueAxis> QT_USE_NAMESPACE class View : public QGraphicsView { public: View(QWidget *parent = nullptr) : QGraphicsView(parent) { m_scene = new QGraphicsScene(this); m_chart = new QChart(); // Add a dummy line series to the chart QLineSeries *series = new QLineSeries(); series->append(0, 0); series->append(1, 2); series->append(2, 4); m_chart->addSeries(series); QValueAxis *axisX = new QValueAxis; axisX->setTitleText("X Axis"); axisX->setLabelsEditable(true); // Enable editable labels QValueAxis *axisY = new QValueAxis; axisY->setTitleText("Y Axis"); axisY->setLabelsEditable(true); // Enable editable labels m_chart->addAxis(axisX, Qt::AlignBottom); m_chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisX); series->attachAxis(axisY); m_chart->setMinimumSize(400, 300); m_scene->addItem(m_chart); setScene(m_scene); } private: QGraphicsScene *m_scene; QChart *m_chart; }; int main(int argc, char *argv[]) { QApplication a(argc, argv); View view; view.show(); return a.exec(); }