3 #Laueye - A program to analyze Laue diffraction diagrams.
4 #Copyright (C) <2008> <Grissiom>
6 #This program is free software: you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation, either version 3 of the License, or
9 #(at your option) any later version.
11 #This program is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU General Public License for more details.
16 #You should have received a copy of the GNU General Public License
17 #along with this program. If not, see <http://www.gnu.org/licenses/>.
19 from PyQt4
.QtGui
import *
20 from PyQt4
.QtCore
import *
23 class SimpleExampleWidget(QWidget
):
24 def __init__(self
, im_ori
, parant
= None):
25 QWidget
.__init
__(self
, parant
)
29 def paintEvent(self
, event
):
30 painter
= QPainter(self
)
31 painter
.drawImage(QPointF(0, 0), self
.im_ori
)
33 app
= QApplication(sys
.argv
)
35 window
.setWindowTitle(u
"试验")
37 #value = store_value()
39 #close_button = QPushButton("Quit")
40 #QObject.connect(close_button, SIGNAL("clicked()"), app, SLOT("quit()"))
42 #spin_box = QSpinBox()
43 #slider = QSlider(Qt.Horizontal)
44 #spin_box.setRange(0, 130)
45 #slider.setRange(0, 130)
46 ##QObject.connect(spin_box, SIGNAL("valueChanged(int)"),slider, SLOT("setValue(int)"))
47 ##QObject.connect(slider, SIGNAL("valueChanged(int)"),spin_box, SLOT("setValue(int)"))
49 #QObject.connect(spin_box, SIGNAL("valueChanged(int)"),value.set(int))
50 #QObject.connect(slider, SIGNAL("valueChanged(int)"),spin_box, SLOT("setValue(int)"))
54 #layout = QHBoxLayout()
55 #layout.addWidget(slider)
56 #layout.addWidget(spin_box)
57 #layout.addWidget(close_button)
58 #window.setLayout(layout)
62 #im_ori.load('/usr/local/src/project_Laueye/svn/trunk/test.png')
64 #painter.drawImage(0, 0, im_ori, 15, 15)
66 layout
= QHBoxLayout()
70 im_ori
.load('../test/test.png')
71 window
.setGeometry(0, 0, im_ori
.width(), im_ori
.height())
72 pain
= SimpleExampleWidget(im_ori
)
73 layout
.addWidget(pain
)
74 window
.setLayout(layout
)