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. Close a Qframe when it open new one
Forum Updated to NodeBB v4.3 + New Features

Close a Qframe when it open new one

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by
    #1

    my application have a mainwindow with a full screen mdiarea and a menù bar.

    When cliked on menù item it open a qframe/qwidget. Every menù item open a new different qframe. My qframe have different classes but are all parent of qframe.

    How I can close a qframe when I open a new one with menù item?

    this code, in my mainwindows work only when the old qframe is open one time:

    @ void main2::newframe()
    {

        if (m_newprogram != NULL)  //work only if m_newprogram is already used
           { m_newprogram->close();}
       m_newframe = new Frame(ui->mdiArea); 
       m_newframe->show();
       m_newframe->activateWindow();
       m_newframe->setAttribute(Qt::WA_DeleteOnClose);
    
    }@
    

    any suggestions?

    bkt

    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