Re: [Interest] QML Singleton and QTimer?

2021-05-10 Thread Jason H
> Sent: Monday, May 10, 2021 at 3:08 AM > From: "Ulf Hermann" > To: interest@qt-project.org > Subject: Re: [Interest] QML Singleton and QTimer? > > Hi, > > > GuiApplication::GuiApplication(int argc, char*argv[]): > >

Re: [Interest] QML Singleton and QTimer?

2021-05-10 Thread Ulf Hermann
Hi, GuiApplication::GuiApplication(int argc, char*argv[]): QGuiApplication::QGuiApplication(argc, argv) { m_hardwareInterface = new HardwareInterface; qmlRegisterSingletonInstance("com.company", 1, 0, "HardwareInterface", m_hardwareInterface); }

Re: [Interest] QML Singleton and QTimer?

2021-05-07 Thread Jérôme Godbout
ate: Friday, May 7, 2021 at 10:10 AM To: Jérôme Godbout Cc: interestqt-project.org Subject: Re: [Interest] QML Singleton and QTimer? Well, the documentation gives the example of the singleton being instantiated at the main.cpp:main() level. It felt a little wrong, but I subclassed QGui

Re: [Interest] QML Singleton and QTimer?

2021-05-07 Thread Jason H
rom: "Jérôme Godbout" To: "Jason H" , "interestqt-project.org" Subject: Re: [Interest] QML Singleton and QTimer? You can check the thread affinity of an object and the current thread that will display the problem you encounter. Use a queued signal into the QTimer

Re: [Interest] QML Singleton and QTimer?

2021-05-06 Thread Jérôme Godbout
e From: Interest on behalf of Jason H Date: Thursday, May 6, 2021 at 5:34 PM To: interestqt-project.org Subject: [Interest] QML Singleton and QTimer? I'm trying to have a simple singleton class, but it doesn't appear that I can use timers? HardwareInterface::HardwareInterface(QObject *parent

[Interest] QML Singleton and QTimer?

2021-05-06 Thread Jason H
I'm trying to have a simple singleton class, but it doesn't appear that I can use timers? HardwareInterface::HardwareInterface(QObject *parent) : QObject(parent) { m_timer = new QTimer(this); connect(m_timer, ::timeout, this, [=](){ qDebug() << Q_FUNC_INFO;