Code Monkey home page Code Monkey logo

esterv.customcontrols.datetimepickers's Introduction

Date and Time pickers types for QML

[TOC]

This repo creates a QML module with custom types for date and time selection. Ideally, the types should look like these.

The types should be style-independent, but the colors used rely on the EstervDesigns Simple style. If you want to change the colors in your top QML file you can do

import Esterv.Styles.Simple
...

Component.onCompleted:
{
Style.frontColor1= (Style.theme)?LightThemeColor:DarkThemeColor//Like control.palette.text

Style.frontColor2= ... 
Style.frontColor3= ... 

Style.backColor1= ... 
Style.backColor2= ... 
Style.backColor3= ... 
}

Installing the module

From source code

git clone https://github.com/EddyTheCo/DateTimePickers.git 

mkdir build
cd build
qt-cmake -G Ninja -DCMAKE_INSTALL_PREFIX=installDir -DCMAKE_BUILD_TYPE=Release -DQTDEPLOY=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF ../DateTimePickers

cmake --build . 

cmake --install . 

where installDir is the installation path, QTDEPLOY install the examples and Qt dependencies using the cmake-deployment-api. One can choose to build or not the example and the documentation with the BUILD_EXAMPLES and BUILD_DOCS variables.

From GitHub releases

Download the releases from this repo.

Using the module in your CMake project

Just add to your project CMakeLists.txt

FetchContent_Declare(
        DTPickersQML
        GIT_REPOSITORY https://github.com/EddyTheCo/DateTimePickers.git
	GIT_TAG vMAJOR.MINOR.PATCH 
	FIND_PACKAGE_ARGS MAJOR.MINOR CONFIG  
    )
FetchContent_MakeAvailable(DTPickersQML)
target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> DTPickersQML::DTPickers) 

If want to use the QML module also add

target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> $<$<STREQUAL:$<TARGET_PROPERTY:DTPickersQML::DTPickers,TYPE>,STATIC_LIBRARY>:DTPickersQML::DTPickersplugin>)

Then you have to add to your QML IMPORT PATH the qrc:/esterVtech.com/imports path. For that one could add this to the main function:

QQmlApplicationEngine engine;
engine.addImportPath("qrc:/esterVtech.com/imports");

Examples

The examples folder shows the use of the different custom types provided by the QML module.

One can also play with the types here

Contributing

We appreciate any contribution!

You can open an issue or request a feature. You can open a PR to the develop branch and the CI/CD will take care of the rest. Make sure to acknowledge your work, and ideas when contributing.

esterv.customcontrols.datetimepickers's People

Contributors

eddytheco avatar

Stargazers

RivTian avatar

Watchers

 avatar

Forkers

self-root

esterv.customcontrols.datetimepickers's Issues

Time picker pm am bug

I think there is a bug in the calculation of the time when using the watch face qml component.
It was changing the am pm property as I changed the hours(or the minutes do not remember well ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.