1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.core.stringlistmodel; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.abstractitemmodel; 17 import qt.core.map; 18 import qt.core.namespace; 19 import qt.core.object; 20 import qt.core.stringlist; 21 import qt.core.variant; 22 import qt.helpers; 23 24 /+ QT_REQUIRE_CONFIG(stringlistmodel); +/ 25 26 27 /// Binding for C++ class [QStringListModel](https://doc.qt.io/qt-6/qstringlistmodel.html). 28 class /+ Q_CORE_EXPORT +/ QStringListModel : QAbstractListModel 29 { 30 mixin(Q_OBJECT); 31 public: 32 /+ explicit +/this(QObject parent = null); 33 /+ explicit +/this(ref const(QStringList) strings, QObject parent = null); 34 35 override int rowCount(ref const(QModelIndex) parent = globalInitVar!QModelIndex) const; 36 override QModelIndex sibling(int row, int column, ref const(QModelIndex) idx) const; 37 38 override QVariant data(ref const(QModelIndex) index, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const; 39 override bool setData(ref const(QModelIndex) index, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole); 40 override bool clearItemData(ref const(QModelIndex) index); 41 42 override /+ Qt:: +/qt.core.namespace.ItemFlags flags(ref const(QModelIndex) index) const; 43 44 override bool insertRows(int row, int count, ref const(QModelIndex) parent = globalInitVar!QModelIndex); 45 override bool removeRows(int row, int count, ref const(QModelIndex) parent = globalInitVar!QModelIndex); 46 override bool moveRows(ref const(QModelIndex) sourceParent, int sourceRow, int count, ref const(QModelIndex) destinationParent, int destinationChild); 47 48 override QMap!(int, QVariant) itemData(ref const(QModelIndex) index) const; 49 override bool setItemData(ref const(QModelIndex) index, ref const(QMap!(int, QVariant)) roles); 50 51 override void sort(int column, /+ Qt:: +/qt.core.namespace.SortOrder order = /+ Qt:: +/qt.core.namespace.SortOrder.AscendingOrder); 52 53 final QStringList stringList() const; 54 final void setStringList(ref const(QStringList) strings); 55 56 override /+ Qt:: +/qt.core.namespace.DropActions supportedDropActions() const; 57 58 private: 59 /+ Q_DISABLE_COPY(QStringListModel) +/ 60 QStringList lst; 61 mixin(CREATE_CONVENIENCE_WRAPPERS); 62 } 63