/qt-qml-analog-clock

Interactive Analog Clock

Primary LanguageQML

Interactive Analog Clock in QML

Project Overview

This project is an implementation of an interactive analog clock using the QML language within the Qt framework. The application provides a simple and elegant UI to display time and allows the user to manually set the time by dragging the clock's hands.

Features

  • Live Clock: Continuously updates the second, minute, and hour hands to display the current time.
  • Draggable Handles: Users can adjust the time by clicking and dragging the minute and hour hands.
  • Reset Functionality: A reset button to set the clock back to the current time.
  • No Images: Fully drawn using QML elements like Rectangle, Canvas, and Text without the use of any Image elements.
  • No QtQuick.Controls: Implemented with basic QML elements, avoiding the use of QtQuick.Controls for educational purposes and greater control over behavior.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Qt 5.x with Qt Quick 2.15 (or later)
  • Qt Creator IDE (recommended for ease of use)

Installation

Follow these steps to run the project on your machine:

  1. Clone the repository using git:
git clone [project-url]
  1. Open Qt Creator and navigate to File > Open File or Project.

  2. Locate the directory where you cloned the repository and open the CMakeLists.txt file.

  3. Configure the project with the appropriate kit (for your system/compiler) when prompted by Qt Creator.

  4. Build the project by clicking the "Build" button (hammer icon) in Qt Creator.

  5. Once the build is complete, you can run the application by clicking the "Run" button (green play icon).

Usage

  • To set the time manually:
    • Click and drag the minute or hour hand to the desired time.
    • The second hand can also be dragged if precise setting to the exact second is needed.
  • To reset the time to the current system time:
    • Click the "Reset Time" button located at the bottom of the clock interface.