Changeset View
Changeset View
Standalone View
Standalone View
src/KGantt/kganttgraphicsscene.cpp
Show First 20 Lines • Show All 863 Lines • ▼ Show 20 Line(s) | 862 | public: | |||
---|---|---|---|---|---|
864 | { | 864 | { | ||
865 | } | 865 | } | ||
866 | 866 | | |||
867 | void setModel( QAbstractItemModel* model ) | 867 | void setModel( QAbstractItemModel* model ) | ||
868 | { | 868 | { | ||
869 | m_model = model; | 869 | m_model = model; | ||
870 | } | 870 | } | ||
871 | 871 | | |||
872 | /*reimp*/int headerHeight() const Q_DECL_OVERRIDE { return 40; } | 872 | /*reimp*/int headerHeight() const override { return 40; } | ||
873 | 873 | | |||
874 | /*reimp*/ bool isRowVisible( const QModelIndex& ) const Q_DECL_OVERRIDE { return true;} | 874 | /*reimp*/ bool isRowVisible( const QModelIndex& ) const override { return true;} | ||
875 | /*reimp*/ bool isRowExpanded( const QModelIndex& ) const Q_DECL_OVERRIDE { return false; } | 875 | /*reimp*/ bool isRowExpanded( const QModelIndex& ) const override { return false; } | ||
876 | /*reimp*/ KGantt::Span rowGeometry( const QModelIndex& idx ) const Q_DECL_OVERRIDE | 876 | /*reimp*/ KGantt::Span rowGeometry( const QModelIndex& idx ) const override | ||
877 | { | 877 | { | ||
878 | return KGantt::Span( idx.row() * ROW_HEIGHT, ROW_HEIGHT ); | 878 | return KGantt::Span( idx.row() * ROW_HEIGHT, ROW_HEIGHT ); | ||
879 | } | 879 | } | ||
880 | /*reimp*/ int maximumItemHeight() const Q_DECL_OVERRIDE { | 880 | /*reimp*/ int maximumItemHeight() const override { | ||
881 | return ROW_HEIGHT/2; | 881 | return ROW_HEIGHT/2; | ||
882 | } | 882 | } | ||
883 | /*reimp*/int totalHeight() const Q_DECL_OVERRIDE { | 883 | /*reimp*/int totalHeight() const override { | ||
884 | return m_model->rowCount()* ROW_HEIGHT; | 884 | return m_model->rowCount()* ROW_HEIGHT; | ||
885 | } | 885 | } | ||
886 | 886 | | |||
887 | /*reimp*/ QModelIndex indexAt( int height ) const Q_DECL_OVERRIDE { | 887 | /*reimp*/ QModelIndex indexAt( int height ) const override { | ||
888 | return m_model->index( height/ROW_HEIGHT, 0 ); | 888 | return m_model->index( height/ROW_HEIGHT, 0 ); | ||
889 | } | 889 | } | ||
890 | 890 | | |||
891 | /*reimp*/ QModelIndex indexBelow( const QModelIndex& idx ) const Q_DECL_OVERRIDE { | 891 | /*reimp*/ QModelIndex indexBelow( const QModelIndex& idx ) const override { | ||
892 | if ( !idx.isValid() )return QModelIndex(); | 892 | if ( !idx.isValid() )return QModelIndex(); | ||
893 | return idx.model()->index( idx.row()+1, idx.column(), idx.parent() ); | 893 | return idx.model()->index( idx.row()+1, idx.column(), idx.parent() ); | ||
894 | } | 894 | } | ||
895 | /*reimp*/ QModelIndex indexAbove( const QModelIndex& idx ) const Q_DECL_OVERRIDE { | 895 | /*reimp*/ QModelIndex indexAbove( const QModelIndex& idx ) const override { | ||
896 | if ( !idx.isValid() )return QModelIndex(); | 896 | if ( !idx.isValid() )return QModelIndex(); | ||
897 | return idx.model()->index( idx.row()-1, idx.column(), idx.parent() ); | 897 | return idx.model()->index( idx.row()-1, idx.column(), idx.parent() ); | ||
898 | } | 898 | } | ||
899 | 899 | | |||
900 | }; | 900 | }; | ||
901 | 901 | | |||
902 | class TestLineItem : public QGraphicsLineItem | 902 | class TestLineItem : public QGraphicsLineItem | ||
903 | { | 903 | { | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |