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. QWidget have size of his parent Widget

QWidget have size of his parent Widget

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

    Hi all,

    I try to define a new QWidget object that manage QWidget childs, as this code:

    ChartManagerWidget::ChartManagerWidget(QWidget *parent)
       : QWidget(parent)
    {
       tabWidgetGraph_ = new QTabWidget(this);
    }
    

    I try to set the size of TabWidget to get as much space possible.
    so I modify the code as:

    ChartManagerWidget::ChartManagerWidget(QWidget *parent)
       : QWidget(parent)
    {
       tabWidgetGraph_ = new QTabWidget(this);
       tabWidgetGraph_->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    }
    

    But nothing append, size of TabWidget is still minimized...

    I modify code that way:

    ChartManagerWidget::ChartManagerWidget(QWidget *parent)
       : QWidget(parent)
    {
       setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
       tabWidgetGraph_ = new QTabWidget(this);
    }
    

    but the size of my Widget is still minimal

    Any thoughts ?

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

      Hi,

      Use a layout e.g. QVBoxLayout.

      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
      • Q Offline
        Q Offline
        quadbyte
        wrote on last edited by
        #3

        Thanks a lot SGaist, it's working fine ... I am so stupid :-)

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

          You're welcome !

          Since that answers your question please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

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

          Q 1 Reply Last reply
          0
          • SGaistS SGaist

            You're welcome !

            Since that answers your question please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

            Q Offline
            Q Offline
            quadbyte
            wrote on last edited by
            #5

            @SGaist the topic tools dont propose me 'solve" item ... How can I do that

            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