惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
罗磊的独立博客
F
Fortinet All Blogs
T
Threatpost
Y
Y Combinator Blog
博客园_首页
美团技术团队
Security Latest
Security Latest
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
V
V2EX - 技术
The Cloudflare Blog
L
LINUX DO - 热门话题
博客园 - 司徒正美
Jina AI
Jina AI
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
The Hacker News
The Hacker News
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Latest news
Latest news
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
雷峰网
雷峰网
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog RSS Feed
W
WeLiveSecurity
D
DataBreaches.Net
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
Know Your Adversary
Know Your Adversary
TaoSecurity Blog
TaoSecurity Blog
S
Securelist
Help Net Security
Help Net Security

博客园 - Jaypei

archlinux中启用sshd [转] AT89C52资料 VirtualBox中安装PuppyLinux4 [转]比较全的Vim 中的正则表达式 luacurl的一个获得html的函数 [转]使用Mac OS X系统必须了解的10条命令 用nuSOAP传递对象数组的问题终于解决 粗心导致的gsoap一个错误 MinGW环境使用gSOAP rdesktop中剪切板共享 [转]在Windows XP下用GCC 4.3.2编译Qt 4.4.3实战 Ubuntu下安装Postgresql 8.3 [原创]关于python的Singleton [转]如何讀取文字檔? (C/C++) (STL) 简单的python读写windows剪切板 - Jaypei 关于SOAPpy传递对象参数调用WebService的问题总结 - Jaypei LinkedServer的用法 - Jaypei 解决Smarty中trancate使用UTF8时中文乱码问题 - Jaypei 关于wxPython中多线程修改主界面 - Jaypei
[原]Qt4.5中Plugins使用方法
Jaypei · 2009-05-18 · via 博客园 - Jaypei

2009-05-18 12:05  Jaypei  阅读(2998)  评论()    收藏  举报

使用静态库方式

这是Assistant中的方法。在程序开始,调用:

Q_IMPORT_PLUGIN(qgif)

在pro文件中加入:

TEMPLATE = app
QTPLUGIN += qgif

这么调用不成功,可能跟我用的是LGPL/Free版本有关。

使用动态库方式

动态库是通过QApplicationCore中的libraryPaths寻找的,默认是在<Qt安装目录>/plugins中寻找,当部署以后,默认就成了<程序目录>,在查资料看到很多说在<程序目录>/plugins寻找的,可能是版本差异。通常修改的方法就是使用以下方式:

QApplicationCore::addLibraryPath("plugins");
// 或
QStringList lpath;
lpath << "..." << "...";
QApplicationCore::setLibraryPath(lpath);

相关静态成员函数有:

QApplicationCore::addLibraryPath
QApplicationCore::libraryPaths
QApplicationCore::removeLibraryPath
QApplicationCore::setLibraryPath

当设置好libraryPath以后就可以按照<QT安装目录>/plugins中的目录结构放到设置好的目录中即可使用。