Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Template:DocLink: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(better link in 4th example, for consistency with the first 3)
(Use https in DocLinks)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><span class="plainlinks">[http://doc.qt.io/qt-5/{{lc:{{{1}}}}}.html#{{{2|}}} {{{3|{{{2|{{{1}}}}}}}}}]</span></includeonly><noinclude>
<includeonly><span class="plainlinks">[https://doc.qt.io/qt-6/{{lc:{{{1}}}}}.html#{{{2|}}} {{{3|{{{2|{{{1}}}}}}}}}]</span></includeonly><noinclude>
This template creates a link to pages in doc.qt.io. The link can be configured by 3 parameters, of which only the first is mandatory:
This template creates a link to pages in [https://doc.qt.io doc.qt.io]. The link can be configured by 3 parameters, of which only the first is mandatory:
* The first parameter usually corresponds to the class name, but can refer to any link under doc.qt.io
* The '''first parameter''' usually corresponds to the '''class name''', but can refer to any link under doc.qt.io
* The second parameter corresponds to an anchor, to allow linking to a specific section of the page. It defaults to an empty string, so the link points to the top of the page.
* The '''second parameter''' corresponds to an '''anchor''', to allow linking to a specific section of the page. It defaults to an empty string, so the link points to the top of the page.
* The third parameter is an optional label. It defaults to the anchor name, if it's provided, or to the first parameter.
* The '''third parameter''' is an optional '''label'''. It defaults to the anchor name, if it's provided, or to the first parameter.


Usage:
Usage:
Line 9: Line 9:
* <tt><nowiki>{{DocLink|QWidget|properties}}</nowiki></tt> produces: {{DocLink|QWidget|properties}}
* <tt><nowiki>{{DocLink|QWidget|properties}}</nowiki></tt> produces: {{DocLink|QWidget|properties}}
* <tt><nowiki>{{DocLink|QWidget|size-prop|size()}}</nowiki></tt> produces: {{DocLink|QWidget|size-prop|size()}}
* <tt><nowiki>{{DocLink|QWidget|size-prop|size()}}</nowiki></tt> produces: {{DocLink|QWidget|size-prop|size()}}
* <tt><nowiki>{{DocLink|QWidget|size-prop|QWidget::size}}</nowiki></tt> produces: {{DocLink|QWidget|size-prop|QWidget::size}}
* <tt><nowiki>{{DocLink|QtWidgets-Index||Qt Widgets}}</nowiki></tt> produces: {{DocLink|QtWidgets-Index||Qt Widgets}} (note the empty anchor parameter)
* <tt><nowiki>{{DocLink|QtWidgets-Index||Qt Widgets}}</nowiki></tt> produces: {{DocLink|QtWidgets-Index||Qt Widgets}} (note the empty anchor parameter)
</noinclude>
</noinclude>

Latest revision as of 09:40, 21 September 2023

This template creates a link to pages in doc.qt.io. The link can be configured by 3 parameters, of which only the first is mandatory:

  • The first parameter usually corresponds to the class name, but can refer to any link under doc.qt.io
  • The second parameter corresponds to an anchor, to allow linking to a specific section of the page. It defaults to an empty string, so the link points to the top of the page.
  • The third parameter is an optional label. It defaults to the anchor name, if it's provided, or to the first parameter.

Usage:

  • {{DocLink|QWidget}} produces: QWidget
  • {{DocLink|QWidget|properties}} produces: properties
  • {{DocLink|QWidget|size-prop|size()}} produces: size()
  • {{DocLink|QWidget|size-prop|QWidget::size}} produces: QWidget::size
  • {{DocLink|QtWidgets-Index||Qt Widgets}} produces: Qt Widgets (note the empty anchor parameter)