Compiler does not see QX11Info

前端 未结 2 587
孤独总比滥情好
孤独总比滥情好 2021-01-22 00:21

I\'ve created a little class to set some global shortcuts. But now, when i compile my app i see many errors:

In file included from ../src/GlobalShortcut/globalsh         


        
相关标签:
2条回答
  • 2021-01-22 00:41

    Vinicius is close to having the full answer.

    This is for Qt 5.1 or newer. The issue is that access to X11 and GDI handles were removed and then put back again in a slightly different place.

    Add x11extras to the .pro file:

    QT += gui x11extras
    

    If the moc generated code fails to compile add the following to the bottom of the the file it includes (X11 headers define Bool):

    #undef Bool
    

    Add the following to the file that needs access to QX11Info:

    #include <QtX11Extras/qx11info_x11.h>
    
    0 讨论(0)
  • 2021-01-22 00:42

    I have not checked, but I believe you only missed adding the following to your .pro file, as stated at the docs

    QT += gui x11extras
    

    It's likely that that you may be missing a header file, but without the error message, I find it a bit hard to figure it out since I've never touched X11 stuff directly.

    Hope it helps.

    0 讨论(0)
提交回复
热议问题