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. Trying to add qlayout ... which allready has a layout.
Forum Updated to NodeBB v4.3 + New Features

Trying to add qlayout ... which allready has a layout.

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 370 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.
  • J Offline
    J Offline
    Jakob Clausen
    wrote on last edited by
    #1

    Hi.

    I have the following code:

    WorkSpace::WorkSpace(QWidget *parent) :
        QStackedWidget(parent)
    {
        QGridLayout* layout = new QGridLayout(this);
    }
    

    The line in the line in the constructor is giving me
    Trying to add qlayout ... which allready has a layout.
    when i run it.

    parent has a layout, but that should be beside the point?

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

      Hi,

      QStackedWidget already has a layout (a QStackedLayout), that's typically a widget you do not subclass but rather use as is.

      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
      2
      • J Offline
        J Offline
        Jakob Clausen
        wrote on last edited by
        #3

        Ok. I did not know that.
        Thank you very much. :-)

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

          Use the doc Luke ;-)

          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
          1

          • Login

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