This forum has been archived. All content is frozen. Please use KDE Discuss instead.

QtScript and short int

Tags: None
(comma "," separated)
cyberwizzard
Registered Member
Posts
29
Karma
0

QtScript and short int

Wed Jan 28, 2009 3:35 pm
I don't know if this is the right forum but here goes.

I'm working on a plugin for Amarok which is written in QtScript. I need to open a TCP connection to localhost. The QTcpSocket::connectToHost needs a unsigned short (16-bit int) as its port parameter.

QtScript is loosly typed and each number as such is probably a 32-bit integer. When calling connectToHost I get this error:
Code: Select all
Error: QAbstractSocket::connectToHost(): could not find a function match; candidates are:
connectToHost(QHostAddress address, unsigned short port, OpenMode mode)
connectToHost(String hostName, unsigned short port, OpenMode mode)


It seems that you can not call a Qt4 function that requires a short integer as type casting is impossible within QtScript.

Am I wrong about this? If so, how do I call connectToHost?




Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell