linux 打开qt 帮助文档,在linux中以qtassistant打开qch文件

在qtassistant所在的根目录(bin目录外)建立一个openqch文件

#!/bin/sh

export RM=$(which rm)

export MAKEDIR=$(which mkdir)

export BINHOME="$(dirname $0)"

export BIN="${BINHOME}/bin"

#export BINBASE=$(basename $0)

export QCHFILE="$1"

export LD_LIBRARY_PATH=${BINHOME}/lib:${LD_LIBRARY_PATH}

if [ -z "${QCHFILE}" ]; then

export PATH="${BIN}"

assistant

else

export BASE="$(basename ${QCHFILE})"

export BOOKTEMP="${BINHOME}/temp/bookindex"

export QHCPFILE="${BOOKTEMP}/${BASE}.qhcp"

export QHCFILE="${BOOKTEMP}/${BASE}.qhc"

${MAKEDIR} -p "${BOOKTEMP}"

export PATH="${BIN}"

#export LD_LIBRARY_PATH=${BINHOME}

echo \<?xml version=\"1.0\" encoding=\"utf8\"?\> > "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

echo \${QCHFILE}\ >> "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

echo \ >> "${QHCPFILE}"

qcollectiongenerator "${QHCPFILE}" -o "${QHCFILE}"

${RM} "${QHCPFILE}"

assistant -collectionFile "${QHCFILE}"

${RM} "${QHCFILE}"

fi

使用时在命令行中敲入命令:

openqch xxx.qch

或者将其与qch类型文件绑定,方法如下:

在${HOME}/.local/share/applications 下建立一个QtAssistant.desktop

[Desktop Entry]

Exec=/hd/tools/Reader/QtAssistant/openqch "%f"

Name=QtAssistant

Type=Application

在系统设置中将该文件与qch文件类型绑定

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值