Pages
API Documentation
On this page

KDarkLightTransition Class

The KDarkLightTransition type represents a transition from day to night or vice versa. More...

  • Header: #include <KDarkLightTransition>
  • CMake: find_package(KNightTime REQUIRED)
    target_link_libraries(mytarget PRIVATE KNightTime::KNightTime)

List of all members, including inherited members

Public Types

Public Functions

Detailed Description

Member Type Documentation

enum KDarkLightTransition::Relation

The Relation enum specifies the relationship between this transition and a point in time.

Constant Value Description
KDarkLightTransition::Upcoming 0 The specified point in time comes before the transition
KDarkLightTransition::InProgress 1 The specified point in time is between the start and the end of the transition
KDarkLightTransition::Passed 2 The specified point in time is after the transition

enum KDarkLightTransition::Type

The Type enum specifies the type of a transition.

Constant Value Description
KDarkLightTransition::Morning 0 Transitioning from night time to daylight
KDarkLightTransition::Evening 1 Transitioning from daylight to night time

Member Function Documentation

KDarkLightTransition::KDarkLightTransition()

Constructs an invalid KDarkLightTransition object.

KDarkLightTransition::KDarkLightTransition(KDarkLightTransition::Type type, const QDateTime &startDateTime, const QDateTime &endDateTime)

Constructs a KDarkLightTransition object with the specified type, startDateTime, and endDateTime.

QDateTime KDarkLightTransition::endDateTime() const

Returns the date and time when the transition ends.

qreal KDarkLightTransition::progress(const QDateTime &dateTime) const

Returns the progress of the transition at the specified dateTime. The progress value is in [0.0, 1.0] range, where 0.0 corresponds to the start of the transition, and 1.0 corresponds to the end of the transition.

QDateTime KDarkLightTransition::startDateTime() const

Returns the date and time when the transition starts.

KDarkLightTransition::Relation KDarkLightTransition::test(const QDateTime &dateTime) const

Checks how the specified dateTime relates to this transition.

KDarkLightTransition::Type KDarkLightTransition::type() const

Returns the type of the transition.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.