LibEngsas
eabstractitemmodel.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2012 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef EABSTRACTITEMMODEL_H
21 #define EABSTRACTITEMMODEL_H
22 
23 #include "eglobal.h"
24 #include <QAbstractItemModel>
25 
36 class E_CORE_EXPORT EAbstractItemModel : public QAbstractItemModel
37 {
38  Q_OBJECT
39  public:
40  EAbstractItemModel(QObject *parent = 0);
41  inline virtual ~EAbstractItemModel(){};
42 
43  static void connectByPass(QObject *parent, EAbstractItemModel *child);
44  static void connectByPass(EAbstractItemModel *parent, QObject *child);
45 
46  protected slots:
53  virtual inline void errorByPass(const QString &message){ emit error(message); };
59  virtual inline void warningByPass(const QString &message){ emit warning(message); };
65  virtual inline void informationByPass(const QString &message){ emit information(message); };
66 
67  private slots:
68  void rowsInsertedByPass(const QModelIndex &parent, int start, int end);
69  void rowsRemovedByPass(const QModelIndex &parent, int start, int end);
70 
71  signals:
72  void error(QString msg);
73  void warning(QString msg);
74  void information(QString msg);
78  void eRowsInserted(const QModelIndex &parent, int start, int end);
82  void eRowsRemoved(const QModelIndex &parent, int start, int end);
83 };
84 
85 #endif // EABSTRACTITEMMODEL_H
Replacement of QAbstractItemModel to provide convenience signals for message handling.
Definition: eabstractitemmodel.h:36
virtual void informationByPass(const QString &message)
Definition: eabstractitemmodel.h:65
#define E_CORE_EXPORT
Definition: eglobal.h:107
virtual void errorByPass(const QString &message)
Definition: eabstractitemmodel.h:53
virtual void warningByPass(const QString &message)
Definition: eabstractitemmodel.h:59
virtual ~EAbstractItemModel()
Definition: eabstractitemmodel.h:41