简体   繁体   English

将QString转换为uint16 *

[英]Convert QString to uint16*

Good day 美好的一天

I'm using a 3rd party library with functions have this sort of signature 我正在使用一个具有这种签名功能的第三方库

int32 WebShot_Open(intptr WebShotHandle, uint16 *Url);

in Visual Studio, I can call this function using the following code 在Visual Studio中,我可以使用以下代码调用此函数

WebShot_Open(WebShotHandle, L"http://www.stackoverflow.com/")

I want to use this function from within Qt, and I want to pass QString to the 2nd parameter. 我想在Qt中使用此函数,并且要将QString传递给第二个参数。

QString url = "www.stackoverflow.com";
WebShot_Open(WebShotHandle, url);

How to do that? 怎么做?

尝试使用utf16 ()方法-像WebShot_Open (WebShotHandle, url.utf16 ())

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM