V
V
vaut2015-01-03 18:24:09
linux
vaut, 2015-01-03 18:24:09

How to replace x11Info when switching to qt5?

Good afternoon. In one open source project, the assembly with the QT backend in the master version was completely broken.
The project is barely glimmering and there is no need to wait for outside help.
Decided to fix it myself. But I had almost nothing to do with C++ and QT and I can't figure out how to fix this construction:

XRRScreenConfiguration *config = XRRGetScreenInfo(QX11Info::display(), RootWindow(QX11Info::display(), x11Info().screen()));

If anyone is interested here is the whole file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AtomKrieg, 2015-01-03
@vaut

Probably so:
or you can do it like this:

XRRScreenConfiguration *config = XRRGetScreenInfo( QX11Info::display(), QX11Info::appRootWindow() );

S
Stanislav Makarov, 2015-01-03
@Nipheris

In general, you can replace it with QDesktopWidget , but you will have to somehow get away from using the Display class, the object pointer of which is returned by the display() method. You need to figure out what the XRRGetScreenInfo function is, and how it uses this Display. Perhaps the primaryScreen property will be enough to get the main screen number and the screenGeometry(int screen) method .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question