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

福田做商城网站建设哪家公司靠谱关键词优化哪家强

福田做商城网站建设哪家公司靠谱,关键词优化哪家强,手机网站制作套餐,怎样制作印章前言 在 Linux 环境下,开发完 Qt 程序后,也需要制作为一个安装包或者可执行文件进行分发。这里介绍使用 linuxdeployqt 将 Qt 程序打包为 .AppImage 应用程序(类似于 Windows 的绿色免安装软件) 环境配置 配置 Qt 环境变量 这…

前言

在 Linux 环境下,开发完 Qt 程序后,也需要制作为一个安装包或者可执行文件进行分发。这里介绍使用 linuxdeployqt 将 Qt 程序打包为 .AppImage 应用程序(类似于 Windows 的绿色免安装软件)

环境配置

配置 Qt 环境变量

这一步是为了能让 linuxdeployqt 工具识别到 Qt 的环境。编辑 bashrc 文件

vim ~/.bashrc

在最后一行后面加入自己的 Qt 环境

#QT ENV
export QTDIR=/home/leo/Qt/5.15.2/gcc_64export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$QTDIR/plugins:$QT_PLUGIN_PATH
export QML2_PATH=$QTDIR/qml:$QML2_PATH

立即生效

source ~/.bashrc

验证

qmake -v

配置 linuxdeployqt

前往 linuxdeployqt 下载 release 发布的 linuxdeployqt-continuous-x86_64.AppImage

然后授予可执行权限,并改个名方便使用,放入 /usr/local/bin 路径下,方便随地使用

chmod 777 linuxdeployqt-continuous-x86_64.AppImage
mv linuxdeployqt-continuous-x86_64.AppImage linuxdeployqt
sudo mv linuxdeployqt /usr/local/bin

测试一下

linuxdelpoyqt --version

piMs7NQ.png

配置 AppImageKit

前往 AppImageKit 下载 appimagetool-x86_64.AppImage

同样地,添加执行权限:

chmod 777 appimagetool-x86_64.AppImage

安装 patchelf

直接 apt 安装 patchelf 即可

sudo apt install patchelf

打包

将应用拷贝至 output 目录下,运行命令(这里以 QClipboard 可执行程序为例):

leo@leo-VirtualBox:~/Desktop/output$ linuxdeployqt QClipboard -appimage
linuxdeployqt  (commit 6fcaf74), build 55 built on 2023-09-23 13:33:41 UTC
Not using FHS-like mode
app-binary: "/home/leo/Desktop/output/QClipboard"
appDirPath: "/home/leo/Desktop/output"
relativeBinPath: "QClipboard"
ERROR: Desktop file missing, creating a default one (you will probably want to edit it)
ERROR: Icon file missing, creating a default one (you will probably want to edit it)
qmakePath 3= ""
appimagetool, continuous build (commit 8bbf694), build <local dev build> built on 2020-12-31 11:48:33 UTC
fatal: 不是 git 仓库(或者任何父目录):.git
Failed to run 'git rev-parse --short HEAD: Child process exited with code 128 (code 128)
Desktop file: /home/leo/Desktop/output/default.desktop
Categories entry not found in desktop file
.desktop file is missing a Categories= key

然后就可以看到,output 目录下生成了一些文件

lrwxrwxrwx 1 leo leo     10 11月  3 21:31 AppRun -> QClipboard
-rw-rw-r-- 1 leo leo    123 11月  3 21:31 default.desktop
-rw-rw-r-- 1 leo leo      0 11月  3 21:31 default.png
drwxrwxr-x 6 leo leo   4096 11月  3 21:31 doc
drwxrwxr-x 2 leo leo   4096 11月  3 21:32 lib
drwxrwxr-x 7 leo leo   4096 11月  3 21:32 plugins
-rwxrwxr-x 1 leo leo 157512 11月  3 21:30 QClipboard
-rw-rw-r-- 1 leo leo    145 11月  3 21:32 qt.conf
drwxrwxr-x 2 leo leo   4096 11月  3 21:32 translations

修改 desktop 文件

我们需要修改默认生成的 desktop 文件

leo@leo-VirtualBox :~/Desktop/output$ cat default. desktop 
[Desktop Entry]
Type=Application
Name=Application
Exec=AppRun %F
Icon=default
Comment=Edit this default file
Terminal=true

可以查看 desktop 文件规范进行修改

这里将 default. desktop 文件重命名为 QClipboard. desktop 文件,并修改为以下内容:

[Desktop Entry]
Categories=System; Office;
Type=Application
Keywords=clip; clipboard;
Name=QClipboard
Exec=AppRun %F
Icon=logo
Comment=A cross-platform clipboard tool that allows selecting items from clipboard history to paste.
Terminal=true

然后删除了多余的文件夹,最终效果如下:
在这里插入图片描述

生成 appimage 应用

使用 appimagetool 生成 appimage 应用。

执行 ./appimagetool-x 86_64. AppImage output/ 后面的output就是我们的 output 目录。

注意:由于下载的appimagetool-x 86_64. AppImage应用并没有放入/usr/local/bin路径下,所以不能直接执行它。

leo@leo-VirtualBox :~/Downloads$ ./appimagetool-x 86_64. AppImage ~/Desktop/output/
appimagetool, continuous build (commit 8 bbf 694), build <local dev build> built on 2020-12-31 11:48:33 UTC
/home/leo/Desktop/output/QClipboard. desktop: hint: value "System; Office;" for key "Categories" in group "Desktop Entry" contains more than one main category; application might appear more than once in the application menu
Using architecture x 86_64
/home/leo/Desktop/output should be packaged as QClipboard-x 86_64. AppImage
WARNING: AppStream upstream metadata is missing, please consider creating itin usr/share/metainfo/QClipboard. appdata. xmlPlease see https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopAppsfor more information or use the generator at http://output.jsbin.com/qoqukof.
Generating squashfs...
Parallel mksquashfs: Using 6 processors
Creating 4.0 filesystem on QClipboard-x 86_64. AppImage, block size 131072.
[========================================================================/] 530/530 100%Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072compressed data, compressed metadata, compressed fragments,compressed xattrs, compressed idsduplicates are removed
Filesystem size 25011.83 Kbytes (24.43 Mbytes)39.56% of uncompressed filesystem size (63223.96 Kbytes)
Inode table size 2316 bytes (2.26 Kbytes)55.20% of uncompressed inode table size (4196 bytes)
Directory table size 861 bytes (0.84 Kbytes)52.25% of uncompressed directory table size (1648 bytes)
Number of duplicate files found 0
Number of inodes 69
Number of files 59
Number of fragments 12
Number of symbolic links  2
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 8
Number of ids (unique uids + gids) 1
Number of uids 1root (0)
Number of gids 1root (0)
Embedding ELF...
Marking the AppImage as executable...
Embedding MD 5 digest
SuccessPlease consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io

然后就可以在appimagetool-x 86_64. AppImage同级路径下,看到生成的QClipboard-x 86_64. AppImage包了

执行测试

QClipboard 应用成功执行

在这里插入图片描述

注意,分发给别人时,需要加上执行权限才可运行

总结

以上就是在 Linux 系统下,打包 Qt 程序为 AppImage 程序的全部过程。

同时欢迎对跨平台剪贴板工具加star:https://github.com/L-Super/QClipboard

https://blog.csdn.net/zyhse/article/details/106381937

https://www.cnblogs.com/linuxAndMcu/p/11016322.html

UnityLaunchersAndDesktopFiles - Community Help Wiki (ubuntu.com)

desktop文件规范 | DeepinWiki

icon-theme-spec

http://www.shuangfujiaoyu.com/news/45474.html

相关文章:

  • 聊城做企业网站的seo优化什么意思
  • 做网站一般用什么语言冬镜seo
  • 郑州网站APP公众号seo排名优化
  • 深圳网站建设公司哪家可以建app搜狗收录
  • 香港网站服务器租用百度联系方式人工客服
  • 温州网络问政平台seo是什么软件
  • wordpress 新闻类网站搜索引擎关键词优化有哪些技巧
  • wordpress首页文章列表只显示摘要seo兼职招聘
  • 雪白丰腴做美妇网站新媒体seo培训
  • 专用车网站建设哪家专业今日足球比赛分析推荐
  • 万网 做网站外贸推广引流
  • 网站正建设中hao123网址导航
  • 网站内容侵权 怎么做ai智能搜索引擎
  • 网站怎么做关键词在哪做在广州做seo找哪家公司
  • 西安网站建设首选佛山网站建设维护
  • 企业网站建设制作设计哪家最专业灰色行业推广平台
  • 找公司做网站源代码给客户吗广告联盟怎么加入
  • 珠海网站建seo竞价推广
  • 建设自己的企业网站需要什么资料推广方案
  • 自己做网站上市网站优化排名方案
  • 企业网站seo最好方法百度号码认证平台取消标记
  • 电子政务门户网站建设方案网站seo案例
  • 惠州最专业的网站建设公司游戏推广代理
  • 南京市的网站是由那几家公司做的推广普通话手抄报
  • 企业网站建设专家网络营销策划论文
  • 如何隐藏网站是基于thinkphp做的重庆网站建设技术外包
  • 凡科网电脑版怎么做网站优化营商环境条例
  • 米拓网站建设步骤360关键词指数查询
  • 广东省住房与城乡建设厅网站同仁seo排名优化培训
  • 阿里云网站备案多久seo标签优化