当前位置: 首页>>代码示例>>Python>>正文


Python util.qtWrapImport函数代码示例

本文整理汇总了Python中util.qtWrapImport函数的典型用法代码示例。如果您正苦于以下问题:Python qtWrapImport函数的具体用法?Python qtWrapImport怎么用?Python qtWrapImport使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qtWrapImport函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_oligos_with_color

def get_oligos_with_color(color):
    """
    Returns the set of oligos that has color <color>.
    """
    if isinstance(color, basestring):
        util.qtWrapImport('QtCore', globals(), ['QString'])
        if color[0] != "#" and len(color) == 6:
            # Probably forgot to add '#' in #ff00ff:
            color = '#'+color
        color = QString(color.lower())  # colors should be lower-case
    return set(oligo for oligo in get_all_oligos() if oligo.color() == color)
开发者ID:basnijholt,项目名称:cadnano2,代码行数:11,代码来源:cadnano_api.py

示例2: set_oligos_color

def set_oligos_color(color, enableRedo=True):
    """
    Sets the color of all selected oligos to <color>.
    """
    if isinstance(color, basestring):
        util.qtWrapImport('QtCore', globals(), ['QString'])
        # PySide uses standard str as QString, but that should not be a problem.
        color = QString(color)
    selectedOs = get_selected_oligos()
    if enableRedo:
        # If A LOT of oligos are selected, this could add considerable overhead.
        # (There will be one undo command in the undo stack for EACH oligo.)
        for oligo in selectedOs:
            oligo.applyColor(color)
    else:
        for oligo in selectedOs:
            oligo.setColor(color) # setColor does not emit the
            oligo.oligoAppearanceChangedSignal(oligo)
开发者ID:basnijholt,项目名称:cadnano2,代码行数:18,代码来源:cadnano_api.py

示例3: globals

# http://www.opensource.org/licenses/mit-license.php

"""
document.py
Created by Jonathan deWerd on 2011-01-26.
"""

import json
from views import styles
from .dnahoneycombpart import DNAHoneycombPart
from .dnasquarepart import DNASquarePart
from .enum import LatticeType

import util
# import Qt stuff into the module namespace with PySide, PyQt4 independence
util.qtWrapImport('QtCore', globals(), ['pyqtSignal', 'QObject'])
util.qtWrapImport('QtGui', globals(), [ 'QUndoCommand'])

class Document(QObject):
    def __init__(self, incompleteArchivedDict=None):
        super(Document, self).__init__()
        self._parts = []
        self._selectedPart = None
        self._controller = None
    
    def fsck(self):
        for p in self._parts:
            p.fsck()

    def controller(self):
        return self._controller
开发者ID:MatthewMcAteer,项目名称:cadnano2,代码行数:31,代码来源:document.py

示例4: Random

# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
"""
base.py
Created by Shawn Douglas on 2011-02-08.
"""
from .enum import StrandType
from random import Random
from views import styles
prng = Random()

import util
# import Qt stuff into the module namespace with PySide, PyQt4 independence
util.qtWrapImport('QtGui', globals(), [ 'QColor'])

class Base(object):
    """
    A POD class that lives in the private API of virtualhelix.
    (Why not put it inside VirtualHelix? Because it's already quite crowded)
    Provides information about which bases are connected to which other bases.
    """
    def __init__(self, vhelix, strandtype, index):
        super(Base, self).__init__()
        self._5pBase = None
        self._3pBase = None
        self._color = None
        self._vhelix = vhelix
        self._strandtype = strandtype
        self._n = index
开发者ID:MatthewMcAteer,项目名称:cadnano2,代码行数:31,代码来源:base.py

示例5: globals

# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
"""
recorder.py

Created by Shawn on 2011-06-30.
"""

import os
import glob
from cadnano import app
from model.enum import LatticeType
import util

util.qtWrapImport("QtCore", globals(), ["Qt", "QPoint", "QPointF", "QEvent", "pyqtSlot"])


class TestRecorder(object):
    """
    TestRecorder can be used to auto-generate functional tests based on
    user input.

    It is currently set up for specific workflow, which assumes the first
    step is creating a part, followed by mousePress, mouseMove, and
    mouseRelease events in the slice and path views.
    
    INSTRUCTIONS:
    To record a new test, call "python main.py -r" from the cadnano2
    root directory. The resulting test will be saved in two places:
    
开发者ID:MatthewMcAteer,项目名称:cadnano2,代码行数:30,代码来源:testrecorder.py

示例6: globals

#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php

import util
util.qtWrapImport('QtCore', globals(), ['QObject', 'pyqtSignal', 'Qt'])
util.qtWrapImport('QtGui', globals(), ['QGraphicsObject'])
util.qtWrapImport('QtSvg', globals(), ['QSvgRenderer'])

class SVGButton(QGraphicsObject):
    def __init__(self, fname, parent=None):
        super(SVGButton, self).__init__(parent)
        self.svg = QSvgRenderer(fname)

    def paint(self, painter, options, widget):
        self.svg.render(painter, self.boundingRect())

    def boundingRect(self):
        return self.svg.viewBoxF()

    clicked = pyqtSignal()
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:31,代码来源:svgbutton.py

示例7: globals

# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
import sys
from abstractpathtool import AbstractPathTool
import util
util.qtWrapImport('QtCore', globals(), [])
util.qtWrapImport('QtGui', globals(), [])


class SelectTool(AbstractPathTool):
    """
    SelectTool is the default tool. It allows editing of breakpoints
    (by clicking and dragging) and toggling of crossovers.
    """
    def __init__(self, controller):
        super(SelectTool, self).__init__(controller)

    def __repr__(self):
        return "selectTool"  # first letter should be lowercase
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:31,代码来源:selecttool.py

示例8: globals

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php

import util
# import Qt stuff into the module namespace with PySide, PyQt4 independence
util.qtWrapImport('QtCore', globals(), ['pyqtSignal', 'QObject'])
util.qtWrapImport('QtGui', globals(), [ 'QActionGroup'])


class SliceToolManager(QObject):
    """Manages interactions between the slice widgets/UI and the model."""
    def __init__(self, win):
        """
        We store mainWindow because a controller's got to have
        references to both the layer above (UI) and the layer below (model)
        """
        super(SliceToolManager, self).__init__()
        self._window = win
        self._connectWindowSignalsToSelf()

    ### SIGNALS ###
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:31,代码来源:slicetoolmanager.py

示例9: globals

import math
import re
from cadnano import app
from model.enum import StrandType
from views import styles
import util

try:
    from OpenGL import GL
except:
    GL = False

GL = False

# import Qt stuff into the module namespace with PySide, PyQt4 independence
util.qtWrapImport('QtCore', globals(), ['QPointF', 'QRectF', 'Qt'])
util.qtWrapImport('QtGui', globals(), ['QBrush', 'QFont', 'QGraphicsItem',\
                                       'QGraphicsSimpleTextItem', 'QPen',\
                                       'QGraphicsTextItem', 'QDrag', \
                                       'QUndoCommand', 'QGraphicsEllipseItem',\
                                       'QTransform', 'QStyle'])

# strand addition stores some meta information in the UndoCommand's text
_strand_re = re.compile("\((\d+),(\d+)\)\.0\^(\d+)")

class EmptyHelixItem(QGraphicsEllipseItem):
    """docstring for EmptyHelixItem"""
    # set up default, hover, and active drawing styles
    _defaultBrush = QBrush(styles.grayfill)
    _defaultPen = QPen(styles.graystroke, styles.SLICE_HELIX_STROKE_WIDTH)
    _hoverBrush = QBrush(styles.bluefill)
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:31,代码来源:emptyhelixitem.py

示例10: globals

import maya.OpenMayaMPx as OpenMayaMPx
import maya.cmds as cmds
import maya.OpenMayaUI as OpenMayaUI
import maya.mel as mel
import sip

sys.path.insert(0, os.environ['CADNANO_PATH'])
# cmds.flushUndo()
# cmds.undoInfo(state=False)

import views.solidview.mayaHotKeys as mayaHotKeys
import views.solidview.mayaUI as mayaUI

import util
util.qtFrameworkList = ['PyQt'] # necessary to overide defaults
util.qtWrapImport('QtGui', globals(), ['qApp', 'QDockWidget', 'QSizePolicy'])

util.qtWrapImport('QtCore', globals(), ['Qt', 'QObject'])

kPluginName = "spCadNano"
gCadNanoButton = None
gCadNanoToolbar = None
fMayaExitingCB = None

gCadNanoApp = None

gIconPath = (
        os.environ['CADNANO_PATH'] +
        "/ui/mainwindow/images/cadnano2-app-icon_shelf.png")

开发者ID:alaindomissy,项目名称:cadnano2,代码行数:29,代码来源:spCadNano.py

示例11: globals

# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
import re
from abstractpathtool import AbstractPathTool
from model.enum import StrandType
from data.dnasequences import sequences
from ui.dialogs.ui_addseq import Ui_AddSeqDialog
from views import styles
import util

util.qtWrapImport('QtGui', globals(), ['QBrush','QColor', 'QDialog', \
                                       'QDialogButtonBox', 'QFont', 'QPen', \
                                       'QRadioButton', 'QSyntaxHighlighter', \
                                       'QTextCharFormat'])
util.qtWrapImport('QtCore', globals(), ['Qt', 'QObject', 'QPointF', \
                                        'QRegExp', \
                                        'QString', 'QSignalMapper', \
                                        'pyqtSignal', 'pyqtSlot'])
dnapattern = QRegExp("[^ACGTacgt]")


class DNAHighlighter(QSyntaxHighlighter):
    def __init__(self, parent):
        QSyntaxHighlighter.__init__(self, parent)
        self.parent = parent
        self.format = QTextCharFormat()
        self.format.setForeground(QBrush(styles.INVALID_DNA_COLOR))
        if styles.UNDERLINE_INVALID_DNA:
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:32,代码来源:addseqtool.py

示例12: globals

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Tue Jul  5 15:37:53 2011
#      by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!

import util

util.qtWrapImport(None, globals(), ["QtCore", "QtGui"])

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(1100, 800)
        MainWindow.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
        MainWindow.setStatusTip(_fromUtf8(""))
        MainWindow.setIconSize(QtCore.QSize(32, 32))
        MainWindow.setDockNestingEnabled(True)
        MainWindow.setDockOptions(
            QtGui.QMainWindow.AllowNestedDocks | QtGui.QMainWindow.AllowTabbedDocks | QtGui.QMainWindow.AnimatedDocks
        )
        self.centralwidget = QtGui.QWidget(MainWindow)
开发者ID:MatthewMcAteer,项目名称:cadnano2,代码行数:31,代码来源:ui_mainwindow.py

示例13: globals

# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php

import bisect

# from PyQt4.QtCore import QAbstractItemModel, QModelIndex, Qt, QByteArray, QString, QStringList, QVariant
# from PyQt4.QtCore import QXmlStreamReader, QXmlStreamWriter

import util
# import Qt stuff into the module namespace with PySide, PyQt4 independence
util.qtWrapImport('QtCore', globals(), ['QAbstractItemModel', 'QModelIndex', \
                                        'Qt', 'QByteArray', 'QString', \
                                        'QStringList', 'QVariant', \
                                        'QXmlStreamReader', \
                                        'QXmlStreamWriter'])


NODETAG = "node"
NAMETAG = "NAMETAG"
OBJ_ID = "objectid"
INST_ID = "instanceid"

KEY, NODE = range(2)

NAME,HIDDEN,LOCKED = range(3)

class Node(object):
    """
开发者ID:MatthewMcAteer,项目名称:cadnano2,代码行数:31,代码来源:treemodel.py

示例14: globals

# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php

import json
from exceptions import ImportError
from legacydecoder import import_legacy_dict
from ui.dialogs.ui_latticetype import Ui_LatticeType
import util, cadnano
if cadnano.app().isGui():#headless:
    from ui.dialogs.ui_latticetype import Ui_LatticeType
    util.qtWrapImport('QtGui', globals(),  ['QDialog', 'QDialogButtonBox'])


def decode(document, string):
    if cadnano.app().isGui():
        # from ui.dialogs.ui_latticetype import Ui_LatticeType
        # util.qtWrapImport('QtGui', globals(),  ['QDialog', 'QDialogButtonBox'])
        dialog = QDialog()
        dialogLT = Ui_LatticeType()  # reusing this dialog, should rename
        dialogLT.setupUi(dialog)

    # try:  # try to do it fast
    #     try:
    #         import cjson
    #         packageObject = cjson.decode(string)
    #     except:  # fall back to if cjson not available or on decode error
开发者ID:alaindomissy,项目名称:cadnano2,代码行数:31,代码来源:decoder.py

示例15: globals

# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
import util
import sys
from abstractpathtool import AbstractPathTool

util.qtWrapImport('QtCore', globals(), ['Qt', 'QPointF'])
util.qtWrapImport('QtGui', globals(), ['QGraphicsItem', 'QBrush', 'QFont',
                                       'QGraphicsSimpleTextItem', 'QPen',
                                       'QPolygonF', 'QPainterPath'])


class BreakTool(AbstractPathTool):
    """
    BreakTool is the default tool. It allows editing of breakpoints
    (by clicking and dragging) and toggling of crossovers.
    """
    # And we actually use those PartGraphicsItem events
    mouseMovePartGraphicsItemUnused = False
    mouseReleasePartGraphicsItemUnused = False
    mousePressPartGraphicsItemUnused = False
    logger = None
开发者ID:divita,项目名称:cadnano2,代码行数:31,代码来源:breaktool.py


注:本文中的util.qtWrapImport函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。