Skip to content

Commit a5bb603

Browse files
committed
setBackgroundColor deprecated, switched to setBackground. updated signals syntax.
1 parent c9477c7 commit a5bb603

4 files changed

Lines changed: 50 additions & 40 deletions

File tree

dataVaultLivePlotter.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def setupTable(self):
459459
for c in range(1, 4):
460460
item = QtGui.QTableWidgetItem()
461461
self.extTable.setItem(r, c, item)
462-
self.extTable.item(r, c).setBackgroundColor(QtGui.QColor(255,255,255))
462+
self.extTable.item(r, c).setBackground(QBrush(QColor(255,255,255)))
463463

464464
def moveDefault(self):
465465
self.move(self.x0, self.y0)
@@ -470,7 +470,7 @@ def checkExt(self):
470470

471471
for r in range(1, len(self.plotInfo) + 1):
472472
for c in range(1, 4):
473-
self.extTable.item(r, c).setBackgroundColor(QtGui.QColor(255,255,255))
473+
self.extTable.item(r, c).setBackground(QBrush(QColor(255,255,255)))
474474

475475
for r in range(1, self.extTable.rowCount()):
476476
try:
@@ -495,7 +495,7 @@ def checkExt(self):
495495
self.accept()
496496
else:
497497
for ii in range(0, len(errCell)):
498-
self.extTable.item(errCell[ii][0], errCell[ii][1]).setBackgroundColor(QtGui.QColor(250,190,160))
498+
self.extTable.item(errCell[ii][0], errCell[ii][1]).setBackground(QBrush(QColor(250,190,160)))
499499

500500
def closeEvent(self, e):
501501
self.reject()
@@ -1353,13 +1353,13 @@ def __init__(self, reactor, file, dir, plotInfo, yMovePos, pencolor):
13531353
self.backBtn1.setStyleSheet("QPushButton#backBtn1 {color:rgb(131,131,131);background-color:black;border: 2px solid rgb(131,131,131);border-radius: 5px; height: 38px; width: 70px}")
13541354

13551355
self.saveMATBtn.setObjectName('saveMATBtn')
1356-
self.saveMATBtn.setStyleSheet("QPushButton#saveMATBtn {image:url(:/dvPlotter/Pictures/saveMATLAB.png);background-color: transparent; height: 23px; width: 23px;}")
1356+
self.saveMATBtn.setStyleSheet("QPushButton#saveMATBtn {border-image:url(:/dvPlotter/Pictures/saveMATLAB.png);background-color: transparent; height: 23px; width: 23px;}")
13571357
self.savePDFBtn.setObjectName('savePDFBtn')
1358-
self.savePDFBtn.setStyleSheet("QPushButton#savePDFBtn {image:url(:/dvPlotter/Pictures/savePDF.png);background-color: transparent; height: 23px; width: 23px;}")
1358+
self.savePDFBtn.setStyleSheet("QPushButton#savePDFBtn {border-image:url(:/dvPlotter/Pictures/savePDF.png);background-color: transparent; height: 23px; width: 23px;}")
13591359
self.editNotesBtn.setObjectName('editNotesBtn')
1360-
self.editNotesBtn.setStyleSheet("QPushButton#editNotesBtn {image:url(:/dvPlotter/Pictures/editNotes.png);background-color: transparent; height: 15px; width: 23px;}")
1360+
self.editNotesBtn.setStyleSheet("QPushButton#editNotesBtn {border-image:url(:/dvPlotter/Pictures/editNotes.png);background-color: transparent; height: 15px; width: 23px;}")
13611361
self.openDVBtn.setObjectName('openDVBtn')
1362-
self.openDVBtn.setStyleSheet("QPushButton#openDVBtn {image:url(:/dvPlotter/Pictures/browse.png); background-color: transparent; height: 18px; width: 18px;}")
1362+
self.openDVBtn.setStyleSheet("QPushButton#openDVBtn {border-image:url(:/dvPlotter/Pictures/browse.png); background-color: transparent; height: 18px; width: 18px;}")
13631363

13641364
self.layout.setColumnStretch(0, 1)
13651365
self.layout.setColumnStretch(1,5)
@@ -1564,8 +1564,8 @@ def __init__(self, reactor, fileDV, dir, plotInfo, yMovePos ):
15641564
self.yAxis = self.plotInfo['y axis']
15651565
self.zAxis = self.plotInfo['z axis']
15661566

1567-
self.connect(QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL+ QtCore.Qt.Key_C), self), QtCore.SIGNAL('activated()'),self.copyPlotToClip)
1568-
1567+
#self.connect(QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL+ QtCore.Qt.Key_C), self), QtCore.SIGNAL('activated()'),self.copyPlotToClip)
1568+
QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL+ QtCore.Qt.Key_C), self).activated.connect(self.copyPlotToClip)
15691569
self.notes = ''
15701570
self.plotTitle = self.plotInfo['title']
15711571
if self.plotTitle[0:5] == 'Plot ':
@@ -1698,13 +1698,13 @@ def __init__(self, reactor, fileDV, dir, plotInfo, yMovePos ):
16981698
self.backBtn1.setStyleSheet("QPushButton#backBtn1 {color:rgb(131,131,131);background-color:black;border: 2px solid rgb(131,131,131);border-radius: 5px; height: 38px; width: 70px}")
16991699

17001700
self.saveMATBtn.setObjectName('saveMATBtn')
1701-
self.saveMATBtn.setStyleSheet("QPushButton#saveMATBtn {image:url(:/dvPlotter/Pictures/saveMATLAB.png);background-color: transparent; height: 23px; width: 23px;}")
1701+
self.saveMATBtn.setStyleSheet("QPushButton#saveMATBtn {border-image:url(:/dvPlotter/Pictures/saveMATLAB.png);background-color: transparent; height: 23px; width: 23px;}")
17021702
self.savePDFBtn.setObjectName('savePDFBtn')
1703-
self.savePDFBtn.setStyleSheet("QPushButton#savePDFBtn {image:url(:/dvPlotter/Pictures/savePDF.png);background-color: transparent; height: 23px; width: 23px;}")
1703+
self.savePDFBtn.setStyleSheet("QPushButton#savePDFBtn {border-image:url(:/dvPlotter/Pictures/savePDF.png);background-color: transparent; height: 23px; width: 23px;}")
17041704
self.editNotesBtn.setObjectName('editNotesBtn')
1705-
self.editNotesBtn.setStyleSheet("QPushButton#editNotesBtn {image:url(:/dvPlotter/Pictures/editNotes.png);background-color: transparent; height: 15px; width: 23px;}")
1705+
self.editNotesBtn.setStyleSheet("QPushButton#editNotesBtn {border-image:url(:/dvPlotter/Pictures/editNotes.png);background-color: transparent; height: 15px; width: 23px;}")
17061706
self.openDVBtn.setObjectName('openDVBtn')
1707-
self.openDVBtn.setStyleSheet("QPushButton#openDVBtn {image:url(:/dvPlotter/Pictures/browse.png); background-color: transparent; height: 18px; width: 18px;}")
1707+
self.openDVBtn.setStyleSheet("QPushButton#openDVBtn {border-image:url(:/dvPlotter/Pictures/browse.png); background-color: transparent; height: 18px; width: 18px;}")
17081708

17091709

17101710

@@ -2188,9 +2188,13 @@ def __init__(self, parent = None):
21882188

21892189
self.lineNumberArea = LineNumberArea(self)
21902190

2191-
self.connect(self, QtCore.SIGNAL('blockCountChanged(int)'), self.updateLineNumberAreaWidth)
2192-
self.connect(self, QtCore.SIGNAL('updateRequest(QRect,int)'), self.updateLineNumberArea)
2193-
self.connect(self, QtCore.SIGNAL('cursorPositionChanged()'), self.highlightCurrentLine)
2191+
#self.connect(self, QtCore.SIGNAL('blockCountChanged(int)'), self.updateLineNumberAreaWidth)
2192+
#self.connect(self, QtCore.SIGNAL('updateRequest(QRect,int)'), self.updateLineNumberArea)
2193+
#self.connect(self, QtCore.SIGNAL('cursorPositionChanged()'), self.highlightCurrentLine)
2194+
2195+
self.blockCountChanged.connect(self.updateLineNumberAreaWidth)
2196+
self.updateRequest.connect(self.updateLineNumberArea)
2197+
self.cursorPositionChanged.connect(self.highlightCurrentLine)
21942198

21952199
self.updateLineNumberAreaWidth(0)
21962200

dirExplorer.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ border-radius: 5px
7878
</property>
7979
<property name="styleSheet">
8080
<string notr="true">QPushButton#home{
81-
image:url(:/dvPlotter/Pictures/home.png);
81+
border-image:url(:/dvPlotter/Pictures/home.png);
8282
background: black;
8383

8484
}
8585

8686
QPushButton:pressed#home{
87-
image:url(:/dvPlotter/Pictures/home.png);
87+
border-image:url(:/dvPlotter/Pictures/home.png);
8888
background: black;
8989
border: 2px rgb(131,131,131);
9090
border-radius: 5px
@@ -176,13 +176,13 @@ color: rgb(131,131,131);</string>
176176
</property>
177177
<property name="styleSheet">
178178
<string notr="true">QPushButton#back{
179-
image:url(:/dvPlotter/Pictures/back.png);
179+
border-image:url(:/dvPlotter/Pictures/back.png);
180180
background: black;
181181

182182
}
183183

184184
QPushButton:pressed#back{
185-
image:url(:/dvPlotter/Pictures/back.png);
185+
border-image:url(:/dvPlotter/Pictures/back.png);
186186
background: black;
187187
border: 2px rgb(131,131,131);
188188
border-radius: 5px
@@ -250,13 +250,13 @@ border-radius: 5px
250250
</property>
251251
<property name="styleSheet">
252252
<string notr="true">QPushButton#addDir{
253-
image:url(:/dvPlotter/Pictures/add.png);
253+
border-image:url(:/dvPlotter/Pictures/add.png);
254254
background: black;
255255

256256
}
257257

258258
QPushButton:pressed#addDir{
259-
image:url(:/dvPlotter/Pictures/add.png);
259+
border-image:url(:/dvPlotter/Pictures/add.png);
260260
background: black;
261261
border: 2px rgb(131,131,131);
262262
border-radius: 5px
@@ -280,13 +280,13 @@ border-radius: 5px
280280
</property>
281281
<property name="styleSheet">
282282
<string notr="true">QPushButton#refresh{
283-
image:url(:/dvPlotter/Pictures/refresh.png);
283+
border-image:url(:/dvPlotter/Pictures/refresh.png);
284284
background: black;
285285

286286
}
287287

288288
QPushButton:pressed#refresh{
289-
image:url(:/dvPlotter/Pictures/refresh.png);
289+
border-image:url(:/dvPlotter/Pictures/refresh.png);
290290
background: black;
291291
border: 2px rgb(131,131,131);
292292
border-radius: 5px

dvExplorer.ui

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ border-radius: 5px
7878
</property>
7979
<property name="styleSheet">
8080
<string notr="true">QPushButton#home{
81-
image:url(:/dvPlotter/Pictures/home.png);
81+
border-image:url(:/dvPlotter/Pictures/home.png);
8282
background: black;
8383

8484
}
8585

8686
QPushButton:pressed#home{
87-
image:url(:/dvPlotter/Pictures/home.png);
87+
border-image:url(:/dvPlotter/Pictures/home.png);
8888
background: black;
8989
border: 2px rgb(131,131,131);
9090
border-radius: 5px
@@ -176,13 +176,13 @@ color: rgb(131,131,131);</string>
176176
</property>
177177
<property name="styleSheet">
178178
<string notr="true">QPushButton#back{
179-
image:url(:/dvPlotter/Pictures/back.png);
179+
border-image:url(:/dvPlotter/Pictures/back.png);
180180
background: black;
181181

182182
}
183183

184184
QPushButton:pressed#back{
185-
image:url(:/dvPlotter/Pictures/back.png);
185+
border-image:url(:/dvPlotter/Pictures/back.png);
186186
background: black;
187187
border: 2px rgb(131,131,131);
188188
border-radius: 5px
@@ -250,13 +250,13 @@ border-radius: 5px
250250
</property>
251251
<property name="styleSheet">
252252
<string notr="true">QPushButton#addDir{
253-
image:url(:/dvPlotter/Pictures/add.png);
253+
border-image:url(:/dvPlotter/Pictures/add.png);
254254
background: black;
255255

256256
}
257257

258258
QPushButton:pressed#addDir{
259-
image:url(:/dvPlotter/Pictures/add.png);
259+
border-image:url(:/dvPlotter/Pictures/add.png);
260260
background: black;
261261
border: 2px rgb(131,131,131);
262262
border-radius: 5px
@@ -265,6 +265,9 @@ border-radius: 5px
265265
<property name="text">
266266
<string/>
267267
</property>
268+
<property name="flat">
269+
<bool>false</bool>
270+
</property>
268271
</widget>
269272
<widget class="QPushButton" name="refresh">
270273
<property name="geometry">
@@ -275,18 +278,21 @@ border-radius: 5px
275278
<height>23</height>
276279
</rect>
277280
</property>
281+
<property name="cursor">
282+
<cursorShape>ArrowCursor</cursorShape>
283+
</property>
278284
<property name="toolTip">
279285
<string>Refresh</string>
280286
</property>
281287
<property name="styleSheet">
282288
<string notr="true">QPushButton#refresh{
283-
image:url(:/dvPlotter/Pictures/refresh.png);
289+
border-image:url(:/dvPlotter/Pictures/refresh.png);
284290
background: black;
285291

286292
}
287293

288294
QPushButton:pressed#refresh{
289-
image:url(:/dvPlotter/Pictures/refresh.png);
295+
border-image:url(:/dvPlotter/Pictures/refresh.png);
290296
background: black;
291297
border: 2px rgb(131,131,131);
292298
border-radius: 5px

plotSetup.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ border-radius: 5px
272272
</property>
273273
<property name="styleSheet">
274274
<string notr="true">QPushButton#add2D{
275-
image:url(:/dvPlotter/Pictures/add.png);
275+
border-image:url(:/dvPlotter/Pictures/add.png);
276276
background: black;
277277

278278
}
279279

280280
QPushButton:pressed#add2D{
281-
image:url(:/dvPlotter/Pictures/add.png);
281+
border-image:url(:/dvPlotter/Pictures/add.png);
282282
background: black;
283283
border: 2px rgb(131,131,131);
284284
border-radius: 5px
@@ -305,13 +305,13 @@ border-radius: 5px
305305
</property>
306306
<property name="styleSheet">
307307
<string notr="true">QPushButton#add1D{
308-
image:url(:/dvPlotter/Pictures/add.png);
308+
border-image:url(:/dvPlotter/Pictures/add.png);
309309
background: black;
310310

311311
}
312312

313313
QPushButton:pressed#add1D{
314-
image:url(:/dvPlotter/Pictures/add.png);
314+
border-image:url(:/dvPlotter/Pictures/add.png);
315315
background: black;
316316
border: 2px rgb(131,131,131);
317317
border-radius: 5px
@@ -338,13 +338,13 @@ border-radius: 5px
338338
</property>
339339
<property name="styleSheet">
340340
<string notr="true">QPushButton#rmv2D{
341-
image:url(:/dvPlotter/Pictures/remove.png);
341+
border-image:url(:/dvPlotter/Pictures/remove.png);
342342
background: black;
343343

344344
}
345345

346346
QPushButton:pressed#rmv2D{
347-
image:url(:/dvPlotter/Pictures/remove.png);
347+
border-image:url(:/dvPlotter/Pictures/remove.png);
348348
background: black;
349349
border: 2px rgb(131,131,131);
350350
border-radius: 5px
@@ -371,13 +371,13 @@ border-radius: 5px
371371
</property>
372372
<property name="styleSheet">
373373
<string notr="true">QPushButton#rmv1D{
374-
image:url(:/dvPlotter/Pictures/remove.png);
374+
border-image:url(:/dvPlotter/Pictures/remove.png);
375375
background: black;
376376

377377
}
378378

379379
QPushButton:pressed#rmv1D{
380-
image:url(:/dvPlotter/Pictures/remove.png);
380+
border-image:url(:/dvPlotter/Pictures/remove.png);
381381
background: black;
382382
border: 2px rgb(131,131,131);
383383
border-radius: 5px

0 commit comments

Comments
 (0)