Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. More xterm in MDI example challenge
Qt 6.12 LTS is out! See what's new in the release blog

More xterm in MDI example challenge

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 889 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    Reason I used MDI example - it has many useful features - such as "tile the displays"....
    Works as expected, however, need some tuning-up.

    Here is an example - "stuff" - I do not know what to call it - in MDI example it is a subwindow / child - so far of unknown type.

    The xterm filled the original size of this sub-window just fine.

    Resizing this sub window to the current size DID NOT resize the original.
    So my current desire is to redraw the original to fit into "up sized sub window".

    I am looking at the params item QString::number(winId()) which tells the xterm "where to write (window) " the command output.

    Should I be able to access that window and copy its contents to expanded subwindow ?

    How ?

            params << "-T" << "bluetoothctl no options (interactive) case 1 -hold file " << "-fa" <<"Monospace" << "-fs" << "14"<< "-hold" <<
                      "-into" <<QString::number(winId())<<
                      "-e" << "bluetoothctl  | tee /tmp/temp.txt";
    
            qDebug() <<"params " << params;
    

    Any suggestion will be appreciated.

    PARTIALLY SOLVED

    MDI example has "Save file" menu option - hence there is a file somewhere waiting to be accessed...

    eab2ee9a-e5b1-458a-a3c1-7449c28d5cde-image.png

    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      Reason I used MDI example - it has many useful features - such as "tile the displays"....
      Works as expected, however, need some tuning-up.

      Here is an example - "stuff" - I do not know what to call it - in MDI example it is a subwindow / child - so far of unknown type.

      The xterm filled the original size of this sub-window just fine.

      Resizing this sub window to the current size DID NOT resize the original.
      So my current desire is to redraw the original to fit into "up sized sub window".

      I am looking at the params item QString::number(winId()) which tells the xterm "where to write (window) " the command output.

      Should I be able to access that window and copy its contents to expanded subwindow ?

      How ?

              params << "-T" << "bluetoothctl no options (interactive) case 1 -hold file " << "-fa" <<"Monospace" << "-fs" << "14"<< "-hold" <<
                        "-into" <<QString::number(winId())<<
                        "-e" << "bluetoothctl  | tee /tmp/temp.txt";
      
              qDebug() <<"params " << params;
      

      Any suggestion will be appreciated.

      PARTIALLY SOLVED

      MDI example has "Save file" menu option - hence there is a file somewhere waiting to be accessed...

      eab2ee9a-e5b1-458a-a3c1-7449c28d5cde-image.png

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @AnneRanch said in More xterm in MDI example challenge:

      Resizing this sub window to the current size DID NOT resize the original.

      Correct. I do not know of any way to tell a running xterm to change its size.

      I am looking at the params item QString::number(winId()) which tells the xterm "where to write (window) " the command output.
      Should I be able to access that window and copy its contents to expanded subwindow ?

      No. As I advised you previously, so long as you use xterm -into you will not be able to access its output programatically from your code, it will be sent to the widget directly from the xterm. The full story can be read at e.g. https://stackoverflow.com/a/14772227/489865, which explains what would be necessary if you did want to try accessing its output, and as you can see would require pretty hefty coding just to try out.

      A 1 Reply Last reply
      0
      • JonBJ JonB

        @AnneRanch said in More xterm in MDI example challenge:

        Resizing this sub window to the current size DID NOT resize the original.

        Correct. I do not know of any way to tell a running xterm to change its size.

        I am looking at the params item QString::number(winId()) which tells the xterm "where to write (window) " the command output.
        Should I be able to access that window and copy its contents to expanded subwindow ?

        No. As I advised you previously, so long as you use xterm -into you will not be able to access its output programatically from your code, it will be sent to the widget directly from the xterm. The full story can be read at e.g. https://stackoverflow.com/a/14772227/489865, which explains what would be necessary if you did want to try accessing its output, and as you can see would require pretty hefty coding just to try out.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @JonB You are addressing tow differtt issues . I think I can get the sizing udder my control using xterm -geometry option.
        Secondly - as you said - he command output goes to QTextEdit object , hence it should not be that hard to work on.
        I have another post kinda of addressing that... sometime it is hard to keep stuff "under one roof".

        JonBJ 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @JonB You are addressing tow differtt issues . I think I can get the sizing udder my control using xterm -geometry option.
          Secondly - as you said - he command output goes to QTextEdit object , hence it should not be that hard to work on.
          I have another post kinda of addressing that... sometime it is hard to keep stuff "under one roof".

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @AnneRanch
          Indeed. You asked about resizing once the xterm is running ("Resizing this sub window to the current size DID NOT resize the original."), I think you are stuck with that. You can specify to xterm how big the window initially when you invoke it, to use more space if you have it, but I don't think you can "send a message" to the running xterm if the user later resizes the Qt window.

          As for the output being sent from the xterm directly into the widget via the "-into" <<QString::number(winId()). If that widget is a QTextEdit and you can get to see what it put there via QTextEdit::text() then that is excellent and that way you can get to see what it output there if you need to!

          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
          • Unsolved