You can use a QDialog. http://pyside.github.io/docs/pyside/PySide/QtGui/QDialog.html
https://wiki.qt.io/Qt_for_Python_Tutorial_SimpleDialog
Do something like below.
from PySide import QtGui # from PySide2 import QtWidgets or from qtpy import QtWidgets
dialog = QtGui.QDialog()
lay = QtGui.QFormLayout()
dialog.setLayout(lay)
slider = QtGui.QSlider()
lay.addRow(QtGui.QLabel('Slider'), slider)
... # Accept buttons
ans = dialog.exec_() # This will block until the dialog closes
# Check if dialog was accepted?
value = slider.value()
... # Continue code.
Similar to the exec_ QMessageBox is this exmaple. https://gist.github.com/tcrowson/8152683242018378a00b
You can probably use a QMessageBox and set the layout to change the look.
What is going on?
Essential PySide works by running an event loop. It runs this infinite while loop that takes events off of a queue an processes them. Any mouse movement or button click is an event.
app = QApplication([])
app.exec_() # This is running the event loop until the application closes.
print('here') # This won't print until the application closes
You could manually reproduce this with any widget.
app = QApplication([]) # Required may be automatic with IPython
slider = QSlider() # No Parent
slider.show()
# Slider is not visible until the application processes the slider.show() event
app.processEvents()
while slider.isVisible(): # When user clicks the X on the slider it will hide the slider
app.processEvents() # Process events like the mouse moving the slider
print('here') # This won't print until the Slider closes
... # Continue code script