Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Add to mdiArea using C++ code and QTDesigner
Forum Updated to NodeBB v4.3 + New Features

Add to mdiArea using C++ code and QTDesigner

Scheduled Pinned Locked Moved Solved C++ Gurus
1 Posts 1 Posters 207 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 6 Jan 2024, 14:29 last edited by Anonymous_Banned275 1 Jun 2024, 18:55
    #1

    SOLVED
    ...using KISS and let the mdiArea do the dirty work

       // TASK add mdiArea sub / child window - QMdiArea
         QMdiArea *qmdiarea = new QMdiArea();
         m_mdiarea->addSubWindow( qmdiarea);
         qmdiarea->setWindowTitle(" Common hcitool (QMdiArea )"); // TOK
         QWidget *qWidget = new QWidget(); // test 
         qmdiarea->addSubWindow( qWidget);
         qmdiarea->addSubWindow( qWidget);
         qmdiarea->addSubWindow( qWidget);
    
         qmdiarea->tileSubWindows();
    
    

    Hello,
    I am asking for actual C++ code and opinions / suggestions / help with the tasks.
    ( current code compiles/ links/runs.)
    I need help with

    1. adding QTabWidget INTO QWidget (mdiArea sunwindow) - NOT to mdiArea main parent !
    2. adding existing (loop) QWidget BUILD using QrDesigner into specific tab . (Is that even possible??)

    I am including current (work in progresses) actual, partially working , copy of my code.
    I have highlighted areas I need help with and would appreciate if you could annotate / add your corrections / suggestions.

    Your suggestion DOES NOT have to compile, I can manage that by myself.

    Many thanks, appreciate actual C++ code where needed

      // TASK add mdiArea sub / child window - QWidget
        //  QWidget create
        QWidget *qWidget = new QWidget();
        m_mdiarea->addSubWindow( qWidget);
        qWidget->setWindowTitle(" Common hcitool (QWidget  )"); // TOK
        // create  QTabWidget
        QTabWidget *tabWidget;
        tabWidget = new QTabWidget(this); // sort of works
        // create layout and add it to tabWidget
        QHBoxLayout *layout = new QHBoxLayout;
        **layout->addWidget(tabWidget);**     // sort of works
        //**issue - shows in parent mdiArea** 
        //i**ssue - shows small size**
        //?? crashesb tabWidget->setLayout(layout);
        //tabWidget->show();
        //**TODO show full size in mdiArea sub wiundow** 
    
        //tabWidget->maximumSize();
        // add tabs in loop OK
        // for index ....
        tabWidget->addTab(qWidget, "TEST first tab ");
        ****
        
    

    This is my "run"

    b82a5efa-3b65-474c-a367-1abb5de13263-image.png

    Notice small "TEST.. " tab title showing attached in upper left corner. Wrong size and location!

    1 Reply Last reply
    0
    • A Axel Spoerl has marked this topic as solved on 6 Jan 2024, 19:04
    • A Anonymous_Banned275 deleted this topic on 10 Jan 2024, 19:28
    • J J.Hilk restored this topic on 15 Jan 2024, 07:11

    1/1

    6 Jan 2024, 14:29

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved