Skip to content

GHowardEng/QT-Gauge-Widget

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Configurable gauge widget for Qt C++ applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%