当前位置: 首页 > 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.yayakq.cn/news/535586/

相关文章:

  • 58做网站google广告
  • 济宁网站建设多少钱四个平台建设网站不显示图片
  • 做钓鱼网站查处广州建设工程交易中心改版
  • 网站开发小图标wordpress用户密码表
  • 保定建站价格网站数据丢失了做数据恢复需多久
  • 做哪类网站wordpress音乐防刷新
  • 网站运行速度优化学校网站推广方案
  • 深圳网站搭建价格h5公众号开发
  • 水文化建设网站长沙网站seo优化排名
  • 西安企业建站排名免费建站分类信息网
  • 简述网站建设的基本流程网站营销方案模板
  • 网站内容该怎么做有哪些网站做的符合企业风格
  • 做天猫网站价格wordpress主题授权码
  • 网站集约化建设的目的wordpress正文
  • tomcat加jsp做网站新桥网站建设培训
  • 酒类做网站做网站公司官网
  • 新野微网站建设贵阳有哪家做网站建设好点的
  • 邯郸网站建设策划方案网站建设湖南岚鸿建设
  • 苏州集团网站制作有意思的网站
  • 苏州网站开发建设方法体育网站建设需求
  • 网站后台使用设计网络
  • 1个人做多网站负责人企业网站模板php
  • 徐州网站制作方案搜索引擎推广的简称是
  • 黑龙江住房和城乡建设局网站大墨免费空间申请
  • 九冶建设有限公司网站网络营销课程个人总结范文
  • 网站设计师联盟工程施工合同免费版
  • 网站建站如何入手设计网站账号
  • 自己的网站就可以做app桂城网站制作
  • 企业网站建设费记什么科目dnf怎么做辅助网站
  • 怎么查看网站的ftp广州seo推广公司