Changeset View
Changeset View
Standalone View
Standalone View
examples/NoValues/mainwindow.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 41 | { | |||
---|---|---|---|---|---|
42 | //qDebug() << "EmptyModel::EmptyModel()"; | 42 | //qDebug() << "EmptyModel::EmptyModel()"; | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | ~EmptyModel() | 45 | ~EmptyModel() | ||
46 | { | 46 | { | ||
47 | //qDebug() << "EmptyModel::~EmptyModel()"; | 47 | //qDebug() << "EmptyModel::~EmptyModel()"; | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | int columnCount( const QModelIndex& parent = QModelIndex() ) const Q_DECL_OVERRIDE | 50 | int columnCount( const QModelIndex& parent = QModelIndex() ) const override | ||
51 | { | 51 | { | ||
52 | Q_UNUSED( parent ); | 52 | Q_UNUSED( parent ); | ||
53 | //qDebug() << "EmptyModel::columnCount(...)"; | 53 | //qDebug() << "EmptyModel::columnCount(...)"; | ||
54 | return 0; | 54 | return 0; | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | int rowCount( const QModelIndex& parent = QModelIndex() ) const Q_DECL_OVERRIDE | 57 | int rowCount( const QModelIndex& parent = QModelIndex() ) const override | ||
58 | { | 58 | { | ||
59 | Q_UNUSED( parent ); | 59 | Q_UNUSED( parent ); | ||
60 | //qDebug() << "EmptyModel::rowCount(...)"; | 60 | //qDebug() << "EmptyModel::rowCount(...)"; | ||
61 | return 0; | 61 | return 0; | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | 64 | | |||
65 | // NOTE: The following method will not be called by KD Chart, | 65 | // NOTE: The following method will not be called by KD Chart, | ||
66 | // because the model is returning 0 for columnCount() / rowCount(). | 66 | // because the model is returning 0 for columnCount() / rowCount(). | ||
67 | QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE | 67 | QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override | ||
68 | { | 68 | { | ||
69 | Q_UNUSED( role ); | 69 | Q_UNUSED( role ); | ||
70 | qDebug() << "EmptyModel::data(" << index.row() << index.column() << ")"; | 70 | qDebug() << "EmptyModel::data(" << index.row() << index.column() << ")"; | ||
71 | Q_ASSERT_X( false, "EmptyModel::data", "We should not end here..." ); | 71 | Q_ASSERT_X( false, "EmptyModel::data", "We should not end here..." ); | ||
72 | return QVariant(); | 72 | return QVariant(); | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const Q_DECL_OVERRIDE | 75 | QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const override | ||
76 | { | 76 | { | ||
77 | Q_UNUSED( row ); | 77 | Q_UNUSED( row ); | ||
78 | Q_UNUSED( column ); | 78 | Q_UNUSED( column ); | ||
79 | Q_UNUSED( parent ); | 79 | Q_UNUSED( parent ); | ||
80 | //qDebug() << "EmptyModel::index(" << row << column << ")"; | 80 | //qDebug() << "EmptyModel::index(" << row << column << ")"; | ||
81 | return QModelIndex(); | 81 | return QModelIndex(); | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | QModelIndex parent( const QModelIndex& parent ) const Q_DECL_OVERRIDE | 84 | QModelIndex parent( const QModelIndex& parent ) const override | ||
85 | { | 85 | { | ||
86 | Q_UNUSED( parent ); | 86 | Q_UNUSED( parent ); | ||
87 | //qDebug() << "EmptyModel::parent(...)"; | 87 | //qDebug() << "EmptyModel::parent(...)"; | ||
88 | return QModelIndex(); | 88 | return QModelIndex(); | ||
89 | } | 89 | } | ||
90 | }; | 90 | }; | ||
91 | 91 | | |||
92 | MainWindow::MainWindow( QWidget* parent ) : | 92 | MainWindow::MainWindow( QWidget* parent ) : | ||
Show All 33 Lines |