Hi,
This is my last post in this blog. Please visit my new blog here: www.tomkonikkara.in
Thank you.
This is my last post in this blog. Please visit my new blog here: www.tomkonikkara.in
Thank you.
"In search of answers..."
pyuic4 widget.ui > calc_ui.py
import sys
from PyQt4 import QtCore, QtGui
from calc_ui import Ui_Widget
class MyForm(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_Widget()
self.ui.setupUi(self)
def calc_sum(Widget):
value1=Widget.ui.a.text();
value2=Widget.ui.b.text();
result=float(value1)+float(value2);
str_result=str(result)
Widget.ui.sum.setText(str_result);
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = MyForm()
myapp.show()
sys.exit(app.exec_())
pyhon calc.pyI am not so good in explaining the code. I think you got the idea of how to make a custom slot and to make a standalone program. If any reader need clarification or more explanation, I will try to explain further.
#include
#include "mainwindow.h"
#include
//![1]
int main(int argv, char **args)
{
QApplication app(argv, args);
QTranslator translator;
translator.load("malayalam");
app.installTranslator(&translator);
app.setApplicationName("Music Player");
app.setQuitOnLastWindowClosed(true);
MainWindow window;
window.show();
return app.exec();
}
QT += phonon
HEADERS += mainwindow.h
SOURCES += main.cpp \
mainwindow.cpp
TRANSLATIONS = malayalam.ts
# install
target.path = $$[QT_INSTALL_EXAMPLES]/phonon/qmusicplayer
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/qmusicplayer
INSTALLS += target sources
wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
symbian:TARGET.UID3 = 0xA000CF6A
#This code input a monochrome bitmap of size 128x64 and convert it to a form compatible to ks0108 graphic lcd(glcd)
arg_list=argv();
x=imread(arg_list{1}); #accept argument
num=0;
printf("Controller 1 (left)\n\n");
page=0;
for offset = [1:8:64]
printf("Page %d:\n",page);
page+=1;
for j=1:64
for i=[offset:offset+7]
num=num+x(i,j)*(2^(i-offset));
endfor
printf("%d ",255-num);
num=0;
endfor
printf("\n\n");
endfor
printf("Controller 2 (right)\n\n");
page=0;
for offset = [1:8:64]
printf("Page %d:\n",page);
page+=1;
for j=65:128
for i=[offset:offset+7]
num=num+x(i,j)*(2^(i-offset));
endfor
printf("%d ",255-num);
num=0;
endfor
printf("\n\n");
endfor