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. Click on Window breaks text selection
Forum Updated to NodeBB v4.3 + New Features

Click on Window breaks text selection

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 394 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
    SkyleDc
    wrote on last edited by
    #1

    Hello ! I'm currently trying to create a software which will embed non-Qt apps (A game) into a QWidget windowContainer in order to help the player with a few things.
    The embedded app is inside a QTabWidget.

    Here's the code for embeding the window into my Qt app :

    WId wid = (WId)FindWindow(NULL, reinterpret_cast<LPCTSTR>(Tab[i].Window_Name.utf16()));
    QWindow *m_window;
    m_window = QWindow::fromWinId(wid);
    
    QWidget *m_widget;
    m_widget = QWidget::createWindowContainer(m_window, this);
    ui->QTabWidget_Game->addTab(m_widget,Tab[i].Window_Name);
    

    When I execute the QT app, it automatically checks if the game is running, if yes, it embeds the game in the QTabWidget.

    The problem is, I can't get my embedded app to accept text selection or even copy/paste after clicking on the QT window itself with my mouse.
    If, after launching the QT app, I do not click on the app's border (see screenshot) and directly click on the game, text selection will work.

    image_2021-08-30_063844.png

    P.S : By text selection, I mean this :

    image_2021-08-30_062509.png

    It's been like 2 weeks and I can't find anything on the web and I can't find how to do.
    Please, help .. 😥

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I wonder if your are not hitting QTBUG-40320 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SkyleDc
        wrote on last edited by SkyleDc
        #3

        Hello @SGaist , first thank you for trying to help me ! 😁

        I did check the post you linked and it seems it isn't quite the same problem. Tho he use the same functions to embed his apps in a QWidget.
        My problem only concern text selection. I can still type text, use my keyboard and my mouse but I can't select text and I can't copy/paste/cut anything.
        I can't even paste text present in my clipboard.

        (I developed this Qt app 2 times, first one being C++ based with QTCreator, and the other one being Python based with PyQt. The bug occurs on both apps)

        EDIT : I tested my app with another window (I tried embeding steam) and I get the same bug (but not everytime) as the post you linked ! I can't type anything, steam seems to soft-lock randomly. Some time i can select/type, sometime not.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I wonder if it's question of strange interaction with the native event dispatcher.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            I wonder if it's question of strange interaction with the native event dispatcher.

            S Offline
            S Offline
            SkyleDc
            wrote on last edited by
            #5

            @SGaist What do you mean ?
            I would really like to solve this problem, so if you have a solution, I would be very thankful.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Rather thinking out loud about Qt's implementation of QAbstractEventDispatcher for Windows.

              Trust me, if I had it I would have already told you how to.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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