From kde-commits Sun Jan 16 14:08:41 2011 From: Laszlo Papp Date: Sun, 16 Jan 2011 14:08:41 +0000 To: kde-commits Subject: [Gluon] d4ee31c: KDE Ext. Player: Add abstractitemview class defini Message-Id: <20110116140841.1DF4FA6090 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129518697106891 A player/kdeext/views/abstractitemview.h [License: LGPL] A player/kdeext/views/abstractitemview.cpp [License: LGPL] commit d4ee31cbf903a1e97867d5ec6501525fff1e0e7b Author: Laszlo Papp Date: Sun Jan 16 16:12:11 2011 -0800 KDE Ext. Player: Add abstractitemview class definition, declaration. diff --git a/player/kdeext/CMakeLists.txt b/player/kdeext/CMakeLists.txt index 27e3678..0d53c43 100644 --- a/player/kdeext/CMakeLists.txt +++ b/player/kdeext/CMakeLists.txt @@ -10,6 +10,7 @@ set(kdeextplayer_SRCS mainwindow.cpp overlay.cpp loginform.cpp + views/abstractitemview.cpp ) if(APPLE) diff --git a/player/kdeext/views/abstractitemview.cpp b/player/kdeext/views/abstractitemview.cpp new file mode 100644 index 0000000..314fb84 --- /dev/null +++ b/player/kdeext/views/abstractitemview.cpp @@ -0,0 +1,40 @@ +/****************************************************************************** + * This file is part of the Gluon Development Platform + * Copyright (C) 2010 Laszlo Papp + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "abstractitemview.h" + +#include + +AbstractItemView::AbstractItemView( QWidget* parent, Qt::WindowFlags wFlags ) + : Overlay( parent, wFlags ) + , m_model( 0 ) +{ +} + +QAbstractItemModel* AbstractItemView::model() const +{ + return m_model; +} + +void AbstractItemView::setModel( QAbstractItemModel* model ) +{ + m_model = model; +} + +#include "abstractitemview.moc" diff --git a/player/kdeext/views/abstractitemview.h b/player/kdeext/views/abstractitemview.h new file mode 100644 index 0000000..088638c --- /dev/null +++ b/player/kdeext/views/abstractitemview.h @@ -0,0 +1,41 @@ +/****************************************************************************** + * This file is part of the Gluon Development Platform + * Copyright (C) 2010 Shantanu Tushar + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef ABSTRACTITEMVIEW_H +#define ABSTRACTITEMVIEW_H + +#include "overlay.h" + +#include +#include + +class AbstractItemView : public Overlay +{ + Q_OBJECT + public: + AbstractItemView( QWidget* parent = 0, Qt::WindowFlags wFlags = 0 ); + + virtual void setModel( QAbstractItemModel* model ); + QAbstractItemModel* model() const; + + protected: + QAbstractItemModel* m_model; +}; + +#endif // ABSTRACTITEMVIEW_H