ui/src/virtualconsole/vcbutton.h and vcbutton.cpp.
Overview
Button widgets can:- Start and stop functions (scenes, chasers, sequences, etc.)
- Flash functions while held down
- Toggle blackout on/off
- Act as panic buttons to stop all running functions
- Display custom icons and colors
- Respond to keyboard shortcuts and external controllers
Button Actions
Buttons support four different action modes:Toggle Mode
The default mode for starting and stopping functions:- First Click: Start the assigned function
- Second Click: Stop the function
- LED Style: Button shows active/inactive state with color
- Best For: Scenes, chasers, sequences, shows
Flash Mode
Temporary activation while button is held:- Press Down: Start function at full intensity
- Release: Stop function immediately
- Flash Override: Option to override newer values (HTP channels)
- Force LTP: Make flash channels behave as LTP channels
- Best For: Strobe effects, temporary lighting states
vcbutton.h:262
Blackout Mode
Toggle the global blackout state:- Click: Toggle blackout on/off
- No Function: Doesn’t require a function assignment
- Fade Time: Optional fade out time when activating blackout
- Best For: Emergency blackout, scene transitions
Stop All Mode
Panic button to stop everything:- Click: Stop all running functions
- No Function: Doesn’t require a function assignment
- Fade Time: Optional fade out time for graceful stop
- Best For: Emergency stop, end of show
Button States
Buttons display their state through visual feedback:vcbutton.h:210-215
State Colors
- Inactive: Normal background color
- Monitoring: Dimmed indicator showing function is running elsewhere
- Active: Bright color indicating button is controlling the function
updateState() method, which queries the function manager to check if the assigned function is running.
Function Attachment
Buttons control functions through a simple ID-based system:vcbutton.h:182-190
Startup Intensity
Buttons can adjust the intensity when starting a function:vcbutton.h:283-304
Startup intensity only affects HTP (Highest Takes Precedence) channels. LTP channels like pan/tilt are not affected by this setting.
- Start a scene at 50% brightness
- Bring up lights gradually by starting at low intensity
- Create subtle lighting states without modifying the original function
Flash Properties
When using Flash mode, additional options control behavior:Flash Override
Determines whether flash channels override newer values:vcbutton.h:317-320
- Enabled: Flash values override any newer values (even from other running functions)
- Disabled: Flash respects HTP rules and may not be visible if other functions have higher values
Flash Force LTP
Makes flash channels behave as LTP (Latest Takes Precedence):vcbutton.h:321-324
Useful for:
- Flashing moving head positions
- Temporarily forcing specific colors
- Overriding color channels during flash
Appearance Customization
Button Icon
Buttons can display custom icons:vcbutton.h:147-153
- Icons are displayed centered on the button
- Supported formats: PNG, JPG, SVG, BMP
- Icons scale to fit the button size
- Icon size is calculated based on button dimensions
Background Color
Custom colors for different states:vcbutton.h:119-128
- Set different colors for active and inactive states
- Use LED-style visual feedback
- Reset to system default colors
Background Image
Alternative to solid colors:vcbutton.h:109-112
- Full-size image fills button background
- Image is stretched to fit button dimensions
- Overrides background color when set
External Control
Keyboard Shortcuts
Assign keyboard combinations to buttons:vcbutton.h:233-234
Examples:
- Single keys:
Space,Enter,A,1 - Combinations:
Ctrl+A,Shift+F1,Alt+Space - Function keys:
F1,F2, etc.
Some key combinations are reserved by the operating system and may not be available for use in QLC+.
External Input
Connect MIDI controllers, OSC, or other input devices:- Button responds to configured input universe/channel
- Value thresholds determine activation
- Feedback sent back to controller (LED indicators)
- Input is processed through
slotInputValueChanged()
checkInputSource() method from VCWidget.
Solo Frame Integration
Buttons behave specially when placed inside a Solo Frame:- Starting a button’s function stops all sibling button functions
- Only one function runs at a time within the solo frame
- Useful for mutually exclusive lighting states
- Checked via
isChildOfSoloFrame()method
vcbutton.h:365
Example scenario:
Button Press/Release Handlers
Internal methods manage button activation:vcbutton.h:336-342
These methods:
- Handle toggle vs. flash logic
- Notify solo frame parents
- Apply startup intensity
- Send feedback to controllers
- Update button visual state
Signal Connections
Buttons monitor function state through signals:vcbutton.h:349-361
These slots:
- Update button state when function starts/stops
- Synchronize with functions started elsewhere
- Handle blackout mode state changes
- Trigger brief blink when function stops
XML Persistence
Buttons save their configuration to workspace files:WindowState: Position and sizeAppearance: Colors, fonts, imagesFunction: Assigned function IDAction: Toggle, Flash, Blackout, or StopAllIntensity: Startup intensity settingsKey: Keyboard shortcutInput: External control source
Button Matrix
Multiple buttons can be created at once:- Access via “Add Button Matrix” menu
- Creates a grid of buttons
- Each button can control a different function
- Useful for scenes, fixtures, or chaser steps
- Implemented in
addvcbuttonmatrix.cpp
The button matrix wizard is a time-saving tool when you need to create many buttons at once, such as when controlling multiple fixtures or creating a scene palette.
Common Use Cases
Scene Trigger
Toggle mode button to activate lighting scenes on stage
Strobe Flash
Flash mode button for temporary strobe effects
Emergency Stop
StopAll button as a panic button at the end of shows
Blackout Control
Blackout mode for quick fade-to-black transitions
