The 9-patch image implementation in Qt Quick Controls 1 is an internal implementation detail of the Android style. It cannot handle .9.png image files out of the box, but takes a normal image without borders and the border information separately (as it was provided by the Ministro style assets).
- http://code.qt.io/cgit/qt/qtquickcontrols.git/tree/src/controls/Styles/Android/qquickandroid9patch_p.h
- http://code.qt.io/cgit/qt/qtquickcontrols.git/tree/src/controls/Styles/Android/qquickandroid9patch.cpp
The existing implementation could serve as a fine starting point for implementing a proper generic QQuickNinePatchImage. It just needs to read/strip the border information from the image file instead of providing such QVariantLists for the borders in the API.
来源:oschina
链接:https://my.oschina.net/u/4000302/blog/3107058