From fee35c4f5ef7a77cef4f3b57983a1e5d977ace2a Mon Sep 17 00:00:00 2001 From: ptv Date: Fri, 24 Aug 2007 07:50:22 +0000 Subject: [PATCH] O-2.7 Convert table into graph --- src/Qtx/QtxTable.cxx | 16 ++++++++++++++++ src/Qtx/QtxTable.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/Qtx/QtxTable.cxx b/src/Qtx/QtxTable.cxx index 097a65934..3ed5417d4 100644 --- a/src/Qtx/QtxTable.cxx +++ b/src/Qtx/QtxTable.cxx @@ -66,6 +66,7 @@ public: QRect indexRect( const int, int* = 0 ); void swapSections( const int, const int ); + int spanedSection( const int index ); virtual QSize sizeHint() const; @@ -506,6 +507,12 @@ QRect QtxTable::Header::indexRect( const int index, int* start ) return r; } +int QtxTable::Header::spanedSection( const int index ) +{ + SpanRange range = findSpanRange( index ); + return range.first; +} + QHeader* QtxTable::Header::mainHeader() const { if ( !table() ) @@ -1958,4 +1965,13 @@ void QtxTable::updateSelectAllButton() mySelectAll->setGeometry( frameWidth(), frameWidth(), leftMargin(), topMargin() ); } +int QtxTable::headerSpanedSection( const Orientation o, const int headIdx, const int index ) +{ + Header* hdr = (Header*)(headIdx < 0 ? header( o ) : header( o, headIdx )); + if ( hdr ) + return hdr->spanedSection( index ); + else + return index; +} + #endif diff --git a/src/Qtx/QtxTable.h b/src/Qtx/QtxTable.h index e95dfc155..ce7bb38f2 100644 --- a/src/Qtx/QtxTable.h +++ b/src/Qtx/QtxTable.h @@ -82,6 +82,8 @@ public: void setVerticalSpan( const Orientation, const int, const int, const int ); void setHorizontalSpan( const Orientation, const int, const int, const int ); + int headerSpanedSection( const Orientation, const int headIdx, const int index ); + QColor headerForegroundColor( const Orientation, const int, const int ) const; QColor headerBackgroundColor( const Orientation, const int, const int ) const; void setHeaderForegroundColor( const Orientation, const int, const int, const QColor& ); -- 2.39.2