码迷,mamicode.com
首页 >  
搜索关键字:qstring    ( 525个结果
【转】QT QString, wchar_t *, TCHAR, CString和其他字符或字符串类型的转化
//QString to wchar_t *: const wchar_t * encodedName = reinterpret_cast(fileName.utf16()); //QString to char * given a file name: QByteArray fileName =...
分类:其他好文   时间:2015-06-04 15:22:23    阅读次数:239
qt5 qDebug()QString 解决中文输出问题
首先加上头文件#include 然后设置QTextCodec*t=QTextCodec::codecForName("GBk");最后转换QString s=t->toUnicode("行了");结果
分类:其他好文   时间:2015-05-25 18:10:33    阅读次数:564
TypeError: PyQt4.QtCore.QVariant python3.x
Python plugin API changes from 1.8 to 2.0 Python plugin API changes from 1.8 to 2.0 SIP API upgrade QVariant removed QSettings return type Replace QString methods Replace QStringList with list Remo...
分类:编程语言   时间:2015-05-22 19:49:38    阅读次数:469
Qt 读取txt文件乱码的解决办法
Qt 读取txt文本乱码问题2015-05-20 15:46方法一:使用QString的fromLocal8Bit()函数复制代码QFile txtfile(filePath); QString tmpStr; if(txtfile.open(QIODevice::ReadOnly)) { ...
分类:其他好文   时间:2015-05-22 14:45:48    阅读次数:241
Qt下 QString转char*
Qt下面,字符串都用QString,确实给开发者提供了方便,想想VC里面定义的各种变量类型,而且函数参数类型五花八门,经常需要今年新那个类型转换Qt再使用第三方开源库时,由于库的类型基本上都是标准的类型,字符串遇的多的就是Char*类型在Qt下怎样将QString转char*呢,需要用到QByteA...
分类:其他好文   时间:2015-05-18 14:31:05    阅读次数:73
QT 字符串处理
QT 字符串处理函数:QString left ( int n ) const //取左边的n个字符。QString right ( int n ) const //取右边的n个字符。replace()函数提供方法替换字符串。remove()函数从字符串中移除字符。split()函数拆分字符串。mi...
分类:其他好文   时间:2015-05-16 17:48:29    阅读次数:124
QInputDialog还挺好用的呵呵
QStringList items; items //bool ok; QString item = QInputDialog::getItem(NULL, QObject::tr("QInputDialog::getItem()"), QObject::tr("Season:"), items, 0, false, &ok); //if (ok && !item.isEmpt...
分类:其他好文   时间:2015-05-15 13:48:31    阅读次数:116
字符串类
字符串有如下几个操作符。 –QString提供了一个二元的“+”操作符用于组合两个字符串,并提供了一个“+=”操作符用于将一个字符串追加到另一个字符串的末尾,例如:QString str1 = "Welcome ";str1=str1+"to you! "; //str1=" Welcome to....
分类:其他好文   时间:2015-05-12 17:05:25    阅读次数:101
Qt Widgets——工具栏和状态栏
本文主要涉及QSizeGrip,QStatusBar,QToolBarQToolBar工具栏默认位于菜单栏下方,其上添加一个个action按钮,用于执行动作绝大多谢以前都涉及过,只列出QToolBar(const QString & title, QWidget * parent = 0) ...
分类:其他好文   时间:2015-05-05 12:14:06    阅读次数:203
QLabel设置行间距
QLabel支持html,所以可以用以下代码设置行QLabel中text的行间距:1 QString text;2 text.append("").append( tr("房间号:")).append(m_roomId).append("")3 .append("").app...
分类:其他好文   时间:2015-05-05 12:06:29    阅读次数:1920
525条   上一页 1 ... 39 40 41 42 43 ... 53 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!