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. Two Questions
Forum Updated to NodeBB v4.3 + New Features

Two Questions

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

    Resizing the window: by default the window, when made smaller, does not resize the contents inside to fit. How to fix?

    Secondly, How to remove the native windows "window" so I can have a borderless window with my own integrated Exit,minimize,max buttons?

    :)

    mzimmersM 1 Reply Last reply
    0
    • LahearleL Lahearle

      Resizing the window: by default the window, when made smaller, does not resize the contents inside to fit. How to fix?

      Secondly, How to remove the native windows "window" so I can have a borderless window with my own integrated Exit,minimize,max buttons?

      mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by
      #2

      @Lahearle Qt isn't a mind reader -- it doesn't know that when you resize a window, you want to resize its contents, too. I'd recommend looking at layouts, and basing your sizing of the contents on the size of the window that holds them.

      For your second question, try adding this line to your ApplicationWindow:

      flags: Qt.FramelessWindowHint
      
      LahearleL 1 Reply Last reply
      1
      • mzimmersM mzimmers

        @Lahearle Qt isn't a mind reader -- it doesn't know that when you resize a window, you want to resize its contents, too. I'd recommend looking at layouts, and basing your sizing of the contents on the size of the window that holds them.

        For your second question, try adding this line to your ApplicationWindow:

        flags: Qt.FramelessWindowHint
        
        LahearleL Offline
        LahearleL Offline
        Lahearle
        wrote on last edited by
        #3

        @mzimmers

        Thanks the borderless window/window hints I didn't know about.

        But I tried layouts and it says that ApplicationWindows are not supported by qt designer (so I just used a regular "Window")
        Underneath GridLayouts and anchors.fill:parent all examples show them declaring each individual component in it, is there a way to just declare every component contained in a particular screen file, like:

        Window {
        width: mainScreen.width
        height: mainScreen.height
        visible: true
        title: "OOGA BOOGA"
        flags: Qt.FramelessWindowHint

        GridLayout{
            anchors.fill: parent
        
        Screen01 {
            id: mainScreen
            width: 1926
        }
        }
        

        }

        :)

        mzimmersM 1 Reply Last reply
        0
        • LahearleL Lahearle

          @mzimmers

          Thanks the borderless window/window hints I didn't know about.

          But I tried layouts and it says that ApplicationWindows are not supported by qt designer (so I just used a regular "Window")
          Underneath GridLayouts and anchors.fill:parent all examples show them declaring each individual component in it, is there a way to just declare every component contained in a particular screen file, like:

          Window {
          width: mainScreen.width
          height: mainScreen.height
          visible: true
          title: "OOGA BOOGA"
          flags: Qt.FramelessWindowHint

          GridLayout{
              anchors.fill: parent
          
          Screen01 {
              id: mainScreen
              width: 1926
          }
          }
          

          }

          mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by mzimmers
          #4

          @Lahearle I'm not sure what you're asking, but assigning a hard-coded value (like 1926) to a subordinate item is going to be problematic. I'd prefer you assign sizes to your main window, and derive sizes for contained objects from that.

          Window {
              id: mainWindow
          
              visible: true
              width: 1926
              GridLayout {
                  anchors.fill: parent
          
                  Screen01 {
                      id: mainScreen
                      width: mainWindow.width
                      // etc.
          

          As an aside, I'm not sure why you'd want a GridLayout with an item (Screen01) that fills your entire main window.

          LahearleL 1 Reply Last reply
          1
          • mzimmersM mzimmers

            @Lahearle I'm not sure what you're asking, but assigning a hard-coded value (like 1926) to a subordinate item is going to be problematic. I'd prefer you assign sizes to your main window, and derive sizes for contained objects from that.

            Window {
                id: mainWindow
            
                visible: true
                width: 1926
                GridLayout {
                    anchors.fill: parent
            
                    Screen01 {
                        id: mainScreen
                        width: mainWindow.width
                        // etc.
            

            As an aside, I'm not sure why you'd want a GridLayout with an item (Screen01) that fills your entire main window.

            LahearleL Offline
            LahearleL Offline
            Lahearle
            wrote on last edited by
            #5

            @mzimmers makes sens thanks

            :)

            mzimmersM 1 Reply Last reply
            0
            • LahearleL Lahearle

              @mzimmers makes sens thanks

              mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #6

              @Lahearle glad to help. If you have more questions pertaining to your original ones, feel free to ask; otherwise consider marking the topic as solved.

              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