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. Changing frame width in QMainWindow
Forum Updated to NodeBB v4.3 + New Features

Changing frame width in QMainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.8k Views 2 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.
  • S Offline
    S Offline
    ShinSat
    wrote on last edited by
    #1

    Hi Gurus,

    A quick question.
    Is there any way to customize the frame width of QMainWindow?
    I'm going to use setWindowFlags(Qt.CustomizeWindowHint) with almose frameless(0px or 1px) style for good looking purpose but with resizing functionality.
    No luck so far, but may be in Stylesheet?

    Thanks in advance for your help.
    Reagars,
    Sat

    JonBJ 1 Reply Last reply
    0
    • S ShinSat

      Hi Gurus,

      A quick question.
      Is there any way to customize the frame width of QMainWindow?
      I'm going to use setWindowFlags(Qt.CustomizeWindowHint) with almose frameless(0px or 1px) style for good looking purpose but with resizing functionality.
      No luck so far, but may be in Stylesheet?

      Thanks in advance for your help.
      Reagars,
      Sat

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @ShinSat
      With the proviso that I know nothing about this, does https://stackoverflow.com/questions/4899301/qmainwindow-set-framesize address your question?

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

        Hi
        Nope you cant. Its controlled by the OS.
        You can draw it yourself and re implement resizing but it often have issues.

        That said, its not an uncommon wish
        https://github.com/dfct/TrueFramelessWindow

        1 Reply Last reply
        1
        • S Offline
          S Offline
          ShinSat
          wrote on last edited by
          #4

          Thank you very much for your help, all!
          Looks like this is a wrong way to go and the only way to achieve that is to code everything(eg. resizing&moving) with "framelessWindowHint"(not customizeWindowHint) if I really want it.

          BTW, I'm curious about how guys deal with window (frame) shape issue as modern desktop applications, especially on Windows, do not use Window frame. That is, I think it's an old fashioned design in modern desktop applications.

          Sat

          mrjjM 1 Reply Last reply
          0
          • S ShinSat

            Thank you very much for your help, all!
            Looks like this is a wrong way to go and the only way to achieve that is to code everything(eg. resizing&moving) with "framelessWindowHint"(not customizeWindowHint) if I really want it.

            BTW, I'm curious about how guys deal with window (frame) shape issue as modern desktop applications, especially on Windows, do not use Window frame. That is, I think it's an old fashioned design in modern desktop applications.

            Sat

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

            @ShinSat

            We just leave it alone.
            Its a OS settings and apps should not invent their own frames as it violates OS guide lines and
            its very frustrating for a user if any app can work in different ways with regards to resize and close symbols.

            On linux, you can easy change how you want the decorations to look like (the frame) and hence its best left to the OS.

            1 Reply Last reply
            2

            • Login

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