1. anatoly techtonik
  2. pyside-copy-paste


anatoly techtonik  committed 19be1de

04.dialog.color.py: call color selection dialog (QColorDialog)

  • Participants
  • Parent commits b61e590
  • Branches default

Comments (0)

Files changed (1)

File 04.dialog.color.py

View file
  • Ignore whitespace
 # Absolutely minimal example of PySide application with button calling dialog
-from PySide.QtGui import QApplication, QPushButton
+from PySide.QtGui import QApplication, QPushButton, QColorDialog
+def choose_color():
+    color  = QColorDialog().getColor()
+    print color
 app = QApplication([])
 # Create top level window/button
-button = QPushButton('Exit')
-# call app.exit() when the button is clicked ('clicked' signal fires)
+button = QPushButton('Choose Color')
+# Call function that invokes color selection dialog when the button is clicked