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. How to add console into widget
Forum Updated to NodeBB v4.3 + New Features

How to add console into widget

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 3.3k 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.
  • L Offline
    L Offline
    looterhunter
    wrote on last edited by
    #1

    hi everyone,

    I Using Qt Terminal Example http://doc.qt.io/qt-5/qtserialport-terminal-example.html

    want to show layout like this below:

    console layout

    I want to show the black console , just show right side, but I don't know how to do it

    the example main code is

        ui->setupUi(this);
        console = new Console;
        console->setEnabled(false);
        setCentralWidget(console);  // I don't know , what component can use, can add console
    

    I don't know , what component can use, can add console
    the code like this?
    ui->widget-> ?? or other

    I appreciate all the suggest. thank you

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

      Hi,

      What would you like to have on the left of your widget ?

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

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What would you like to have on the left of your widget ?

        L Offline
        L Offline
        looterhunter
        wrote on last edited by
        #3

        @SGaist
        Because I want to add control panel on left side

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

          Then once you have that widget do something like:

          QWidget *centralWidget;
          QHBoxLayout *layout = new QHBoxLayout(centralWidget);
          layout->addWidget(myCoolControlPanelWidget);
          layout->addWidget(terminalWidget);
          setCentralWidget(centralWidget);
          

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

          L 1 Reply Last reply
          1
          • SGaistS SGaist

            Then once you have that widget do something like:

            QWidget *centralWidget;
            QHBoxLayout *layout = new QHBoxLayout(centralWidget);
            layout->addWidget(myCoolControlPanelWidget);
            layout->addWidget(terminalWidget);
            setCentralWidget(centralWidget);
            
            L Offline
            L Offline
            looterhunter
            wrote on last edited by
            #5

            @SGaist

            thank you dear SGaist

            I reference
            Dock Widgets Example
            It's can also have this effect

            and finally thank you very much for you code.

            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