summaryrefslogtreecommitdiffhomepage
path: root/pyqt.html.markdown
diff options
context:
space:
mode:
authorBoris Verkhovskiy <boris.verk@gmail.com>2024-04-03 04:13:28 -0700
committerBoris Verkhovskiy <boris.verk@gmail.com>2024-04-03 04:13:28 -0700
commitf5516715c094a7f4ed78f5cfd4099edf112350bd (patch)
treec79b3fa1e38ada15c698b577308871c2f88d342d /pyqt.html.markdown
parent693a1c85b0447c379a7fe33ad47a1b7246a0072d (diff)
[pyqt/*] fix formatting
rouge doesn't work with uppercase language names, also cleaned up whitespace
Diffstat (limited to 'pyqt.html.markdown')
-rw-r--r--pyqt.html.markdown20
1 files changed, 10 insertions, 10 deletions
diff --git a/pyqt.html.markdown b/pyqt.html.markdown
index 6bdb6488..2b331874 100644
--- a/pyqt.html.markdown
+++ b/pyqt.html.markdown
@@ -11,25 +11,25 @@ contributors:
This is an adaption on the C++ intro to QT by [Aleksey Kholovchuk](https://github.com/vortexxx192
), some of the code examples should result in the same functionality
-this version just having been done using pyqt!
+this version just having been done using pyqt!
```python
import sys
from PyQt4 import QtGui
-
+
def window():
- # Create an application object
+ # Create an application object
app = QtGui.QApplication(sys.argv)
# Create a widget where our label will be placed in
w = QtGui.QWidget()
- # Add a label to the widget
+ # Add a label to the widget
b = QtGui.QLabel(w)
- # Set some text for the label
+ # Set some text for the label
b.setText("Hello World!")
- # Give some size and placement information
+ # Give some size and placement information
w.setGeometry(100, 100, 200, 50)
b.move(50, 20)
- # Give our window a nice title
+ # Give our window a nice title
w.setWindowTitle("PyQt")
# Have everything display
w.show()
@@ -41,10 +41,10 @@ if __name__ == '__main__':
```
-In order to get some of the more advanced features in **pyqt** we need to start looking at building additional elements.
+In order to get some of the more advanced features in **pyqt** we need to start looking at building additional elements.
Here we show how to introduce a dialog popup box, useful for asking the user to confirm a decision or to provide information.
-```Python
+```python
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
@@ -63,7 +63,7 @@ def window():
w.setWindowTitle("PyQt Dialog")
w.show()
sys.exit(app.exec_())
-
+
# This function should create a dialog window with a button
# that waits to be clicked and then exits the program
def showdialog():