简体   繁体   中英

Need Qt QPA and X11 clarification

I tried to understand Qts platform handling for hours now, but I dont get it. For my hotkey handling I currently use a mixture of X11extras for getting display, xlib for key conversions and xcb for the Qt native event handling. Three libs to link. And where does the undocumented QPA play a role here? Now I wonder if this is necessary. I need some clarification here. I am using qt 5.4. What is the way to go for the future?

For Qt, you shouldn't need to do any native platform coding for key events unless you're using native windows. Read about QEvent and the event functions in QWidget .

Use QWidget::nativeEvent() or QCoreApplication::installNativeEventFilter() if you need direct access to raw X11 events. Native event filters at the application level are processed for every event and have more of a performance impact than subclassing QWidget and reimplementing nativeEvent() .

Read about QWindow::fromWinId() and QWidget::createWindowContainer() if you need to embed a native window as a child widget.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM