Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-04 09:53:26

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QSTRINGLISTMODEL_H
0006 #define QSTRINGLISTMODEL_H
0007 
0008 #include <QtCore/qabstractitemmodel.h>
0009 #include <QtCore/qstringlist.h>
0010 
0011 QT_REQUIRE_CONFIG(stringlistmodel);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit QStringListModel(QObject *parent = nullptr);
0020     explicit QStringListModel(const QStringList &strings, QObject *parent = nullptr);
0021 
0022     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0023     QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
0024 
0025     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0026     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
0027     bool clearItemData(const QModelIndex &index) override;
0028 
0029     Qt::ItemFlags flags(const QModelIndex &index) const override;
0030 
0031     bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0032     bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0033     bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override;
0034 
0035     QMap<int, QVariant> itemData(const QModelIndex &index) const override;
0036     bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles) override;
0037 
0038     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0039 
0040     QStringList stringList() const;
0041     void setStringList(const QStringList &strings);
0042 
0043     Qt::DropActions supportedDropActions() const override;
0044 
0045 private:
0046     Q_DISABLE_COPY(QStringListModel)
0047     QStringList lst;
0048 };
0049 
0050 QT_END_NAMESPACE
0051 
0052 #endif // QSTRINGLISTMODEL_H