![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
QT
Vinx911
这个作者很懒,什么都没留下…
展开
-
动态调用dll时遇到Invalid address specified to RtlValidateHeap错误
问题dll中函数返回QByteArray,主程序释放时总是提示Invalid address specified to RtlValidateHeap解决方法发现是用了错误的运行库造成的,在Debug用了Release的库,改为Debug的库问题解决。疑问为什么Debug模式不能调用Release的库?如果dll为第三方提供,只有Release的库该如何解决?...原创 2021-11-17 09:15:27 · 699 阅读 · 0 评论 -
Qt中减少SQLite数据库文件的大小
下是我在Qt中清除和压缩SQLite数据库文件的操作。通常,当您从SQLite数据库中删除某些条目时,它不会被物理删除,而是会被标记为已删除并且不会在查询中检索。这样做的好处是它可以快速运行。但是明显的不利之处是没有释放可用空间。要释放已删除文件占用的空间,您需要执行以下操作:QSqlQuery query(db);query.prepare("VACUUM");if (!query.exec()){ QMessageBox::critical(this, "Error", "Can't com原创 2020-10-26 15:22:22 · 729 阅读 · 0 评论 -
QWT QwtMarker中Label的文本对齐
对于QwtMarker的Label对齐方式设置可以使用函数void QwtPlotMarker::setLabelAlignment(Qt::Alignment align)但这只能设置相对于标记下的对齐方式,具体说明可以看文档In case of QwtPlotMarker::HLine the alignment is relative to the y position of the marker, but the horizontal flags correspond to the can原创 2020-09-30 10:19:25 · 571 阅读 · 0 评论 -
QCustomplot在绘制过程中,隐藏0刻度线
以下内容来自《QQ群:Qt交流大会(853086607)》QCustomploy在绘制过程中,会有一个0刻度线,这个线怎么隐藏?QCPGrid::setZeroLinePen 函数可以设置零刻度线的画笔,将画笔设置为Qt::noPen即可隐藏零刻度线。...原创 2020-09-02 09:30:35 · 1833 阅读 · 0 评论 -
QCustomPlot提示 “QOpenGLFramebufferObject::bind() called from incompatible context“
QCustomPlot提示 “QOpenGLFramebufferObject::bind() called from incompatible context” 解决方法在void QCPPaintBufferGlFbo::draw(QCPPainter *painter) const方法中的painter->drawImage(0, 0, mGlFrameBuffer->toImage());之前添加if(QOpenGLContext::currentContext() !=原创 2020-09-01 13:56:54 · 1249 阅读 · 0 评论 -
Qt QRadioButton设置为只读
项目中有时会需要查看之前设置的参数,但是不能修改,就需要把参数控件设置为只读模式。QRadioButton没有只读模式,只能禁用控件,但是禁用后图标会变成灰色。问:如果不想让图标变为灰色该怎么办呢?答:可以使用一下两种方式解决1. 贴图将QRadioButton禁用后,在样式表中设置控件的图标rdoBtn->setEnable(false);QRadioButton::indicator::checked:disable{ image: url(:/images/radiobu原创 2020-09-01 09:39:08 · 2855 阅读 · 4 评论 -
QT 开源类库集合
QT优秀类库集合一、自定义控件1. QSint2. QicsTable3. Longscroll-qt4. Advanced Docking System二、图表控件1. Qwt2. QCustomPlot3. JKQTPlotter三、网络1. QHttpEngine2. HTTP四、 音视频1. vlc-qt五、多线程1. tasks六、数据库1. EasyQtSql一、自定义控件1. QSint源代码地址:QSint:https://sourceforge.net/p/qsint/code/H原创 2020-08-25 15:18:45 · 16701 阅读 · 0 评论 -
QComboBox使用QSS无法修改下拉按钮的宽度
问:QComboBox使用QSS无法修改下拉按钮的宽度ComboBox::drop-down { width: 200px;}使用上面代码修改下拉按钮的宽度不起作用答:需要给QComboBox加上边框,否则不接受下拉按钮的宽度QComboBox { border: 1px solid gray;}// 或QComboBox { padding-right: 0px;}...原创 2020-07-20 12:16:13 · 842 阅读 · 0 评论 -
QT使用OpenGl后闪退,并提示llvm error: out of memory
问题QT使用OpenGl后闪退,并提示llvm error: out of memory。解决出现这样的问题,是因为Qt的缓存文件。删除即可解决。具体位置:C:\Users\UserName\AppData\Local\cache\qtshadercache原创 2020-07-14 08:25:55 · 2831 阅读 · 0 评论 -
QT Creator 内部变量大全
%{#:<value>%{Config:DefaultProjectDirectory}%{Config:LastFileDialogDirectory}%{Cpp:LicenseTemplate}%{Cpp:LicenseTemplatePath:FileBaseName}%{Cpp:LicenseTemplatePath:FileName}%{Cpp:LicenseTe...原创 2019-07-14 12:10:23 · 1738 阅读 · 4 评论 -
QT调用大恒工业相机出现{-1}{Failed to get the libgxiapi.so library path}的临时解决方法
最近在用树莓派驱动大恒工业相机做实时视频显示,使用QT开发。在开发过程中出现{-1}{Failed to get the libgxiapi.so library path}错误提示。多次排查后发现时添加了窗口全屏导致的。 this->showFullScreen();因为树莓派下QT程序默认是全屏的,所以这句可以注释掉,或者在程序后加参数-platform xcb来运行。...原创 2019-07-13 22:50:45 · 1914 阅读 · 0 评论 -
QT 样式表属性大全
Box样式width:宽度height:高度max-width:最大宽度max-height:最大高度min-width:最小宽度min-height:最小高度margin:边距尺寸margin-topmargin-rightmargin-bottommargin-leftpadding:填充尺寸padding-toppadding-rightpadding...原创 2019-06-16 15:44:28 · 13318 阅读 · 1 评论