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. Pyqt5 Qmessagebox

Pyqt5 Qmessagebox

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

    HI there, i would like know if it is possible to remove the windows frame from a QMessageBox,

    messagebox is as follows

    QMessageBox.critical(self, 'An Error Occured', 'OD Cannot be Empty', QMessageBox.Ok)
    
    

    My application has no windows frame using

    self.setWindowFlag(QtCore.Qt.WindowType.FramelessWindowHint)
    
    

    so I would like to remove it from the QMessageBox, but I do not know how to achieve this.

    Thanks

    jsulmJ 1 Reply Last reply
    0
    • E EchoLab

      HI there, i would like know if it is possible to remove the windows frame from a QMessageBox,

      messagebox is as follows

      QMessageBox.critical(self, 'An Error Occured', 'OD Cannot be Empty', QMessageBox.Ok)
      
      

      My application has no windows frame using

      self.setWindowFlag(QtCore.Qt.WindowType.FramelessWindowHint)
      
      

      so I would like to remove it from the QMessageBox, but I do not know how to achieve this.

      Thanks

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

      @EchoLab You can't do that with static QMessageBox.critical method. But you can create a QMessageBox instance and use setWindowFlag. Of course you will need to configure it to behave same as QMessageBox.critical.

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

      1 Reply Last reply
      2
      • E Offline
        E Offline
        EchoLab
        wrote on last edited by
        #3

        @jsulm Thank you for that, I got it now,

        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