QSocketNotifier: Can only be used with threads started with QThread

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

QSocketNotifier: Can only be used with threads started with QThread

Post by PrzemoF »

I upgraded fedora to 37 and FreeCAD now produces this:

Code: Select all

$ FreeCAD
FreeCAD 0.21.0, Libs: 0.21.0Rpre_33268.fc37 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2023
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

QSocketNotifier: Can only be used with threads started with QThread
QOpenGLFunctions created with non-current context
Wayland does not support QWindow::requestActivate()
Wayland does not support QWindow::requestActivate()
Wayland does not support QWindow::requestActivate()
Wayland does not support QWindow::requestActivate()
Wayland does not support QWindow::requestActivate()

Code: Select all

OS: Fedora Linux 37 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.0.pre_33268.fc37 (Git)
Build type: Unknown
Python 3.11.3, Qt 5.15.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * BIM 2021.12.0
  * MeshRemodel 1.8919.0
  * Help 1.0.3
  * ExtremeProDark 2.7.8
  * ProDarkThemePreferencePack 1.0.0
Bottom of the screen also shows error.
Screenshot from 2023-05-23 22-53-07.png
Screenshot from 2023-05-23 22-53-07.png (115.97 KiB) Viewed 2868 times
WARNING: there is a chance that it's my local problem as the system went through some bumps during the fedora upgrade.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by PrzemoF »

Same on:

Code: Select all

OS: Fedora Linux 37 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.0.pre_33274.fc37 (Git)
Build type: Unknown
Python 3.11.3, Qt 5.15.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * BIM 2021.12.0
  * MeshRemodel 1.8919.0
  * Help 1.0.3
  * ExtremeProDark 2.7.8
  * ProDarkThemePreferencePack 1.0.0
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by wmayer »

It must be related to your system because FreeCAD doesn't use QSocketNotifier anywhere. And the warnings about wayland come from your system too since FreeCAD doesn't directly access the API of the display server.

Now the question is whether there is a simple way to filter the warnings. If you build FreeCAD yourself can you add this line to void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg):

Code: Select all

Base::Console().Message("%s\n", context.category);
and report back what the output is?
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by adrianinsaval »

what about the wayland error?
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by openBrain »

wmayer wrote: Wed May 24, 2023 7:52 am can you add this line to void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg):

Code: Select all

Base::Console().Message("%s\n", context.category);
and report back what the output is?
Wouldn't that be good to add this in the debug builds?
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by wmayer »

Wouldn't that be good to add this in the debug builds?
I have prepared a PR to show the category in parentheses. This way we can easily add it to the ignore list if needed.

https://github.com/FreeCAD/FreeCAD/pull/9648
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by PrzemoF »

Most likely there is problem with my system I'm unable to boot to GUI now.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by PrzemoF »

On fedora we miss qqc2-desktop-style - I'll add that to the dependencies. The wayland error - I switched to xorg for now, but I'll come back later.
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: QSocketNotifier: Can only be used with threads started with QThread

Post by wmayer »

Done.
Post Reply