Qt快速图像不显示
Qt Quick image not showing
当我尝试将图像添加到新qt快速项目的模板时,它会编译并显示窗口,但仅显示编辑文本和矩形。
import QtQuick 2.6
Rectangle {
property alias mouseArea: mouseArea
property alias textEdit: textEdit
width: 360
height: 360
MouseArea {
id: mouseArea
anchors.fill: parent
}
TextEdit {
id: textEdit
text: qsTr("Enter some text...")
verticalAlignment: Text.AlignVCenter
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 20
Rectangle {
anchors.fill: parent
anchors.margins: -10
color: "transparent"
border.width: 1
}
}
Image {
id: image
x: 207
y: 235
width: 100
height: 100
source: "../../QtIcon.png"
}
}
您可以通过添加 infront file://在文件系统中使用图像。 示例:来源:"file://C:/test.png">
相关文章:
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- C++射线示踪剂ppm表示没有足够的数据来显示图像
- 我在 OpenGL 中显示图像时遇到问题
- 无法在 Opencv 中显示图像导致内存位置
- 从C++调用网络摄像头并在 Python 中显示图像
- C++列出屏幕以在第二台显示器中显示图像
- 如何用QT显示图像
- 如何在 QGraphicsView 中显示图像
- C++/openCV - 为什么显示图像会产生 Linux 分割错误?(打开CV错误?
- 在C 中显示图像及其元数据
- C++显示图像并将其保持到下一张图像的最佳方法
- 如何使用SDL_surface在用户定义的矩形上显示图像?
- 如何使用QVector的QPixmap显示图像?
- 如何在任何使用 Opencv 的计算机上显示图像
- 使用 qt 和 opengl、定时精度和垂直同步问题、c++ 显示图像
- QLabel像视频一样显示图像
- 使用 c++ 显示图像
- Qt表查看单元格中的显示图像并在单击时获取路径
- 在Visual C 控制台应用程序中显示图像
- 如何使用Createbsection显示图像