diff options
| author | Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io> | 2025-08-05 10:01:40 +0200 |
|---|---|---|
| committer | Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io> | 2025-08-05 17:35:52 +0200 |
| commit | 67086b4149da86427666967d11f3c0f33330b5b3 (patch) | |
| tree | c3a16a64d4847593840c35c11540189e5a41151a /src/widgets/doc/snippets/reading-selections/window.cpp | |
| parent | 965638584a9ed88d720a23f0c170c4f636839671 (diff) | |
Make snippets in widget folder compilable and add to the build system
Created a CMakeLists.txt file in the widgets folder and added snippets
to it.
Fixed related issues with missing includes and compilation errors.
Task-number: QTBUG-137566
Change-Id: Ief61c3675d8b4d5935bbb0cb951d3a9e82f437f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/reading-selections/window.cpp')
| -rw-r--r-- | src/widgets/doc/snippets/reading-selections/window.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/widgets/doc/snippets/reading-selections/window.cpp b/src/widgets/doc/snippets/reading-selections/window.cpp index fe1a79e331a..23b45917f54 100644 --- a/src/widgets/doc/snippets/reading-selections/window.cpp +++ b/src/widgets/doc/snippets/reading-selections/window.cpp @@ -15,9 +15,27 @@ #include <QMenuBar> #include <QStatusBar> -#include "model.h" #include "window.h" +class TableModel : public QAbstractTableModel +{ + Q_OBJECT +public: + TableModel(int rows, int columns, QObject *parent = nullptr) {} + + int rowCount(const QModelIndex &parent = QModelIndex()) const override { + return 0; + } + + int columnCount(const QModelIndex &parent = QModelIndex()) const override { + return 0; + } + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override { + return QVariant(); + } +}; + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { |
