X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fabstractitemview.h;h=d7fd4881f19b0503d9596a62653c3578981ce729;hp=8ae6d22bbaaf3a55fa15154def761477dcfe6e04;hb=45645a28bdc5b6c1052b3e4cebf8cc80832d205a;hpb=1cb02004ee5973b89368bd84f234d4652794690d diff --git a/src/uisupport/abstractitemview.h b/src/uisupport/abstractitemview.h index 8ae6d22b..d7fd4881 100644 --- a/src/uisupport/abstractitemview.h +++ b/src/uisupport/abstractitemview.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,46 +18,44 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTITEMVIEW_H -#define ABSTRACTITEMVIEW_H +#pragma once -#include +#include "uisupport-export.h" + +#include #include +#include #include #include -#include -#include #include +#include -class AbstractItemView : public QWidget +class UISUPPORT_EXPORT AbstractItemView : public QWidget { Q_OBJECT public: - AbstractItemView(QWidget *parent = 0); + AbstractItemView(QWidget* parent = nullptr); - inline QAbstractItemModel *model() { return _model; } - void setModel(QAbstractItemModel *model); + inline QAbstractItemModel* model() { return _model; } + void setModel(QAbstractItemModel* model); - inline QItemSelectionModel *selectionModel() const { return _selectionModel; } - void setSelectionModel(QItemSelectionModel *selectionModel); + inline QItemSelectionModel* selectionModel() const { return _selectionModel; } + void setSelectionModel(QItemSelectionModel* selectionModel); inline QModelIndex currentIndex() const { return _selectionModel->currentIndex(); } protected slots: - virtual void closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint) {}; - virtual void commitData(QWidget *) {}; - virtual void currentChanged(const QModelIndex &, const QModelIndex &) {}; - virtual void dataChanged(const QModelIndex &, const QModelIndex &) {}; - virtual void editorDestroyed(QObject *) {}; - virtual void rowsAboutToBeRemoved(const QModelIndex &, int, int) {}; - virtual void rowsInserted(const QModelIndex &, int, int) {}; - virtual void selectionChanged(const QItemSelection &, const QItemSelection &) {}; + virtual void closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint){}; + virtual void commitData(QWidget*){}; + virtual void currentChanged(const QModelIndex&, const QModelIndex&){}; + virtual void dataChanged(const QModelIndex&, const QModelIndex&){}; + virtual void editorDestroyed(QObject*){}; + virtual void rowsAboutToBeRemoved(const QModelIndex&, int, int){}; + virtual void rowsInserted(const QModelIndex&, int, int){}; + virtual void selectionChanged(const QItemSelection&, const QItemSelection&){}; protected: QPointer _model; QPointer _selectionModel; }; - - -#endif // ABSTRACTITEMVIEW_H