Skip to content

Instantly share code, notes, and snippets.

@oglops
oglops / drag_between_two_list_widgets_check_2_multi_sel_toggle.py
Created August 26, 2014 15:45
enable drag and drop / extended selection at the same time by setting QAbstractItemView.DragSelectingState, set optimum dragging hotzone, fix single click after dragging selection, enable clicking checkbox toggle and keep selection after spacebar toggling
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
import sys
import os
class ThumbListWidget(QtGui.QListWidget):
_rows_to_del = []
@oglops
oglops / drag_between_two_list_widgets_check_2_multi_sel_toggle_1.py
Created August 27, 2014 03:49
fix dragging selection and checkbox toggling
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
import sys
import os
class ThumbListWidget(QtGui.QListWidget):
_rows_to_del = []
@oglops
oglops / simple_treeWidget_2.py
Last active August 29, 2015 14:05
simple tree widget with item widgets template #2
#!/usr/bin/env python2
import os
import sys
import re
import textwrap
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
@oglops
oglops / gif-batch.sh
Last active August 29, 2015 14:05
latest version i'm using at home ffcast screen casting
#!/usr/bin/env bash
# the convert call depends on whether you have h264 support in
# convert -list format
# if you don't have it , then record to -vcodec huffyuv
# if you see convert: Not enough pixel data `/tmp/x.avi' @ avi.c/ReadAVIImage/1243.
# maybe try removing -vcodec completely and use uncompressed avi
# usage:
@oglops
oglops / simple_treeWidget_custom_dropIndicator_multi_1.py
Created August 28, 2014 10:28
修复不能拖放到本行其他列,以及拖到其他行其他列的时候,没有画框的问题
#!/usr/bin/env python2
# problems:
# dragging 3 items, two nested, one root level, only 2 of 3 are moved if left mouse button dragging , MMB is fine
import os
import sys
import re
from PyQt4 import QtGui, QtCore
@oglops
oglops / PyQt4-Qt4.nsi
Last active August 29, 2015 14:05
compiled pyqt4 with phonon mysql psql odbc qscintalla plugins, added Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
# PyQt4 with Qt4 NSIS installer script.
#
# Copyright (c) 2014 Riverbank Computing Limited <[email protected]>
#
# This file is part of PyQt.
#
# This file may be used under the terms of the GNU General Public
# License versions 2.0 or 3.0 as published by the Free Software
# Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
# included in the packaging of this file. Alternatively you may (at
@oglops
oglops / simple_treeWidget_2_customDrop_0.py
Created September 1, 2014 02:12
drop items with itemWidgets by recreating them recursively in dropEvent
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class CommandWidget(QtGui.QDialog):
@oglops
oglops / simple_treeWidget_2_customDrop_1.py
Last active August 29, 2015 14:05
drop items with itemWidgets by recreating them recursively in dropEvent, with custom drop indicator
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class CommandWidget(QtGui.QDialog):
@oglops
oglops / simple_treeWidget_2_customDrop_2.py
Created September 1, 2014 02:52
drop items with itemWidgets by cloning them recursively in dropEvent, with custom drop indicator
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class CommandWidget(QtGui.QDialog):
@oglops
oglops / PyQt4-Qt4.nsi
Created August 5, 2015 15:50
PyQt4 nsi script for maya 2016
# PyQt4 with Qt4 NSIS installer script.
#
# Copyright (c) 2015 Riverbank Computing Limited <[email protected]>
#
# This file is part of PyQt4.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file. Please review the
# following information to ensure the GNU General Public License version 3.0