Laurent Mesguenlmesguen.hashnode.dev·Dec 6, 2024Qt Meta-Object CompilerIn Qt, MOC (Meta-Object Compiler) is a fundamental part of the framework that enables many of its advanced features, such as signals and slots, introspection, and dynamic property handling. Here’s a detailed explanation of how the MOC works: 1. Role ...44 readsmoc
Laurent Mesguenlmesguen.hashnode.dev·Nov 12, 2024QtWidgets vs. QML: Choosing the Right Toolkit for Your Qt ApplicationsWhen developing applications with the Qt framework, you’ll often face a choice between using QtWidgets and QML. Each has unique strengths suited to different types of projects, so understanding their distinctions can help you choose the best tool for...109 readsProgramming Blogs
Niclas Blomberglambda-snail.hashnode.dev·Sep 11, 2024QSqlRelationalTableModel and Proxy ModelsIntroduction This article outlines a problem I faced when working on one of my side projects. The project is a budget app written in Qt and C++. Since I’m still learning I don’t dare to claim that the solution here is the best - or even that it is co...26 readsMy C++ Learning JourneyC++
黄江桂baagod.hashnode.dev·Sep 3, 2024disable QComboBox from responding to mouse scroll eventdef wheelEvent(self, e: QWheelEvent): e.ignore() This way, even if QComboBox is in the parent QScrollArea, it won't affect its normal scrolling.Qt
Israel Galadimaisraelsgalaxy.hashnode.dev·Aug 31, 2024GSoC'24 Final Blog PostI started out GSoC'24 with the aim of making LabPlot a more "Python-friendly" application. The project deliverables were to: Create Python bindings to LabPlot's C++ backend, and Enable Python programs to control a running LabPlot application. Alt...120 readsQt
源赖朝www.leiex.com·Aug 28, 2024Windows下编译Qt6编译环境 操作系统: Windows 11 Home 22H2 编译器:Visual Studio 2022 Community CPU:Intel Core i7-12700 @ 2.10GHz 内存:16GB 参考官方文档: https://wiki.qt.io/Building_Qt_6_from_Git https://doc.qt.io/qt-6.5/qtwebengine-platform-notes.html#windows https://wiki.qt.io/QtWebEngi...40 readsQt
源赖朝www.leiex.com·Aug 16, 2024Qt Model-View学习之手动更新Model数据在使用基于QAbstractListModel的自定义Model时,遇到数据更新后Model不自动刷新数据的问题。通过手动发送更新信号即可解决。 方法,在更新数据时调用 emit beginResetModel(); emit endResetModel(); 注意reset model需要成对使用。Qt
源赖朝www.leiex.com·Aug 16, 2024Insert an image into a QTextEdit1. Using html tag QTextEdit *textEditor = new QTextEdit(0); QTextDocumentFragment fragment; fragment = QTextDocumentFragment::fromHtml(""); textEditor->textCursor().insertFragment(fragment); textEditor->setVisible(true); 2. Using QTextDocument's res...30 readsQt
源赖朝www.leiex.com·Aug 16, 2024Qt TextDocument内容组织方式Qt的QTextEdit等控件在存储内容的时候是以QTextDocument & QTextBlock & QTextFragment组织内容的。 包含关系为QTextDocument QTextBlock QTextFragment 一般一个控件(如QTextEdit)只包含一个QTextDocument,文档对象可以很容易的保存为HTML或者ODF文件。 其中,QTextBlock是以换行符分隔的,遇到一个换行符就新建一个QTextBlock,因此,一行内容就是一个QTextBlock。 而...C++
源赖朝www.leiex.com·Aug 16, 2024QTextEdit动态显示gif动画原理:使用QMovie播放gif并更新当前帧到QTextEdit中Document的Resource。相关信号:QMovie::frameChanged(int frameNo)实例代码: 初始化QMovie对象: QMovie*movie=newQMovie(this); movie->setFileName(img_path); movie->setCacheMode(QMovie::CacheNone); connect(movie,SIGNAL(frameChanged(int)),th...C++