Compiler does not see QX11Info

前端 未结 2 609
孤独总比滥情好
孤独总比滥情好 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 
    

提交回复
热议问题