简介

在当今世界的信息时代,图书馆对于人们的学习和研究具有举足轻重的地位。传统图书馆已经不能满足人们的需求,因此,构建一个有效、高效的图书馆数据库系统显得尤为必要。QT是一种流行的软件开发工具,它提供了良好的图形用户界面(UI)支持,并以跨平台易用性著名。本文将介绍使用QT如何构建一个图书馆数据库系统。

创建数据库

我们需要创建一个适当的数据库。使用SQL Server或MySql等关系数据库管理系统(RDBMS)。使用QT提供的 QSqlDatabase 类可以方便地连接数据库。在使用 QSqlDatabase 前,我们还应该选择合适的数据库驱动程序,该驱动程序必须能够与我们选择的 RDBMS 兼容。可以使用QSqlDatabase::drivers()函数来查询所有已安装的驱动程序。

例如,下面的代码创建了一个名为”library”的数据库并连接到其默认数据库中。可以在任何操作系统中使用该代码。我们将使用QT提供的 SQLite 驱动程序来连接这个数据库。

“`

#include

#include

QSqlDatabase db = QSqlDatabase::addDatabase(“QSQLITE”);

db.setDatabaseName(“library”);

if (!db.open()) {

qDebug()

}

“`

设计表结构

创建好数据库后,我们需要设计表结构。表结构是 RDBMS 中数据的逻辑组织形式,最终用于存储、操作并检索数据。一个典型的图书馆应该至少包含以下三张表:book、author和publisher。统计信息表或用户表也可以作为附加表。

“`

QSqlQuery query;

query.exec(“create table book (“

“id int primary key, “

“title varchar(255), “

“author_id int, “

“publisher_id int, “

“in varchar(20),”

“year int”

“)”);

query.exec(“create table author(“

“id int primary key, “

“name varchar(100)”

“)”);

query.exec(“create table publisher( “

“id int primary key, “

“name varchar(255)”

“)”);

“`

在本示例中,book 表保存图书的基本信息,包括题目、作者、出版商、ISBN 号和出版年份。作者和出版商表仅包含各自的ID和名称两个字段。

添加数据

当我们创建好表结构后,下一步就是添加数据。通过 QSqlQuery 类,我们可以添加和查询数据。例如,下面的代码将向图书表中添加一条记录:

“`

QSqlQuery query;

query.prepare(“insert into book (id, title, author_id, publisher_id, in, year) “

“values (:id, :title, :author_id, :publisher_id, :in, :year)”);

query.bindValue(“:id”, 1);

query.bindValue(“:title”, “The Great Gaty”);

query.bindValue(“:author_id”, 1);

query.bindValue(“:publisher_id”, 1);

query.bindValue(“:in”, “9780141182636”);

query.bindValue(“:year”, 1925);

query.exec();

“`

查询记录

我们可以使用 SQL 语句从数据库中查询数据。例如,下面的代码将返回图书表中的所有记录:

“`

QSqlQuery query;

query.exec(“select * from book”);

while (query.next()) {

int id = query.value(0).toInt();

QString title = query.value(1).toString();

int author_id = query.value(2).toInt();

int publisher_id = query.value(3).toInt();

QString in = query.value(4).toString();

int year = query.value(5).toInt();

qDebug()</p><p>}</p><p>“`</p><p>使用 QT 特性进行图形界面设计</p><p>QT 提供了大量用于创建图形界面的特性。其中包括:</p><p>– QT Designer(图形用户界面设计器)</p><p>– QT Creator(用于软件开发工具)</p><p>– QT Widgets(提供编写 Qt 程序的默认库)</p><p>QT Designer</p><p>QT Designer 是一个跨平台的布局设计器,允许程序员在使用 QT 编写代码之前、完全可视化地创建私有部件窗口。创建窗口后,将UI文件用uic编译器进行编译,这将创建一个C++源文件(ui_XXX.h),供程序员使用。</p><p>QT Creator</p><p>QT Creator 是一个面向对象的跨平台 IDE,可以使用它来开发和调试QT应用程序。QT Creator 编辑器具有很多有用的功能,例如具有语法突出显示、自动完成、引用工具和符号浏览器等功能的代码编辑器。此外,还提供了一个调试器、一个项目管理器、一个版本控制系统和一个集成过程与版本控制系统的构建系统。</p><p>QT Widgets</p><p>QT Widgets 是 QT 框架的默认库,提供了一套丰富的基础用户界面组件,例如按钮、标签、文本编辑器等。QT Widgets 的界面组件具有类似的标识符、事件处理、信号发送,以及主题、可访问性和布局管理等特性。</p><p>结论</p><p class="cus_content_list"><strong>相关问题拓展阅读:</strong></p><ul><li><a href="https://www.dbs724.com/#qtdesigner怎么使用数据库" title="qtdesigner怎么使用数据库">qtdesigner怎么使用数据库</a></li><li><a href="https://www.dbs724.com/#QT添加图片到mysql数据库" title="QT添加图片到mysql数据库">QT添加图片到mysql数据库</a></li></ul><div id="toc_container" class="toc_transparent no_bullets"><p class="toc_title">文章目录</p><ul class="toc_list"><li><a href="#qtdesigner"><span class="toc_number toc_depth_1">1</span> qtdesigner怎么使用数据库</a></li><li><a href="#QTmysql"><span class="toc_number toc_depth_1">2</span> QT添加图片到mysql数据库</a></li></ul></div><h3 id="qtdesigner怎么使用数据库"><span id="qtdesigner">qtdesigner怎么使用数据库</span></h3><p>qtdesigner使用数据库的方法是渣迹,数如皮并据库文件的创建和链接: bool bExist = QFile::exists(“my.db”); //判断数据库文件是否存在 m_dataBase = QSqlDatabase::addDatabase(“QSQLITE”握猜,”123”); //选择数据库驱动为SqlLite。</p><h3 id="QT添加图片到mysql数据库"><span id="QTmysql">QT添加图片到mysql数据库</span></h3><p>数腊悉滑据库存储图片名称,输轮腊出的陆斗时候添加路径就可以了。</p><p>echo “img src=’./image/”.$img.”.jpg’ alt=””;</p><p>qt图书馆数据库的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于qt图书馆数据库,使用QT构建图书馆数据库系统,qtdesigner怎么使用数据库,QT添加图片到mysql数据库的信息别忘了在本站进行查找喔。</p><div class='yarpp yarpp-related yarpp-related-website yarpp-related-none yarpp-template-list'><p>无关联文章</p></div><div class="post-end"></div><ul class="post-copyright"><li class="post-copyright-link"><strong>本文来源链接地址:</strong> <a rel="bookmark" title="使用QT构建图书馆数据库系统 (qt图书馆数据库)" href="https://www.npspro.cn/14129.html"> https://www.npspro.cn/14129.html</a></li></ul></div><div id="pay-single-box"></div><div class="article-copyright">www.npspro.cn软师兄<br/><a href="https://www.npspro.cn">软师兄</a> » <a href="https://www.npspro.cn/14129.html">使用QT构建图书馆数据库系统 (qt图书馆数据库)</a></div><div class="ripro_gg_wrap pc"><div style="color:red;">50T免费网盘资源大集合【持续更中~~~~】:<a href='https://link3.cc/88531cn' target="_blank">点击查看</a></div><hr /> <a href='http://doc.88531.cn/docs/yfwqtj' target="_blank"><img data-lazyloaded="1" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDQwIiBoZWlnaHQ9IjkiIHZpZXdCb3g9IjAgMCAxMDQwIDkiPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHN0eWxlPSJmaWxsOiNjZmQ0ZGI7ZmlsbC1vcGFjaXR5OiAwLjE7Ii8+PC9zdmc+" width="1040" height="9" class="alignnone size-full wp-image-38236" data-src="/wp-content/uploads/txad/2.png" alt="" /></a></div><div class="article-footer"><div class="author-box"><div class="author-image"> <img alt='' data-src='https://www.npspro.cn/wp-content/themes/ripro/assets/images/avatar/1.png' class='lazyload avatar avatar-96 photo ' height='96' width='96' /></div><div class="author-info"><h4 class="author-name"> <a target="_blank" href="javascript:;">程序猿零零漆</a> <span class="label label-warning"><i class="fa fa-diamond"></i> 钻石</span></h4></div></div><div class="xshare"> <span class="xshare-title">分享到:</span> <a href="javascript:;" title="收藏文章" etap="star" data-postid="14129" class="ripro-star"><i class="fa fa-star-o"></i></a> <a href="" etap="share" data-share="qq" class="share-qq"><i class="fa fa-qq"></i></a> <a href="" etap="share" data-share="weibo" class="share-weibo"><i class="fa fa-weibo"></i></a></div></div></div></div></article><div class="entry-navigation"><nav class="article-nav"> <span class="article-nav-prev">上一篇<br><a href="https://www.npspro.cn/12027.html" rel="prev">iOS应用程序下载数据库文件的打开指南 (ios app下载数据库文件怎么打开)</a></span> <span class="article-nav-next">下一篇<br><a href="https://www.npspro.cn/16384.html" rel="next">微博遭遇数据库异常,用户数据安全受威胁? (微博数据库异常)</a></span></nav></div></main></div></div><div class="sidebar-column col-lg-3"><aside class="widget-area"><div id="recent-posts-4" class="widget widget_recent_entries"><h5 class="widget-title">近期文章</h5><ul><li> <a href="https://www.npspro.cn/37642.html">不用开VIP会员,这个开源神器让你实现音乐自由多端支持Spotube</a></li><li> <a href="https://www.npspro.cn/37640.html">受够音乐平台VIP套路?这个开源神器让你实现音乐自由</a></li><li> <a href="https://www.npspro.cn/37630.html">强大!支持全网的安卓万能视频下载工具 v3.9.2 去广告会员版</a></li><li> <a href="https://www.npspro.cn/37628.html">ACR Phone安卓版(安卓电话录音软件) v0.364 修改版</a></li><li> <a href="https://www.npspro.cn/37626.html">安卓手机哔哩哔哩漫游 v8.43.0 去广告净化</a></li></ul></div><div id="toc-widget-2" class="widget toc_widget"><h5 class="widget-title">文章目录</h5><ul class="toc_widget_list no_bullets"><li><a href="#qtdesigner"><span class="toc_number toc_depth_1">1</span> qtdesigner怎么使用数据库</a></li><li><a href="#QTmysql"><span class="toc_number toc_depth_1">2</span> QT添加图片到mysql数据库</a></li></ul></div></aside></div></div></div></div><footer class="site-footer"><div class="container"><div class="footer-widget"><div class="row"><div class="col-xs-12 col-sm-6 col-md-3 widget--about"><div class="widget--content"><div class="footer--logo mb-20"> <img data-lazyloaded="1" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ODgiIGhlaWdodD0iMTU5IiB2aWV3Qm94PSIwIDAgNDg4IDE1OSI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgc3R5bGU9ImZpbGw6I2NmZDRkYjtmaWxsLW9wYWNpdHk6IDAuMTsiLz48L3N2Zz4=" width="488" height="159" class="tap-logo" data-src="https://www.npspro.cn/wp-content/uploads/2024/08/1723198965-da49b08e96b0cfd.png" data-dark="https://www.npspro.cn/wp-content/uploads/2024/08/1723198965-da49b08e96b0cfd.png" alt="软师兄"></div><p class="mb-10">www.npspro.cn软师兄,为你提供最优质的资源</p></div></div><div class="col-xs-12 col-sm-3 col-md-2 col-md-offset-1 widget--links"><div class="widget--title"><h5>本站导航</h5></div><div class="widget--content"><ul class="list-unstyled mb-0"></ul></div></div><div class="col-xs-12 col-sm-3 col-md-2 widget--links"><div class="widget--title"><h5>友情链接</h5></div><div class="widget--content"><ul class="list-unstyled mb-0"></ul></div></div><div class="col-xs-12 col-sm-12 col-md-4 widget--newsletter"><div class="widget--title"><h5>快速搜索</h5></div><div class="widget--content"><form class="newsletter--form mb-30" action="https://www.npspro.cn/" method="get"> <input type="text" class="form-control" name="s" placeholder="关键词"> <button type="submit"><i class="fa fa-arrow-right"></i></button></form><h6>特别声明:本站所有资源均来源于互联网,如有侵权请联系站长(181050043#qq.com),将第一时间删除,源码仅供参考学习,请勿商用或其它非法用途,否则一切后果用户自负!</h6></div></div></div></div><div class="footer-links"><h6>友情链接:</h6><ul class="friendlinks-ul"></ul></div><div class="site-info"> © 2024Theme by - www.npspro.cn软师兄 <a href="https://beian.miit.gov.cn" target="_blank" class="text" rel="noreferrer nofollow"> 陕ICP备2023008366号-4</a> <br></div></div></footer><div class="rollbar"><div class="rollbar-item tap-dark" etap="tap-dark" title="夜间模式"><i class="mdi mdi-brightness-4"></i></div><div class="rollbar-item tap-click-qiandao"><a class="click-qiandao" title="签到" href="javascript:;"><i class="fa fa-calendar-check-o"></i></a></div><div class="rollbar-item tap-pencil"><a target="_blank" title="投稿赚钱" href="https://www.npspro.cn/wp-admin/post-new.php"><i class="fa fa-pencil"></i></a></div><div class="rollbar-item tap-qq" etap="tap-qq"><a target="_blank" title="QQ咨询" href="http://wpa.qq.com/msgrd?v=3&uin=181050043&site=qq&menu=yes"><i class="fa fa-qq"></i></a></div><div class="rollbar-item tap-blog-style" etap="tap-blog-style" data-id="1" title="博客模式"><i class="fa fa-list"></i></div><div class="rollbar-item" etap="to_full" title="全屏页面"><i class="fa fa-arrows-alt"></i></div><div class="rollbar-item" etap="to_top" title="返回顶部"><i class="fa fa-angle-up"></i></div></div><div class="dimmer"></div><div id="popup-signup" class="popup-signup fade" style="display: none;"><div class="register-login-modal" role="document"><div class="modal-content"><div class="modal-body"> <img data-lazyloaded="1" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ODgiIGhlaWdodD0iMTU5IiB2aWV3Qm94PSIwIDAgNDg4IDE1OSI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgc3R5bGU9ImZpbGw6I2NmZDRkYjtmaWxsLW9wYWNpdHk6IDAuMTsiLz48L3N2Zz4=" width="488" height="159" class="popup-logo" data-src="https://www.npspro.cn/wp-content/uploads/2024/08/1723198965-da49b08e96b0cfd.png" data-dark="https://www.npspro.cn/wp-content/uploads/2024/08/1723198965-da49b08e96b0cfd.png" alt="软师兄"><ul class="nav nav-tabs"><li class="active"><a href="#login" data-toggle="login">登录</a></li><li><a href="#signup" data-toggle="signup">注册</a></li></ul><div class="tab-content"><div class="tab-pane fade in active" id="login"><div class="signup-form-container text-center"><form class="mb-0"><div class="form-group"> <input type="text" class="form-control" name="username" placeholder="*用户名或邮箱"></div><div class="form-group"> <input type="password" class="form-control" name="password" placeholder="*密码"></div> <button type="button" class="go-login btn btn--primary btn--block"><i class="fa fa-bullseye"></i> 安全登录</button></form></div></div><div class="tab-pane fade in" id="signup"><form class="mb-0"><div class="form-group"> <input type="text" class="form-control" name="user_name" placeholder="输入英文用户名"></div><div class="form-group"> <input type="email" class="form-control" name="user_email" placeholder="绑定邮箱"></div><div class="form-group"> <input type="password" class="form-control" name="user_pass" placeholder="密码最小长度为6"></div><div class="form-group"> <input type="password" class="form-control" name="user_pass2" placeholder="再次输入密码"></div><div class="form-group"><div class="input-group"> <input type="text" class="form-control" name="captcha" placeholder="邮箱验证码"> <span class="input-group-btn"> <button class="go-captcha_email btn btn--secondary" type="button">发送验证码</button> </span></div></div> <button type="button" class="go-register btn btn--primary btn--block"><i class="fa fa-bullseye"></i> 立即注册</button></form></div></div> <a target="_blank" href="https://www.npspro.cn/wp-login.php?action=lostpassword" class="rest-password">忘记密码?</a></div></div></div></div><div class="off-canvas"><div class="canvas-close"><i class="mdi mdi-close"></i></div><div class="logo-wrapper"> <a href="https://www.npspro.cn/"> <img data-lazyloaded="1" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ODgiIGhlaWdodD0iMTU5IiB2aWV3Qm94PSIwIDAgNDg4IDE1OSI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgc3R5bGU9ImZpbGw6I2NmZDRkYjtmaWxsLW9wYWNpdHk6IDAuMTsiLz48L3N2Zz4=" width="488" height="159" class="logo regular" data-src="https://www.npspro.cn/wp-content/uploads/2024/08/1723198965-da49b08e96b0cfd.png" alt="软师兄"> </a></div><div class="mobile-menu hidden-lg hidden-xl"></div><aside class="widget-area"><div id="recent-posts-3" class="widget widget_recent_entries"><h5 class="widget-title">最近文章</h5><ul><li> <a href="https://www.npspro.cn/37642.html">不用开VIP会员,这个开源神器让你实现音乐自由多端支持Spotube</a></li><li> <a href="https://www.npspro.cn/37640.html">受够音乐平台VIP套路?这个开源神器让你实现音乐自由</a></li><li> <a href="https://www.npspro.cn/37630.html">强大!支持全网的安卓万能视频下载工具 v3.9.2 去广告会员版</a></li><li> <a href="https://www.npspro.cn/37628.html">ACR Phone安卓版(安卓电话录音软件) v0.364 修改版</a></li><li> <a href="https://www.npspro.cn/37626.html">安卓手机哔哩哔哩漫游 v8.43.0 去广告净化</a></li></ul></div><div id="calendar-3" class="widget widget_calendar"><h5 class="widget-title">日历</h5><div id="calendar_wrap" class="calendar_wrap"><table id="wp-calendar" class="wp-calendar-table"><caption>2025 年 5 月</caption><thead><tr><th scope="col" title="星期一">一</th><th scope="col" title="星期二">二</th><th scope="col" title="星期三">三</th><th scope="col" title="星期四">四</th><th scope="col" title="星期五">五</th><th scope="col" title="星期六">六</th><th scope="col" title="星期日">日</th></tr></thead><tbody><tr><td colspan="2" class="pad"> </td><td><a href="https://www.npspro.cn/date/2025/05/01" aria-label="2025 年 4 月 30 日 发布的文章">1</a></td><td><a href="https://www.npspro.cn/date/2025/05/02" aria-label="2025 年 5 月 1 日 发布的文章">2</a></td><td>3</td><td id="today">4</td><td>5</td></tr><tr><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td></tr><tr><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td></tr><tr><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td><td>25</td><td>26</td></tr><tr><td>27</td><td>28</td><td>29</td><td>30</td><td class="pad" colspan="3"> </td></tr></tbody></table><nav aria-label="上个月及下个月" class="wp-calendar-nav"> <span class="wp-calendar-nav-prev"><a href="https://www.npspro.cn/date/2025/04">« 4 月</a></span> <span class="pad"> </span> <span class="wp-calendar-nav-next"> </span></nav></div></div></aside></div> <script type="litespeed/javascript">console.log("SQL 请求数:37");console.log("页面生成耗时: 0.82994")</script> <script type="litespeed/javascript">var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="https://hm.baidu.com/hm.js?225297bceab00c11f86be5cf7eefe4ca";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})()</script> <script id="toc-front-js-extra" type="litespeed/javascript">var tocplus={"visibility_show":"show","visibility_hide":"hide","width":"Auto"}</script> <script id="app-js-extra" type="litespeed/javascript">var caozhuti={"site_name":"\u8f6f\u5e08\u5144","home_url":"https:\/\/www.npspro.cn","ajaxurl":"https:\/\/www.npspro.cn\/wp-admin\/admin-ajax.php","is_singular":"1","tencent_captcha":{"is":"","appid":""},"infinite_load":"\u52a0\u8f7d\u66f4\u591a","infinite_loading":"<i class=\"fa fa-spinner fa-spin\"><\/i> \u52a0\u8f7d\u4e2d...","site_notice":{"is":"0","color":"rgb(33, 150, 243)","html":"<div class=\"notify-content\"><h3>\u6b22\u8fce\u6765\u5230\u8f6f\u5e08\u5144<\/h3><div>\u5168\u7f51\u6700TOP\u8d44\u6e90\u5206\u4eab<\/div><\/div>"},"pay_type_html":{"html":"<div class=\"pay-button-box\"><div class=\"pay-item\" id=\"alipay\" data-type=\"1\"><i class=\"alipay\"><\/i><span>\u652f\u4ed8\u5b9d<\/span><\/div><div class=\"pay-item\" id=\"weixinpay\" data-type=\"2\"><i class=\"weixinpay\"><\/i><span>\u5fae\u4fe1\u652f\u4ed8<\/span><\/div><\/div><p style=\"font-size: 13px; padding: 0; margin: 0;\">\u5f53\u524d\u4e3a\u6e38\u5ba2\u8d2d\u4e70\u6a21\u5f0f<\/p>","alipay":1,"weixinpay":2}}</script> <script data-no-optimize="1">!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).LazyLoad=e()}(this,function(){"use strict";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,a=arguments[e];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function i(t){return e({},it,t)}function o(t,e){var n,a="LazyLoad::Initialized",i=new t(e);try{n=new CustomEvent(a,{detail:{instance:i}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(a,!1,!1,{instance:i})}window.dispatchEvent(n)}function l(t,e){return t.getAttribute(gt+e)}function c(t){return l(t,bt)}function s(t,e){return function(t,e,n){e=gt+e;null!==n?t.setAttribute(e,n):t.removeAttribute(e)}(t,bt,e)}function r(t){return s(t,null),0}function u(t){return null===c(t)}function d(t){return c(t)===vt}function f(t,e,n,a){t&&(void 0===a?void 0===n?t(e):t(e,n):t(e,n,a))}function _(t,e){nt?t.classList.add(e):t.className+=(t.className?" ":"")+e}function v(t,e){nt?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}function g(t){return t.llTempImage}function b(t,e){!e||(e=e._observer)&&e.unobserve(t)}function p(t,e){t&&(t.loadingCount+=e)}function h(t,e){t&&(t.toLoadCount=e)}function n(t){for(var e,n=[],a=0;e=t.children[a];a+=1)"SOURCE"===e.tagName&&n.push(e);return n}function m(t,e){(t=t.parentNode)&&"PICTURE"===t.tagName&&n(t).forEach(e)}function a(t,e){n(t).forEach(e)}function E(t){return!!t[st]}function I(t){return t[st]}function y(t){return delete t[st]}function A(e,t){var n;E(e)||(n={},t.forEach(function(t){n[t]=e.getAttribute(t)}),e[st]=n)}function k(a,t){var i;E(a)&&(i=I(a),t.forEach(function(t){var e,n;e=a,(t=i[n=t])?e.setAttribute(n,t):e.removeAttribute(n)}))}function L(t,e,n){_(t,e.class_loading),s(t,ut),n&&(p(n,1),f(e.callback_loading,t,n))}function w(t,e,n){n&&t.setAttribute(e,n)}function x(t,e){w(t,ct,l(t,e.data_sizes)),w(t,rt,l(t,e.data_srcset)),w(t,ot,l(t,e.data_src))}function O(t,e,n){var a=l(t,e.data_bg_multi),i=l(t,e.data_bg_multi_hidpi);(a=at&&i?i:a)&&(t.style.backgroundImage=a,n=n,_(t=t,(e=e).class_applied),s(t,ft),n&&(e.unobserve_completed&&b(t,e),f(e.callback_applied,t,n)))}function N(t,e){!e||0<e.loadingCount||0<e.toLoadCount||f(t.callback_finish,e)}function C(t,e,n){t.addEventListener(e,n),t.llEvLisnrs[e]=n}function M(t){return!!t.llEvLisnrs}function z(t){if(M(t)){var e,n,a=t.llEvLisnrs;for(e in a){var i=a[e];n=e,i=i,t.removeEventListener(n,i)}delete t.llEvLisnrs}}function R(t,e,n){var a;delete t.llTempImage,p(n,-1),(a=n)&&--a.toLoadCount,v(t,e.class_loading),e.unobserve_completed&&b(t,n)}function T(o,r,c){var l=g(o)||o;M(l)||function(t,e,n){M(t)||(t.llEvLisnrs={});var a="VIDEO"===t.tagName?"loadeddata":"load";C(t,a,e),C(t,"error",n)}(l,function(t){var e,n,a,i;n=r,a=c,i=d(e=o),R(e,n,a),_(e,n.class_loaded),s(e,dt),f(n.callback_loaded,e,a),i||N(n,a),z(l)},function(t){var e,n,a,i;n=r,a=c,i=d(e=o),R(e,n,a),_(e,n.class_error),s(e,_t),f(n.callback_error,e,a),i||N(n,a),z(l)})}function G(t,e,n){var a,i,o,r,c;t.llTempImage=document.createElement("IMG"),T(t,e,n),E(c=t)||(c[st]={backgroundImage:c.style.backgroundImage}),o=n,r=l(a=t,(i=e).data_bg),c=l(a,i.data_bg_hidpi),(r=at&&c?c:r)&&(a.style.backgroundImage='url("'.concat(r,'")'),g(a).setAttribute(ot,r),L(a,i,o)),O(t,e,n)}function D(t,e,n){var a;T(t,e,n),a=e,e=n,(t=It[(n=t).tagName])&&(t(n,a),L(n,a,e))}function V(t,e,n){var a;a=t,(-1<yt.indexOf(a.tagName)?D:G)(t,e,n)}function F(t,e,n){var a;t.setAttribute("loading","lazy"),T(t,e,n),a=e,(e=It[(n=t).tagName])&&e(n,a),s(t,vt)}function j(t){t.removeAttribute(ot),t.removeAttribute(rt),t.removeAttribute(ct)}function P(t){m(t,function(t){k(t,Et)}),k(t,Et)}function S(t){var e;(e=At[t.tagName])?e(t):E(e=t)&&(t=I(e),e.style.backgroundImage=t.backgroundImage)}function U(t,e){var n;S(t),n=e,u(e=t)||d(e)||(v(e,n.class_entered),v(e,n.class_exited),v(e,n.class_applied),v(e,n.class_loading),v(e,n.class_loaded),v(e,n.class_error)),r(t),y(t)}function $(t,e,n,a){var i;n.cancel_on_exit&&(c(t)!==ut||"IMG"===t.tagName&&(z(t),m(i=t,function(t){j(t)}),j(i),P(t),v(t,n.class_loading),p(a,-1),r(t),f(n.callback_cancel,t,e,a)))}function q(t,e,n,a){var i,o,r=(o=t,0<=pt.indexOf(c(o)));s(t,"entered"),_(t,n.class_entered),v(t,n.class_exited),i=t,o=a,n.unobserve_entered&&b(i,o),f(n.callback_enter,t,e,a),r||V(t,n,a)}function H(t){return t.use_native&&"loading"in HTMLImageElement.prototype}function B(t,i,o){t.forEach(function(t){return(a=t).isIntersecting||0<a.intersectionRatio?q(t.target,t,i,o):(e=t.target,n=t,a=i,t=o,void(u(e)||(_(e,a.class_exited),$(e,n,a,t),f(a.callback_exit,e,n,t))));var e,n,a})}function J(e,n){var t;et&&!H(e)&&(n._observer=new IntersectionObserver(function(t){B(t,e,n)},{root:(t=e).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))}function K(t){return Array.prototype.slice.call(t)}function Q(t){return t.container.querySelectorAll(t.elements_selector)}function W(t){return c(t)===_t}function X(t,e){return e=t||Q(e),K(e).filter(u)}function Y(e,t){var n;(n=Q(e),K(n).filter(W)).forEach(function(t){v(t,e.class_error),r(t)}),t.update()}function t(t,e){var n,a,t=i(t);this._settings=t,this.loadingCount=0,J(t,this),n=t,a=this,Z&&window.addEventListener("online",function(){Y(n,a)}),this.update(e)}var Z="undefined"!=typeof window,tt=Z&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),et=Z&&"IntersectionObserver"in window,nt=Z&&"classList"in document.createElement("p"),at=Z&&1<window.devicePixelRatio,it={elements_selector:".lazy",container:tt||Z?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"litespeed-loading",class_loaded:"litespeed-loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},ot="src",rt="srcset",ct="sizes",lt="poster",st="llOriginalAttrs",ut="loading",dt="loaded",ft="applied",_t="error",vt="native",gt="data-",bt="ll-status",pt=[ut,dt,ft,_t],ht=[ot],mt=[ot,lt],Et=[ot,rt,ct],It={IMG:function(t,e){m(t,function(t){A(t,Et),x(t,e)}),A(t,Et),x(t,e)},IFRAME:function(t,e){A(t,ht),w(t,ot,l(t,e.data_src))},VIDEO:function(t,e){a(t,function(t){A(t,ht),w(t,ot,l(t,e.data_src))}),A(t,mt),w(t,lt,l(t,e.data_poster)),w(t,ot,l(t,e.data_src)),t.load()}},yt=["IMG","IFRAME","VIDEO"],At={IMG:P,IFRAME:function(t){k(t,ht)},VIDEO:function(t){a(t,function(t){k(t,ht)}),k(t,mt),t.load()}},kt=["IMG","IFRAME","VIDEO"];return t.prototype={update:function(t){var e,n,a,i=this._settings,o=X(t,i);{if(h(this,o.length),!tt&&et)return H(i)?(e=i,n=this,o.forEach(function(t){-1!==kt.indexOf(t.tagName)&&F(t,e,n)}),void h(n,0)):(t=this._observer,i=o,t.disconnect(),a=t,void i.forEach(function(t){a.observe(t)}));this.loadAll(o)}},destroy:function(){this._observer&&this._observer.disconnect(),Q(this._settings).forEach(function(t){y(t)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){var e=this,n=this._settings;X(t,n).forEach(function(t){b(t,e),V(t,n,e)})},restoreAll:function(){var e=this._settings;Q(e).forEach(function(t){U(t,e)})}},t.load=function(t,e){e=i(e);V(t,e)},t.resetStatus=function(t){r(t)},Z&&function(t,e){if(e)if(e.length)for(var n,a=0;n=e[a];a+=1)o(t,n);else o(t,e)}(t,window.lazyLoadOptions),t});!function(e,t){"use strict";function a(){t.body.classList.add("litespeed_lazyloaded")}function n(){console.log("[LiteSpeed] Start Lazy Load Images"),d=new LazyLoad({elements_selector:"[data-lazyloaded]",callback_finish:a}),o=function(){d.update()},e.MutationObserver&&new MutationObserver(o).observe(t.documentElement,{childList:!0,subtree:!0,attributes:!0})}var d,o;e.addEventListener?e.addEventListener("load",n,!1):e.attachEvent("onload",n)}(window,document);</script><script data-no-optimize="1">var litespeed_vary=document.cookie.replace(/(?:(?:^|.*;\s*)_lscache_vary\s*\=\s*([^;]*).*$)|^.*$/,"");litespeed_vary||fetch("/wp-content/plugins/litespeed-cache/guest.vary.php",{method:"POST",cache:"no-cache",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log(e),e.hasOwnProperty("reload")&&"yes"==e.reload&&(sessionStorage.setItem("litespeed_docref",document.referrer),window.location.reload(!0))});</script><script data-optimized="1" type="litespeed/javascript" data-src="https://www.npspro.cn/wp-content/litespeed/js/fff0d437a2f491f1cb79feddfb95727c.js?ver=15284"></script><script>const litespeed_ui_events=["mouseover","click","keydown","wheel","touchmove","touchstart"];var urlCreator=window.URL||window.webkitURL;function litespeed_load_delayed_js_force(){console.log("[LiteSpeed] Start Load JS Delayed"),litespeed_ui_events.forEach(e=>{window.removeEventListener(e,litespeed_load_delayed_js_force,{passive:!0})}),document.querySelectorAll("iframe[data-litespeed-src]").forEach(e=>{e.setAttribute("src",e.getAttribute("data-litespeed-src"))}),"loading"==document.readyState?window.addEventListener("DOMContentLoaded",litespeed_load_delayed_js):litespeed_load_delayed_js()}litespeed_ui_events.forEach(e=>{window.addEventListener(e,litespeed_load_delayed_js_force,{passive:!0})});async function litespeed_load_delayed_js(){let t=[];for(var d in document.querySelectorAll('script[type="litespeed/javascript"]').forEach(e=>{t.push(e)}),t)await new Promise(e=>litespeed_load_one(t[d],e));document.dispatchEvent(new Event("DOMContentLiteSpeedLoaded")),window.dispatchEvent(new Event("DOMContentLiteSpeedLoaded"))}function litespeed_load_one(t,e){console.log("[LiteSpeed] Load ",t);var d=document.createElement("script");d.addEventListener("load",e),d.addEventListener("error",e),t.getAttributeNames().forEach(e=>{"type"!=e&&d.setAttribute("data-src"==e?"src":e,t.getAttribute(e))});let a=!(d.type="text/javascript");!d.src&&t.textContent&&(d.src=litespeed_inline2src(t.textContent),a=!0),t.after(d),t.remove(),a&&e()}function litespeed_inline2src(t){try{var d=urlCreator.createObjectURL(new Blob([t.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm,"$1")],{type:"text/javascript"}))}catch(e){d="data:text/javascript;base64,"+btoa(t.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm,"$1"))}return d}</script></body></html> <!-- Page optimized by LiteSpeed Cache @2025-05-04 19:35:47 --> <!-- Page supported by LiteSpeed Cache 6.2.0.1 on 2025-05-04 19:35:46 --> <!-- Guest Mode --> <!-- QUIC.cloud UCSS in queue -->