Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. xterm -info - how to get windowID from "parent'?
Forum Updated to NodeBB v4.3 + New Features

xterm -info - how to get windowID from "parent'?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 741 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I hope this question can be posted as "other tool (question) ".
    I like to test xterm -info option, however, I fail to retrieve JUST the "windowID" from "parent ".
    I am getting combination of id and name of "parent".
    -info option wnats only "windowID".
    How do I get it ?

    qDebug()<< "parent " << parent;

    From xterm man

    -into windowId
    
    Given an X window identifier (an integer, which can be hexadecimal, octal or 
    decimal according to whether it begins with "0x", "0" or neither), 
    xterm will reparent its top-level shell widget to that window. This is used to embed xterm within other applications.
    
    1 Reply Last reply
    0
    • Axel SpoerlA Online
      Axel SpoerlA Online
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      Major and minor ID of an X window are implementation details, which you cannot and should not access from the platform abstraction level. Of course you can debug or even modify the Qt XCB plugin to access the data. The question is: What do you want to do with it? What do you want to test, that you cannot test by other means (and thus platform independent)?

      Software Engineer
      The Qt Company, Oslo

      JonBJ 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        Major and minor ID of an X window are implementation details, which you cannot and should not access from the platform abstraction level. Of course you can debug or even modify the Qt XCB plugin to access the data. The question is: What do you want to do with it? What do you want to test, that you cannot test by other means (and thus platform independent)?

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by JonB
        #3

        @Axel-Spoerl
        This comes from my answer to the OP at https://forum.qt.io/topic/139123/qprocess-running-xterm-how-to-read-write-directly-to-xterm/7

        @AnneRanch
        The code I referenced at https://stackoverflow.com/questions/62177109/embeding-xterm-into-qt5-application-in-c/62178907#62178907 works just fine.

        The QString::number(winId()) it uses to pass as the argument for -into returns e.g. 46137350 for me, i.e. it is just a number, exactly as the man page you quote states.

        I fail to retrieve JUST the "windowID" from "parent ".

        Don't know what you are doing here. The code does not use any parent, and there is no "combination of id and name of "parent"". The code, and the xterm -into, puts the xterm into the QWidget you are creating for it, or whatever widget you tell it to, exactly as per WId QWidget::winId() const. I don't know what your parent is since you do not give any context. But obviously if for whatever reason you have some QWidget *parent variable you want to put it into you would specify parent->winId().

        1 Reply Last reply
        1
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          Here is part of my debug
          void MainWindow::SubWindow(int index) index 10
          parent QWidget(0x55df4c941a90, name="tab_148")
          Windid "14680140"
          processTERMINAL->waitForStarted() OK
          ""
          ""
          As far as "what is going on here " - I asked how to get window id - and received convoluted message basically not answering my question and asking "why are you doing this..." .
          It is immaterial why I am doing this , because if I attempt to explain ( again) what am I doing , then I am not ready for another reply in such style.

          The example referenced does not explain where "winID" come from , it is practical for me , but rather typical " do this and do not ask why".

          I case somebody really care - I am "attaching" QProcess which executes "xterm" in QTabWidget page ..

          The unanswered question is - standard , normal usage on QTabWidget switches between pages...

          When I use QProcess QTabWidget it DOES NOT switch - it moves current page GUI "down the totem pole" and keeps the original QProcess running ....

          maybe -info is the answer....

          JonBJ 1 Reply Last reply
          0
          • A Anonymous_Banned275

            Here is part of my debug
            void MainWindow::SubWindow(int index) index 10
            parent QWidget(0x55df4c941a90, name="tab_148")
            Windid "14680140"
            processTERMINAL->waitForStarted() OK
            ""
            ""
            As far as "what is going on here " - I asked how to get window id - and received convoluted message basically not answering my question and asking "why are you doing this..." .
            It is immaterial why I am doing this , because if I attempt to explain ( again) what am I doing , then I am not ready for another reply in such style.

            The example referenced does not explain where "winID" come from , it is practical for me , but rather typical " do this and do not ask why".

            I case somebody really care - I am "attaching" QProcess which executes "xterm" in QTabWidget page ..

            The unanswered question is - standard , normal usage on QTabWidget switches between pages...

            When I use QProcess QTabWidget it DOES NOT switch - it moves current page GUI "down the totem pole" and keeps the original QProcess running ....

            maybe -info is the answer....

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by JonB
            #5

            @AnneRanch said in xterm -info - how to get windowID from "parent'?:

            I asked how to get window id - and received convoluted message basically not answering my questio

            I explained that, just as the stackoverflow post did. It is QWidget::winId(), and I gave you the reference. Your Windid "14680140" output is perfect, and is what you must pass to xterm -into. That's it for window ids and xterm. Don't know what you meant by your earlier "I am getting combination of id and name of "parent". Don't know what isn't 100% clear. The answer is QWidget::winId(). That is how to get window id for a widget. Which is what you just asked. Everyone else here can understand what I have said. Is that clear enough for you, or not clear?

            The example referenced does not explain where "winID" come from , it is practical for me , but rather typical " do this and do not ask why".

            "Returns the window system identifier of the widget." That is the answer. If you don't like that, complain to X11 org or Qt developers. What more than this explanation are you expecting?

            The unanswered question is - standard , normal usage on QTabWidget switches between pages...

            When I use QProcess QTabWidget it DOES NOT switch - it moves current page GUI "down the totem pole" and keeps the original QProcess running ....

            Nobody other than you knows what this means. QProcess has nothing to do with tabs. The fact that your code looks like it spawns multiple QProcesses has nothing whatsoever to do with xterm, -into, tabs or widgets. It is that, from what I have seen, you simply spawn separate QProcesses every time the user changes tab. Why you do that I don't know. So that is your code and your choice.

            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