title: How do I open an image in a separate window using a button click in PyQT5?
body: <pre><code>from PyQt5.QtWidgets import QApplication, QLabel, QWidget, QFileDialog, QPushButton, QLineEdit,QVBoxLayout, QHBoxLayout
  from PyQt5.QtCore import *
  from PyQt5.QtGui import QPixmap
  from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QDialog, QVBoxLayout
  import Updated_encrypt
  import sys
  
  class Window(QWidget):
      def __init__(self):
          super().__init__()
  
          self.title = 'Encrypt/Decrypt'
          self.top = 200
          self.left = 500
          self.width = 400
          self.height = 300
  
          self.InitWindow()
  
      def InitWindow(self):
          self.setWindowTitle(self.title)
          self.setGeometry(self.left, self.top, self.width, self.height)
  
          vbox = QVBoxLayout()
  
          self.button1 = QPushButton('Encrypt')
          self.button1.clicked.connect(self.openSecondDialog)
  
          self.button2 = QPushButton('Decrypt')
  
          vbox.addWidget(self.button1)
          vbox.addWidget(self.button2)
  
          self.setLayout(vbox)
  
          self.show()
  
      def openSecondDialog(self):
          hbox = QVBoxLayout()
          mydialog = QDialog(self)
          mydialog.show()
  
          self.button2 = QPushButton('Check Image')
          self.button2.clicked.connect(self.getImage)
          hbox.addWidget(self.button2)
          self.setLayout(hbox)
          self.show()
  
      def getImage(self):
           hbox = QHBoxLayout()
           file_Name = QFileDialog.getOpenFileName(self,
                                                  'OpenFile',
                                                  '',
                                                  '')
           image_path = file_Name[0]
           updatedImage = Updated_encrypt.decrypt(image_path, 123)
           pixmap = QPixmap(updatedImage)
           self.label.setPixmap(QPixmap(pixmap))
           self.resize(pixmap.width(), pixmap.height())
  
  App = QApplication(sys.argv)
  window = Window()
  sys.exit(App.exec())
  </code></pre>
  
  <p>I have my code set up to implement an algorithm to modify an image when my I select it from my pop up dialogue. What I am trying to accomplish is for the image to pop up in a separate window when I click the encrypt button. I can't seem to get anything to pop up in the separate window aside from the window itself. Any help would be appreciated.</p>