Hi!
I am writing text editor in multiplatform way. In the past I most time spending on Windows, but now I am back to the Linux and I want next version of my text editor will be usable on Linux also.
Now am working with Kubuntu 18.10 with Kde Plasma windows manager. I have 4 virtual desktops. Most of the time I am working only with first of them. But I can image to work with file manager on some other screen and I want to run my editor from file manager many times (intense working with source files in many languages). I do some basic tests and I am failed to find "right Qt way" to determine number of desktop on which my text editor is running. I try:
1. Identify by screen pointer:
Qt Code:
  1. MainWindow w;
  2. reinterpret_cast<quint64>(w.windowHandle()->screen()
To copy to clipboard, switch view to plain text mode 
Which is wrong because it is unique from instance to instance.
2. Find siblings of current screen:
Qt Code:
  1. QList<QScreen*> lScreens(w.windowHandle()->screen()->virtualSiblings());
  2. for(QScreen* lScreen : lScreens)
  3. qInfo() << "Detected screen: " << reinterpret_cast<quint64>(lScreen);
To copy to clipboard, switch view to plain text mode 
But it return only first screen (3 rest are ignored).
3. Identify by primaryScreen pointer:
Qt Code:
  1. qInfo() << "Detected screen: " << reinterpret_cast<quint64>(a.primaryScreen());
To copy to clipboard, switch view to plain text mode 
But it failed also (it is unique from instance to instance).
4. QDesktopWidget::screenNumber()
But it always return 0 (no mater what is current desktop).

Do you have any other ideas?