一个特定的问题只能在客户方重现。尽管我们进行了所有尝试,但我们无法在本地复制它。
但我知道 Windows 2008 R2 中的 TaskMgr 可以为进程创建转储文件。所以,我的问题是:是否可以在客户站点上为我们软件的某个进程创建转储,然后在本地调查该转储文件?
我们已经对我们的软件进行了新的构建(我们为所有二进制文件保存了一个构建沙箱和 *.PDB 文件)。然后我们在现场安装了它,现在我们正在等待客户报告问题再次发生时,因此我们将为挂起过程创建一个转储文件,然后尝试对其进行调查。
我的问题有两部分:
目前我怀疑这是否可行。因为我试图在我的本地 Win 2008 R2 VM 上创建一个验证测试。我使用.PDB 文件Sleep(30000)构建所有文件,然后我以一种模式运行我们的软件,当它在中间暂停很长时间时,我在 TaskMgr 中单击“创建转储文件”,恰好在它暂停时(它的简单调用)。然后我尝试在 WinDbg 中加载该转储文件并检查我能在那里找到什么。让我对这种方式感到悲观的第一件事是错误的堆栈跟踪。特别是 - 我在 WinDbg 中看不到完整的堆栈跟踪。它只显示 wow64 .dll 和 ntdll.dll 模块的堆栈跟踪,我看不到我们代码的堆栈跟踪。特别是我只看到这个:
wow64cpu!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu!TurboDispatchJumpAddressEnd+0x56b
wow64!Wow64SystemServiceEx+0x1ce
wow64!Wow64LdrpInitialize+0x42a
ntdll!RtlUniform+0x6e6
ntdll!RtlCreateTagHeap+0xa7
ntdll!LdrInitializeThunk+0xe
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用调试器附加进程时,我看到一个完整的调用堆栈,如下所示:
ntdll.dll! 7754fd910
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7754fd9l0
KernelBase.dll! 76ae3bd50
KernelBase.dll! 76ae44a 5Q
ScrVm.DLL!Profiler::DoSleep(intmilliseconds=30000) Line 205
ScrVm.DLL!Script::VmToolKit::iMethod_Sleep(unsigned …Run Code Online (Sandbox Code Playgroud) 如何读取QTimeEditQt中用户设置的当前小时和分钟,以及如何QDateTime读取(读取当前的日,月,年,分钟和小时)?
有没有办法modelData从视图委托(特别是中继器)访问。
我尝试使用单独的属性并尝试通过它访问它,model.modelData但这都不起作用。
请参阅下面的代码快照。
提前致谢。
Component
{
id: comp_1
Rectangle
{
color: "green"
width: 200
height: 200
}
}
Component
{
id: comp_2
Rectangle
{
color: "red"
width: 200
height: 200
Text
{
anchors.fill: parent
text: modelData
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
function getDelegate(itemName)
{
if(itemName === "comp1")
return comp_1;
else
return comp_2;
}
Row
{
Repeater
{
id: repeat
model: ["comp1", "comp2"]
Loader
{
sourceComponent: getDelegate(modelData)
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有这样的事情:
var arr = []
arr.indexOf(element => element.includes(''))
Run Code Online (Sandbox Code Playgroud)
QtCreator为此给出了错误。我的Qt版本是5.12,我正在使用QtCreator 4.8。
我可以在QML中使用这种lambda表达式吗?
编辑:解决了.
嗨,我从Qt开始,我尝试连接一个插槽信号,QProcess::started()但不能.QObject::connect()回报false.
知道我做错了什么吗?
这是代码的一部分:
class foo : public QObject
{
public:
QProcess *process;
public slots:
void process_started();
}
foo::foo()
{
process = new QProcess();
bool status = QObject::connect( process, SIGNAL( started() ), this, SLOT( process_started() ) );
// status is false, meaning the slot and signal couldn't be connected
}
Run Code Online (Sandbox Code Playgroud)
我知道这个过程成功启动,因为我尝试过process->WaitForStarted()并返回true.但是我在插槽上放了一个断点,foo::process_started()它永远不会被击中.这有什么问题?谢谢!
我在插入值时遇到了一些麻烦 SQLite database
这就是我创建数据库的方式:
if(query.exec("CREATE TABLE IF NOT EXISTS visitorItemsV4 (channelID, itemId, itemName, itemPic, itemPrice, itemMeta);")) {
qDebug() << "Table `visitorItemsV4` created.";
}
Run Code Online (Sandbox Code Playgroud)
这就是我插入新项目的方式:
if (db.isOpen()) {
qDebug() << itemId;
qDebug() << itemName;
qDebug() << itemPic;
qDebug() << itemPrice;
QSqlQuery query(db);
ret = query.exec(QString("insert or replace into visitorItemsV4 values ('%1', '%2', '%3', '%4', '%5', '%6');")
.arg(channel).arg(itemId).arg(itemName).arg(itemPic).arg(itemPrice).arg(itemPrice));
qDebug() << query.lastError();
if (ret) {
qDebug() << "saved item";
}
}
Run Code Online (Sandbox Code Playgroud)
问题是itemPrice始终获取值%5并itemMeta获取值%6
itemPrice变量包含499所以我期望这是价值 …