[vlc-commits] Qt: PL/MLModels: implement columnCount() in parent class
Francois Cartegnie
git at videolan.org
Fri Jul 20 19:58:08 CEST 2012
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 20 16:57:50 2012 +0200| [f5714b1ee352159a246300ee358ec54f8c1ac4d1] | committer: Francois Cartegnie
Qt: PL/MLModels: implement columnCount() in parent class
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5714b1ee352159a246300ee358ec54f8c1ac4d1
---
modules/gui/qt4/components/playlist/ml_model.cpp | 5 -----
modules/gui/qt4/components/playlist/ml_model.hpp | 1 -
modules/gui/qt4/components/playlist/playlist_model.cpp | 5 -----
modules/gui/qt4/components/playlist/playlist_model.hpp | 1 -
modules/gui/qt4/components/playlist/vlc_model.cpp | 6 ++++++
modules/gui/qt4/components/playlist/vlc_model.hpp | 3 +++
6 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/ml_model.cpp b/modules/gui/qt4/components/playlist/ml_model.cpp
index 69ae782..a4d3be4 100644
--- a/modules/gui/qt4/components/playlist/ml_model.cpp
+++ b/modules/gui/qt4/components/playlist/ml_model.cpp
@@ -214,11 +214,6 @@ QMimeData* MLModel::mimeData( const QModelIndexList &indexes ) const
return data;
}
-int MLModel::columnCount( const QModelIndex & ) const
-{
- return columnFromMeta( COLUMN_END );
-}
-
int MLModel::rowCount( const QModelIndex & parent ) const
{
if( !parent.isValid() )
diff --git a/modules/gui/qt4/components/playlist/ml_model.hpp b/modules/gui/qt4/components/playlist/ml_model.hpp
index 2bf86f1..3b46532 100644
--- a/modules/gui/qt4/components/playlist/ml_model.hpp
+++ b/modules/gui/qt4/components/playlist/ml_model.hpp
@@ -67,7 +67,6 @@ public:
const QModelIndex & parent = QModelIndex() ) const;
virtual QModelIndex currentIndex() const;
int rowCount( const QModelIndex & parent = QModelIndex() ) const;
- int columnCount( const QModelIndex & parent = QModelIndex() ) const;
QModelIndex parent( const QModelIndex& ) const;
QVariant headerData( int, Qt::Orientation, int ) const;
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index a41c356..030bf21 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -575,11 +575,6 @@ QModelIndex PLModel::parent( const QModelIndex &index ) const
return createIndex(parentItem->row(), 0, parentItem);
}
-int PLModel::columnCount( const QModelIndex &) const
-{
- return columnFromMeta( COLUMN_END );
-}
-
int PLModel::rowCount( const QModelIndex &parent ) const
{
const PLItem *parentItem = parent.isValid() ? getItem( parent ) : rootItem;
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 948c353..7bf2195 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -78,7 +78,6 @@ public:
virtual QVariant headerData( int section, Qt::Orientation orientation,
int role = Qt::DisplayRole ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
- virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual QModelIndex index( const int r, const int c, const QModelIndex &parent ) const;
virtual QModelIndex parent( const QModelIndex &index ) const;
diff --git a/modules/gui/qt4/components/playlist/vlc_model.cpp b/modules/gui/qt4/components/playlist/vlc_model.cpp
index ede9773..4895f37 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.cpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.cpp
@@ -76,3 +76,9 @@ QPixmap VLCModel::getArtPixmap( const QModelIndex & index, const QSize & size )
return artPix;
}
+
+int VLCModel::columnCount( const QModelIndex & ) const
+{
+ return columnFromMeta( COLUMN_END );
+}
+
diff --git a/modules/gui/qt4/components/playlist/vlc_model.hpp b/modules/gui/qt4/components/playlist/vlc_model.hpp
index 4c1fdb5..e017014 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.hpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.hpp
@@ -50,6 +50,9 @@ public:
};
VLCModel( intf_thread_t *_p_intf, QObject *parent = 0 );
+ /*** QAbstractItemModel subclassing ***/
+ virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
+
virtual int itemId( const QModelIndex & ) const = 0;
virtual input_item_t *getInputItem( const QModelIndex & ) const = 0;
virtual QModelIndex currentIndex() const = 0;
More information about the vlc-commits
mailing list