Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. It looks like showFullscreen() and showNormal() have different effects
Forum Updated to NodeBB v4.3 + New Features

It looks like showFullscreen() and showNormal() have different effects

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 624 Views
  • 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.
  • lionelML Offline
    lionelML Offline
    lionelM
    wrote on last edited by
    #1

    I want to make a control that can double click on the full screen, and then double click to restore the original.showFullscreen() can be full screen, but showNormal() does not bring it back, it becomes a separate window.fullscreen works 100% ,but getting back to normal widget embedded in another widget ends with flying widget not docked in it's previous location.

            if event_type == event.MouseButtonDblClick and watched == self.ui.label_photo:
                if not flag:
                    self.ui.label_photo.setWindowFlag(Qt.Window)
                    self.ui.label_photo.showFullScreen()
                    flag = True
                else:
                    self.ui.label_photo.setWindowFlag(Qt.SubWindow)
                    self.ui.label_photo.showNormal()
                    flag = False
    

    normal
    Screenshot 2021-01-08 161310.png
    now
    Screenshot 2021-01-08 161232.png

    jsulmJ 1 Reply Last reply
    0
    • lionelML lionelM

      I want to make a control that can double click on the full screen, and then double click to restore the original.showFullscreen() can be full screen, but showNormal() does not bring it back, it becomes a separate window.fullscreen works 100% ,but getting back to normal widget embedded in another widget ends with flying widget not docked in it's previous location.

              if event_type == event.MouseButtonDblClick and watched == self.ui.label_photo:
                  if not flag:
                      self.ui.label_photo.setWindowFlag(Qt.Window)
                      self.ui.label_photo.showFullScreen()
                      flag = True
                  else:
                      self.ui.label_photo.setWindowFlag(Qt.SubWindow)
                      self.ui.label_photo.showNormal()
                      flag = False
      

      normal
      Screenshot 2021-01-08 161310.png
      now
      Screenshot 2021-01-08 161232.png

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @lionelM said in It looks like showFullscreen() and showNormal() have different effects:

      self.ui.label_photo.setWindowFlag(Qt.SubWindow)
      self.ui.label_photo.showNormal()

      My guess is: you need to put self.ui.label_photo back to its parent (set the parent again?) and add to parents layout.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      lionelML 1 Reply Last reply
      1
      • jsulmJ jsulm

        @lionelM said in It looks like showFullscreen() and showNormal() have different effects:

        self.ui.label_photo.setWindowFlag(Qt.SubWindow)
        self.ui.label_photo.showNormal()

        My guess is: you need to put self.ui.label_photo back to its parent (set the parent again?) and add to parents layout.

        lionelML Offline
        lionelML Offline
        lionelM
        wrote on last edited by
        #3

        @jsulm said in It looks like showFullscreen() and showNormal() have different effects:

        parents layout

        Thanks, that helped me out. I tried using setParent, but forgot to add it back to the parents layout.

        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