![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Qt,arm
氺月洞天
在校的专业是计算机科学与技术,对C++和C语言有着浓厚的兴趣, 研究过逆波兰表达式,对递归有深入了解和实战,有在csdn写微博的习惯,截至有60多篇的文章,微博地址:https://blog.csdn.net/ch593030323
展开
-
1.加载web控件、2.DESTDIR和AppDirPath、3.pro 拷贝文件
源码来源于:https://gitee.com/feiyangqingyun/QWidgetDemo下的一个子项目感兴趣的有三点:1.加载web控件、2.DESTDIR和AppDirPath不同,需要在pro指定DESKDIR才能正常执行、3.pro 拷贝文件原创 2022-11-11 09:39:35 · 381 阅读 · 0 评论 -
多项目编程极简用例
多项目编程极简用例原创 2022-06-23 13:44:49 · 130 阅读 · 0 评论 -
无序的map、QMap的对应list
第一阶段,map不排序,但是结果为倒序int main(int argc, char *argv[]){ QApplication a(argc, argv); struct greater2 { bool operator()(const int& x, const int& y) const { return true; } }; std::map<int, QString, greater2>原创 2022-04-26 14:07:48 · 1809 阅读 · 0 评论 -
tableview.delegate.style.drawControl换行的问题
现象:直接按下图,\n是没法实现换行功能的将\n替换成\u2028即可\u2028的相关分析 - 行分隔符: U+2028 - Unicode 字符百科\u2028 行分隔符\u2029 段落分隔符原创 2022-02-14 13:18:56 · 216 阅读 · 0 评论 -
函数重载下的虚函数
void print(int d = 0);有两种调用方式:print(); 和 print(2);那么virtual void print(int d = 0); 是否也相当于两种虚函数呢?先说结论:virtual void print(int d = 0);只有一种调用方式,即print(2);之类的其实证明很简单,看看派生类的void print(); 是否能打印父类默认的值就行#include <QApplication>#include <QtDebug>原创 2021-11-18 10:51:27 · 295 阅读 · 0 评论 -
expect ssh的密码安全问题
https://blog.sreek.net/ssh-login-using-encrypted-password-file/https://blog.sreek.net/ssh-login-using-encrypted-password-file/原创 2021-10-12 10:33:10 · 166 阅读 · 0 评论 -
QString[]和QString.at()的区别
现象:QString x;qDebug() << __LINE__<< x.size() << x.length();//10 0 0qDebug() << __LINE__<< x.[0];//11 '\x0'qDebug() << __LINE__<< x.[10];//12 '\x0'qDebug() << __LINE__<< x.at(0);//ASSERT: "uint(i原创 2021-09-14 11:34:22 · 2487 阅读 · 1 评论 -
qt debug 不含引号
#include <QDebug>#include <QString>intmain(){QString foo="Hello";intx=1234;qDebug()<<"foo="<<foo<<"x="<<x;qDebug().nospace().noquote()<<"foo="<<foo<<" x="<<x;}Th...原创 2021-05-24 15:03:43 · 267 阅读 · 0 评论 -
获取小部件所在的窗口
QWidget *QWidget::window() constReturns the window for this widget, i.e. the next ancestor widget that has (or could have) a window-system frame.If the widget is a window, the widget itself is returned.Typical usage is changing the window title:aWidge原创 2021-04-25 11:22:08 · 148 阅读 · 0 评论 -
Qt下继承类使用QWidget的d指针
pro: QT += widget-privatecpp:#include"private/qwidget_p.h"cpp:QWidgetPrivate *d = static_cast<QWidgetPrivate*>(d_ptr.data());然后就能直接使用d指针了原创 2021-03-12 16:54:20 · 593 阅读 · 2 评论 -
MySql连接超过7小时后断开的解决方法;高分屏的解决方案
1.MySql连接超过7小时后断开的解决方法// This must be done before the connection is openeddb.setConnectOptions("MYSQL_OPT_RECONNECT=1;");2.高分屏的解决方案#ifdef Q_OS_WIN { QApplication app(argc, argv); QSize primaryScreenSize = app.primaryScreen()-&g.原创 2021-01-08 11:01:37 · 188 阅读 · 0 评论 -
Qt QVariant 的 default-constructed values
The documentation of certain container class functions refer to default-constructed values; for example, QVector automatically initializes its items with default-constructed values, and QMap::value() returns a default-constructed value if the specified key原创 2020-11-18 19:39:22 · 238 阅读 · 0 评论 -
C++的模板个人理解加例子
工厂模式 :例如产品确定工厂,如服务端和客户端通讯,通过包确定包数据格式,同时生成新的包策略模式 :例如数据同步的策略:增量上传和全部上传,两种策略,并可以切换适配器模式:例如新接口变量是string,老接口是int,做中间适配,新接口-》【string-》int-》】老接口单例模式 :例如全局只有一个实体类,程序退出释放原型模式 :例如QSqlDataBase::clone()一个类,不需要关系上一个类的连接参数,只是做一个clone模板模式 :例如QList外观...原创 2020-09-24 20:50:12 · 109 阅读 · 0 评论 -
1.Qt之打包发布程序 (NSIS);
写好了程序之后要关心的就是怎么将程序打包成一个安装包发给用户了,这里就推荐一个功能比较全面的打包脚本NSIS。在一般情况下,只要不是特别傻逼的需求 (纠结安装包字符串显示的大爷惹不起惹不起....) 都是能实现的。Qt程序处理编译程序的release版1.IDE版构建方式换成Release,点击Qt Creator的运行按钮2.命令行版(方便自动化构建)set PATH=c:\Qt\Qt5.7.0\5.7\mingw53_32\bin;%PATH%set PATH=c:\..转载 2020-09-10 19:14:37 · 315 阅读 · 0 评论 -
【QT源代码复用】QDateTimeEdit的下拉按钮事件响应
源码中的例子 QStyleOptionComboBox optCombo; optCombo.init(this); optCombo.editable = true; optCombo.subControls = QStyle::SC_All; if(QStyle::SC_ComboBoxArrow == this->style()->hitTestComplexControl(QStyle::CC_ComboBox, &optCombo,原创 2020-08-09 21:39:40 · 805 阅读 · 0 评论 -
1.QTableWidget的closable,2.pro/build_pass、member,3.QString&&
1.QTableWidget的closable#include "tabwidgetforaddorremove.h"#include <QTableWidgetItem>#include <QtDebug>#include <QFile>#include <QPushButton>#include <QHeaderView&g...原创 2020-04-24 18:18:33 · 321 阅读 · 0 评论 -
1.QTableWidget插入按钮,灵活删除本行,一列显示行号
QTableWidget插入按钮ui->tableWidget->setIndexWidget(ui->tableWidget->index(row, "button"), button);灵活删除本行 lds_pushbutton *button = qobject_cast<lds_pushbutton *>(this->send...原创 2019-11-22 16:24:53 · 999 阅读 · 0 评论 -
Qt pixmap实现disabled等状态,libcurl图片上传在window和linux下实现,Openssl::SHA1和QCryptographicHash::Sha1
Qt pixmap实现disabled等状态QPixmap pixmap(const QSize &size, Mode mode = Normal, State state = Off) const;enum Mode { Normal, Disabled, Active, Selected };enum State { On, Off };利用QIcon来实现就行li...原创 2018-11-22 09:47:24 · 336 阅读 · 0 评论 -
1.git 总结, 2.lambda function
1.git 总结版本本git version 2.16.1.windows.1提交更新:1.git add -u2.git commit -m "1"3.git push项目更新1.git pull第一次上传项目1.git init2.git add .3.git commit -m "first use"4.git remote add ori...原创 2018-03-07 16:29:45 · 270 阅读 · 0 评论 -
关于window下和Ubuntu下获取本地ip地址的方法;2.关于通过槽函数名执行槽函数的办法,3.QString初始化的意义
1.首先网上的两种方法window上可行,但是Ubuntu 显示127.0.0.1 QHostInfoa =QHostInfo::fromName(QHostInfo::localHostName()); foreach(const QHostAddress &b, a.addresses()) { if(b.protocol() == QA原创 2017-03-23 11:49:26 · 495 阅读 · 0 评论 -
关于qt QSqlDatabase::database(connectionName) 和QNetworkAccessManager::post()导致卡死的情况
在arm下,不停的使用1.QSqlDatabase::database(connectionName), 【函数返回db】开启事物,【函数返回db】提交数据库, 不停的执行事务操作,导致mysql无响应的情况解决:软件开始定义一个 db = database,以后固定使用该别名来执行数据库操作,db。transaction、db。commit2.QNetworkAccess原创 2017-03-11 13:59:08 · 2134 阅读 · 0 评论