优化显示

This commit is contained in:
sunlit@home 2017-02-12 19:38:03 +08:00
parent 819d54e5d7
commit 8bf7692267
2 changed files with 8 additions and 8 deletions

View File

@ -149,9 +149,11 @@ class TreeModel(QtCore.QAbstractItemModel):
return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEditable
def headerData(self, section, orientation, role):
if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole:
if orientation == QtCore.Qt.Horizontal:
if role == QtCore.Qt.DisplayRole:
return self.rootItem.data(section)
elif role == QtCore.Qt.TextAlignmentRole:
return QtCore.Qt.AlignCenter
return None
def index(self, row, column, parent):

View File

@ -100,21 +100,18 @@ class DrEngineManager(QtGui.QWidget):
grid.addWidget(self.activeTable, 1, 2)
btnEdit = QtGui.QPushButton(u'编辑', self)
btnRestart = QtGui.QPushButton(u'更新数据', self)
vbox = QtGui.QVBoxLayout()
vbox.addLayout(grid)
vline = QtGui.QHBoxLayout()
vline.addWidget(btnEdit)
vline.addWidget(btnRestart)
vbox.addLayout(vline)
vbox.addWidget(self.logMonitor)
self.setLayout(vbox)
btnEdit.clicked.connect(self.openDr)
btnRestart.clicked.connect(self.restart)
#----------------------------------------------------------------------
def updateLog(self, event):
@ -171,6 +168,7 @@ class DrEngineManager(QtGui.QWidget):
def openDr(self):
"""打开行情数据记录组件"""
self.mDrEditWidget = DrEditWidget(self,self.mainEngine, self.eventEngine)
self.mDrEditWidget.setWindowTitle(u"编辑订阅")
self.mDrEditWidget.setFixedSize(800,800)
self.mDrEditWidget.show()