NDEVR
API Documentation
ConnectionWidget

A small widget that can be shown that allows the user to attempt a connection, disconnect, or even define a connection. More...

Collaboration diagram for ConnectionWidget:
[legend]

Public Member Functions

 ConnectionWidget (QWidget *parent=nullptr)
 Constructs a ConnectionWidget.
void clearConnection ()
 Clears the current connection and resets the widget.
ConnectionInfo connectionInfo () const
 Returns the current connection info.
void connectionModifiedSignal ()
 Emitted when the connection configuration has been modified.
void connectionRequested ()
 Emitted when the user requests a connection attempt.
void setAllowClearButton (bool show)
 Sets whether to show a button for clearing the connection.
void setAllowConnect (bool allow_connect)
 Sets whether the user is allowed to initiate a connection.
void setAllowDisconnect (bool allow_disconnect)
 Sets whether the user is allowed to disconnect.
void setButtonState (Button::ButtonState button_state)
 Sets the visual state of the connection buttons.
void setConnection (const ConnectionInfo &sensor)
 Sets the connection to display and manage using connection info.
void setConnection (const StringView &sensor_id)
 Sets the connection to display and manage by its identifier string.
void setShowBluetoothSettingsButton (bool show)
 Sets whether to show a button for opening Bluetooth system settings.
void setShowWiFiSettingsButton (bool show)
 Sets whether to show a button for opening Wi-Fi system settings.

Protected Member Functions

void updatedSlot ()
 Slot called when the connection state or configuration is updated.
void updateLayout ()
 Rebuilds the widget layout based on current settings.

Protected Attributes

bool m_allow_clear_button = false
 Whether the clear button is shown.
bool m_allow_connect = false
 Whether the connect action is allowed.
bool m_allow_disconnect = false
 Whether the disconnect action is allowed.
Buttonm_clear_button = nullptr
 Button to clear the current connection.
ConnectionInfo m_connection_info
 The current connection configuration.
Buttonm_connection_setup_button = nullptr
 Button to open the connection setup dialog.
Buttonm_connection_state_button = nullptr
 Button showing connection state and toggling connect/disconnect.
ConnectionSetupWidgetm_setup_widget = nullptr
 The connection setup dialog widget.

Detailed Description

A small widget that can be shown that allows the user to attempt a connection, disconnect, or even define a connection.


Definition at line 49 of file ConnectionWidget.h.

Constructor & Destructor Documentation

◆ ConnectionWidget()

ConnectionWidget::ConnectionWidget ( QWidget * parent = nullptr)
explicit

Constructs a ConnectionWidget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ connectionInfo()

ConnectionInfo ConnectionWidget::connectionInfo ( ) const
inline

Returns the current connection info.

Returns
The ConnectionInfo for the current connection.

Definition at line 104 of file ConnectionWidget.h.

References m_connection_info.

◆ setAllowClearButton()

void ConnectionWidget::setAllowClearButton ( bool show)

Sets whether to show a button for clearing the connection.

Parameters
[in]showWhether to show the clear button.

◆ setAllowConnect()

void ConnectionWidget::setAllowConnect ( bool allow_connect)

Sets whether the user is allowed to initiate a connection.

Parameters
[in]allow_connectWhether connect is permitted.

◆ setAllowDisconnect()

void ConnectionWidget::setAllowDisconnect ( bool allow_disconnect)

Sets whether the user is allowed to disconnect.

Parameters
[in]allow_disconnectWhether disconnect is permitted.

◆ setButtonState()

void ConnectionWidget::setButtonState ( Button::ButtonState button_state)

Sets the visual state of the connection buttons.

Parameters
[in]button_stateThe button state to apply.

◆ setConnection() [1/2]

void ConnectionWidget::setConnection ( const ConnectionInfo & sensor)

Sets the connection to display and manage using connection info.

Parameters
[in]sensorThe connection info to use.

◆ setConnection() [2/2]

void ConnectionWidget::setConnection ( const StringView & sensor_id)

Sets the connection to display and manage by its identifier string.

Parameters
[in]sensor_idThe connection identifier.

◆ setShowBluetoothSettingsButton()

void ConnectionWidget::setShowBluetoothSettingsButton ( bool show)

Sets whether to show a button for opening Bluetooth system settings.

Parameters
[in]showWhether to show the Bluetooth settings button.

◆ setShowWiFiSettingsButton()

void ConnectionWidget::setShowWiFiSettingsButton ( bool show)

Sets whether to show a button for opening Wi-Fi system settings.

Parameters
[in]showWhether to show the Wi-Fi settings button.

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