Commit 832be4f0 authored by Ingo Meyer's avatar Ingo Meyer

Merge branch 'develop'

parents d3cfd15c c593216d
......@@ -16,6 +16,8 @@ array_contains() {
}
python_flags() {
local DARWIN_CONDA_INCLUDE="${CONDA_PREFIX}/include/python2.7"
local DARWIN_CONDA_LIB="${CONDA_PREFIX}/lib"
local DARWIN_LOCAL_FRAMEWORK="/usr/local/Library/Frameworks"
local DARWIN_FRAMEWORK="/System/Library/Frameworks"
local DARWIN_LOCAL_INCLUDE="/usr/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7"
......@@ -29,7 +31,10 @@ python_flags() {
case "${OS}" in
Darwin)
if [ -d "${DARWIN_LOCAL_FRAMEWORK}" ]; then
if [ -n "${CONDA_PREFIX}" ]; then
INC_FLAGS="-I${DARWIN_CONDA_INCLUDE}"
LIB_FLAGS="-L${DARWIN_CONDA_LIB} -lpython2.7"
elif [ -d "${DARWIN_LOCAL_FRAMEWORK}" ]; then
INC_FLAGS="-F${DARWIN_LOCAL_FRAMEWORK} -I${DARWIN_LOCAL_INCLUDE}"
LIB_FLAGS="-F${DARWIN_LOCAL_FRAMEWORK} -framework Python"
else
......
SUBDIRS=$(shell find . -mindepth 1 -maxdepth 1 -type d)
ALL_DISTROS = centos centos6 debian suse
ALL_DISTROS = debian centos fedora suse
ifeq ($(DISTROS),all)
override DISTROS = $(ALL_DISTROS)
endif
......@@ -13,7 +13,7 @@ ifndef DISTROS
@./create_package.sh
else
@for DISTRO in $(DISTROS); do \
./create_package.sh "$${DISTRO}"; \
./create_package.sh "$${DISTRO}" || break; \
done
endif
......
This diff is collapsed.
__version_info__ = (0, 8, 8)
__version_info__ = (0, 9, 0)
__version__ = '.'.join(map(str, __version_info__))
......@@ -44,7 +44,7 @@ class Configuration(ConfigNode):
def __init__(self):
# camera_position =
# offset = (0.0, 0.0, 0.0)
self.gl_window_size = [400, 400]
self.gl_window_size = [1200, 400]
self.atom_radius = 0.4
self.bond_radius = 0.1
pass
......
......@@ -4,7 +4,7 @@
from __future__ import absolute_import
from PyQt4 import QtGui, QtCore
from PyQt5 import QtCore, QtWidgets
from gui.util.table_with_removeable_items import TableWithRemoveableEntries
from gui.util.cutoff_preview_table import CutoffPreviewTable
......@@ -38,7 +38,7 @@ class CutoffHistoryTable(TableWithRemoveableEntries):
for i, history_entry in enumerate(self._history):
current_row = []
for j, value in enumerate((history_entry.filename, history_entry.frame + 1, history_entry.time)):
item = QtGui.QTableWidgetItem(str(value))
item = QtWidgets.QTableWidgetItem(str(value))
item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEditable)
current_row.append(item)
cutoff_table = CutoffPreviewTable(history_entry.radii)
......
......@@ -3,7 +3,7 @@
from __future__ import absolute_import
import sys
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore
from gui.util.labeled_combobox import LabeledComboBox
from config.cutoff_presets import cutoff_presets
......
......@@ -4,7 +4,7 @@
from __future__ import absolute_import
from PyQt4 import QtGui, QtCore
from PyQt5 import QtCore, QtWidgets
from gui.util.table_with_removeable_items import TableWithRemoveableEntries
from gui.util.cutoff_preview_table import CutoffPreviewTable
......@@ -38,12 +38,12 @@ class CutoffPresetTable(TableWithRemoveableEntries):
for i, presets_entry in enumerate(self._presets):
current_row = []
for j, value in enumerate((presets_entry.name, )):
item = QtGui.QTableWidgetItem(str(value))
item = QtWidgets.QTableWidgetItem(str(value))
item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEditable)
current_row.append(item)
if isinstance(presets_entry.radii, float):
cutoff_fixed_value = presets_entry.radii
item = QtGui.QTableWidgetItem(str(cutoff_fixed_value))
item = QtWidgets.QTableWidgetItem(str(cutoff_fixed_value))
item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEditable)
item.setTextAlignment(QtCore.Qt.AlignCenter)
current_row.append(item)
......
......@@ -5,11 +5,11 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore, QtWidgets
class CutoffTableWidget(QtGui.QTableWidget):
class CutoffLineEdit(QtGui.QLineEdit):
class CutoffTableWidget(QtWidgets.QTableWidget):
class CutoffLineEdit(QtWidgets.QLineEdit):
focus_in = QtCore.pyqtSignal()
def __init__(self, *args, **kwargs):
......@@ -27,11 +27,11 @@ class CutoffTableWidget(QtGui.QTableWidget):
self._init_ui()
def _init_ui(self):
self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
self.setHorizontalHeaderLabels(("Covalent Radius", "Cutoff Radius"))
self.setVerticalHeaderLabels(self._radii.keys())
for i in range(len(self._radii)):
self.setItem(i, 0, QtGui.QTableWidgetItem())
self.setItem(i, 0, QtWidgets.QTableWidgetItem())
self.item(i, 0).setText(str(self._radii.values()[i]))
current_line_edit = CutoffTableWidget.CutoffLineEdit()
current_line_edit.textEdited.connect(self.text_edited)
......
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore, QtGui, QtWidgets
class AboutDialog(QtGui.QDialog):
class AboutDialog(QtWidgets.QDialog):
'''
Einfacher About-Dialog, der den Titel, das Icon, eine Beschreibung und eine Liste von Autoren anzeigt.
Autoren werden als Liste von Tupeln uebergeben, in dem Format (Name (str), Mail (str))
'''
class MailLabel(QtGui.QLabel):
class MailLabel(QtWidgets.QLabel):
def __init__(self, mail, parent):
super(AboutDialog.MailLabel, self).__init__('<a href="mailto:%s">%s</a>' % (mail, mail), parent)
self.mail = mail
......@@ -28,24 +28,24 @@ class AboutDialog(QtGui.QDialog):
def _init_ui(self):
# Label
self.lb_title = QtGui.QLabel('<h2>%s</h2>' % self.title, self)
self.lb_description = QtGui.QLabel('<p>%s</p>' % self.description, self)
self.lb_author = QtGui.QLabel('<b>%s</b>' % 'Autoren:', self)
self.lb_title = QtWidgets.QLabel('<h2>%s</h2>' % self.title, self)
self.lb_description = QtWidgets.QLabel('<p>%s</p>' % self.description, self)
self.lb_author = QtWidgets.QLabel('<b>%s</b>' % 'Autoren:', self)
self.lb_authors = []
for author, mail in self.authors:
lb_author = QtGui.QLabel(author, self)
lb_author = QtWidgets.QLabel(author, self)
lb_mail = self.MailLabel(mail, self)
self.lb_authors.append((lb_author, lb_mail))
# Icon
self.pm_icon = QtGui.QLabel(self)
self.pm_icon = QtWidgets.QLabel(self)
self.pm_icon.setPixmap(self.icon.pixmap(128, 128))
# Layout
self.la_main_layout = QtGui.QVBoxLayout()
self.la_icon_desc_layout = QtGui.QHBoxLayout()
self.la_desc_author_layout = QtGui.QVBoxLayout()
self.la_authors = QtGui.QGridLayout()
self.la_main_layout = QtWidgets.QVBoxLayout()
self.la_icon_desc_layout = QtWidgets.QHBoxLayout()
self.la_desc_author_layout = QtWidgets.QVBoxLayout()
self.la_authors = QtWidgets.QGridLayout()
self.la_main_layout.addWidget(self.lb_title, alignment=QtCore.Qt.AlignHCenter)
self.la_main_layout.addLayout(self.la_icon_desc_layout, stretch=1)
......@@ -60,5 +60,5 @@ class AboutDialog(QtGui.QDialog):
self.la_authors.addWidget(lb_author, i, 0)
self.la_authors.addWidget(lb_mail, i, 1)
self.la_main_layout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
self.la_main_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
self.setLayout(self.la_main_layout)
This diff is collapsed.
......@@ -4,13 +4,13 @@
from __future__ import absolute_import
from PyQt4 import QtGui, QtCore
from PyQt5 import QtCore, QtWidgets
from config.cutoff_history import cutoff_history
from config.cutoff_history import HistoryEntry
from gui.cutoff_history_table import CutoffHistoryTable
class CutoffHistoryDialog(QtGui.QDialog):
class CutoffHistoryDialog(QtWidgets.QDialog):
def __init__(self, parent, elements, preferred_filenames_with_frames=None):
super(CutoffHistoryDialog, self).__init__(parent)
history = cutoff_history.filtered_history(elements,
......@@ -18,15 +18,15 @@ class CutoffHistoryDialog(QtGui.QDialog):
self._init_ui(history)
def _init_ui(self, history):
self.gb_history = QtGui.QGroupBox('History')
self.gb_history = QtWidgets.QGroupBox('History')
self.tw_cutoff = CutoffHistoryTable(history)
self.pb_ok = QtGui.QPushButton('Ok')
self.pb_ok = QtWidgets.QPushButton('Ok')
self.pb_ok.setEnabled(False)
self.pb_cancel = QtGui.QPushButton('Cancel')
self.pb_cancel = QtWidgets.QPushButton('Cancel')
self.la_main = QtGui.QVBoxLayout()
self.la_history = QtGui.QVBoxLayout()
self.la_ok_cancel = QtGui.QHBoxLayout()
self.la_main = QtWidgets.QVBoxLayout()
self.la_history = QtWidgets.QVBoxLayout()
self.la_ok_cancel = QtWidgets.QHBoxLayout()
self.la_main.addWidget(self.gb_history)
self.la_history.addWidget(self.tw_cutoff)
self.la_ok_cancel.addStretch()
......@@ -36,7 +36,7 @@ class CutoffHistoryDialog(QtGui.QDialog):
self.la_ok_cancel.addStretch()
self.la_ok_cancel.setContentsMargins(0, 0, 0, 0)
self.la_main.addLayout(self.la_ok_cancel)
self.la_main.setSizeConstraint(QtGui.QLayout.SetFixedSize)
self.la_main.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
self.gb_history.setLayout(self.la_history)
self.setLayout(self.la_main)
......
from PyQt4 import QtGui, QtCore
from PyQt5 import QtCore, QtWidgets
class ProgressDialog(QtGui.QDialog):
class ProgressDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
QtWidgets.QDialog.__init__(self, parent)
self.finished = False
self.initUI()
def initUI(self):
hbox = QtGui.QVBoxLayout()
self.label = QtGui.QLabel('starting calculation', self)
self.progressbar = QtGui.QProgressBar(self)
# self.cancel_btn = QtGui.QPushButton('Cancel', self)
hbox = QtWidgets.QVBoxLayout()
self.label = QtWidgets.QLabel('starting calculation', self)
self.progressbar = QtWidgets.QProgressBar(self)
# self.cancel_btn = QtWidgets.QPushButton('Cancel', self)
# self.cancel_btn.clicked.connect(self.cancel)
self.setMinimumSize(300,100)
vbox = QtGui.QHBoxLayout()
vbox = QtWidgets.QHBoxLayout()
vbox.addStretch()
# vbox.addWidget(self.cancel_btn)
......@@ -37,9 +37,9 @@ class ProgressDialog(QtGui.QDialog):
@QtCore.pyqtSlot()
def close_dialog(self):
if self.finished:
self.done(QtGui.QDialog.Accepted)
self.done(QtWidgets.QDialog.Accepted)
else:
self.done(QtGui.QDialog.Rejected)
self.done(QtWidgets.QDialog.Rejected)
pass
def print_step(self, *text):
......
This diff is collapsed.
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore, QtWidgets
class CalculationTable(QtGui.QTableView):
class CalculationTable(QtWidgets.QTableView):
def __init__(self, parent):
QtGui.QTableView.__init__(self,parent)
self.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
QtWidgets.QTableView.__init__(self,parent)
self.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
class TableModel(QtCore.QAbstractTableModel):
......
......@@ -4,15 +4,15 @@
# TODO: fix frame indexing. it should start at 0 for everything, except in the strings that are displayed in the widgets
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore, QtGui, QtWidgets
class LabeledFrameChooser(QtGui.QWidget):
value_changed = QtCore.Signal()
class LabeledFrameChooser(QtWidgets.QWidget):
value_changed = QtCore.pyqtSignal()
def __init__(self, parent, num_frames, calculated, text):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
self.framebar = FrameBar(self, num_frames, calculated)
self.text = text
self.num_frames = num_frames
......@@ -20,29 +20,29 @@ class LabeledFrameChooser(QtGui.QWidget):
self.init_gui()
def init_gui(self):
hbox = QtGui.QHBoxLayout()
vbox = QtGui.QVBoxLayout()
self.lineedit = QtGui.QLineEdit(self)
hbox = QtWidgets.QHBoxLayout()
vbox = QtWidgets.QVBoxLayout()
self.lineedit = QtWidgets.QLineEdit(self)
# self.lineedit.setMinimumSize(30, 1)
# self.lineedit.setMaximumSize(40, 40)
self.update_lineedit()
self.lineedit.setAlignment(QtCore.Qt.AlignRight)
self.lineedit.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
self.lineedit.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
hbox.addWidget(QtGui.QLabel(self.text+':', self), 0)
hbox.addWidget(QtWidgets.QLabel(self.text+':', self), 0)
hbox.addWidget(self.lineedit, 1)
#hbox.addWidget(QtGui.QLabel('/'+str(self.maxf), self))
#hbox.addWidget(QtWidgets.QLabel('/'+str(self.maxf), self))
#hbox.addStretch()
vbox.addLayout(hbox)
vbox.addWidget(self.framebar)
self.lineedit.returnPressed.connect(self.lineedit_return_pressed)
self.setLayout(vbox)
self.show()
......@@ -58,7 +58,7 @@ class LabeledFrameChooser(QtGui.QWidget):
def lineedit_return_pressed(self):
try:
l_1 = [int(i.strip()) for i in str(self.lineedit.text()).split(',')]
# translate indices from human to machine
# translate indices from human to machine
l = [i - 1 for i in l_1]
except ValueError:
print 'Enter a valid number'
......@@ -80,18 +80,18 @@ class LabeledFrameChooser(QtGui.QWidget):
def value(self):
return self.framebar.get_selection()
class FrameBar(QtGui.QWidget):
class FrameBar(QtWidgets.QWidget):
def __init__(self, parent, num_frames, calculated):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
self.parent = parent
self.num_frames = num_frames
self.calculated = calculated
self.width = 300
self.height = 10
self.height = 10
self.selection = [0]
self.last_clicked = 0
self.last_clicked = 0
self.setMinimumSize(self.width+5, self.height+5)
......@@ -102,7 +102,7 @@ class FrameBar(QtGui.QWidget):
self.h = float(self.width)/(self.num_frames)
p = self.painter
p.setPen(QtCore.Qt.NoPen)
p.setBrush(red)
......
# -*- coding: utf-8 -*-
from PyQt4 import QtGui
from PyQt5 import QtWidgets
from gui.gl_widget import GLWidget
from gui.pdf_widget import PDFWidget
from gui.histogram_widget import HistogramWidget
class GLStack(QtGui.QStackedWidget):
class GLStack(QtWidgets.QStackedWidget):
def __init__(self, parent, main_window):
QtGui.QStackedWidget.__init__(self, parent)
QtWidgets.QStackedWidget.__init__(self, parent)
self.parent = parent
self.control = parent.control
self.gl_widget = GLWidget(self, main_window)
......@@ -19,6 +19,8 @@ class GLStack(QtGui.QStackedWidget):
self.addWidget(self.pdf_widget)
self.addWidget(self.histogram_widget)
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
self.show()
def activate(self, index):
......@@ -28,4 +30,4 @@ class GLStack(QtGui.QStackedWidget):
def updatestatus(self):
for index in range(self.count()):
widget = self.widget(index)
widget.updatestatus()
\ No newline at end of file
widget.updatestatus()
......@@ -4,7 +4,14 @@ from __future__ import absolute_import
import numpy as np
import numpy.linalg as la
from PyQt4 import QtCore, QtGui, QtOpenGL
from PyQt5 import QtCore, QtWidgets
try:
from PyQt5.QtWidgets import QOpenGLWidget
has_qopenglwidget = True
except ImportError:
from PyQt5 import QtOpenGL
from PyQt5.QtOpenGL import QGLWidget
has_qopenglwidget = False
from config.configuration import config
from OpenGL.GL import glReadPixels, GL_FLOAT, GL_DEPTH_COMPONENT
......@@ -17,14 +24,18 @@ class UpdateGLEvent(QtCore.QEvent):
QtCore.QEvent.__init__(self, QtCore.QEvent.Type(t))
class GLWidget(QtOpenGL.QGLWidget):
class GLWidget(QOpenGLWidget if has_qopenglwidget else QGLWidget):
"""
OpenGL widget to show the 3D-scene
"""
def __init__(self, parent, main_window):
QtOpenGL.QGLWidget.__init__(self, QtOpenGL.QGLFormat(QtOpenGL.QGL.SampleBuffers), parent)
if has_qopenglwidget:
super(GLWidget, self).__init__(parent)
else:
super(GLWidget, self).__init__(QtOpenGL.QGLFormat(QtOpenGL.QGL.SampleBuffers), parent)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
self.update_needed = False
self.dataset_loaded = False
self.control = parent.control
......@@ -39,7 +50,7 @@ class GLWidget(QtOpenGL.QGLWidget):
pass
def minimumSizeHint(self):
return QtCore.QSize(config.OpenGL.gl_window_size[0], config.OpenGL.gl_window_size[1])
return QtCore.QSize(400, 400)
def sizeHint(self):
return QtCore.QSize(config.OpenGL.gl_window_size[0], config.OpenGL.gl_window_size[1])
......@@ -59,8 +70,8 @@ class GLWidget(QtOpenGL.QGLWidget):
def wheelEvent(self, e):
self.update_needed = True
if e.modifiers() != QtCore.Qt.ShiftModifier:
if e.orientation() == QtCore.Qt.Vertical:
self.vis.zoom(e.delta())
if e.pixelDelta().y() != 0:
self.vis.zoom(-e.pixelDelta().y())
else:
rot_v = 0.1
if e.orientation() == QtCore.Qt.Horizontal:
......@@ -68,7 +79,7 @@ class GLWidget(QtOpenGL.QGLWidget):
else:
self.vis.rotate_mouse(0, e.delta() * rot_v)
QtGui.QApplication.postEvent(self, UpdateGLEvent())
QtWidgets.QApplication.postEvent(self, UpdateGLEvent())
def mousePressEvent(self, e):
if e.buttons() and QtCore.Qt.LeftButton:
......@@ -159,7 +170,13 @@ class GLWidget(QtOpenGL.QGLWidget):
"""
Refresh scene
"""
self.vis.paint(self.geometry().width(), self.geometry().height())
self.vis.paint(self.width(), self.height(), has_qopenglwidget)
def updateGL(self):
if has_qopenglwidget:
self.update()
else:
super(GLWidget, self).updateGL()
def activate(self):
pass
......
......@@ -2,7 +2,7 @@
from __future__ import absolute_import
from PyQt4 import QtCore, QtGui
from PyQt5 import QtCore, QtWidgets
import gr
from qtgr import GRWidget
import csv
......@@ -22,17 +22,11 @@ class GrHistogramWidget(GRWidget):
def __init__(self, *args, **kwargs):
super(GrHistogramWidget, self).__init__(*args, **kwargs)
self.init_gui(self)
self.xvalues = None
self.yvalues = None
self.title = None
self.datapoints = None
def init_gui(self, form):
form.resize(QtCore.QSize(500, 500).expandedTo(form.minimumSizeHint()))
QtCore.QMetaObject.connectSlotsByName(form)
def setdata(self, xvalues, yvalues, widths, title):
self.xvalues = xvalues
self.yvalues = yvalues
......@@ -86,10 +80,10 @@ class GrHistogramWidget(GRWidget):
gr.text(0.8 * self.sizex, 0.9 * self.sizey, self.title)
class HistogramWidget(QtGui.QWidget):
class HistogramWidget(QtWidgets.QWidget):
def __init__(self, parent):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
self.control = parent.control
self.results = None
......@@ -97,51 +91,51 @@ class HistogramWidget(QtGui.QWidget):
self.init_gui()
def init_gui(self):
vbox = QtGui.QVBoxLayout()
grid = QtGui.QGridLayout()
vbox = QtWidgets.QVBoxLayout()
grid = QtWidgets.QGridLayout()
self.gr_widget = GrHistogramWidget()
self.datasetlabel = QtGui.QLabel("No data loaded.", self)
self.datasetlabel = QtWidgets.QLabel("No data loaded.", self)
self.datasetlabel.setAlignment(QtCore.Qt.AlignHCenter)
selectbox = QtGui.QHBoxLayout()
self.cavity_type_box = QtGui.QComboBox(self)
selectbox = QtWidgets.QHBoxLayout()
self.cavity_type_box = QtWidgets.QComboBox(self)
self.cavity_type_box.setMinimumWidth(180)
selectbox.addWidget(self.cavity_type_box)
selectbuttongroup = QtGui.QButtonGroup(self)
self.volumebutton = QtGui.QRadioButton("Cavity Volume", self)
selectbuttongroup = QtWidgets.QButtonGroup(self)
self.volumebutton = QtWidgets.QRadioButton("Cavity Volume", self)
selectbox.addWidget(self.volumebutton)
selectbuttongroup.addButton(self.volumebutton)
self.areabutton = QtGui.QRadioButton("Surface Area", self)
self.areabutton = QtWidgets.QRadioButton("Surface Area", self)
selectbox.addWidget(self.areabutton)
selectbuttongroup.addButton(self.areabutton)
self.volumebutton.setChecked(True)
grid.addLayout(selectbox, 0, 0)
self.weightbutton = QtGui.QCheckBox("Weighted Histogram", self)
self.weightbutton = QtWidgets.QCheckBox("Weighted Histogram", self)
self.weightbutton.setChecked(True)
grid.addWidget(self.weightbutton, 0, 1)
binbox = QtGui.QHBoxLayout()
binbox.addWidget(QtGui.QLabel("Number of Bins:", self), 0)
self.nbins = QtGui.QLineEdit(self)
binbox = QtWidgets.QHBoxLayout()
binbox.addWidget(QtWidgets.QLabel("Number of Bins:", self), 0)
self.nbins = QtWidgets.QLineEdit(self)
self.nbins.setMinimumWidth(50)
binbox.addWidget(self.nbins, 0, QtCore.Qt.AlignLeft)
grid.addLayout(binbox, 0, 2)
buttonbox = QtGui.QHBoxLayout()
buttonbox = QtWidgets.QHBoxLayout()
self.plotbutton = QtGui.QPushButton("Plot", self)
self.plotbutton = QtWidgets.QPushButton("Plot", self)
buttonbox.addWidget(self.plotbutton)
self.connect(self.plotbutton, QtCore.SIGNAL("clicked()"), self.draw)
self.plotbutton.clicked.connect(self.draw)
self.export_image_button = QtGui.QPushButton("Save Image", self)
self.export_image_button = QtWidgets.QPushButton("Save Image", self)
buttonbox.addWidget(self.export_image_button)
self.connect(self.export_image_button, QtCore.SIGNAL("clicked()"), self.export_image)
self.export_image_button.clicked.connect(self.export_image)