KGantt::ListViewRowController

Search for usage in LXR

KGantt::ListViewRowController Class Reference

#include <kganttlistviewrowcontroller.h>

Inheritance diagram for KGantt::ListViewRowController:

Public Member Functions

 ListViewRowController (QListView *lv, QAbstractProxyModel *proxy)
 
int headerHeight () const override
 
QModelIndex indexAbove (const QModelIndex &idx) const override
 
QModelIndex indexAt (int height) const override
 
QModelIndex indexBelow (const QModelIndex &idx) const override
 
bool isRowExpanded (const QModelIndex &idx) const override
 
bool isRowVisible (const QModelIndex &idx) const override
 
int maximumItemHeight () const override
 
Span rowGeometry (const QModelIndex &idx) const override
 
int totalHeight () const override
 
- Public Member Functions inherited from KGantt::AbstractRowController
 AbstractRowController ()
 
virtual ~AbstractRowController ()
 

Detailed Description

This is an implementation of AbstractRowController that aligns a gantt view with a QListView. Provided for convenience for users who want to use View with QListView instead of QTreeView.

Definition at line 28 of file kganttlistviewrowcontroller.h.

Constructor & Destructor Documentation

◆ ListViewRowController()

ListViewRowController::ListViewRowController ( QListView * lv,
QAbstractProxyModel * proxy )

Definition at line 21 of file kganttlistviewrowcontroller.cpp.

◆ ~ListViewRowController()

ListViewRowController::~ListViewRowController ( )
override

Definition at line 26 of file kganttlistviewrowcontroller.cpp.

Member Function Documentation

◆ headerHeight()

int ListViewRowController::headerHeight ( ) const
overridevirtual
Returns
The height of the header part of the view.

Implement this to control how much space is reserved at the top of the view for a header

Implements KGantt::AbstractRowController.

Definition at line 33 of file kganttlistviewrowcontroller.cpp.

◆ indexAbove()

QModelIndex ListViewRowController::indexAbove ( const QModelIndex & idx) const
overridevirtual
Returns
The modelindex for the previous row before idx.
See also
QTreeView::indexAbove

Implements KGantt::AbstractRowController.

Definition at line 76 of file kganttlistviewrowcontroller.cpp.

◆ indexAt()

QModelIndex ListViewRowController::indexAt ( int height) const
overridevirtual

Implements KGantt::AbstractRowController.

Definition at line 71 of file kganttlistviewrowcontroller.cpp.

◆ indexBelow()

QModelIndex ListViewRowController::indexBelow ( const QModelIndex & idx) const
overridevirtual
Returns
The modelindex for the next row after idx.
See also
QTreeView::indexBelow

Implements KGantt::AbstractRowController.

Definition at line 82 of file kganttlistviewrowcontroller.cpp.

◆ isRowExpanded()

bool ListViewRowController::isRowExpanded ( const QModelIndex & idx) const
overridevirtual

Implements KGantt::AbstractRowController.

Definition at line 55 of file kganttlistviewrowcontroller.cpp.

◆ isRowVisible()

bool ListViewRowController::isRowVisible ( const QModelIndex & idx) const
overridevirtual
Returns
true if the row containing index idx is visible in the view.

Implement this to allow KGantt to optimize how items on screen are created. It is not harmful to always return true here, but the View will not perform optimally.

Implements KGantt::AbstractRowController.

Definition at line 48 of file kganttlistviewrowcontroller.cpp.

◆ maximumItemHeight()

int ListViewRowController::maximumItemHeight ( ) const
overridevirtual

Implements KGantt::AbstractRowController.

Definition at line 38 of file kganttlistviewrowcontroller.cpp.

◆ rowGeometry()

Span ListViewRowController::rowGeometry ( const QModelIndex & idx) const
overridevirtual
Returns
A Span consisting of the row offset and height for the row containing idx. A simple implementation might look like
Span MyRowCtrlr::rowGeometry(const QModelIndex& idx)
{
return Span(idx.row()*10,10);
}
A class representing a start point and a length.
int row() const const

Implements KGantt::AbstractRowController.

Definition at line 62 of file kganttlistviewrowcontroller.cpp.

◆ totalHeight()

int ListViewRowController::totalHeight ( ) const
overridevirtual
Returns
the total height of the rows. For uniformly sized rows that would be number_of_rows*row_height.

Implements KGantt::AbstractRowController.

Definition at line 43 of file kganttlistviewrowcontroller.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:52:04 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.