![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
QT
QT
SF_WJ
淮安
展开
-
QT 信号与槽
1、连接 信号与槽: 1对1 1对多 多对1 信号与信号 1对1 2、断开 信号与槽 disconnect(res);(QMetaObject::Connection res:连接的返回值) 1对1:disconnect(this , signal, this , slot); 1对多:disconnect(this , signal, 0, 0); 多对1:disconnect(0, 0, this, slot); 多对多:disconnect(this, 0, this, 0); disconnect原创 2020-07-06 18:05:49 · 138 阅读 · 0 评论 -
QString关于查询、截取字符串问题
解释: QString可以通过index进行查询 int QString::indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const 解析: index查询字符串中str的位置 例子: QString parent = QStringLiteral("王/杰/最/帅/了"); 要求: 先把字符串中"/“去除,在查询“”最帅“”字符串 解析: 把要去除”/",首先需要把字原创 2020-06-20 14:31:18 · 2127 阅读 · 1 评论 -
关于QString的section方法的一些问题
含义: section的字面意思是"把…分段",实际上这个函数就是这个意思。 易错讲解: 1、 //完整的函数 QString section(const QString &sep, int start, int end = -1, QString::SectionFlags flags = SectionDefault) const 重点: 这个函数首先会将str对象按照"sep"分成几个段,然后start和end会是根据这些段来计算的。 例如: QString parent = QStri原创 2020-06-20 12:24:15 · 1180 阅读 · 1 评论