如何安裝 Qt 相關文件 (HTML版)

操作步驟

只要執行下面指令,就會安裝Qt大部分的相關說明文件(HTML版)。

$ sudo apt-get install qt5-doc-html

觀看文件首頁

執行

$ dpkg -L qt5-doc-html | grep index.html

顯示

/usr/share/qt5/doc/qtdoc/index.html

所以可以執行下面指令,觀看文件首頁

$ firefox /usr/share/qt5/doc/qtdoc/index.html

或是也可以濃縮成一行,直接執行下面指令

$ firefox $(dpkg -L qt5-doc-html | grep index.html)

首頁的內容類似於「http://doc.qt.io/qt-5/」這一頁。

topics

執行

$ dpkg -L qt5-doc-html | grep topics

顯示

/usr/share/qt5/doc/qtdoc/topics-app-development.html
/usr/share/qt5/doc/qtdoc/topics-core.html
/usr/share/qt5/doc/qtdoc/topics-data-storage.html
/usr/share/qt5/doc/qtdoc/topics-graphics.html
/usr/share/qt5/doc/qtdoc/topics-network-connectivity.html
/usr/share/qt5/doc/qtdoc/topics-scripting.html
/usr/share/qt5/doc/qtdoc/topics-ui.html
/usr/share/qt5/doc/qtdoc/topics-web-content.html

上面的頁面,可以對應到網路上的文件網址

index.html

執行

$ dpkg -L qtbase5-doc-html | grep '\-index.html'

顯示

/usr/share/qt5/doc/qtconcurrent/qtconcurrent-index.html
/usr/share/qt5/doc/qtcore/qtcore-index.html
/usr/share/qt5/doc/qtdbus/qtdbus-index.html
/usr/share/qt5/doc/qtgui/qtgui-index.html
/usr/share/qt5/doc/qtnetwork/qtnetwork-index.html
/usr/share/qt5/doc/qtopengl/qtopengl-index.html
/usr/share/qt5/doc/qtplatformheaders/qtplatformheaders-index.html
/usr/share/qt5/doc/qtprintsupport/qtprintsupport-index.html
/usr/share/qt5/doc/qtsql/qtsql-index.html
/usr/share/qt5/doc/qttestlib/qttest-index.html
/usr/share/qt5/doc/qtwidgets/qtwidgets-index.html
/usr/share/qt5/doc/qtxml/qtxml-index.html

上面的頁面,可以對應到網路上的文件網址

閱讀入門

建議可以先從「/usr/share/qt5/doc/qtwidgets/qtwidgets-index.html」閱讀起。

執行下面指令

$ dpkg -L qtbase5-doc-html | grep index.html | grep qtwidgets

顯示

/usr/share/qt5/doc/qtwidgets/qtwidgets-index.html

執行

$ firefox /usr/share/qt5/doc/qtwidgets/qtwidgets-index.html

或是執行

$ firefox $(dpkg -L qtbase5-doc-html | grep index.html | grep qtwidgets)

tutorial.html

執行

$ dpkg -L qtbase5-doc-html | grep '\-tutorial.html'

顯示

/usr/share/qt5/doc/qmake/qmake-tutorial.html
/usr/share/qt5/doc/qttestlib/qtest-tutorial.html
/usr/share/qt5/doc/qtwidgets/widgets-tutorial.html

上面的頁面,可以對應到網路上的文件網址

執行

$ firefox $(dpkg -L qtbase5-doc-html | grep tutorial.html | grep qtwidgets)

manual

執行

$ dpkg -L qtbase5-doc-html | grep '\-manual.html'

顯示

/usr/share/qt5/doc/qmake/qmake-manual.html

上面的頁面,可以對應到網路上的文件網址

執行

$ firefox $(dpkg -L qtbase5-doc-html | grep '\-manual.html' | grep qmake)

除了上面建議,可以先從「/usr/share/qt5/doc/qtwidgets/qtwidgets-index.html」閱讀起。

入門時,也建議閱讀「/usr/share/qt5/doc/qmake/qmake-manual.html」,初步了解「qmake」的用法。

額外的「qt5-doc-html」套件探索,可以參考「簡易探索 qt5-doc-html」。