I tried embedding emacs in a Qt application using the QX11EmbedContainer and it works, but with two important exceptions. First of all, here is the code:
#include <QX11EmbedWidget> #include <QtGui> #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); QX11EmbedContainer container; container.show(); container.resize(500, 500); QProcess* process = new QProcess(&container); QString executable("emacsclient"); QStringList arguments; arguments << "--parent-id" << QString::number(container.winId()); process->start(executable, arguments); int status = app.exec(); process->close(); return status; }
And the compilation and execution line (and the previous version of emacs server):
$ emacs -q --daemon & // filtered output $ g++ test.cpp -lQtGui -lQtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 $ ./a.out
And finally, the result:

But when or when I try to write something in the minibuffer, the size of the widget collapses, and the focus is also lost:

If I click on (now shorter) widgets, I can work with emacs without problems, but I have to resize the window so that emacs expands at a different time, as originally.
Where is the problem?
qt emacs embed
Peregring-lk
source share