<< to CrossControl homepage

Support & Service Center

Qt - Button Example (VA / VC)

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

The posted example below shows how to use the physical push buttons on the VC and VA displays. This example will send a signal when any one of the pushbuttons is pressed or released which will allow the programmer to know the state of any button on the display.

The buttons are handled in a wrapper class and sent to the main Qt application with Qt's signal and slot mechanism. You can start your application from this project or simply copy the 'hwbutton.h' and 'hwbutton.cpp' files into your own project and use the signals generated from that class as shown in the attached example.

To use the example, download and copy the attached .tar file into the Virtual Machine. Extract the files and open the .pro file in Qt. Build and run for the ARM displays.


Update 3/31/17: The posted example has been modified to allow the VC/VA buttons to be simulated in the Virtual Machine. For this to work you must open up a terminal in the Virtual Machine and type:

sudo usermod -a -G root ccs

Press enter and enter 'default' as the password when requested. Finally, log out of the 'ccs' account or restart the Virtual Machine. Once you log back in you should now be able to use the demo below to simulate the VC/VA buttons in the Virtual Machine use the F1 to F10 keys on the keyboard.



AttachmentSize
Binary Data va_vc_buttons_example.tar_.gz701.62 KB
whatever
whatever