maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   A start in coding (https://talk.maemo.org/showthread.php?t=75952)

GigaByte 2011-08-21 19:32

A start in coding
 
Hi,

So I decided I want to make an app, a very simple one. It would be a window, with buttons, and each button executes a command in xterm while in root. Commands that I will need will be wget, tar, cd, bzip2...

Anybody's help?

Reffyyyy 2011-08-21 19:44

Re: A start in coding
 
Can be done easily in Qt. You're going to want to use QWidget (obviously), QPushButton, and QProcess. You'll also probably want any of the layout classes.

You could also do it in QML, but you'll need to integrate Qt/C++ in order to actually execute the commands. QML doesn't have a QProcess equivalent.

GigaByte 2011-08-21 20:16

Re: A start in coding
 
Quote:

Originally Posted by Reffyyyy (Post 1074208)
Can be done easily in Qt. You're going to want to use QWidget (obviously), QPushButton, and QProcess. You'll also probably want any of the layout classes.

You could also do it in QML, but you'll need to integrate Qt/C++ in order to actually execute the commands. QML doesn't have a QProcess equivalent.

So, Nokia Qt SDK should provide all of what I will need, right?

marxian 2011-08-21 20:46

Re: A start in coding
 
After installing Qt SDK, you will need add the Maemo target via the SDK Maintenance Tool. Then you have everything you need to create and deploy a Maemo Qt application. :)

JamesBond@ge 2011-08-21 20:56

Re: A start in coding
 
Congratulations to Marxypoos for his 1000th post \o/ ;-)

qwazix 2011-08-21 21:47

Re: A start in coding
 
I'd use python with pyQT no development environment needed and you can develop right on your phone

Code:

#!/usr/bin/python
from PyQt4 import QtGui
import sys
import os


g=QtGui
app=g.QApplication(sys.argv)
window= g.QWidget()
label=g.QLabel('hw')
button=g.QPushButton('run vi')

button.clicked.connect(lambda: os.system('vi'))
layout = g.QVBoxLayout()
window.setLayout(layout)
layout.addWidget(label)
layout.addWidget(button)
window.show()
sys.exit(app.exec_())

then run python whatever.py, it will show a label and a button that rns vi in the same terminal window

SHARP66 2011-08-21 21:47

Re: A start in coding
 
why not python? I think it is simpler

AlMehdi 2011-08-21 21:51

Re: A start in coding
 
QT is good but you have other options too... a simpler one would be to use Python with Bash or a simple dialog like Zenity and Bash. If you are familiar with shell scripting that would be the easiest way. Neither Python nor bash would require an DE or SDK to be installed. You could make the Python UI with QT Designer though if you prefer wysiwyg.

The Zenity way would probably be the easiest but maybe not what you are after.

TomppaS 2011-08-22 16:29

Re: A start in coding
 
First do you know how to code? If not learn basics of some programming language. I recommend python or c++. Forget about GUI programming (Qt) and learn to make simple command line applications (Hello World and stuff). This may sound dull and you wanna make something cool but it will help you ALOT in the future. Start learning Qt when you have enought experience with some programming language.


All times are GMT. The time now is 10:40.

vBulletin® Version 3.8.8