Qt Popup as a completer window
I need to make some kind of popup window that contains propositions to complete sentences in text editor (QTextPlainEdit). This window needs to be on top of all windows of this application. Also this popup mustn't interrupt typing in the text editor when it appears. I tried different types of flags for QWidget that implements this completer but all I have got is that this completer window is placed above all windows of OS (even if this application is not active) or it interrupts typing in the text editor and makes main window not active any time it appears. What flags should I use for completer widget?
You could try to use QWidget::setWindowFlags(Qt::Window | Qt::FramelessWindowHint). Otherwise you could use a customized version of Qt::Popup, by overriding the automatic closing behavior. You could also try this: if you set the QTextPlainEdit's parent as the completer's parent it should do what you want, provided that the parent does not have a layout (otherwise it will not "float").
The Qt docs contain an example that implements a google-based auto-completer widget, here: http://qt-project.org/doc/qt-4.8/network-googlesuggest.html. As far as I can tell, they do two things that might be relevant to your situation. One is the flags they set on the popup widget: popup = new QTreeWidget; popup->setWindowFlags(Qt::Popup); popup->setFocusPolicy(Qt::NoFocus); popup->setFocusProxy(parent); The other is a custom event filter on the popup widget, which forwards most keypress-events to the editor widget, and closes the auto-completer on Enter or Escape.
Qt5 Force TabWidget to resize on window size change
Not getting a TCPSocket response in my code
How to determine cause of DirectX 11 driver hang
How to undock tab with osgViewer from QTabWidget?
Inheriting forms in Qt with CMake (multiple inheritance method)
Force threads to wait for other threads to complete their jobs before going further?
QMainWindow opacity work, Qdialog not
How to do chalk style drawing with Qt
Read and write to a file from a QTableView
How to run multiple commands with an extra target in QMake
RE-running get requests using QNetworkAccessManager
QWizard opens and closes immediately
Qt Mobility or Qt Location available for desktop use?
QtWebkit, Can't use '#' key
Creating a home screen for my embedded board using Qt/Qt Quick
Combination cmake 22.214.171.124 with qt 5.1 won't create ui_xxx.h files