qt

multiple sql statements in QSqlQuery using the sqlite3 driver

陌路散爱 提交于 2021-02-15 04:05:37
问题 I have a file containing several SQL statements that I'd like to use to initialize a new sqlite3 database file. Apparently, sqlite3 only handles multiple statements in one query via the sqlite3_exec() function, and not through the prepare/step/finalize functions. That's all fine, but I'd like to use the QtSQL api rather than the c api directly. Loading in the same initializer file via QSqlQuery only executes the first statement, just like directly using the prepare/step/finalize functions

Qt开发Activex笔记(二):Qt调用Qt开发的Activex控件

a 夏天 提交于 2021-02-14 23:11:09
若该文为原创文章,转载请注明原文出处 本文章博客地址: https://blog.csdn.net/qq21497936/article/details/113789693 长期持续带来更多项目与技术分享,咨询请加QQ:21497936、微信:yangsir198808 红胖子(红模仿)的博文大全:开发技术集合(包含Qt实用技术、树莓派、三维、OpenCV、OpenGL、ffmpeg、OSG、单片机、软硬结合等等)持续更新中…(点击传送门) Qt开发专栏:开发技术 上一篇:《 Qt开发Activex笔记(一):环境搭建、基础开发流程和演示Demo 》 下一篇:敬请期待... <br> 前言   开发Activex控件,以供其他应用程序调用,本篇章讲解Qt调用Activex控件,不限于Qt开发的Activex控件。 <br> Demo    <br> QAxWidget 概述   QAxWidget类是包装ActiveX控件的QWidget。   QAxWidget可以实例化为空对象,带有它应该包装的ActiveX控件的名称,或者带有指向ActiveX控件的现有接口指针。ActiveX控件的属性、方法和事件仅使用QAxBase支持的数据类型,可以作为Qt属性、插槽和信号使用。基类QAxBase提供了一个API,可以通过IUnknown指针直接访问ActiveX。  

How to use mouseMoveEvent on paintEvent on Qt 5?

感情迁移 提交于 2021-02-13 17:44:19
问题 I'm new on Qt and c++, so I'm having some difficulties. I'm trying to create a widget that can get the mouseMoveEvent position and draw an ellipse on my pixmap on mouse position. Below you can see the code: #include "myimage.h" #include <QPainter> #include <QPen> #include <QColor> #include <QMouseEvent> #include <QDebug> Myimage::Myimage(QWidget *parent) : QWidget(parent) { setMouseTracking(true); // E.g. set in your constructor of your widget. } // Implement in your widget void Myimage:

How to use mouseMoveEvent on paintEvent on Qt 5?

℡╲_俬逩灬. 提交于 2021-02-13 17:39:40
问题 I'm new on Qt and c++, so I'm having some difficulties. I'm trying to create a widget that can get the mouseMoveEvent position and draw an ellipse on my pixmap on mouse position. Below you can see the code: #include "myimage.h" #include <QPainter> #include <QPen> #include <QColor> #include <QMouseEvent> #include <QDebug> Myimage::Myimage(QWidget *parent) : QWidget(parent) { setMouseTracking(true); // E.g. set in your constructor of your widget. } // Implement in your widget void Myimage:

How to use mouseMoveEvent on paintEvent on Qt 5?

时光总嘲笑我的痴心妄想 提交于 2021-02-13 17:38:08
问题 I'm new on Qt and c++, so I'm having some difficulties. I'm trying to create a widget that can get the mouseMoveEvent position and draw an ellipse on my pixmap on mouse position. Below you can see the code: #include "myimage.h" #include <QPainter> #include <QPen> #include <QColor> #include <QMouseEvent> #include <QDebug> Myimage::Myimage(QWidget *parent) : QWidget(parent) { setMouseTracking(true); // E.g. set in your constructor of your widget. } // Implement in your widget void Myimage:

Python高级进阶#015 pyqt5进度条QProgressBar结合使用qbasictimer

故事扮演 提交于 2021-02-13 05:03:44
本期GUI界面,我们继续学习新的控件Qprogressbar。 知识回顾 1.滑动控件qslider 控件设置的关键:设置最大值、最小值,绝对范围。 2.核心类库QtCore,枚举类Qt 核心枚举类的使用,可以帮助我们对代码的理解。 一、进度条的使用思想 进度条qprogressbar 使用思想: 1.载入类库 2.初始化类对象 3.设置最小值和最大值 4.时钟的使用QBasicTimer,槽方法对应类库的timerEvent 5.判断什么时候停止加载进度条 这里我们在学习使用进度条的时候,必须要结合使用时钟控件,这样才能让我们看到进度条动的感觉。 二、制作案例 说明如下: 1.界面由进度条和按钮组成 2.进度条的值范围为0~100 3.按钮的状态为“开始”、“停止”、“完成” 4..按钮需要能够控制进度条的运行 三、开发过程知识点介绍 1.导入时钟类 from PyQt5.QtCore import QBasicTimer 2.初始化进度条 self.pgb=QProgressBar(self) 类对象的初始化 self.pgb.move(50,50) 将进度条移动到指定位置 self.pgb.resize(300,20) 设置进度条宽高 3.设置进度条的范围 #设置进度条的范围 self.pgb.setMinimum(0) self.pgb.setMaximum(100)

九、Pyqt5进度条——QProgressBar

左心房为你撑大大i 提交于 2021-02-13 03:53:04
QProgressBar部件为进度条,进度条方向为水平或者竖直。在处理一个耗时较长的任务时,可能就会用到进度条部件。因为使用进度条可以形象告诉用户当前的任务正在进行中。 进度条常用函数如下: 函数 值 内容 setInvertedAppearance True/False 设置进度条的走向。 Ture:从左至右或从上到下 False:从右至左或从下到上 默认为True setOrientation Qt.Horizontal/ Qt.Vertical 设置进度条为水平、竖直。 默认为水平 setMinimum 0~99 设置最小值 ,默认0 setMinimum 0~99 设置最大值 ,默认99 setFormat %p %v %m 设置进度条旁的文本显示: 以百分比表示; 以当前值表示; 以总步长表示。 默认为百分比(%p)。 示例如下: 1 import sys,time 2 from PyQt5.QtWidgets import QApplication, QWidget, QProgressBar, QPushButton,QVBoxLayout 3 from PyQt5.QtCore import Qt 4 5 6 class Mywin(QWidget): 7 def __init__ (self): 8 super(). __init__ () 9 self

Ubuntu18.04 安装 OpenCV 4.1.1

梦想的初衷 提交于 2021-02-13 01:42:21
1. 安装依赖包 sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev # 处理图像所需的包 sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev sudo apt-get install libxvidcore-dev libx264-dev # 处理视频所需的包 sudo apt-get install libatlas-base-dev gfortran # 优化opencv功能 sudo apt-get install ffmpeg 出现下面错误 errorE: unable to locate libjasper-dev 就运行下面命令 sudo apt-get

Issue with “blanking screen” when running Qt application in fullscreen mode

非 Y 不嫁゛ 提交于 2021-02-11 17:41:49
问题 We have a Qt based browser application which uses QWebEninge under the hood. Currently we are fighting with an issue where the screen goes blank for a moment eacht time the window gets or looses the focus (f.ex. each time the QVirtualKeyboard becomes invoked). Following a Qt's recommendation, we tried to implement QWindowsWindowFunctions::setHasBorderInFullScreen prior to call of QMainWindow::showFullScreen() . But this results in an inacceptable reduction of the available window area, e.g.