是否可以通过使用a DialogFragment将其移出中心并将其放置在屏幕上的任何位置?
这有什么问题吗?它给了我奇怪的编译错误:
候选函数不可行:第二个参数没有从“void (QThread::*)(QThread::QPrivateSignal)”到“const char *”的已知转换
QTimer timer;
timer.setInterval(3000);
connect(&timer, &QTimer::timeout, this, &ThisClass::runConnectionCheck);
QThread connectionThread;
timer.moveToThread(&connectionThread);
connect(&connectionThread, &QThread::started, &timer, &QTimer::start);
connectionThread.start();
Run Code Online (Sandbox Code Playgroud) 我想知道根据 QML 代码中的条件创建矩形、文本或按钮的最佳方法是什么。
这是一个伪代码:
import QtQuick 2.0
Item{
property string name = "rect" or "text" or "button"
id:root
if (name === "rect")
Rectangle {
//properties
parent: root
}
else if (name === "text")
Text {
//properties
parent: root
}
else if (name === "button")
Button {
//properties
parent: root
}
}
Run Code Online (Sandbox Code Playgroud) Window例如,我想知道 a是否有一些子元素。是否有可能得到哪个孩子在其MouseArea当前的 x 和 y之下?