radiomanV / TL866

Open source software for TL866
GNU General Public License v2.0
334 stars 79 forks source link

Fixed QT6 and macOS build errors #41

Closed Kreeblah closed 2 years ago

Kreeblah commented 2 years ago

I noticed that this wouldn't compile against QT6, and there seemed to be some issues with how libusb was called. This fixes those problems.

radiomanV commented 2 years ago

Sorry, but can you explain to me what's wrong with some issues with how libusb was called? It is legal to pass null for the default context: https://libusb.sourceforge.io/api-1.0/libusb_contexts.html. The initial approach was like yours but i have changed to nullptr some time ago. The QT6 fixes are okay. Thanks!

Kreeblah commented 2 years ago

The issue wasn't with nullptr specifically. It was that on line 52, there's a reference to ctx which isn't defined. So, I added a definition for that. I suppose changing that line to nullptr rather than adding a ctx definition would have worked just as well, though.

Kreeblah commented 2 years ago

OK, I just switched back to nullptr for the context, and used that for line 52 in usb_macos.cpp as well.

radiomanV commented 2 years ago

Oh, you're absolutely right. As i don't use macos i never encountered this error. Thanks for clarifications. I'll merge this.

radiomanV commented 2 years ago

Also a small fix, we need to set the background role for all those labels used as leds otherwise they're all set to grey color (at least in my Linux distro). It seems that QT6 introduced some changes and requirements not present in the previous versions. Meh, i never liked Qt but that is.