当前位置: 首页 > news >正文

抽奖网站怎么做网站建站论坛

抽奖网站怎么做,网站建站论坛,广告营销包括哪些方面,设计必备网站项目结构 整个工程由一个主程序构成和一个模块构成(dll)。整个工程的结构目录如下 Define.priMyProject.proMyProject.pro.user ---bin ---MainProgrammain.cppMainProgram.proMainProgram.pro.userwidget.cppwidget.hwidget.ui ---MathDllMathDll.proMathDll.pro.userMyMath.…项目结构 整个工程由一个主程序构成和一个模块构成(dll)。整个工程的结构目录如下 Define.priMyProject.proMyProject.pro.user ---bin ---MainProgrammain.cppMainProgram.proMainProgram.pro.userwidget.cppwidget.hwidget.ui ---MathDllMathDll.proMathDll.pro.userMyMath.cppMyMath.hqmake文件介绍 1 MyProject.pro TEMPLATE subdirs #多工程项目 CONFIG ordered #指定编译顺序 SUBDIRS MathDll \ #模块dllMainProgram #主工程2 Define.pri win32 {CONFIG(release, debug|release){contains(QT_ARCH, i386) {BIN_PATHrelease_x86_} else {BIN_PATHrelease_x64_}} else {contains(QT_ARCH, i386) {BIN_PATHdebug_x86_} else {BIN_PATHdebug_x64_}} }DESTDIR $$PWD/bin/$$BIN_PATH #生成的二进制文件可执行文件或者库的目标位置放在pri文件中在有pro文件包含这样就不用重复写 3 MathDll.pro QT - guiTEMPLATE libCONFIG c11# The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES QT_DEPRECATED_WARNINGS DEFINES MATHDLL_LIBRARY #使用预定义来控制是导出函数符号到dll还是导出dll中的函数符号# You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES QT_DISABLE_DEPRECATED_BEFORE0x060000 # disables all the APIs deprecated before Qt 6.0.0include($$PWD/../Define.pri) #引入pri文件SOURCES \MyMath.cpp \MyMath.h #拷贝头文件到指定目录以便其它程序能够使用该dll QMAKE_POST_LINK xcopy /y/F \$$PWD/MyMath.h\ \$$PWD/../bin/includePath\\\ $$escape_expand(\\n\\t)# Default rules for deployment. qnx: target.path /tmp/$${TARGET}/bin else: unix:!android: target.path /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS target4 MainProgram.pro #------------------------------------------------- # # Project created by QtCreator 2023-12-09T17:29:33 # #-------------------------------------------------QT core guigreaterThan(QT_MAJOR_VERSION, 4): QT widgetsTARGET MainProgram TEMPLATE app# The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES QT_DISABLE_DEPRECATED_BEFORE0x060000 # disables all the APIs deprecated before Qt 6.0.0include($$PWD/../Define.pri) #引入pri文件 LIBS -L$$PWD/../bin/$$BIN_PATH #设置搜索链接动态库的目录CONFIG c11INCLUDEPATH $$PWD/../bin/includePath #设置搜索头文件目录 LIBS -lMathDll #链接库文件SOURCES \main.cpp \widget.cppHEADERS \widget.hFORMS \widget.ui# Default rules for deployment. qnx: target.path /tmp/$${TARGET}/bin else: unix:!android: target.path /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS target 注意 : LIBS -L$$PWD/../bin/$$BIN_PATH这句话是很重要的在程序编译链接时会使用到动态库的 lib 文件用于生成程序。而默认链接的位置是 MainProgram 目录下如果没有该语句就会提示找不到 MathDll.lib 文件可执行程序生成失败。 源文件分析 1 MyMath.h #ifndef MYMATH_H_ #define MYMATH_H_ //包含QObject才能识别 Q_DECL_EXPORT Q_DECL_IMPORT #include QObject //预定义来控制导入导出符号 #if defined (MATHDLL_LIBRARY) #define MATHDLL_LIBRRY_EXPORT Q_DECL_EXPORT #else #define MATHDLL_LIBRRY_EXPORT Q_DECL_IMPORT #endifclass MATHDLL_LIBRRY_EXPORT MyMath{ public:MyMath();~MyMath();int add(int a, int b); };#endif2 widget.cpp #include widget.h #include ui_widget.h #include MyMath.hWidget::Widget(QWidget *parent) :QWidget(parent),ui(new Ui::Widget) {ui-setupUi(this); }Widget::~Widget() {delete ui; }void Widget::on_pushButton_clicked() {int a ui-lineEdit-text().toInt();int b ui-lineEdit_2-text().toInt();MyMath myMath;int sum myMath.add(a, b); //使用动态链接库中的函数ui-label-setText(ui-label-text() QString::number(sum)); } 效果
http://wiki.neutronadmin.com/news/25535/

相关文章:

  • 做色流网站要注意什么地方百度框架户一级代理商
  • 公司网站开发建设什么会计科目网站建设的目的包含哪些方面
  • 死链接对网站的危害有哪些营销型网站四大功能
  • 仿牌网站 域名注册惠州网站建设怎么样
  • 网站移动转换网站费做进什么科目
  • 吴忠门户网站建设网站后台html模板
  • 公司网站设计定制做企业网站需要买什么
  • 好的网站制作平台中文域名可以做网站吗
  • 做教育网站多少钱湘潭网站建设 x磐石网络
  • 南昌网站建设模板下载网址南宁网站制作公
  • 制作化妆品网站好听罕见绝不重名的公司名称
  • 垂直行业门户网站如何建设平台型的网站
  • 免费收录网站大全用wordpress建一个网站吗
  • 做的最好的本地生活网站湛江专业网站建设公司
  • 唐山专业网站建设公司网站开发 网页上传 网页制作
  • 网站优化怎样提高网站用户体验有了域名空间怎么做网站
  • 舆情网站入口做网站的要到处跑吗
  • 做网站最快多久密云建设银行招聘网站
  • 泉州自助建站软件php与mysql网站开发全接触
  • 极乐宝盒网站建设铁岭 网站建设
  • 网站建设销售策划方案网页建设推荐
  • 深圳网站建设(龙华信科)赣州网站建设方案
  • 网站建设项目需求说明旅游公司网站建设策划书
  • 网站对公司的意义建筑工程承包方式
  • 做网络作家哪个网站好网站建设自查工作
  • 阿克苏网站建设优化江门文件推广设计
  • 苏州seo推广优化seo 网站排名
  • 西南大学校园网站建设往年考试卷最好的网站模板
  • 万网主机怎么上传网站吗大型车网站建设
  • 音乐网站制作教程中装建设董事长