|
|
2010-06-05
, 12:26
|
|
Posts: 60 |
Thanked: 59 times |
Joined on Jul 2008
|
#2
|
|
|
2010-06-05
, 13:16
|
|
Posts: 376 |
Thanked: 511 times |
Joined on Aug 2009
@ Greece
|
#3
|
Hey all ... Well I've finally found some time to start trying to develop stuff for the N900, but there are some things which are confusing me which I need some assistance on ...
Firstly, I see there are two ways I can program for the N900: C++ and Python ... I've heard devloping using Python is somewhat easier, but since I dont know python and have been using c++ for 6-7 years now, I think C++ is the better option here ... Do you agree ?
#!/usr/bin/python
# Convenience imports
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
# This is a decorator class
class WinUi:
# With only one function to decorate a window
def setupUi(self, parent):
self.centralwidget=QWidget(parent)
parent.setCentralWidget(self.centralwidget)
# A horizontal layout
self.layout=QHBoxLayout(self.centralwidget)
# With three items
self.label=QLabel("Name:", self.centralwidget)
self.txt=QLineEdit(self.centralwidget)
self.but=QPushButton(self.centralwidget)
l=self.layout
# Add them to the layout
l.addWidget(self.label)
l.addWidget(self.txt)
l.addWidget(self.but)
# Se the label of the button
self.but.setText("OK")
class Win(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
# Setup the UI using the decorator class
self.ui=WinUi()
self.ui.setupUi(self)
# Connect the mouse "clicked" event to a function
self.ui.but.clicked.connect(self.click)
def click(self):
txt=self.ui.txt.text()
if txt=='':
QMessageBox.critical(self, "Error", "Please type something")
else:
QMessageBox.information(self, "Success", "You typed: %s" % txt)
# Standard things
# Create an application then create a window.
# Show the window and run the main loop
app=QApplication(sys.argv)
win=Win()
win.show()
app.exec_()
python myfile.py
|
|
2010-06-05
, 14:02
|
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#4
|
Firstly, I see there are two ways I can program for the N900: C++ and Python ... I've heard devloping using Python is somewhat easier, but since I dont know python and have been using c++ for 6-7 years now, I think C++ is the better option here ... Do you agree ?
Secondly, I'm trying to develop using Nokia's Qt technology, but there's a lot of jargon here on the forums which is confusing me. Can someone please clarify the difference between the following terms:
Qt 4.6 (or Qt 4.7) which is installed on the N900 ... Why is this need to be installed ? Are these the Header file libraries that would be used ?
Qt Creator and Qt Designer ... Isn't the latter part of the former ?
Nokia Qt SDK Framework .. How is this differenct from QT Creator ?
MADDE ... How is this related to the entire 'Qt' technology ?
PyQt ... I understand is for using Qt with Python, but this is an actual tool, or is it a name given to a group of programs (Qt Designer, Python, etc..), and is it an official Nokia bundle/program ?
As you can see, I'm just trying to piece together the terms right now, so I know what is being discussed when I search the forums ..
Lastly, if anyone knows any tutorial here on how to start developing Apps for N900 in C++ using Qt, please do post the link .. !
Thanks !