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. how to use the following documentation? void QWidget::setMaximumSize(int maxw, int maxh).
Forum Updated to NodeBB v4.3 + New Features

how to use the following documentation? void QWidget::setMaximumSize(int maxw, int maxh).

Scheduled Pinned Locked Moved Unsolved General and Desktop
int maxhhow to use the
7 Posts 3 Posters 1.4k 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.
  • R Offline
    R Offline
    Recency
    wrote on last edited by
    #1

    how to use the following documentation? void QWidget::setMaximumSize(int maxw, int maxh).
    In other words, I Qwindow that I want to set the max. size. As of now, when a user presses the top max button on the window menu, the entire program fills the screen. I want to prevent the program from filling the whole screen. The documentation that I have posted above seems to be the answer, however, I do not know how to code and implement this document into my actual program. Forgive me, in that I am fairly new to qt.

    raven-worxR 1 Reply Last reply
    0
    • R Recency

      how to use the following documentation? void QWidget::setMaximumSize(int maxw, int maxh).
      In other words, I Qwindow that I want to set the max. size. As of now, when a user presses the top max button on the window menu, the entire program fills the screen. I want to prevent the program from filling the whole screen. The documentation that I have posted above seems to be the answer, however, I do not know how to code and implement this document into my actual program. Forgive me, in that I am fairly new to qt.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Recency
      you need to call setMaximumSize() on the widget which acts as your window.
      Additionally you might need to disable the maximize button when the screen size is bigger than the maximum size.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Recency
        wrote on last edited by
        #3

        Thank you. I have retrieved the following code that worked.
        setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
        However, I am very lost in the understanding of qt's documentations. Are there any tutorial books or instruction that you may have for advice.

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

          @Recency
          Hi
          This one
          http://www.bogotobogo.com/cplusplus/files/c-gui-programming-with-qt-4-2ndedition.pdf
          Is pretty nice for introduction. Its Qt4 but most is still the same in Qt5.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Recency
            wrote on last edited by
            #5

            Thanks to everyone. This was my first post to this site and it has been very educational.

            Although disabling the max. button does work, what I was looking for was the following code.
            this->setMaximumSize(int( 400), int(234) );
            The key word "CALL" that you have stated gives a lot of meaning to the qt documentations.
            Again many thanks.

            mrjjM 1 Reply Last reply
            0
            • R Recency

              Thanks to everyone. This was my first post to this site and it has been very educational.

              Although disabling the max. button does work, what I was looking for was the following code.
              this->setMaximumSize(int( 400), int(234) );
              The key word "CALL" that you have stated gives a lot of meaning to the qt documentations.
              Again many thanks.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Recency
              Hi
              If inside the class, you do not need "this", also why are you using int() ?
              Wont this
              setMaximumSize(400,234 );

              just compile and run too?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Recency
                wrote on last edited by
                #7

                setMaximumSize(400,234 );
                Much Cleaner Indeed

                Many Thanks

                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