Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems with QTextEdit focus in QX11EmbedWidget
Qt 6.11 is out! See what's new in the release blog

Problems with QTextEdit focus in QX11EmbedWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 915 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s77s
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved