qt


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.

Related Links

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 2.8.11.2 with qt 5.1 won't create ui_xxx.h files

Categories

HOME
oracle
knockout.js
xcode
livecode
applescript
scroll
activex
antd
ant
iverilog
android-emulator
material-components
hyperledger
sentry
cisco
hspi
msmq
lda
supervisord
async-await
phonegap-build
nullreferenceexception
bazaar
bsd
liferay-6.2
generator
web-config-transform
fstar
offline-caching
gravity-forms-plugin
amazon-cloudtrail
laravel-4.2
osx-lion
kendo-listview
counting
serversocket
buildforge
nanogallery
ms-dos
telephonymanager
microsoft-ui-automation
aurelia-http-client
classnotfoundexception
apache-toree
asihttprequest
doctrine-extensions
nuclio
webalizer
return-type
jgrapht
openstack-glance
portability
mobile-angular-ui
mechanicalturk
wildfly-9
annotatorjs
rational-performance-test
okio
nclam
ndk-build
nsrunloop
gcloud-node
powerpoint-2013
django-redis
wikimedia-commons
outlook.com
nette
auto-generate
search-form
replicaset
dynamics-ax-2012-r2
nsmutabledata
incron
encryption-symmetric
igor
relationships
xhprof
rpg
accountmanager
cpu-time
pre
cloo
compiler-flags
mp4parser
acceptance-testing
reentrancy
multiple-dispatch
clearinterval
system-information
fbml
dynamic-c
expression-web
data-dump
bll
downgrade
android-2.1-eclair
principles
resharper-5.0
yahoo-maps
main-method
server-load
account-management

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile