SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Slots | Private Attributes | List of all members
ButtonSwitch Class Reference

#include <buttonswitch.h>

Inherits QToolButton.

Public Member Functions

 ButtonSwitch (QWidget *parent=NULL)
 
void doToggle (bool checked)
 

Private Slots

void onToggled (bool checked)
 

Private Attributes

QPalette m_originalPalette
 

Detailed Description

Definition at line 8 of file buttonswitch.h.

Constructor & Destructor Documentation

◆ ButtonSwitch()

ButtonSwitch::ButtonSwitch ( QWidget *  parent = NULL)

Definition at line 4 of file buttonswitch.cpp.

References m_originalPalette, and onToggled().

4  :
5  QToolButton(parent)
6 {
7  setCheckable(true);
8  m_originalPalette = palette();
9  connect(this, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));
10 }
QPalette m_originalPalette
Definition: buttonswitch.h:19
void onToggled(bool checked)
+ Here is the call graph for this function:

Member Function Documentation

◆ doToggle()

void ButtonSwitch::doToggle ( bool  checked)

Definition at line 23 of file buttonswitch.cpp.

References onToggled().

24 {
25  onToggled(checked);
26 }
void onToggled(bool checked)
+ Here is the call graph for this function:

◆ onToggled

void ButtonSwitch::onToggled ( bool  checked)
privateslot

Definition at line 12 of file buttonswitch.cpp.

References m_originalPalette.

Referenced by ButtonSwitch(), and doToggle().

13 {
14  if(checked) {
15  QPalette p = m_originalPalette;
16  p.setColor(QPalette::Button, QColor(0x80, 0x46, 0x00));
17  setPalette(p);
18  } else {
19  setPalette(m_originalPalette);
20  }
21 }
QPalette m_originalPalette
Definition: buttonswitch.h:19
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_originalPalette

QPalette ButtonSwitch::m_originalPalette
private

Definition at line 19 of file buttonswitch.h.

Referenced by ButtonSwitch(), and onToggled().


The documentation for this class was generated from the following files: