Я запускаю свое приложение, и оно сразу падает, в общем-то, я не знаю почему, но я знаю, что переместил его с версии 4.8 qt на версию 5.12 qt. Я получил сообщение об ошибке, как показано ниже:
User ID: 502
Date/Time: 2019-04-15 12:05:42.546 +0300
OS Version: Mac OS X 10.14.4 (18E226)
Report Version: 12
Time Awake Since Boot: 260000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [45798]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.qt-project.QtCore 0x000000010fc65a6f QObject::moveToThread(QThread*) + 31
Код:
ControlSetting::ControlSetting(Controller* controller, QObject *parent) :
QObject(parent)
{
impl = PtrControllSettingsPrivate(new ControllerSettingsPrivate(controller, this));
QThread* thread = new QThread();
thread->setObjectName("ControllerSetting");
this->moveToThread(thread);
connect(thread, SIGNAL(started()), this, SLOT(Start()));
connect(this, SIGNAL(finished()), thread, SLOT(quit()));
connect(this, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
}
И дополнительная информация из отчета о сбое:
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0xe8758948f07d8948 rbx: 0x000000010a6bb340 rcx: 0x00007fa0da522701 rdx: 0x000000010a486cd3
rdi: 0x00007fa0da570650 rsi: 0x00007fa0da563450 rbp: 0x00007ffee5784cd0 rsp: 0x00007ffee5784c70
r8: 0x000000000da5084b r9: 0x0000000000000000 r10: 0x00007ffee5785b28 r11: 0x000000011660fa50
r12: 0x0000000000000000 r13: 0x00007fa0da570650 r14: 0x0000000000000000 r15: 0x00007fa0da563450
rip: 0x000000011660fa6f rfl: 0x0000000000010202 cr2: 0x000000010a4c98f0
Logical CPU: 0
Error Code: 0x00000000
Trap Number: 13
Мой стек:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.qt-project.QtCore 0x000000010fc65a6f QObject::moveToThread(QThread*) + 31
1 com.w.Desktop 0x000000010c28bfcb ControlSetting:: ControlSetting(Controller*, QObject*) + 459 (ControlSetting:347)
2 com.w.Desktop 0x000000010c28c275 ControlSetting::ControlSetting(Controller*, QObject*) + 37 (ControlSetting:351)
3 com.w.Desktop 0x000000010c0682cc Controller::Controller(QObject*) + 908 (Controller:645)
4 com.w.Desktop 0x000000010c06a05d Controller::Controller(QObject*) + 29 (Controller:798)
5 com.w.Desktop 0x000000010c05edff Application::Setup() + 2943 (Application.cpp:276)
6 com.w.Desktop 0x000000010c03df4a main + 490 (main.cpp:161)
7 libdyld.dylib 0x00007fff766fe3d5 start + 1