Python PySide.QtGui.QPixmap() Examples

The following are 24 code examples of PySide.QtGui.QPixmap(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtGui , or try the search function .
Example #1
Source File: universal_tool_template_0903.py    From universal_tool_template.py with MIT License 7 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version="0.1"
        self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name) 
Example #2
Source File: shelf.py    From dpa-pipe with MIT License 6 votes vote down vote up
def add_button(self, **kwargs):

        # so not sure if this is going to work, yay programming!
        # intercept/adjust some of the arguments

        cmd = kwargs.get('command', 'print "No action defined"')
        label = kwargs.get('label', 'Unknown')
        annotation = kwargs.get('annotation', '')
        image = QtGui.QPixmap()

        for (key, val) in kwargs.iteritems():
            if key.startswith("image") and IconFactory.is_icon_path(val):
                image = QtGui.QIcon(self.icon_factory.disk_path(val))

        action = QtGui.QAction(self.widget)
        action.setIcon(image)
        action.setToolTip(annotation)
        action.triggered.connect(lambda: self._exec_cmd(cmd))

        button = QtGui.QToolButton()
        button.setAutoRaise(True)
        button.setDefaultAction(action)
        self.layout.addWidget(button)

    # ------------------------------------------------------------------------- 
Example #3
Source File: AboutTab.py    From CANalyzat0r with GNU General Public License v3.0 6 votes vote down vote up
def prepareUI():
        """
        This just sets up the GUI elements.
        """

        # Setup the "fork me" ribbon
        pixmapForkMe = QtGui.QPixmap(Settings.FORKME_PATH)
        Globals.ui.labelAboutForkMe.setPixmap(pixmapForkMe)
        Globals.ui.labelAboutForkMe.setTextInteractionFlags(
            QtCore.Qt.TextBrowserInteraction)
        Globals.ui.labelAboutForkMe.setOpenExternalLinks(True)
        Globals.ui.labelAboutForkMe.mousePressEvent = AboutTab.browseGitHub

        # Setup the logo
        Globals.ui.labelSWLogo.setMaximumWidth(300)
        Globals.ui.labelSWLogo.setMaximumHeight(19)
        pixmapSWLogo = QtGui.QPixmap(Settings.LOGO_PATH)
        Globals.ui.labelSWLogo.setPixmap(pixmapSWLogo)
        Globals.ui.labelSWLogo.setTextInteractionFlags(
            QtCore.Qt.TextBrowserInteraction)
        Globals.ui.labelSWLogo.setOpenExternalLinks(True)
        Globals.ui.labelSWLogo.mousePressEvent = AboutTab.browseSW 
Example #4
Source File: _import.py    From dpa-pipe with MIT License 5 votes vote down vote up
def __init__(self, session=None, parent=None):

        super(SubscriptionImportWizard, self).__init__(parent=parent)

        self.setModal(True)

        if not session:
            session = SessionRegistry().current()

        self._session = session

        logo_pixmap = QtGui.QPixmap(
            IconFactory().disk_path("icon:///images/icons/import_32x32.png"))

        self.setWindowTitle("Subscription Import")
        self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)

        # get entity classes
        entity_classes = EntityRegistry().get_entity_classes(
            self.session.app_name)

        # map entity category to class
        self._category_lookup = {}
        for cls in entity_classes:
            self._category_lookup[cls.category] = cls

        selection_id = self.addPage(self.sub_selection_page)
        options_id = self.addPage(self.import_options_page)

        self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)
        self.setButtonText(QtGui.QWizard.FinishButton, 'Import')

        self._subs_widget.itemSelectionChanged.connect(self._toggle_options)

        if not self._subs_widget.repr_items: 
            QtGui.QMessageBox.warning(self.parent(), "Import Warning",
                "<b>No subs available to Import</b>."
            )
            self.NO_SUBS = True

    # ------------------------------------------------------------------------- 
Example #5
Source File: imports.py    From dpa-pipe with MIT License 5 votes vote down vote up
def __init__(self, session=None, parent=None):

        super(EntityImportWizard, self).__init__(parent=parent)

        self.setModal(True)

        if not session:
            session = SessionRegistry().current()

        self._session = session

        logo_pixmap = QtGui.QPixmap(
            IconFactory().disk_path("icon:///images/icons/import_32x32.png"))

        self.setWindowTitle("Product Import")
        self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)

        self._query_categories()

        query_id = self.addPage(self.product_query_page)
        selection_id = self.addPage(self.product_selection_page)
        options_id = self.addPage(self.import_options_page)
        confirm_id = self.addPage(self.import_confirm_page)

        self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)

        self.product_widget.itemSelectionChanged.connect(self._toggle_options)

        self.setButtonText(QtGui.QWizard.FinishButton, 'Export')

        self.currentIdChanged.connect(self._check_descriptions)

    # ------------------------------------------------------------------------- 
Example #6
Source File: export.py    From dpa-pipe with MIT License 5 votes vote down vote up
def __init__(self, session=None, parent=None):

        super(EntityExportWizard, self).__init__(parent=parent)

        self.setModal(True)

        if not session:
            session = SessionRegistry().current()

        self._session = session

        logo_pixmap = QtGui.QPixmap(
            IconFactory().disk_path("icon:///images/icons/export_32x32.png"))

        self.setWindowTitle("Entity Export")
        self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)

        self._query_entities()

        selection_id = self.addPage(self.entity_selection_page)
        options_id = self.addPage(self.export_options_page)
        confirm_id = self.addPage(self.export_confirm_page)

        self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)

        self.entity_widget.itemSelectionChanged.connect(self._toggle_options)

        self.setButtonText(QtGui.QWizard.FinishButton, 'Export')

        self.currentIdChanged.connect(self._check_descriptions)

        if not self.exportable_entities: 
            QtGui.QMessageBox.warning(self.parent(), "Export Warning",
                "<b>No entities available to Export</b>. If all entities " + \
                "have been published at this version already, you will " + \
                "need to <b>version up</b> before continuing."
            )
            self.NO_ENTITIES = True

    # ------------------------------------------------------------------------- 
Example #7
Source File: app.py    From bitmask-dev with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kw):
        url = kw.pop('url', None)
        first = False
        if not url:
            url = get_authenticated_url()
            first = True
        self.url = url
        self.closing = False

        super(QWebView, self).__init__(*args, **kw)
        self.setWindowTitle('Bitmask')
        self.bitmask_browser = NewPageConnector(self) if first else None
        self.loadPage(self.url)

        self.bridge = AppBridge(self) if first else None

        if self.bridge is not None and HAS_WEBENGINE:
            print "[+] registering python<->js bridge"
            channel = QWebChannel(self)
            channel.registerObject("bitmaskApp", self.bridge)
            self.page().setWebChannel(channel)

        icon = QtGui.QIcon()
        icon.addPixmap(
            QtGui.QPixmap(":/mask-icon.png"),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(icon) 
Example #8
Source File: PySimulator.py    From PySimulator with GNU Lesser General Public License v3.0 5 votes vote down vote up
def showAbout(self):
        widget = QtGui.QDialog(self)
        widget.setWindowTitle("About PySimulator")
        p = QtGui.QPalette()
        p.setColor(QtGui.QPalette.Background, QtGui.QColor("white"))
        widget.setPalette(p)
        layout = QtGui.QGridLayout(widget)
        widget.setLayout(layout)
        pixmap = QtGui.QPixmap(self.rootDir + "/Icons/dlr-splash.png")
        iconLabel = QtGui.QLabel()
        iconLabel.setPixmap(pixmap)
        layout.addWidget(iconLabel, 0, 0)
        layout.addWidget(QtGui.QLabel("Copyright (C) 2011-2015 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.),\nInstitute of System Dynamics and Control. All rights reserved.\n\nPySimulator is free software: You can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nPySimulator is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with PySimulator. If not, see www.gnu.org/licenses."), 1, 0)
        layout.addWidget(QtGui.QLabel("PySimulator Version: " + str(version)), 2, 0)
        button = QtGui.QPushButton("OK")
        button.clicked.connect(widget.close)
        layout.addWidget(button, 3, 0)
        widget.show() 
Example #9
Source File: app.py    From shortcircuit with MIT License 5 votes vote down vote up
def additional_gui_setup(self):
        # Additional GUI setup
        self.graphicsView_banner.mouseDoubleClickEvent = MainWindow.banner_double_click
        self.setWindowTitle(__appname__)
        self.scene_banner = QtGui.QGraphicsScene()
        self.graphicsView_banner.setScene(self.scene_banner)
        self.scene_banner.addPixmap(QtGui.QPixmap(":images/banner.png"))
        self._path_message("", MainWindow.MSG_OK)
        self._avoid_message("", MainWindow.MSG_OK)
        self.lineEdit_source.setFocus()

        # Auto-completion
        system_list = self.nav.eve_db.system_name_list()
        for line_edit_field in [
            self.lineEdit_source,
            self.lineEdit_destination,
            self.lineEdit_avoid_name,
            self.lineEdit_set_dest,
        ]:
            completer = QtGui.QCompleter(system_list, self)
            completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
            line_edit_field.setCompleter(completer)

        # Signals
        self.pushButton_eve_login.clicked.connect(self.btn_eve_login_clicked)
        self.pushButton_player_location.clicked.connect(self.btn_player_location_clicked)
        self.pushButton_find_path.clicked.connect(self.btn_find_path_clicked)
        self.pushButton_crest_config.clicked.connect(self.btn_crest_config_clicked)
        self.pushButton_trip_config.clicked.connect(self.btn_trip_config_clicked)
        self.pushButton_trip_get.clicked.connect(self.btn_trip_get_clicked)
        self.pushButton_avoid_add.clicked.connect(self.btn_avoid_add_clicked)
        self.pushButton_avoid_delete.clicked.connect(self.btn_avoid_delete_clicked)
        self.pushButton_avoid_clear.clicked.connect(self.btn_avoid_clear_clicked)
        self.pushButton_set_dest.clicked.connect(self.btn_set_dest_clicked)
        self.pushButton_reset.clicked.connect(self.btn_reset_clicked)
        self.lineEdit_source.returnPressed.connect(self.line_edit_source_return)
        self.lineEdit_destination.returnPressed.connect(self.line_edit_destination_return)
        self.lineEdit_avoid_name.returnPressed.connect(self.line_edit_avoid_name_return)
        self.lineEdit_set_dest.returnPressed.connect(self.btn_set_dest_clicked)
        self.tableWidget_path.itemSelectionChanged.connect(self.table_item_selection_changed) 
Example #10
Source File: universal_tool_template_0904.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version="0.1"
        self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        self.qui_user_dict = {}
        #------------------------------ 
Example #11
Source File: universal_tool_template_0803.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version="0.1"
        self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        # Custom user variable
        #------------------------------
        # initial data
        #------------------------------
        self.memoData['data']=[]
        
        self.setupStyle()
        if isinstance(self, QtWidgets.QMainWindow):
            self.setupMenu()
        self.setupWin()
        self.setupUI()
        self.Establish_Connections()
        self.loadData()
        self.loadLang() 
Example #12
Source File: PySimulator.py    From PySimulator with GNU Lesser General Public License v3.0 4 votes vote down vote up
def start_PySimulator():
    runBenchmark = False
    app = QtGui.QApplication.instance()
    if not app:
        app = QtGui.QApplication([])

    pixmap = QtGui.QPixmap(os.path.abspath(os.path.dirname(__file__)) + "/Icons/dlr-splash.png")
    splash = QtGui.QSplashScreen(pixmap)
    splash.show()
    app.processEvents()

    splash.showMessage("Loading External dependencies...")
    path, file = os.path.split(os.path.realpath(__file__))
    os.chdir(path)
    # modified import statements, allowing them to be processed inside this function and make them globally available
    globals()["configobj"] = __import__("configobj", globals(), locals(), [], -1)
    globals()["QtCore"] = __import__("PySide", globals(), locals(), ["QtCore"], -1).QtCore
    globals()["ETSConfig"] = __import__("traits.etsconfig.etsconfig", globals(), locals(), ["ETSConfig"], -1).ETSConfig
    ETSConfig.toolkit = "qt4"
    globals()["chaco"] = __import__("chaco", globals(), locals(), [], -1)
    globals()["string"] = __import__("string", globals(), locals(), [], -1)
    globals()["threading"] = __import__("threading", globals(), locals(), [], -1)
    globals()["os"] = __import__("os", globals(), locals(), [], -1)
    globals()["re"] = __import__("re", globals(), locals(), [], -1)
    globals()["sys"] = __import__("sys", globals(), locals(), [], -1)
    globals()["inspect"] = __import__("inspect", globals(), locals(), [], -1)
    globals()["VariablesBrowser"] = __import__("VariablesBrowser", globals(), locals(), [], -1)
    globals()["IntegratorControl"] = __import__("IntegratorControl", globals(), locals(), [], -1)
    globals()["plotWidget"] = __import__("plotWidget", globals(), locals(), [], -1)
    globals()["IntegratorControl"] = __import__("IntegratorControl", globals(), locals(), [], -1)
    globals()["Plugins"] = __import__("Plugins", globals(), locals(), [], -1)
    globals()["partial"] = __import__("functools", globals(), locals(), ["partial"], -1).partial
    globals()["windowConsole"] = __import__("windowConsole", globals(), locals(), [], -1)
    import compileall
    splash.showMessage("Loading PySimulator...")
    compileall.compile_dir(os.getcwd(), force=True, quiet=True)
    sg = SimulatorGui()
    sg.show()
    splash.finish(sg)

    if runBenchmark:
        # shows a benchmark including the time spent in diffrent routines during execution
        import cProfile
        cProfile.run('app.exec_()', 'logfile')
        import pstats
        p = pstats.Stats('logfile')
        p.strip_dirs().sort_stats('cumulative').print_stats()
    else:
        app.exec_() 
Example #13
Source File: ui.py    From CSGO-Market-Float-Finder with MIT License 4 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Authenticate")
        Form.resize(220, 105)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Form.setWindowIcon(icon)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        Form.setMinimumSize(QtCore.QSize(220, 105))
        Form.setMaximumSize(QtCore.QSize(220, 105))
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName("label_3")
        self.verticalLayout.addWidget(self.label_3)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.AuthBox = QtGui.QLineEdit(Form)
        self.AuthBox.setObjectName("AuthBox")
        self.horizontalLayout.addWidget(self.AuthBox)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.AuthButton = QtGui.QPushButton(Form)
        self.AuthButton.setObjectName("AuthButton")
        self.horizontalLayout_2.addWidget(self.AuthButton)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

        QtCore.QObject.connect(self.AuthButton, QtCore.SIGNAL("clicked()"), self.auth) 
Example #14
Source File: casc_plugin.py    From CASC with GNU General Public License v2.0 4 votes vote down vote up
def get_clamav_icon(return_hex=False, return_pixmap=False):
    clamav_icon = ( '89504E470D0A1A0A0000000D494844520000001A0000001A08060000'
                    '00A94A4CCE000000097048597300000B1300000B1301009A9C180000'
                    '001974455874536F6674776172650041646F626520496D6167655265'
                    '61647971C9653C000004A54944415478DABC965F4CDB5514C7BFF7D7'
                    '5FFFD0C2DA04D8803A680B5306E34F7046972CA1D944F73081FD8926'
                    'EADC740F2688CB78501F8C913D9810E616E28359E603F3498D89AB31'
                    'B06571A6304748468031D9A285B4FC29B004C8DA425B28FDFD3CF757'
                    '685A2819F3CF9ADCFE7EBF7BEF399F7BCE3DE7DCCB6459C653F971D0'
                    'B0B9C4C29FFF754BD42BACF2DAFE273BE27A45FE770B912C3C535A5F'
                    '3239EC583FF34A5189A59289F56AC04E9FA675C34E6A8E52D7D0E07A'
                    'B9FBA4AF13CBB925ABDF8C9BF58ED97AB591A51D4807AB269822D45C'
                    '586C7A9E896D36269CDCC2CABBFC909BF7B9EE39572195D390BA2FCA'
                    'C1810EEF58751C5466DED970089A8BEF32DD0CF5557EA78D56EE652A'
                    '471153199FC44F3EC8E74C2189BB6BB0450EE60E60A5E99E77E2EB38'
                    'C86C369BC835D3ED6C9B2E1B42E8B22A9C661544BC226AB70CE9892E'
                    'E3EE4A042724ED7210B2E66DD9CFBBAD5EAFD71307F11FC11C855055'
                    '5F6219B17D6014913AD596412C1C2581D87B831C587421DA4710FBDA'
                    'B8901821A3889A3EC32216B8041792B69863526C3E97FB9CE4096230'
                    '0BE2A5C42971D03E8D1EF9E4AE5E3982F3E0C6D390C0B606A2797C3E'
                    '97EB21F92A951AAF6BF4875282D218CEAE39AA50A4A857B127CB189A'
                    '5FAED628AFB3B204DADDFA942011CCCE27EC22AB4EA8F5FF283B8F8A'
                    '3A940B6A05448A8D676CCF26EFD1416BA185D66FDC4F5156AF4E43E4'
                    '5F94828FB4E9784F6D4034F6990CA27DB448F4BF5325225310683B93'
                    '83A02FBC883F97C31B94FE160C20204593FAB2988062D2C3171B5DEF'
                    '3A89DA0AB5250AF54562388B0A70EDCD23E83368D13A3783D3D363F8'
                    '39F06803BCE9E18432F6905CF54B55296E57ED818FEBA08586A82D27'
                    'CC576A1D413C4B040892FFE649E8F8F916ECDABD1BBD3535386DB7A3'
                    '26DD888F337392407B75067C9A95872F66A7D079B806AD17BE442810'
                    'C0B5DAE3F07BBD08127029C1338A45BFBB473D61C83E0A6A78E4288C'
                    '9999CAE05F2E17F2F3F3D13E3480FEDA57B19070760DE56463FF5717'
                    'F0616323FA87EE2A7D1ABD1E93C545A0BAA7E45448568A6E72D491A9'
                    '4E3EC87DEBF7FB110E8731363686BADA5A6C379BF1566B0BF21CDF23'
                    '92978BC94FCEE20DE70D1C3C7614B57575E8EEEE56744CCFCCC0B7B0'
                    'A0B86F814ADF8F6E572A10DAF88A1963982080DBE3C10C09728BE2B9'
                    '9695A928297DF940BCCF5250A0CC191F1FC7FCDC1C82BD77F088161C'
                    '906547CA3CBAED1EE51675F949D195F73FC0FCFC3C8A699F8C2613FE'
                    '181E56DAF59FAE223035859B97BFC1FD070F94C58497965051518100'
                    'EDCF0F0D679440A02AEE0BD0B191540B13EF0C2F5A6D954630A71182'
                    '91E778765929B697976147CE0E4CDDEA41FA9D7E18287C79CD98DDF3'
                    '1C6CAF1DC636B2F266470742BF3A2191377C1C24CB4D1DEE91B64D41'
                    '4ACDB3169ECA00DA33485D3A091AE899468D1F186AFA5E2B534A4AC8'
                    'B110E6A11CA427773D59F26DA77BE4D486EA9EEA16F492D566278043'
                    '0F66E4101D99A0A5A7B8EA6B96907B1182F0540EC90AECDC0DF74873'
                    'CA6364B3EBD60B169B49C7589B0E38A921D59A583D8C6FAAA4647E2C'
                    '4AC9AA2ECA996627EDF3A6E7D5E3EE7504B46818AB276BECE4361381'
                    '2CD4ED916325C6495639280F071F7B303EAD0BE4DF020C0026BB3556'
                    '2D86F1AC0000000049454E44AE426082')

    if return_hex:
        return clamav_icon

    image = QtGui.QImage()
    image.loadFromData(QtCore.QByteArray.fromHex(clamav_icon))

    pixmap = QtGui.QPixmap()
    pixmap.convertFromImage(image)
    if return_pixmap:
        return pixmap

    return QtGui.QIcon(pixmap) 
Example #15
Source File: universal_tool_template_1010.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = "0.1"
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {}
        #------------------------------ 
Example #16
Source File: universal_tool_template_1110.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #17
Source File: universal_tool_template_1100.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #18
Source File: universal_tool_template_1115.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        self.hotkey = {}
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #19
Source File: GearBox_template_1010.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = "0.1"
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {}
        #------------------------------ 
Example #20
Source File: universal_tool_template_2010.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None):
        QtWidgets.QMainWindow.__init__(self, parent)

        # class property
        self.tpl_ver = tpl_ver
        self.tpl_date = tpl_date
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        # class info
        self.name = self.__class__.__name__
        self.fileType='.{0}_EXT'.format(self.name)
        
        # class path and icon
        self.location = ''
        if getattr(sys, 'frozen', False):
            self.location = sys.executable # frozen case - cx_freeze
        else:
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        
        # class data
        self.hotkey = {}
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.memoData['last_browse'] = ''
            
        # core function variable
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'spin':'QSpinBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #21
Source File: universal_tool_template_1020.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #22
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 4 votes vote down vote up
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'
        self.hotkey = {}
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {} 
Example #23
Source File: base.py    From dpa-pipe with MIT License 4 votes vote down vote up
def __init__(self, parent=None):

        super(BaseDarkKnightDialog, self).__init__(parent=parent)

        cls = self.__class__

        self.setWindowTitle("TDK")
        self.setWindowIcon(QtGui.QIcon(cls._icon_path))

        self.main_layout = QtGui.QVBoxLayout(self)
        self.main_layout.setSpacing(4)
        self.main_layout.setContentsMargins(4, 4, 4, 4)

        # ---- logo image

        logo_btn = QtGui.QPushButton()
        logo_btn.setCheckable(True)
        logo_btn.setFlat(True)
        logo_full = QtGui.QPixmap(cls._logo_full_path)
        logo = QtGui.QPixmap(cls._logo_path)

        def _display_logo(checked):
            if checked: 
                logo_btn.setFixedSize(logo_full.size())
                logo_btn.setIcon(QtGui.QIcon(logo_full))
                logo_btn.setIconSize(logo_full.size())
            else:
                logo_btn.setFixedSize(logo.size())
                logo_btn.setIcon(QtGui.QIcon(logo))
                logo_btn.setIconSize(logo.size())
                
        _display_logo(logo_btn.isChecked())
        logo_btn.toggled.connect(_display_logo)

        logo_layout = QtGui.QHBoxLayout()
        logo_layout.addStretch()
        logo_layout.addWidget(logo_btn)
        logo_layout.addStretch()
        
        self.main_layout.addLayout(logo_layout)
        self.main_layout.setStretchFactor(logo_btn, 0)

    # ------------------------------------------------------------------------- 
Example #24
Source File: session.py    From dpa-pipe with MIT License 4 votes vote down vote up
def __init__(self, title, options_config, icon_path=None, 
        action_button_text=None, modal=False):

        super(SessionActionDialog, self).__init__()

        self.setModal(modal)
        self.setWindowTitle(title)

        icon_lbl = QtGui.QLabel()
        icon_lbl.setPixmap(QtGui.QPixmap(icon_path))
        icon_lbl.setAlignment(QtCore.Qt.AlignRight)

        title = QtGui.QLabel(title)
        title.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        font = title.font()
        font.setPointSize(18)
        title.setFont(font)

        header_layout = QtGui.QHBoxLayout()
        header_layout.addWidget(icon_lbl)
        header_layout.addWidget(title)
        header_layout.setStretchFactor(title, 90)

        self._options = ActionOptionWidget(options_config)

        self._btn_box = QtGui.QDialogButtonBox()
        self._btn_box.addButton(QtGui.QDialogButtonBox.Cancel)
        self._action_btn = self._btn_box.addButton(QtGui.QDialogButtonBox.Ok)

        if action_button_text:
            self._action_btn.setText(action_button_text)

        layout = QtGui.QVBoxLayout(self)
        layout.addLayout(header_layout)
        layout.addWidget(self._options)
        layout.addWidget(self._btn_box)

        self._options.value_changed.connect(self.check_value)

        self._btn_box.accepted.connect(self.accept)
        self._btn_box.rejected.connect(self.reject)

        self.check_value()

    # -------------------------------------------------------------------------