Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] problem with QStringList in a Model class?
Forum Updated to NodeBB v4.3 + New Features

[solved] problem with QStringList in a Model class?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shalongbasi
    wrote on last edited by
    #1

    I am trying to build a table model, but when compiled, the error genereated "field stepTable has incomplete type", what does that mean?

    another question is that what's the best data struct to hold a two demisional string matrix. thanks

    @class steptablemodel : public QAbstractTableModel
    {
    Q_OBJECT
    public:
    explicit steptablemodel(QObject *parent = 0);
    steptablemodel(QStringList tablelist, QObject *parent = 0);
    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;

    signals:

    public slots:

    private:
    QStringList stepTable;
    }; @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you @include <QStringList>@

      in your header ?

      On a related note Qt offers a "QStringListModel":http://qt-project.org/doc/qt-4.8/qstringlistmodel.html

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shalongbasi
        wrote on last edited by
        #3

        thanks. I want a two demension table view. so QStringListModel does not fit that.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved