mirror of
https://github.com/wassname/sloth.git
synced 2026-07-18 12:40:43 +08:00
Try to add possibility to insert widgets anywhere. Does not work
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from PyQt4.QtCore import Qt, QRect, QSize, QPoint
|
||||
from PyQt4.QtGui import QLayout, QSizePolicy
|
||||
from PyQt4.QtGui import QLayout, QSizePolicy, QWidgetItem
|
||||
|
||||
class FloatingLayout(QLayout):
|
||||
def __init__(self, parent=None):
|
||||
@@ -66,6 +66,13 @@ class FloatingLayout(QLayout):
|
||||
wid = wid.parentWidget()
|
||||
i += 1
|
||||
|
||||
def insertItem(self, pos, item):
|
||||
self._items.insert(pos, item)
|
||||
self.invalidate()
|
||||
|
||||
def insertWidget(self, pos, wid):
|
||||
self.insertItem(pos, QWidgetItem(wid))
|
||||
|
||||
def addItem(self, item):
|
||||
self._items.append(item)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user