Exemplo n.º 1
0
 def sizeHint(self, option, index):
     fm = option.fontMetrics
     if index.column() in (MOD1, MOD2, MOD3):
         if self.mod is None:
             w = 0
             for mod in self.modifiers:
                 cw = fm.width(mod)
                 if cw > w:
                     w = cw
                     self.mod = mod
         else:
             w = fm.width(self.mod)
         return QSize(w+20, fm.height())
     elif index.column() == KEY:
         if self.key is None:
             w = 0
             for key in self.keys:
                 cw = fm.width(key)
                 if cw > w:
                     w = cw
                     self.key = key
         else:
             w = fm.width(self.key)
         return QSize(w+20, fm.height())
     return QItemDelegate.sizeHint(self, option, index)
Exemplo n.º 2
0
	def sizeHint(self, option, index):
		fm = option.fontMetrics
		if index.column() in (SRC_ADDR, DST_ADDR):
			text = index.model().data(index).toString()
			document = QTextDocument()
			document.setDefaultFont(option.font)
			document.setHtml(text)
			#document.setPageSize(option.rect.size())
			return QSize(document.idealWidth() + 5, 1.3 * fm.height())
		return QItemDelegate.sizeHint(self, option, index)
Exemplo n.º 3
0
 def sizeHint(self, option, index):
     if index.column() is self._column:
         return QSize(option.rect.size().width(), 25)
         
     return QItemDelegate.sizeHint(self, option, index)
Exemplo n.º 4
0
 def sizeHint( self, option, index ):
     " Returns the size hint in which the only height matters "
     origSize = QItemDelegate.sizeHint( self, option, index )
     self.lastHeight = origSize.height() + self.delta
     origSize.setHeight( self.lastHeight )
     return origSize
Exemplo n.º 5
0
    def sizeHint(self, opt, index):

        option = opt;
        sz = QItemDelegate.sizeHint(self, opt, index) + QSize(2, 2)
        return sz
Exemplo n.º 6
0
 def sizeHint(self, option, index):
     " Returns the size hint in which the only height matters "
     origSize = QItemDelegate.sizeHint(self, option, index)
     self.lastHeight = origSize.height() + self.delta
     origSize.setHeight(self.lastHeight)
     return origSize