Code Monkey home page Code Monkey logo

qt-gauge-widget's Introduction

QT-Gauge-Widget

Custom Gauge Widget for Qt QWidget and QMainWindow

A graphical gauge for qt/c++ applications

This gauge doesn't use any static picture or wallpaper, rather it is rendered at C++ Runtime by 'drawing'. This allows for dynamic changes to the instrument's attributes.

Extensibile widget can be adapted for use as Compass , Altimeter , etc...

How to use this widget:
  • First use header and source file in your project
  • Instantiate QcGaugeWidget object (this will run necessary initialization)
  • Set key attributes for your application
  • Add widget to layout (unless widget is already present in UI form)
  • See example below:
Add to header (.h) file:
 #include "qcgaugewidget.h"
 QcGaugeWidget * mSpeedGauge;
Suggested initialization in .cpp file (change colours, units etc. as desired)
    mSpeedGauge = new QcGaugeWidget();          // Instantiate and call constructor    
    mSpeedGauge->setColour(Qt::cyan);           // Set accent colours        
    mSpeedGauge->titleLabel->setText("km/h");   // Title or Units
    mSpeedGauge->needle->setValueRange(0,80);   // Displayable range of values
    ui->verticalLayout->addWidget(mSpeedGauge); // Add widget to layout

Results in:

image

Can also be adapted for other uses:

image

This is building on other's work to make the widget more accessible and extensible.

See parent project: https://github.com/Berrima/Qt-custom-gauge-widget

qt-gauge-widget's People

Contributors

ghowardeng avatar

Watchers

 avatar

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.