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. What is the difference between QSizePolicy::Expanding and QSizePolicy::Ignored?
Forum Updated to NodeBB v4.3 + New Features

What is the difference between QSizePolicy::Expanding and QSizePolicy::Ignored?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 651 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.
  • F Offline
    F Offline
    fokhagyma
    wrote on last edited by
    #1

    I understand what the documentation says about the various policies, but what are the cases when the Expanding policy does not behave like the Ignored policy? I didn't find any relevant info on the net and on this forum.

    Pl45m4P 1 Reply Last reply
    0
    • F fokhagyma

      I understand what the documentation says about the various policies, but what are the cases when the Expanding policy does not behave like the Ignored policy? I didn't find any relevant info on the net and on this forum.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @fokhagyma

      Expanding means the given widget is allowed to expand and shrink, if able to. But the preferred size is sizeHint OR larger (e.g. to increase readability of the widget).
      Ignored means the widget's sizeHint will be ignored completely and it take as much space as it is available.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      F 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @fokhagyma

        Expanding means the given widget is allowed to expand and shrink, if able to. But the preferred size is sizeHint OR larger (e.g. to increase readability of the widget).
        Ignored means the widget's sizeHint will be ignored completely and it take as much space as it is available.

        F Offline
        F Offline
        fokhagyma
        wrote on last edited by
        #3

        @Pl45m4 Ok, basically both give a given widget "as much space as possible". I am curious what are the cases when Expanding do not give "as much space as possible" to the widget? What conditions are needed to not expand the widget with the Expanding policy?

        Pl45m4P 1 Reply Last reply
        0
        • F fokhagyma

          @Pl45m4 Ok, basically both give a given widget "as much space as possible". I am curious what are the cases when Expanding do not give "as much space as possible" to the widget? What conditions are needed to not expand the widget with the Expanding policy?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @fokhagyma

          When other widgets limit the expansion for example.

          Check the QSizePolicy documentation


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          F 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @fokhagyma

            When other widgets limit the expansion for example.

            Check the QSizePolicy documentation

            F Offline
            F Offline
            fokhagyma
            wrote on last edited by fokhagyma
            #5

            @Pl45m4 Limited expansion is still an expansion, and in a sense every expansion is limited. Or do you say that there are different types of expansion? If that is the case, why does the documentation say nothing about it? So, is Expanding expansion different than Ignored expansion? If yes, then what is the difference?

            I checked the QSizePolicy documentation and still don't know what the difference between Expanding and Ignored is.

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fokhagyma
              wrote on last edited by
              #6

              QSizePolicy::Expanding has 3 flags: GrowFlag | ShrinkFlag | ExpandFlag
              QSizePolicy::Ignored has 3 flags: ShrinkFlag | GrowFlag | IgnoreFlag
              Both have GrowFlag and ShrinkFlag, but one has ExpandFlag, and the other one has IgnoreFlag.
              I know that only with the ExpandFlag I can use the QSizePolicy::expandingDirections() function, but I want to know the behavioral difference. From the descriptions of these two flags, it seems that maybe there are cases of using the ExpandFlag when the widget does not get as much space as possible. What are these cases?

              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