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. Frameless but resizable QMainwindow

Frameless but resizable QMainwindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 3.5k 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 All,

    A quick question about pyqt5.9.
    Is there any way to create a frameless QMainwindow with resizable functionality on Windows environment?

    Many thanks in advance.
    Sat

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yes, but you have to implement the resizing capability yourself (probably by reimplementing some mouse events).

      (Z(:^

      S 1 Reply Last reply
      0
      • sierdzioS sierdzio

        Yes, but you have to implement the resizing capability yourself (probably by reimplementing some mouse events).

        S Offline
        S Offline
        ShinSat
        wrote on last edited by
        #3

        @sierdzio thank you very much for an update!
        Do you know if there’s any sample code to share?

        Sat

        sierdzioS JonBJ 2 Replies Last reply
        0
        • S ShinSat

          @sierdzio thank you very much for an update!
          Do you know if there’s any sample code to share?

          Sat

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @ShinSat said in Frameless but resizable QMainwindow:

          Do you know if there’s any sample code to share?

          Nope, sorry.

          (Z(:^

          1 Reply Last reply
          0
          • S ShinSat

            @sierdzio thank you very much for an update!
            Do you know if there’s any sample code to share?

            Sat

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

            @ShinSat
            Have a look at https://stackoverflow.com/a/11783130/489865 ?

            Although it is resizing a widget, does the code show you the events for resizing the main window itself instead?

            S 1 Reply Last reply
            2
            • JonBJ JonB

              @ShinSat
              Have a look at https://stackoverflow.com/a/11783130/489865 ?

              Although it is resizing a widget, does the code show you the events for resizing the main window itself instead?

              S Offline
              S Offline
              ShinSat
              wrote on last edited by
              #6

              @JNBarchan Thanks for your help.
              What if I want to move the widget with resizing capability in mouseMoveEvent?

              Sat

              sierdzioS 1 Reply Last reply
              0
              • S ShinSat

                @JNBarchan Thanks for your help.
                What if I want to move the widget with resizing capability in mouseMoveEvent?

                Sat

                sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                @ShinSat said in Frameless but resizable QMainwindow:

                What if I want to move the widget with resizing capability in mouseMoveEvent?

                I'd suggest this:

                • on mouse press, save the information about where the press originated (left, right, bottom, top margin of the window, or maybe the centre?)
                • on mouse move, either resize or move the window based on the point of origin and move delta

                (Z(:^

                S 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  @ShinSat said in Frameless but resizable QMainwindow:

                  What if I want to move the widget with resizing capability in mouseMoveEvent?

                  I'd suggest this:

                  • on mouse press, save the information about where the press originated (left, right, bottom, top margin of the window, or maybe the centre?)
                  • on mouse move, either resize or move the window based on the point of origin and move delta
                  S Offline
                  S Offline
                  ShinSat
                  wrote on last edited by ShinSat
                  #8

                  @sierdzio Thanks for your help, I just completed a prototype version. I'll continue to brush up this.
                  Thanks again for your support!

                  Sat

                  S 1 Reply Last reply
                  1
                  • S ShinSat

                    @sierdzio Thanks for your help, I just completed a prototype version. I'll continue to brush up this.
                    Thanks again for your support!

                    Sat

                    S Offline
                    S Offline
                    ShinSat
                    wrote on last edited by ShinSat
                    #9

                    @ShinSat Sorry, again.
                    Is there a way to handle the mouse cursor shape with resizing function when the mouse cursor is on the widget's edge?
                    I'm trying to implement resize function where the cursor shape changes on QMainWindow's edge(eg. SplitHCursor).
                    It works but not 100%. I found mouseMoveEvent is not fired when its on some widgets inheriting scrollarea such as QPlainText. Without receiving mouseMoveEvent, I can't control the cursor shape on QPlainText, for example.
                    I know creating a subclass from QPlainText works but this is not an option as every child can be anonymous. I want to package every basic behavior in one basic custom class.

                    Any ideas?
                    Sat

                    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