CANpie FD
CAN programming interface environment - Version 3.08
|
The QCanSocketDialog class provides a dialog for connection to an existing QCanNetwork. The dialog creates a new QCanSocket and tries to connect after exec() is called. It is possible to setup the desired CAN channel by calling setChannel() in advance. Also the QCanServer host address can be configured by calling setHostAddress().
The following code snippet shows the usage of the QCanSocketDialog class.
The status of the connection is displayed after the CAN details label.
Inherits QDialog.
Signals | |
void | socketSelected (QCanSocket *pclSocketV) |
Public Member Functions | |
QCanSocketDialog (QWidget *pclParentV, Qt::WindowFlags f) | |
QCanSocketDialog (QWidget *pclParentV=Q_NULLPTR, const QString &caption=QString()) | |
CAN_Channel_e | channel () const |
int | exec (void) |
QHostAddress | peerAddress () const |
void | setHostAddress (const QHostAddress clHostAddressV) |
void | setChannel (const CAN_Channel_e teChannelV) |
QCanSocketDialog::QCanSocketDialog | ( | QWidget * | pclParentV, |
Qt::WindowFlags | f | ||
) |
[in] | pclParentV | Pointer to QWidget parent class |
Create a new CAN socket dialog.
QCanSocketDialog::QCanSocketDialog | ( | QWidget * | pclParentV = Q_NULLPTR , |
const QString & | caption = QString() |
||
) |
[in] | pclParentV | Pointer to QWidget parent class |
Create a new CAN socket dialog.
CAN_Channel_e QCanSocketDialog::channel | ( | ) | const |
The function returns the selected CAN channel number. In case 'Cancel' has been pressed or the connection to the QCanServer failed the function will return QCan::eCAN_CHANNEL_NONE.
int QCanSocketDialog::exec | ( | void | ) |
Shows the dialog as a modal dialog, blocking until the user closes it. The function returns either QDialog::Accepted or QDialog::Rejected.
QHostAddress QCanSocketDialog::peerAddress | ( | ) | const |
Setup the QCanServer host address which should be displayed as default before the exec() method is called.
void QCanSocketDialog::setChannel | ( | const CAN_Channel_e | teChannelV | ) |
[in] | teChannelV | CAN channel number |
Setup the CAN channel number which should be displayed as default before the exec() method is called.
void QCanSocketDialog::setHostAddress | ( | const QHostAddress | clHostAddressV | ) |
[in] | clHostAddressV | Server host address |
Setup the QCanServer host address which should be displayed as default before the exec() method is called.
|
signal |
[in] | pclSocketV | Pointer to socket |
This signal is emitted when the dialog window is closed using the OK button.