Revision control

Copy as Markdown

{#-
Copyright (C) 2025 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-#}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ escape_html(title) }}</title>
{%- if stylesheetEnabled %}
<link rel="stylesheet" href="{{ escape_html(stylesheetName) }}">
{%- endif %}
</head>
<body>
<header class="header-bar">
<div class="qt-logo">
<img src="qt-logo-documentation.png" alt="Qt Documentation" height="28">
</div>
<nav class="breadcrumbs" aria-label="Breadcrumbs">
{% if exists("breadcrumbs") %}{% for crumb in breadcrumbs %}{% if existsIn(crumb, "current") %}<span class="crumb current">{{ escape_html(crumb.title) }}</span>{% else %}<span class="crumb">{{ escape_html(crumb.title) }}</span>{% if not loop.is_last %}<span class="separator">&gt;</span>{% endif %}{% endif %}{% endfor %}{% else %}<span class="crumb current">{{ escape_html(title) }}</span>{% endif %}
</nav>
</header>
<main class="content">
<h1>{{ escape_html(fullTitle) }}</h1>
{% if default(brief, "") != "" %}
<p class="brief">{{ escape_html(brief) }}</p>
{% endif %}
{% if exists("since") %}
<span class="since">Since {{ escape_html(since) }}</span>
{% endif %}
{% set ai_prompt = "I'm reading the Qt documentation page '" + title + "'" %}
{% if exists("genus") %}{% set ai_prompt = ai_prompt + " (" + genus.label + ")" %}{% endif %}
{% if brief %}{% set ai_prompt = ai_prompt + ". Summary: " + brief %}{% endif %}
{% set ai_prompt = ai_prompt + ". Explain the key concepts and typical usage patterns." %}
<div class="toolbar">
<button class="toolbar-btn" id="copy-btn" onclick="copyPage()" title="Copy page content">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="9" rx="1"/><path d="M3 10.5V3a1 1 0 011-1h6.5"/></svg> Copy
</button>
<a href="#" id="md-link" class="toolbar-btn" title="View as Markdown">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="3" width="14" height="10" rx="1.5"/><path d="M4 10V6l2 2.5L8 6v4"/><path d="M11 8.5l1.5 1.5L14 8.5"/></svg> Markdown
</a>
<details class="ask-ai">
<summary class="toolbar-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.5 3.5l1.4 1.4M11.1 11.1l1.4 1.4M12.5 3.5l-1.4 1.4M4.9 11.1l-1.4 1.4"/><circle cx="8" cy="8" r="2.5"/></svg> Ask AI
</summary>
<nav class="dropdown-content" id="ai-menu" data-prompt="{{ escape_html(ai_prompt) }}">
<a class="ai-link" data-provider="claude"><span class="ai-badge ai-claude">C</span> Explain with Claude</a>
<a class="ai-link" data-provider="chatgpt"><span class="ai-badge ai-chatgpt">G</span> Explain with ChatGPT</a>
<a class="ai-link" data-provider="grok"><span class="ai-badge ai-grok">X</span> Explain with Grok</a>
</nav>
</details>
</div>
{% include "partials/html/content_blocks.html" %}
{% if length(sections) > 0 %}
{% for section in sections %}
<div class="section-{{ section.id }}">
<h2>{{ escape_html(section.title) }}</h2>
{% if length(section.members) > 0 %}
<table class="alignedsummary">
{% for member in section.members %}
<tr>
<td class="memItemLeft">{% if existsIn(member, "href") and member.href != "" %}<a href="{{ member.href }}">{{ escape_html(member.signature) }}</a>{% else %}{{ escape_html(member.signature) }}{% endif %}</td>
<td class="memItemRight">{{ escape_html(default(member.brief, "")) }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if existsIn(section, "reimplementedMembers") %}
<h3>Reimplemented {{ escape_html(section.plural) }}</h3>
<table class="alignedsummary">
{% for member in section.reimplementedMembers %}
<tr>
<td class="memItemLeft">{% if existsIn(member, "href") and member.href != "" %}<a href="{{ member.href }}">{{ escape_html(member.signature) }}</a>{% else %}{{ escape_html(member.signature) }}{% endif %}</td>
<td class="memItemRight">{{ escape_html(default(member.brief, "")) }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if existsIn(section, "inheritedMembers") %}
{% for inherited in section.inheritedMembers %}
<p>{{ inherited.count }} {{ escape_html(section.plural) }} inherited from {% if inherited.href != "" %}<a href="{{ inherited.href }}">{{ escape_html(inherited.className) }}</a>{% else %}{{ escape_html(inherited.className) }}{% endif %}</p>
{% endfor %}
{% endif %}
</div>
{% endfor %}
{% endif %}
</main>
<footer class="content footer">
<p>Generated by QDoc.</p>
</footer>
<script>
function copyPage() {
var btn = document.getElementById('copy-btn');
var text = document.querySelector('main.content').innerText;
navigator.clipboard.writeText(text).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="9" rx="1"/><path d="M3 10.5V3a1 1 0 011-1h6.5"/></svg> Copy'; }, 1500);
});
}
document.addEventListener('DOMContentLoaded', function() {
var menu = document.getElementById('ai-menu');
if (menu) {
var prompt = encodeURIComponent(menu.getAttribute('data-prompt'));
var urls = { claude: 'https://claude.ai/new?q=', chatgpt: 'https://chatgpt.com/?q=', grok: 'https://grok.com/?q=' };
var links = menu.querySelectorAll('.ai-link');
for (var i = 0; i < links.length; i++) {
var provider = links[i].getAttribute('data-provider');
if (urls[provider]) links[i].href = urls[provider] + prompt;
links[i].target = '_blank';
links[i].rel = 'noopener';
}
}
var mdLink = document.getElementById('md-link');
if (mdLink) {
var path = window.location.pathname;
var name = path.substring(path.lastIndexOf('/') + 1).replace('.html', '.md');
mdLink.href = '../markdown/' + name;
}
document.querySelectorAll('pre').forEach(function(pre) {
var btn = document.createElement('button');
btn.className = 'code-copy-btn';
btn.textContent = 'Copy';
btn.addEventListener('click', function() {
navigator.clipboard.writeText(pre.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
});
pre.style.position = 'relative';
pre.appendChild(btn);
});
});
</script>
</body>
</html>