Commit 30d86633 authored by Poseidon's avatar Poseidon

StatusPlotWidget revisado, criando logSpecWidget

parent 610200c7
......@@ -126,4 +126,9 @@ class MainWindow(QtGui.QMainWindow):
pass
def newLog(self):
self.progress_bar = QtGui.QProgressBar(self)
self.progress_bar.setFixedHeight(20)
self.progress_bar.setMinimumWidth(50)
self.progress_bar.setMaximumWidth(75)
self.status_bar.addPermanentWidget(self.progress_bar, 0)
self.status_bar.showMessage("Serial Port not specified")
from PyQt4 import QtGui
class LogSpecWidget(QtGui.QWidget):
def __init__(self, pattern = None):
super(LogSpecWidget, self).__init__(pattern)
vbox = QtGui.QVBoxLayout(self)
hbox = QtGui.QHBoxLayout()
lbl = QtGui.QLabel(self)
lbl.setText('Serial Port:')
self.serial_port_cb = QtGui.QComboBox(self)
self.serial_port_btt = QtGui.QToolButton(self)
self.serial_port_btt.setIcon(QtGui.QIcon('../resources/refresh.png'))
hbox.addWidget(lbl)
hbox.addWidget(self.serial_port_cb)
hbox.addStretch(1)
hbox.addWidget(self.serial_port_btt)
vbox.addLayout(hbox)
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
main_w = LogSpecWidget()
main_w.show()
sys.exit(app.exec_())
......@@ -4,19 +4,18 @@ class StatusPlotWidget(QtGui.QWidget):
def __init__(self, pattern = None):
super(StatusPlotWidget, self).__init__(pattern)
wid = QtGui.QWidget(pattern)
vbox = QtGui.QVBoxLayout(wid)
hbox = QtGui.QHBoxLayout(wid)
vbox = QtGui.QVBoxLayout(self)
hbox = QtGui.QHBoxLayout()
time_lbl1 = QtGui.QLabel(wid)
time_lbl1 = QtGui.QLabel(self)
time_lbl1.setText('Current Time: ')
self.curr_time = QtGui.QLabel(wid)
self.curr_time.setText('00.00 s')
self.curr_time = QtGui.QLabel(self)
self.curr_time.setText('00.0 s')
time_lbl2 = QtGui.QLabel(wid)
time_lbl2 = QtGui.QLabel(self)
time_lbl2.setText('Total Time: ')
self.total_time = QtGui.QLabel(wid)
self.total_time.setText('00.00 s')
self.total_time = QtGui.QLabel(self)
self.total_time.setText('00.0 s')
hbox.addWidget(time_lbl1)
hbox.addWidget(self.curr_time)
......@@ -24,27 +23,26 @@ class StatusPlotWidget(QtGui.QWidget):
hbox.addWidget(time_lbl2)
hbox.addWidget(self.total_time)
vbox.addLayout(hbox)
vbox.addStretch(0.5)
self.progress_bar = QtGui.QProgressBar(wid)
self.progress_bar.setFixedHeight(40)
self.progress_bar = QtGui.QProgressBar(self)
self.progress_bar.setFixedHeight(30)
vbox.addWidget(self.progress_bar)
vbox.addStretch(1)
vbox.addStretch(0.5)
self.ok_stop_btt = QtGui.QPushButton("OK")
self.cancel_btt = QtGui.QPushButton("Cancel")
hbox = QtGui.QHBoxLayout(wid)
hbox = QtGui.QHBoxLayout()
hbox.addStretch(1)
hbox.addWidget(self.ok_stop_btt)
hbox.addWidget(self.cancel_btt)
vbox.addLayout(hbox)
#wid.setLayout(vbox)
wid.show()
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
main_w = StatusPlotWidget()
#main_w.show()
main_w.show()
sys.exit(app.exec_())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment