正则算法Qt

LinkList  和 list<int> 区别?

Linklist存了不仅下一个节点,还有上一个节点,总共两个。

相对于ArrayList,LinkedList的插入,添加,删除操作速度更快,因为当元素被添加到集合任意位置的时候,不需要像数组那样重新计算大小或者是更新索引。

LinkedList比ArrayList更占内存,因为LinkedList为每一个节点存储了两个引用,一个指向前一个元素,一个指向下一个元素。

 

ArrayList 和List区别?

ArrayList同样也是一个容器,但是其大小不固定,底层 采用的也是线性连续空间来存放元素,当线性连续空间不足以存放元素时,又重新申请一片更大的空间(大约是原空间的2倍),将原有的内容移过去

曾老师的正则表达式?

	tStr = tStr.remove(QRegExp("[\\[\\]]"));
	QStringList strlist = tStr.split(" ");	//[0.1d 0.2d 1.0d]


	QRegExp numRX(QString("([0-9-+.]+)([rd]?)"));	//-12.5d(r for relative value and d for domain value)
	QRegExp stringRX(QString("[A-Za-z_]+[-]?[a-z]*"));	//e.g. func, Func, jewel_c

	if (str.contains("*"))
	{
		strlist = str.split("*");
		iType=1;
	}
	else if (str.contains("/"))
	{
		strlist = str.split("/");
		iType=2;
	}
	else if (str.contains("+"))

//1. Separate cmd string and parameter strings, e.g. "R(X, 30)"
	QRegExp rx(QString("([A-Za-z]+[0-9]*)\\(([^\\)]+)\\)"));	//"R" and "X, 30"
	
    m_cmdStr = rx.cap(1);
	//2. Identify number parameters and recognize parameter type
	QString tStr = rx.cap(2);	//"X, 30"

QstringList?底层

QStringList list;
list << "hello";
list << "world";
list.append("abc");

QString tmp = list.at(i);//据说不支持下标

QStringList list2 = str.split(",");

bool b = list2.contains("123");

    QStringList strList = item.split('#');
    QString str1 = st
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Hands-On High Performance Programming with Qt 5: Build cross-platform applications using concurrency, parallel programming, and memory management Author: Marek Krajewski Pub Date: 2019 ISBN: 978-1789531244 Pages: 384 Language: English Format: EPUB Size: 17 Mb Build efficient and fast Qt applications, target performance problems, and discover solutions to refine your code Achieving efficient code through performance tuning is one of the key challenges faced by many programmers. This book looks at Qt programming from a performance perspective. You’ll explore the performance problems encountered when using the Qt framework and means and ways to resolve them and optimize performance. The book highlights performance improvements and new features released in Qt 5.9, Qt 5.11, and 5.12 (LTE). You’ll master general computer performance best practices and tools, which can help you identify the reasons behind low performance, and the most common performance pitfalls experienced when using the Qt framework. In the following chapters, you’ll explore multithreading and asynchronous programming with C++ and Qt and learn the importance and efficient use of data structures. You’ll also get the opportunity to work through techniques such as memory management and design guidelines, which are essential to improve application performance. Comprehensive sections that cover all these concepts will prepare you for gaining hands-on experience of some of Qt’s most exciting application fields – the mobile and embedded development domains. By the end of this book, you’ll be ready to build Qt applications that are more efficient, concurrent, and performance-oriented in nature What you will learn Understand classic performance best practices Get to grips with modern hardware architecture and its performance impact Implement tools and procedures used in performance optimization Grasp Qt-specific work techniques for graphical user interface (GUI) and platform programming Make Transmission Control Protocol (TCP) and Hypertext Transfer Protocol (HTTP) performant and use the relevant Qt classes Discover the improvements Qt 5.9 (and the upcoming versions) holds in store Explore Qt’s graphic engine architecture, strengths, and weaknesses

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值