Results 1 to 6 of 6
char ProjectSniffer::GetDevice()
{
QByteArray bytes = ui->comboBoxDev->currentText().toAscii().data();
char *Dev;
QString devQ = ui->comboBoxDev->currentText();
Dev = (char)devQ;
return Dev;
}
How can i do that right?...
- 12-14-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 13
Qt QString to char
char ProjectSniffer::GetDevice()
{
QByteArray bytes = ui->comboBoxDev->currentText().toAscii().data();
char *Dev;
QString devQ = ui->comboBoxDev->currentText();
Dev = (char)devQ;
return Dev;
}
How can i do that right?
- 12-14-2009 #2
How about
or justCode:char* ProjectSniffer::GetDevice() { char *Dev = ui->comboBoxDev->currentText().toAscii().data(); return Dev; }
I suppose your function should be returnin pointer (char*) not just character (char)?Code:char* ProjectSniffer::GetDevice() { return ui->comboBoxDev->currentText().toAscii().data(); }
- 12-14-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 13
- 12-14-2009 #4
- 12-14-2009 #5Just Joined!
- Join Date
- Oct 2009
- Posts
- 13
return C struct
How can i return a C struct in a Qt Function??
- 12-15-2009 #6
Same way as you would return it in C-function.
In case you're not familiar with how to do it you could look in to example 6.1 in here:
The C Book — Structures


Reply With Quote
