PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::widgets::DeviceToolButton Class Reference

#include <devicetoolbutton.hpp>

Inheritance diagram for pv::widgets::DeviceToolButton:
Collaboration diagram for pv::widgets::DeviceToolButton:

Signals

void device_selected ()
 

Public Member Functions

 DeviceToolButton (QWidget *parent, DeviceManager &device_manager, QAction *connect_action)
 
shared_ptr< devices::Deviceselected_device ()
 
void set_device_list (const list< shared_ptr< devices::Device > > &devices, shared_ptr< devices::Device > selected)
 
void reset ()
 

Private Slots

void on_action (QObject *action)
 
void on_menu_hovered (QAction *action)
 
void on_menu_hover_timeout ()
 

Private Member Functions

void update_device_list ()
 

Private Attributes

DeviceManagerdevice_manager_
 
QAction *const connect_action_
 
QMenu menu_
 
QSignalMapper mapper_
 
shared_ptr< devices::Deviceselected_device_
 
vector< weak_ptr< devices::Device > > devices_
 
QString device_tooltip_
 

Detailed Description

Definition at line 49 of file devicetoolbutton.hpp.

Constructor & Destructor Documentation

pv::widgets::DeviceToolButton::DeviceToolButton ( QWidget *  parent,
DeviceManager device_manager,
QAction *  connect_action 
)

Constructor

Parameters
parentthe parent widget.
device_managerthe device manager.
connect_actionthe connect-to-device action.

Definition at line 43 of file devicetoolbutton.cpp.

Here is the call graph for this function:

Member Function Documentation

void pv::widgets::DeviceToolButton::device_selected ( )
signal

Definition at line 152 of file moc_devicetoolbutton.cpp.

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::on_action ( QObject action)
privateslot

Definition at line 118 of file devicetoolbutton.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::on_menu_hover_timeout ( )
privateslot

Definition at line 157 of file devicetoolbutton.cpp.

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::on_menu_hovered ( QAction *  action)
privateslot

Definition at line 140 of file devicetoolbutton.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::reset ( )

Sets the current device to "no device". Useful for when a selected device fails to open.

Definition at line 85 of file devicetoolbutton.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< Device > pv::widgets::DeviceToolButton::selected_device ( )

Returns a reference to the selected device.

Definition at line 70 of file devicetoolbutton.cpp.

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::set_device_list ( const list< shared_ptr< devices::Device > > &  devices,
shared_ptr< devices::Device selected 
)

Sets the current list of devices.

Parameters
devicethe list of devices.
selected_devicethe currently active device.

Definition at line 75 of file devicetoolbutton.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::widgets::DeviceToolButton::update_device_list ( )
private

Repopulates the menu from the device list.

Definition at line 92 of file devicetoolbutton.cpp.

Here is the caller graph for this function:

Member Data Documentation

QAction* const pv::widgets::DeviceToolButton::connect_action_
private

Definition at line 101 of file devicetoolbutton.hpp.

DeviceManager& pv::widgets::DeviceToolButton::device_manager_
private

Definition at line 100 of file devicetoolbutton.hpp.

QString pv::widgets::DeviceToolButton::device_tooltip_
private

Definition at line 109 of file devicetoolbutton.hpp.

vector< weak_ptr<devices::Device> > pv::widgets::DeviceToolButton::devices_
private

Definition at line 107 of file devicetoolbutton.hpp.

QSignalMapper pv::widgets::DeviceToolButton::mapper_
private

Definition at line 104 of file devicetoolbutton.hpp.

QMenu pv::widgets::DeviceToolButton::menu_
private

Definition at line 103 of file devicetoolbutton.hpp.

shared_ptr<devices::Device> pv::widgets::DeviceToolButton::selected_device_
private

Definition at line 106 of file devicetoolbutton.hpp.


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