Problems with QTextEdit focus in QX11EmbedWidget
-
I have an window, tabs as central widget in it and embed containers in each tab.
My code:
Parent process:
@#include <QApplication>
#include <QProcess>
#include <QX11EmbedContainer>int main ( int argc, char * argv [] )
{
QApplication app ( argc, argv );
QX11EmbedContainer * embedContainer = new QX11EmbedContainer ();
QProcess * process = new QProcess ( embedContainer );
process -> start ( "./client", QStringList () << QString :: number ( embedContainer -> winId () ) );
embedContainer -> show ();
int status = app . exec ();
process -> close ();
return status;
}@
Child process:
@#include <QApplication>
#include <QGridLayout>
#include <QTextEdit>
#include <QX11EmbedWidget>int main ( int argc, char * argv [] )
{
QApplication app ( argc, argv );
QX11EmbedWidget * embedWidget = new QX11EmbedWidget ();
QGridLayout * layout = new QGridLayout ( embedWidget );
layout -> setContentsMargins ( 0, 0, 0, 0 );
QTextEdit * editor = new QTextEdit ();
layout -> addWidget ( editor );
embedWidget -> embedInto ( QString ( app . arguments () [ 1 ] ) . toULong () );
embedWidget -> show ();
return app . exec ();
}@
All compiles good and runs without any fatal exceptions.Now, my problem:
When my program starts:- xterm works without problem
- I can change and move tab
- I can select text ( left mouse button and 2x left mouse button ), paste text ( middle mouse button )
- Cursor icon is changed when mouse enter or leave QTextEdit
- When I click on xterm console focus for all tabs work normally
- I get focus for QTextEdit only after TAB button is pressed ( when QTextEdit tab is active; no focus on left mouse click; works globally for all tabs - focus fix by tab press ), I can not focus by right mouse button click ( no context menu )
Qt version: 4.8.6
Platform: Linux x86 ( Manjaro )Thanks for your time and sorry for my poor English.