kdgantt2
kdganttdatetimegrid.cpp
Go to the documentation of this file.
45 case KDGantt::DateTimeScaleFormatter::Second: dbg << "KDGantt::DateTimeScaleFormatter::Second"; break;
46 case KDGantt::DateTimeScaleFormatter::Minute: dbg << "KDGantt::DateTimeScaleFormatter::Minute"; break;
47 case KDGantt::DateTimeScaleFormatter::Hour: dbg << "KDGantt::DateTimeScaleFormatter::Hour"; break;
49 case KDGantt::DateTimeScaleFormatter::Week: dbg << "KDGantt::DateTimeScaleFormatter::Week"; break;
50 case KDGantt::DateTimeScaleFormatter::Month: dbg << "KDGantt::DateTimeScaleFormatter::Month"; break;
51 case KDGantt::DateTimeScaleFormatter::Year: dbg << "KDGantt::DateTimeScaleFormatter::Year"; break;
124 DateTimeScaleFormatter::DateTimeScaleFormatter( Range range, const QString& format, Qt::Alignment alignment )
139 DateTimeScaleFormatter& DateTimeScaleFormatter::operator=( const DateTimeScaleFormatter& other )
160 const QString longWeekNumber = ( shortWeekNumber.length() == 1 ? QString::fromLatin1( "0" ) : QString() ) + shortWeekNumber;
501 if( qVariantCanConvert<QDateTime>(sv) && !(sv.type() == QVariant::String && qVariantValue<QString>(sv).isEmpty()) ) {
585 painter->fillRect( QRectF( x, exposedRect.top(), dayWidth, exposedRect.height() ), painter->brush() );
613 painter->fillRect( QRectF( x, exposedRect.top(), dayWidth, exposedRect.height() ), painter->brush() );
700 painter->fillRect( QRectF( exposedRect.left(), s.start(), exposedRect.width(), s.length() ), d->noInformationBrush );
703 //if ( idx.row()%2 ) painter->fillRect( QRectF( exposedRect.x(), s.start(), exposedRect.width(), s.length() ), QApplication::palette().alternateBase() );
721 void DateTimeGrid::Private::getAutomaticFormatters( DateTimeScaleFormatter** lower, DateTimeScaleFormatter** upper)
747 void DateTimeGrid::paintHeader( QPainter* painter, const QRectF& headerRect, const QRectF& exposedRect,
770 const QRectF upperHeaderRect( headerRect.x(), headerRect.top(), headerRect.width()-1, headerRect.height() * upperRatio );
771 const QRectF lowerHeaderRect( headerRect.x(), upperHeaderRect.bottom()+1, headerRect.width()-1, headerRect.height()-upperHeaderRect.height()-1 );
785 const QRectF upperHeaderRect( headerRect.x(), headerRect.top(), headerRect.width()-1, headerRect.height() * upperRatio );
786 const QRectF lowerHeaderRect( headerRect.x(), upperHeaderRect.bottom()+1, headerRect.width()-1, headerRect.height()-upperHeaderRect.height()-1 );
800 const QRectF upperHeaderRect( headerRect.x(), headerRect.top(), headerRect.width()-1, headerRect.height() * upperRatio );
801 const QRectF lowerHeaderRect( headerRect.x(), upperHeaderRect.bottom()+1, headerRect.width()-1, headerRect.height()-upperHeaderRect.height()-1 );
813 const QRectF upperHeaderRect( headerRect.x(), headerRect.top(), headerRect.width()-1, headerRect.height() * upperRatio );
814 const QRectF lowerHeaderRect( headerRect.x(), upperHeaderRect.bottom()+1, headerRect.width()-1, headerRect.height()-upperHeaderRect.height()-1 );
831 QDateTime dt = formatter->currentRangeBegin( d->chartXtoDateTime( offset + exposedRect.left() ) ).toUTC();
841 opt.rect = QRectF( x - offset+1, headerRect.top(), qMax<qreal>( 1., nextx-x-1 ), headerRect.height() ).toAlignedRect();
867 opt.rect = QRectF( x-offset+1, headerRect.top()+headerRect.height()/2., dayWidth()/24., headerRect.height()/2. ).toAlignedRect();
890 void DateTimeGrid::paintDayScaleHeader( QPainter* painter, const QRectF& headerRect, const QRectF& exposedRect,
903 opt.rect = QRectF( x-offset+1, headerRect.top()+headerRect.height()/2., dayWidth(), headerRect.height()/2. ).toAlignedRect();
918 opt.rect = QRectF( x2-offset, headerRect.top(), dayWidth()*7., headerRect.height()/2. ).toRect();
981 assertTrue( grid.isSatisfiedConstraint( Constraint( model.index( 0, 0 ), model.index( 2, 0 ) ) ) );
982 assertFalse( grid.isSatisfiedConstraint( Constraint( model.index( 2, 0 ), model.index( 0, 0 ) ) ) );
1006 QDateTime result2 = dt2.addDays( days ).addSecs( static_cast<int>(secs-(days*24.*60.*60.) ) ).addMSecs( qRound( ( secs-static_cast<int>( secs ) )*1000. ) );
QAbstractItemModel * model() const
Definition: kdganttabstractgrid.cpp:64
KDAB_SCOPED_UNITTEST_SIMPLE(KDGantt, DateTimeGrid,"test")
Definition: kdganttdatetimegrid.cpp:944
virtual void setModel(QAbstractItemModel *model)
Definition: kdganttabstractgrid.cpp:58
DateTimeScaleFormatter * userDefinedUpperScale() const
Definition: kdganttdatetimegrid.cpp:408
QString format() const
Definition: kdganttdatetimegrid.cpp:148
void setWeekStart(Qt::DayOfWeek)
Definition: kdganttdatetimegrid.cpp:418
virtual QDateTime nextRangeBegin(const QDateTime &datetime) const
Definition: kdganttdatetimegrid.cpp:187
virtual ~DateTimeScaleFormatter()
Definition: kdganttdatetimegrid.cpp:134
int tabHeight(const QString &txt, QWidget *widget=0) const
Definition: kdganttdatetimegrid.cpp:709
QDateTime chartXtoDateTime(qreal x) const
Definition: kdganttdatetimegrid.cpp:77
void paintVerticalUserDefinedLines(QPainter *painter, const QRectF &sceneRect, const QRectF &exposedRect, const DateTimeScaleFormatter *formatter, QWidget *widget)
Definition: kdganttdatetimegrid.cpp:620
void paintVerticalDayLines(QPainter *painter, const QRectF &sceneRect, const QRectF &exposedRect, QWidget *widget)
Definition: kdganttdatetimegrid.cpp:564
void paintHeader(QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
Definition: kdganttdatetimegrid.cpp:747
Definition: kdganttglobal.h:204
void gridChanged()
qreal dateTimeToChartX(const QDateTime &dt) const
Definition: kdganttdatetimegrid.cpp:67
DateTimeScaleFormatter(Range range, const QString &formatString, Qt::Alignment alignment=Qt::AlignCenter)
Definition: kdganttdatetimegrid.cpp:124
DateTimeScaleFormatter & operator=(const DateTimeScaleFormatter &other)
Definition: kdganttdatetimegrid.cpp:139
QDebug operator<<(QDebug dbg, KDGantt::DateTimeScaleFormatter::Range range)
Definition: kdganttdatetimegrid.cpp:42
Qt::DayOfWeek weekStart() const
Definition: kdganttdatetimegrid.cpp:425
void setNoInformationBrush(const QBrush &brush)
Definition: kdganttdatetimegrid.cpp:463
virtual QModelIndex indexAbove(const QModelIndex &idx) const =0
Definition: kdganttglobal.h:207
Abstract baseclass for grids. A grid is used to convert between QModelIndex'es and gantt chart values...
Definition: kdganttabstractgrid.h:40
QDateTime startDateTime
Definition: kdganttdatetimegrid_p.h:108
bool rowSeparators() const
Definition: kdganttdatetimegrid.cpp:449
bool mapFromChart(const Span &span, const QModelIndex &idx, const QList< Constraint > &constraints=QList< Constraint >()) const
Definition: kdganttdatetimegrid.cpp:538
virtual QModelIndex indexBelow(const QModelIndex &idx) const =0
virtual QDateTime currentRangeBegin(const QDateTime &datetime) const
Definition: kdganttdatetimegrid.cpp:242
void setFreeDays(const QSet< Qt::DayOfWeek > &fd)
Definition: kdganttdatetimegrid.cpp:436
QDateTime mapToDateTime(qreal x) const
Definition: kdganttdatetimegrid.cpp:333
virtual QString text(const QDateTime &datetime) const
Definition: kdganttdatetimegrid.cpp:167
Definition: kdganttglobal.h:205
void paintGrid(QPainter *painter, const QRectF &sceneRect, const QRectF &exposedRect, AbstractRowController *rowController=0, QWidget *widget=0)
Definition: kdganttdatetimegrid.cpp:641
bool isSatisfiedConstraint(const Constraint &c) const
Definition: kdganttabstractgrid.cpp:86
virtual void paintUserDefinedHeader(QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, const DateTimeScaleFormatter *formatter, QWidget *widget=0)
Definition: kdganttdatetimegrid.cpp:824
QBrush noInformationBrush() const
Definition: kdganttdatetimegrid.cpp:471
void getAutomaticFormatters(DateTimeScaleFormatter **lower, DateTimeScaleFormatter **upper)
Definition: kdganttdatetimegrid.cpp:721
void setUserDefinedUpperScale(DateTimeScaleFormatter *upper)
Definition: kdganttdatetimegrid.cpp:392
QSet< Qt::DayOfWeek > freeDays() const
Definition: kdganttdatetimegrid.cpp:443
DateTimeScaleFormatter * userDefinedLowerScale() const
Definition: kdganttdatetimegrid.cpp:401
virtual Span rowGeometry(const QModelIndex &idx) const =0
qreal mapFromDateTime(const QDateTime &dt) const
Definition: kdganttdatetimegrid.cpp:326
void paintVerticalHourLines(QPainter *painter, const QRectF &sceneRect, const QRectF &exposedRect, QWidget *widget)
Definition: kdganttdatetimegrid.cpp:592
virtual QModelIndex indexAt(int height) const =0
Qt::Alignment alignment() const
Definition: kdganttdatetimegrid.cpp:179
QSet< Qt::DayOfWeek > freeDays
Definition: kdganttdatetimegrid_p.h:113
QDateTime startDateTime() const
Definition: kdganttdatetimegrid.cpp:299
void setUserDefinedLowerScale(DateTimeScaleFormatter *lower)
Definition: kdganttdatetimegrid.cpp:378
virtual void paintHourScaleHeader(QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
Definition: kdganttdatetimegrid.cpp:854
virtual void paintDayScaleHeader(QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
Definition: kdganttdatetimegrid.cpp:890
Qt::DayOfWeek weekStart
Definition: kdganttdatetimegrid_p.h:112
Abstract baseclass for row controllers. A row controller is used by the GraphicsView to nagivate the ...
Definition: kdganttabstractrowcontroller.h:34
Definition: kdganttdatetimegrid.h:69
void setStartDateTime(const QDateTime &dt)
Definition: kdganttdatetimegrid.cpp:309
Span mapToChart(const QModelIndex &idx) const
Definition: kdganttdatetimegrid.cpp:479
void setRowSeparators(bool enable)
Definition: kdganttdatetimegrid.cpp:454
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.