在 Qt5 中使用文本元素的彩色圆点 [英] Colored dots on using text element in Qt5

查看:44
本文介绍了在 Qt5 中使用文本元素的彩色圆点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了这个示例代码:

import QtQuick 2.0

Rectangle {
    width: 360
    height: 360
    Text {
        text: qsTr("Hello World")
        anchors.centerIn: parent
        font.pixelSize: 55
    }
    MouseArea {
        anchors.fill: parent
        onClicked: {
            Qt.quit();
        }
    }
}

执行此操作时,我看到文本以及围绕文本的一些彩色圆点:

On executing this, I see text along with some colored dots surrounding the text :

平台:Windows 7:Qt 5.0.1

Platform : Windows 7 : Qt 5.0.1

问.有人可以指出可能存在的问题吗?

Q. Can someone point out what might be the possible problem ?

附言:这不是我的显示器的问题,它可以在 ubuntu 和操作系统的同一台机器上正常工作.

P.S. : This isnt a problem with my monitor, it works fine on the same machine with ubuntu as the OS.

推荐答案

您正在使用 Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB).OpenGL 部分意味着这个 Qt 构建需要运行 OpenGL 驱动程序.某些 Windows 安装破坏了 OpenGL 支持.您需要确保系统安装了来自显卡供应商的最新驱动程序,或者您不应使用该版本的 Qt.这很可能是您问题的根源.

You're using Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB). The OpenGL part means that this build of Qt requires working OpenGL drivers. Some Windows installations have broken OpenGL support. You need to either ensure that the system has most recent drivers installed from the graphics card vendor, or you should not use that version of Qt. That's likely the source of your issue.

您需要下载例如Qt 5.1.1 for Windows 32-bit (VS 2010, 505 MB).没有 OpenGL 字样的版本使用 ANGLE.ANGLE 是基于 DirectX 9 的 OpenGL ES 2 实现.当您使用它时,您将不再依赖于可运行的 OpenGL 驱动程序.

You need to download, for example, Qt 5.1.1 for Windows 32-bit (VS 2010, 505 MB). The version without the word OpenGL in it uses ANGLE. ANGLE is an implementation of OpenGL ES 2 on top of DirectX 9. When you use it, you won't be dependent on working OpenGL drivers anymore.

MinGW 下尚无 ANGLE 支持.您可以将 Visual Studio Express 用于您的编译器,它工作正常.您将只能通过 Qt Creator 使用构建工具,而不是 IDE,因此它是 Express 的事实并不会限制您.您需要下载并安装相关的 Platform SDK 块以获取调试工具.

There's no ANGLE support under MinGW yet. You can use the Visual Studio Express for your compiler, it works fine. You'll only be using the build tools via Qt Creator, not the IDE, so the fact that it's Express doesn't limit you. You'll need to download and install the relevant chunk of Platform SDK to get the debugging tools.

这篇关于在 Qt5 中使用文本元素的彩色圆点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆