0

My program will either open a GUI or not depending on some commandline parameters. Right now I am instantiating QApplication for my main event loop, but noticed that my program aborts when run from a headless machine (missing xorg/xcb) unless i specify some environment variables to trick it into believing there is an xorg running.

When I instead instantiate QCoreApplication I don't have access to activeWindow(). The code requiring activeWindow() will never run in the cases when the program is run headless (that is the purose of the commandline parameters).

So what I am asking is, would it be possible to make QApplication run without problems even on a headless machine, and simply not show any GUI?

What are my other options?

Ed Heal
  • 59,252
  • 17
  • 87
  • 127
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95

1 Answers1

1

No, this is not possible. But you can create QCoreApplication or QApplication in dependent from command line args.

synacker
  • 1,722
  • 13
  • 32