hi.........
I am new to qt...so please clarify my doubt ....
I need to convert char array to string......which i need to assigned as a text of qtable.
Thanks....
hi.........
I am new to qt...so please clarify my doubt ....
I need to convert char array to string......which i need to assigned as a text of qtable.
Thanks....
QString::QString takes const char *...
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
The solution depends on the encoding used to represent text in the char array. QString has a few convenience functions for a few common ones (fromAscii(), fromLatin1(), fromUtf8()) and the encoding defined by the current locale (fromLocal8Bit()). For more options see the QTextCodec class.
thanks.....i will try it......
I have a other question regarding qsocket....I have a one pedestal system to which i need to pass a command through ethernet......so I need to work with qsocket.
but while running my program there is no status update from my socket state.It is always showing "CONNECTING" state.i am not getting how to solve it.
Here is my code...
ui.h:
QSocket *sock;
in a button clicked functon ..........
{
sock->connectToHost(ipaddress,portnum);
if(sock->state() == QSocket::connecting)
printing some message.......
else if(sock->state() == QSocket::connected)
printing some message.......
else if(sock->state() == QSocket::Idle)
printing some message.......
}
thanks......
You should catch QAbstractSocket::connected signal or use QAbstractSocket::waitForConnected in case you are using blocking sockets.
PS. Use tags CODE next time.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks