如何解决如何确定应用程序是否在 Qt6 上的 X11 平台上运行?
我正在努力将 Qt5 应用程序移植到 Qt6。由于在 Qt6 中删除了 {% if product.variants.size > 1 %}
<script>
function selectCallback(variant,selector) {
// This is where you would put any code that you want to run when the variant changes.
}
var variantIdFieldIdentifier = 'variant-select';
new Shopify.OptionSelectors(variantIdFieldIdentifier,{
// Product object required to know how options map to variants...
product: {{ product | json }},// Function to do any interesting stuff (eg: update price field,image,etc) when selections change...
onVariantSelected: selectCallback,// When true,will update the URL to be a direct link to the currently-selected variant...
enableHistoryState: true
})
</script>
{% endif %}
模块,我必须检查平台是否为 Qt X11 Extras
,我该怎么做?
这是当前实现所使用的。
X11
我还有 if (QX11Info::isPlatformX11())
{
...
...
}
类的其他用例。我如何移植这个?我似乎没有找到任何其他解决方案。
解决方法
QGuiApplication::platformName() 检查应该没问题,见 https://doc.qt.io/qt-6/qguiapplication.html#platformName-prop
顺便说一下,QtX11Extras 中的 QX11Info 和其他内容已移入 QtGui(开发分支,6.2),另见 https://codereview.qt-project.org/c/qt/qtbase/+/348530。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。