/***************************************************************************
 *   Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl>                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef CONFIGTABLEVIEW_H
#define CONFIGTABLEVIEW_H

#include <QTableView>
#include <QVariant>

class ConfigTableView : public QTableView
{
Q_OBJECT
Q_PROPERTY( QVariant value READ getValue WRITE setValue USER true)
public:
  ConfigTableView(QWidget* w);
  /**
    Model should also implement VariantSerializable or getValue() and setValue() will not work
  */
  virtual void setModel (QAbstractItemModel*);
  
  /** Before using getValue() or setValue() set model which implements VariantSerializable */
  QVariant getValue() const;
  void setValue(const QVariant& data);
signals:
  void modelDataChanged();
};

#endif // CONFIGTABLEVIEW_H
