View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#14
Quick example, basically ripped it from here and modified it to do what you're asking (simplistically, you'll still need to figure out formatting). I only left comments in the areas that I changed since you can read his original tutorial/comments at the website.

Developed, screenshotted, and uploaded to a webserver all on my N900. I love this "phone" !

Code:
#I don't use PySide
from PyQt4 import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys

class MyMainWindow(QWidget):
	def __init__(self):
		QWidget.__init__(self, None)
 
		vbox = QVBoxLayout()
 
		b = QPushButton("Push me!")
		vbox.addWidget(b)
 
		self.connect(b, SIGNAL("clicked()"), self.buttonPushed)
 
		self.setLayout(vbox)
 
	def buttonPushed(self):
		d = QDialog(self)
 
		vbox = QVBoxLayout()
		#Add Layouts
		horizontalLayout = QHBoxLayout() 
		horizontalLayout1 = QHBoxLayout() 

		# Now create your buttons.
		b = QPushButton("Close window")
		c = QPushButton("Die")
		e = QPushButton("In Fires")
		f = QPushButton("With Chickens!")
 
		self.connect(b, SIGNAL("clicked()"), d.close)
 
		# Add buttons to your layouts, they'll show up in the order given.
		horizontalLayout1.addWidget(f)
		horizontalLayout1.addWidget(b)
		horizontalLayout.addWidget(c)
		horizontalLayout.addWidget(e)
 
		# Add layouts to your main Layout
		vbox.addLayout (horizontalLayout)
		vbox.addLayout (horizontalLayout1)
		d.setLayout(vbox)
 
		# Show the window!
		d.show()
 
if __name__ == '__main__':
	app = QApplication(sys.argv)
 
	w = MyMainWindow()
	w.show()
 
	app.exec_()
	sys.exit()
Attached Images
 
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following 3 Users Say Thank You to fatalsaint For This Useful Post: