Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to delete an already existing widget layout
Forum Updated to NodeBB v4.3 + New Features

How to delete an already existing widget layout

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 936 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    I want to change QWidget layout

    delete layout;
    Ticker* pTicker = new Ticker(this);
    QMainWindow::setCentralWidget(pTicker);

    The program has unexpectedly finished.

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

      Hi,

      No, you are trying to modify/delete a QMainWindow layout which is not the same thing. Just don't try do that, QMainWindow's layout is a special layout to handle all its components (dock, status bar, tool bar etc.) . If you don't want it, just don't use a QMainWindow.

      If you still need a QMainWindow, your custom widget should go in as the central widget (with setCentralWidget) So you have to at least create a container widget like I wrote "here":http://qt-project.org/forums/viewthread/49120/P15/

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

      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