Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

qtlib: add LabeledSeparator widget

This widget is useful alternative to QFrame.

Changeset 7ffbc51b8c4f

Parent 9d81b3742cc1

by Yuki KODAMA

Changes to one file · Browse files at 7ffbc51b8c4f Showing diff from parent 9d81b3742cc1 Diff from another changeset...

 
373
374
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
377
378
 
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
@@ -373,6 +373,25 @@
  def clear_icon(self):   self.status_icon.setHidden(True)   +class LabeledSeparator(QtGui.QWidget): + + def __init__(self, label=None, parent=None): + QtGui.QWidget.__init__(self, parent) + + box = QtGui.QHBoxLayout() + box.setContentsMargins(*(0,)*4) + + if label: + label = QtGui.QLabel(label) + box.addWidget(label) + + sep = QtGui.QFrame() + sep.setFrameShadow(QtGui.QFrame.Sunken) + sep.setFrameShape(QtGui.QFrame.HLine) + box.addWidget(sep, 1, QtCore.Qt.AlignVCenter) + + self.setLayout(box) +  def fileEditor(filename):   'Open a simple modal file editing dialog'   dialog = QtGui.QDialog()