Using Apache POI library to read contents from old Microsoft .doc file, including paragraphs and tables in order. Figure out a workaround to the strange situation that HWPFDocument eats or swallows some characters and beeps.
How to extract XML data from the XFA form using Java with iText7
What is the XFA form? First, you need to know there are two types of PDF forms, XFA, and Acroform. (See the doc) Acroform is an old interactive form technology by Adobe, but it is more commonly used and supported by many third-party software. XFA is newer than Acroform, it's…
TransferDog 开源发布 🎉
TransferDog 是使用 python 与 pyside6 写的一个文件传输程序。 地址:https://github.com/funway/TransferDog
PySide6 实现 Qt 程序的多语言
1 在源码中事先准备好字符串 对于要进行多语言翻译的字符串,需要在 coding 的时候使用 QCoreApplication.translate() 或者 QObject.tr() 这两个静态方法预埋好“翻译入口”。 如下图所示: 当程序运行时,这两个方 ...
如何实现 "Reveal in Finder" 的功能
Sublime、VSCode 这些编辑器都有一个 "Reveal in Finder" 的功能(macOS 是 Finder, Windows 下是 "Reveal in Explorer", Linux 下是 "Open Containing Folde ...
使用 QLocalSocket 与 QLocalServer 实现程序的单实例运行。
之前在 这篇文章 中,曾用 QSharedMemory 实现了 QT 程序的单实例运行。 除此之外,还有一种方式是使用 QLocalSocket 与 QLocalServer 实现。 与 QSharedMemory 相比,QLocalSocket 更麻烦一 ...
Qt: border-radius of page in QToolBox are broken —— QToolBox 中 page 的圆角边框无法闭合问题排查
1 异常现象 今天用到了 QToolBox,然后想给每个 page 添加圆角边框,于是使用了如下 stylesheet QToolBox > QWidget { border: 1px solid silver; border-radius: 6px ...
Qt: QTreeView 可视区域内节点判断与滚动事件
这两天遇到两个问题: 1、对于一个 QTreeView,如何判断一个节点的 QModelIndex 是否处于 QTreeView 可视区域内。当 QTreeView 中有太多节点,必然有些节点是处于可视区域外部的,不显示的。QTreeView 也不会对这些 ...
Python 创建线程安全的单例
之前在文章《深入理解 Python 中的类与元类》中讲了使用 __new__() 方法可以很方便地实现单例模式。但其实那段代码是线程不安全的。 验证代码如下: import threading import time class Singleton(obj ...