xterm -info - how to get windowID from "parent'?
-
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.
-
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)?
-
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)?
@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 thexterm -into
, puts the xterm into theQWidget
you are creating for it, or whatever widget you tell it to, exactly as per WId QWidget::winId() const. I don't know what yourparent
is since you do not give any context. But obviously if for whatever reason you have someQWidget *parent
variable you want to put it into you would specifyparent->winId()
. -
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....
-
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....
@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. YourWindid "14680140"
output is perfect, and is what you must pass toxterm -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 isQWidget::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 multipleQProcess
es has nothing whatsoever to do withxterm
,-into
, tabs or widgets. It is that, from what I have seen, you simply spawn separateQProcess
es every time the user changes tab. Why you do that I don't know. So that is your code and your choice.