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. Error::-> "aggregate QSet<QPersistentModelIndex> checklist' has incomplete type and cannot be defined"
Forum Updated to NodeBB v4.3 + New Features

Error::-> "aggregate QSet<QPersistentModelIndex> checklist' has incomplete type and cannot be defined"

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 3.5k 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.
  • K Offline
    K Offline
    Ketan Shah
    wrote on last edited by
    #1

    Hii, I am getting the follwing error,can any1 help me..

    Error::-> "aggregate QSet<QPersistentModelIndex> checklist' has incomplete type and cannot be defined"

    below is my code..

    @
    standarditemmodel::standarditemmodel(QObject *parent) :
    QStandardItemModel(parent)
    {
    QSet <QPersistentModelIndex> checklist;
    }

    QVariant standarditemmodel::data(const QModelIndex& index, int role) const
    {
    if (role == Qt::CheckStateRole) return checklist.contains(index) ? Qt::Checked : Qt::Unchecked;
    return QStandardItemModel::data(index, role);
    }

    Qt::ItemFlags standarditemmodel::flags(const QModelIndex& index) const
    {
    return QStandardItemModel::flags(index) | Qt::ItemIsUserCheckable;
    }

    bool standarditemmodel::setData(const QModelIndex& index, const QVariant& value, int role)
    {
    if (role == Qt::CheckStateRole)
    {
    if (value == Qt::Checked)
    checklist.insert(index);
    else checklist.remove(index);
    emit dataChanged(index, index);
    return true;
    }
    return QStandardItemModel::setData(index, value, role);
    }
    @

    [edit: code highlighted / Denis Kormalev]

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tdmatsu
      wrote on last edited by
      #2

      how are the header files included?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        Hm, strange bug with bolding all text. And nothing wrong in first post. Marius, do you see?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mgran
          wrote on last edited by
          #4

          [quote author="Denis Kormalev" date="1306693935"]Hm, strange bug with bolding all text. And nothing wrong in first post. Marius, do you see?[/quote]

          Strange indeed, thanks for reporting Denis.

          Project Manager - Qt Development Frameworks

          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