Python PyQt5.QtGui.QCursor() Examples

The following are code examples for showing how to use PyQt5.QtGui.QCursor(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: pdash   Author: CPChain   File: header.py    GNU General Public License v3.0 6 votes vote down vote up
def init_ui(self):
            self.setObjectName("search_bar")
            self.setFixedSize(300, 25)
            self.setTextMargins(25, 0, 20, 0)

            self.search_btn = search_btn = QPushButton(self)
            search_btn.setObjectName("search_btn")
            search_btn.setFixedSize(18, 18)
            search_btn.setCursor(QCursor(Qt.PointingHandCursor))
            self.search_btn.clicked.connect(self.search_act)
            self.returnPressed.connect(self.search_act)

            def set_layout():
                main_layout = QHBoxLayout()
                main_layout.addWidget(search_btn)
                main_layout.addStretch()
                main_layout.setContentsMargins(5, 0, 0, 0)
                self.setLayout(main_layout)
            set_layout() 
Example 2
Project: MusicBox   Author: HuberTRoy   File: addition.py    MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(SearchLineEdit, self).__init__()
        self.setObjectName("SearchLine")
        self.parent = parent
        self.setMinimumSize(218, 20)
        with open('QSS/searchLine.qss', 'r') as f:
            self.setStyleSheet(f.read())

        self.button = QPushButton(self)
        self.button.setMaximumSize(13, 13)
        self.button.setCursor(QCursor(Qt.PointingHandCursor))

        self.setTextMargins(3, 0, 19, 0)

        self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding)

        self.mainLayout = QHBoxLayout()
        self.mainLayout.addSpacerItem(self.spaceItem)
        # self.mainLayout.addStretch(1)
        self.mainLayout.addWidget(self.button)
        self.mainLayout.addSpacing(10)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.mainLayout) 
Example 3
Project: kawaii-player   Author: kanishka-linux   File: optionwidgets.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, uiwidget, name):
        super(GSBCSlider, self).__init__(parent)
        global ui
        self.parent = parent
        ui = uiwidget
        self.setObjectName(name)
        self.setOrientation(QtCore.Qt.Horizontal)
        if name == 'zoom':
            self.setRange(-2000, 2000)
            self.setSingleStep(10)
            self.setPageStep(10)
        elif name == 'speed':
            self.setRange(-100, 900)
            self.setSingleStep(10)
            self.setPageStep(10)
        else:
            self.setRange(-100, 100)
            self.setSingleStep(1)
            self.setPageStep(1)
        #self.setTickInterval(5)
        self.setValue(0)
        self.setMouseTracking(True)
        self.valueChanged.connect(self.adjust_gsbc_values)
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        #self.setTickPosition(QtWidgets.QSlider.TicksAbove) 
Example 4
Project: GeoMop   Author: GeoMop   File: point.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, point_data, parent=None, tmp=False):
        """if item is selected"""
        self.point_data = point_data
        self._tmp = False
        point_data.object = self
        self.state = ItemStates.standart
        """Item state"""
        self.bold = False
        super().__init__(parent)
        self.set_size()
        self.setPen(cfg.diagram.pen)
        self.setBrush(QtGui.QBrush(self.pen().color()))
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))    
        self.setZValue(self.STANDART_ZVALUE)
        if tmp:
            self.set_tmp()
        self.update_color() 
Example 5
Project: GeoMop   Author: GeoMop   File: line.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, line_data, parent=None, tmp=False):
        super().__init__(line_data.p1.x, line_data.p1.y, line_data.p2.x, line_data.p2.y, parent)
        self.line_data = line_data
        self._tmp = False
        line_data.object = self
        """Line data object"""
        self.state = ItemStates.standart
        """Item state"""
        self.setPen(cfg.diagram.no_pen)
        self.real_pen = QtGui.QPen(cfg.diagram.pen)
        self.setCursor(QtGui.QCursor(QtCore.Qt.UpArrowCursor))
        self.setZValue(self.STANDART_ZVALUE)
        self.bold = False
        if tmp:
            self.set_tmp()
        self.update_color() 
Example 6
Project: dzetsaka   Author: nkarasiak   File: progressBar.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, inMsg=' Loading...', inMaxStep=1):
        """
        """
        # Save reference to the QGIS interface
        # initialize progressBar
        # QApplication.processEvents() # Help to keep UI alive
        self.iface = iface

        widget = iface.messageBar().createMessage('Please wait  ', inMsg)

        prgBar = QProgressBar()
        self.prgBar = prgBar

        widget.layout().addWidget(self.prgBar)
        iface.messageBar().pushWidget(widget)
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))

        # if Max 0 and value 0, no progressBar, only cursor loading
        # default is set to 0
        prgBar.setValue(1)
        # set Maximum for progressBar
        prgBar.setMaximum(inMaxStep) 
Example 7
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 6 votes vote down vote up
def create_cancel_button(self):
        """
        Create CANCEL button for the whole window.
        """
        self.cancel_button = QtWidgets.QPushButton(self.widget)
        self.cancel_button.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.cancel_button.setFixedSize(101, 31)
        self.cancel_button.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                         " font: 57 11pt \\\"Ubuntu\\\";\n"
                                         "\n"
                                         "font-weight: bold;\n"
                                         "color: rgb(85, 87, 83);")

        _translate = QtCore.QCoreApplication.translate
        self.cancel_button.setText(_translate("Add_On_Options", "Cancel")) 
Example 8
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 6 votes vote down vote up
def create_add_button(self):
        """
        Create a button to add a new window view.
        """
        self.window.add_new_window = QtWidgets.QPushButton(self.window.widget)
        self.window.add_new_window.setFixedSize(141, 31)
        self.window.add_new_window.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.window.add_new_window.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                          "font: 57 11pt \\\"Ubuntu\\\";\n"
                                          "color:rgb(75,0,130);\n"
                                          "font-weight: bold;")
        self.window.add_new_window.setVisible(False)

        _translate = QtCore.QCoreApplication.translate
        self.window.add_new_window.setText(_translate("Add_On_Options", "Add New Window")) 
Example 9
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 6 votes vote down vote up
def create_add_button(self):
        """
        Create a button to create a new ROI from isodose.
        """
        self.window.add_new_roi = QtWidgets.QPushButton(self.window.widget)
        self.window.add_new_roi.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.window.add_new_roi.setFixedSize(161, 31)
        self.window.add_new_roi.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                       "font: 57 11pt \\\"Ubuntu\\\";\n"
                                       "color:rgb(75,0,130);\n"
                                       "font-weight: bold;")
        self.window.add_new_roi.setVisible(False)

        _translate = QtCore.QCoreApplication.translate
        self.window.add_new_roi.setText(_translate("Add_On_Options", "Add new Isodose")) 
Example 10
Project: OnkoDICOM   Author: didymo   File: DVH.py    GNU Lesser General Public License v2.1 6 votes vote down vote up
def export_button(self):
        """
        Create a button Export DVH.
        """
        button = QtWidgets.QPushButton()
        button.setFocusPolicy(QtCore.Qt.NoFocus)
        button.setFixedSize(QtCore.QSize(100, 39))
        button.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        button.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                            "font: 57 11pt \"Ubuntu\";\n"
                                            "color:rgb(75,0,130);\n"
                                            "font-weight: bold;\n")
        _translate = QtCore.QCoreApplication.translate
        button.setText(_translate("MainWindow", "Export DVH"))
        button.clicked.connect(self.export_csv)

        return button 
Example 11
Project: buttermanager   Author: egara   File: buttermanager.py    GNU General Public License v3.0 6 votes vote down vote up
def fill_filesystem_info(self, filesystem):
        """Fills filesystem information in the GUI.

        Arguments:
            filesystem (obj: Filesystem): Filesystem.
        """
        tooltip = "More info about the filesystem: \n \n" \
                  "Devices: {devices} \n" \
                  "Mounted points: {mounted_points}".format(devices=filesystem.devices,
                                                            mounted_points=filesystem.mounted_points)
        self.label_filesystem_info_more.setToolTip(tooltip)
        self.label_filesystem_info_more.setCursor(QCursor(Qt.WhatsThisCursor))
        self.label_filesystem_size_value.setText(filesystem.total_size)
        self.label_filesystem_allocated_value.setText(filesystem.total_allocated)
        self.progressbar_data.setValue(filesystem.data_percentage)
        self.progressbar_metadata.setValue(filesystem.metadata_percentage)
        # self.progressbar_system.setValue(filesystem.system_percentage)

        # Showing labels
        self.show_space_labels() 
Example 12
Project: attendance-automation   Author: hardeepnarang10   File: application.py    GNU General Public License v3.0 6 votes vote down vote up
def setup_cam(self):
        self.frame_cam = QtWidgets.QLabel(self.centralwidget)
        self.frame_cam.setGeometry(QtCore.QRect(20, 20, 640, 478))

        # Give frame a box enclosure (boundary)
        self.frame_cam.setFrameShape(QtWidgets.QFrame.Box)

        # Add font style properties
        self.qfont.setFamily('Segoi UI')
        self.qfont.setPointSize(20)
        self.frame_cam.setFont(self.qfont)
        self.frame_cam.setCursor(QtGui.QCursor(QtCore.Qt.CrossCursor))
        self.frame_cam.setStyleSheet('background: rgb(0, 40, 100); color: white;')
        self.frame_cam.setAlignment(QtCore.Qt.AlignCenter)
        self.frame_cam.setText(self.qtranslate(self.centralwidget_name, 'Camera Output'))


    # Setup right pane buttons 
Example 13
Project: CvStudio   Author: haruiz   File: box_item.py    MIT License 6 votes vote down vote up
def __init__(self,*args, **kwargs):
        super(EditableBox,self).__init__(*args,*kwargs)
        self.setZValue(10)
        self.setAcceptHoverEvents(True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable,True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable,True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges,True)
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.setOpacity(0.5)
        self.signals = EditableBoxSignals()
        self._pen_color = QColor(235,72,40)
        self.setPen(QtGui.QPen(self._pen_color,1))
        self._brush_color = QColor(255, 0, 0, 100)
        self._tag = None
        self._labels_dao = LabelDao()
        self._label=LabelVO() 
Example 14
Project: CvStudio   Author: haruiz   File: polygon_item.py    MIT License 6 votes vote down vote up
def __init__(self,parent=None):
        super(EditablePolygon,self).__init__(parent)
        self.setZValue(10)
        self.setAcceptHoverEvents(True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges, True)
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.points=[]
        self.controls=[]
        self.setOpacity(0.5)
        self._labels_dao = LabelDao()
        self.signals = EditablePolygonSignals()
        self._pen_color=QtGui.QColor(235,72,40)
        self._brush_color=QtGui.QColor(255, 0, 0, 100)
        self.setPen(QtGui.QPen(self._pen_color,1))
        self._label = LabelVO()
        self._tag = None 
Example 15
Project: pdash   Author: CPChain   File: __init__.py    GNU General Public License v3.0 5 votes vote down vote up
def click(self, callback):
        if isinstance(self.widget, QLabel):
            Binder.click(self.widget, callback)
            self.widget.setCursor(QCursor(Qt.PointingHandCursor))
            return
        self.widget.clicked.connect(callback) 
Example 16
Project: pdash   Author: CPChain   File: button.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, text, width=228, height=38, *args, **kw):
        super().__init__(text, *args, **kw)
        self.width = width
        self.height = height
        self.op = QGraphicsOpacityEffect(self)
        self.op.setOpacity(self.NO_TRANSPARENT)
        self.setGraphicsEffect(self.op)
        self.setAutoFillBackground(True)
        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.setStyleSheet(self.blank_style()) 
Example 17
Project: dunya-desktop   Author: MTG   File: audioattframe.py    GNU General Public License v3.0 5 votes vote down vote up
def _set_size_attributes(self):
        """Sets the size policies of frame"""
        size_policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        size_policy.setHorizontalStretch(0)
        size_policy.setVerticalStretch(0)
        size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(size_policy)
        self.setCursor(QCursor(Qt.ArrowCursor))
        self.setFrameShape(QFrame.StyledPanel)
        self.setFrameShadow(QFrame.Raised)
        self.setLineWidth(1) 
Example 18
Project: ovs-toolbox   Author: nbonnand   File: ovs-toolbox.py    Apache License 2.0 5 votes vote down vote up
def cursor(shape):
    if(debug):mydebug(inspect.currentframe())

    if(shape):
        if(shape=='WAIT'):
            shape=QtCore.Qt.WaitCursor
        QtWidgets.QApplication.setOverrideCursor(QtGui.QCursor(shape))
    else:
        QtWidgets.QApplication.restoreOverrideCursor()
        
#--------------------------------------------------------------- 
Example 19
Project: CopyTranslatePaste   Author: HanyuuLu   File: ui.py    MIT License 5 votes vote down vote up
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            self.movingFlag = True
            self.movingPosition = event.globalPos() - self.pos()
            event.accept()
            self.setCursor(QtGui.QCursor(Qt.OpenHandCursor))
        return super().mousePressEvent(event) 
Example 20
Project: CopyTranslatePaste   Author: HanyuuLu   File: ui.py    MIT License 5 votes vote down vote up
def mouseReleaseEvent(self, event):
        self.movingFlag = False
        self.setCursor(QtGui.QCursor(Qt.ArrowCursor))

    # checkBox function

    # def checkBoxChanged(self, state):
    #     if self.sender() == self.qcbAutoRead:
    #         self.autoRead = True if(state == 2) else False
    #     elif self.sender() == self.qcbAutoCopy:
    #         self.autoWrite = True if (state == 2) else False

    # fetch the text from textOrigin 
Example 21
Project: ismrmrd-viewer   Author: DietrichBE   File: ISMRMRDTableView.py    MIT License 5 votes vote down vote up
def cellClicked(self,clickedIndex):
        """
        Show tooltip with flag names upon "flag" cell selection.
        """

        if self.tmodel.colnames[clickedIndex.column()] == 'flags':
            # get the cell value (and convert to integer)
            x = int(self.tmodel.data(clickedIndex))

            # extract reversed bit string => index 0 returns LSB
            bits = format(x,'b')[::-1]

            # extract flag names using the flag dictionary
            text = ''
            for indBit in range(0,len(bits)):
                if bits[indBit] != '0':
                    try:
                        text += self.flagsDict[indBit+1] + '\n'
                    except Exception as e:
                        text += 'Unknown FLAG!!!\n'

            # remove last new line character
            text = text[0:-1]

            # get mouse position and display tooltip
            cursor = QCursor()
            point = QPoint(cursor.pos().x() + 10, cursor.pos().y() + 10)
            QToolTip.showText(point,text) 
Example 22
Project: BankCard-Recognizer   Author: ShawnHXH   File: app.py    MIT License 5 votes vote down vote up
def load_img_from_filedialog(self):
        self.img_name, _ = QFileDialog.getOpenFileName(None, "Load Image", self.last_path, "*.png;*.jpg;*.jpeg")
        self.diaplay_img.viewport().setProperty("cursor", QCursor(Qt.ArrowCursor))
        if self.img_name:
            # Saving current path for next load convenience.
            self.last_path = os.path.split(self.img_name)[0]
            # Refresh it every time new image load in.
            self.zoom_scala = 1
            self.rotate_degree = 0
            # Load in new image and its info.
            self.img_array = cv2.imread(self.img_name)
            self.pose_it(self.img_array.copy()) 
Example 23
Project: BankCard-Recognizer   Author: ShawnHXH   File: app.py    MIT License 5 votes vote down vote up
def click_rotate_right(self):
        # Negative number means right.
        if self.diaplay_img.scene():
            self.rotate_degree -= 1
            if self.rotate_degree <= -3:
                self.rotate_degree = 0
            self.img_array = rotate_bound(self.img_array, self.rotate_degree)
            self.diaplay_img.viewport().setProperty("cursor", QCursor(Qt.ArrowCursor))
            self.pose_it(self.img_array.copy())
        else:
            self.statusbar.showMessage("No image load in yet!") 
Example 24
Project: BankCard-Recognizer   Author: ShawnHXH   File: app.py    MIT License 5 votes vote down vote up
def click_rotate_left(self):
        if self.diaplay_img.scene():
            self.rotate_degree += 1
            if self.rotate_degree >= 3:
                self.rotate_degree = 0
            self.img_array = rotate_bound(self.img_array, self.rotate_degree)
            self.diaplay_img.viewport().setProperty("cursor", QCursor(Qt.ArrowCursor))
            self.pose_it(self.img_array.copy())
        else:
            self.statusbar.showMessage("No image load in yet!") 
Example 25
Project: BankCard-Recognizer   Author: ShawnHXH   File: part.py    MIT License 5 votes vote down vote up
def mouseDoubleClickEvent(self, event):
        # Activate manual locate.
        if self.scene() is not None:
            if not self.item.activate:
                self.item.activate = True
                self.viewport().setProperty("cursor", QCursor(Qt.CrossCursor))
            else:
                self.item.activate = False
                self.viewport().setProperty("cursor", QCursor(Qt.ArrowCursor))
        else:
            pass 
Example 26
Project: kawaii-player   Author: kanishka-linux   File: kawaii_player.py    GNU General Public License v3.0 5 votes vote down vote up
def show_cursor_now(self):
        MainWindow.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) 
Example 27
Project: kawaii-player   Author: kanishka-linux   File: guisignals.py    GNU General Public License v3.0 5 votes vote down vote up
def cursor_function(self, val):
        widget, opt = val
        if opt == "show":
            widget.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        else:
            if platform.system().lower() == "darwin" and widget == ui.tab_5:
                widget.arrow_timer.start(1000)
            else:
                widget.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor)) 
Example 28
Project: kawaii-player   Author: kanishka-linux   File: player.py    GNU General Public License v3.0 5 votes vote down vote up
def arrow_hide(self):
        if self.player_val in ["mplayer", "mpv", "libmpv"]:
            if self.ui.frame_extra_toolbar.isHidden() and self.ui.list2.isHidden():
                self.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor))
                self.setFocus()
                logger.debug("arrow hide")
            elif self.hasFocus():
                self.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor))
                logger.debug('player has focus')
            else:
                logger.debug('player not focussed') 
Example 29
Project: kawaii-player   Author: kanishka-linux   File: optionwidgets.py    GNU General Public License v3.0 5 votes vote down vote up
def mouseMoveEvent(self, event):
        self.setFocus()
        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) 
Example 30
Project: kawaii-player   Author: kanishka-linux   File: optionwidgets.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, uiwidget, mainwidget):
        super(VolumeSlider, self).__init__(parent)
        global ui, MainWindow
        MainWindow = mainwidget
        ui = uiwidget
        self.parent = parent
        self.setOrientation(QtCore.Qt.Horizontal)
        self.setRange(0, 100)
        self.setPageStep(2)
        self.setSingleStep(2)
        self.setMouseTracking(True)
        self.valueChanged.connect(self.adjust_volume)
        self.pressed = False
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.release = False 
Example 31
Project: kawaii-player   Author: kanishka-linux   File: thumbnail.py    GNU General Public License v3.0 5 votes vote down vote up
def arrow_hide(self):
        if ui.player_val == "mplayer" or ui.player_val == "mpv":
            self.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor))
        print("arrow hide") 
Example 32
Project: kawaii-player   Author: kanishka-linux   File: mpv_opengl.py    GNU General Public License v3.0 5 votes vote down vote up
def arrow_hide(self):
        if gui.player_val in ['mpv', 'mplayer', 'libmpv']:
            if self.hasFocus():
                self.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor))
                logger.debug('player has focus')
                #QtWidgets.QApplication.setOverrideCursor(QtCore.Qt.BlankCursor);
            else:
                logger.debug('player not focussed')
            if (self.ui.fullscreen_video and self.hasFocus() and self.ui.tab_6.isHidden()
                        and self.ui.list2.isHidden() and self.ui.tab_2.isHidden()):
                self.ui.frame1.hide() 
Example 33
Project: GeoMop   Author: GeoMop   File: scene.py    GNU General Public License v3.0 5 votes vote down vote up
def setup_cursors(cls):
        cls.point =  QtGui.QCursor(QtCore.Qt.PointingHandCursor)
        cls.segment = QtGui.QCursor(QtCore.Qt.UpArrowCursor)
        cls.polygon = QtGui.QCursor(QtCore.Qt.CrossCursor)
        cls.draw = QtGui.QCursor(QtCore.Qt.ArrowCursor) 
Example 34
Project: GeoMop   Author: GeoMop   File: diagram.py    GNU General Public License v3.0 5 votes vote down vote up
def _add_point(self, gobject, p1, label='Add point', add_next=False):
        """Add point to diagram and paint it."""
        if gobject is None or isinstance(gobject, Polygon):
            point =cfg.diagram.add_point(p1.x(), p1.y(), label) 
            p = Point(point)
            self.add_graphical_object(p)
        elif isinstance(gobject, Point):
            return gobject, label
        elif isinstance(gobject, Line): 
            if label=='Add point':
                label='Add new point to line'
            point, l2 = cfg.diagram.add_new_point_to_line(gobject.line_data, p1.x(), p1.y(), label)
            l = Line(l2)
            self.add_graphical_object(l)
            p = Point(point)
            self.add_graphical_object(p)
            self._add_polygons()
        if add_next:
            self._last_p1_real = p
            self._last_p1_on_line = None
            self._remove_last()
            line = struc.Diagram.make_tmp_line(p1.x(), p1.y(), p1.x(), p1.y())
            pt1 = Point(line.p1, tmp=True)
            self.add_graphical_object(pt1)
            pt2 = Point(line.p2, tmp=True)
            pt2.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
            self.add_graphical_object(pt2)
            l = Line(line, tmp=True)
            self.add_graphical_object(l)
            self._last_line = line
            self._add_polygons()
        return p, None 
Example 35
Project: GeoMop   Author: GeoMop   File: point.py    GNU General Public License v3.0 5 votes vote down vote up
def set_tmp(self):
        """set style and z"""
        self._tmp = True
        self.state = ItemStates.added
        self.setZValue(self.TMP_ZVALUE) 
        #self.setCursor(QtGui.QCursor(QtCore.Qt.CrossCursor)) 
Example 36
Project: GeoMop   Author: GeoMop   File: polygon.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, polygon_data, parent=None):
        super().__init__(polygon_data.qtpolygon, parent)
        self.polygon_data = polygon_data
        polygon_data.object = self
        """polygon data object"""
        self.state = ItemStates.standart
        """Item state"""
        self.setPen(QtGui.QPen(QtCore.Qt.NoPen))
        self.depth = polygon_data.depth
        #self.setCursor(QtGui.QCursor(QtCore.Qt.UpArrowCursor))
        self.setZValue(self.MIN_ZVALUE+self.depth)
        self.update_brush() 
Example 37
Project: GeoMop   Author: GeoMop   File: line.py    GNU General Public License v3.0 5 votes vote down vote up
def set_tmp(self):
        """set style and z"""
        self._tmp = True
        self.state = ItemStates.added
        self.setZValue(self.TMP_ZVALUE)
        #self.setCursor(QtGui.QCursor(QtCore.Qt.CrossCursor)) 
Example 38
Project: GeoMop   Author: GeoMop   File: line.py    GNU General Public License v3.0 5 votes vote down vote up
def move_line(self, new_state=None):
        """Move line"""
        if new_state is not None:
            self.state = new_state
            if new_state is ItemStates.moved:
                self.setZValue(self.MOVE_ZVALUE)
                #self.setCursor(QtGui.QCursor(QtCore.Qt.SizeAllCursor))
            else:
                self.setZValue(self.STANDART_ZVALUE)
                self.setCursor(QtGui.QCursor(QtCore.Qt.UpArrowCursor)) 
        self.setLine(self.line_data.p1.x, self.line_data.p1.y, self.line_data.p2.x, self.line_data.p2.y)
        self.update_color() 
Example 39
Project: GeoMop   Author: GeoMop   File: connection.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, connection, parent=None):
        super(Connection, self).__init__(parent)
        self._conn = connection
        self.setPen(QtGui.QPen(QtCore.Qt.black, 2))
        self.setZValue(10)        
        self.setCursor(QtGui.QCursor(QtCore.Qt.CrossCursor))
        self.set_path() 
Example 40
Project: Facial_Expression_Recognition_FER2013   Author: Baticsute   File: UI.py    MIT License 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(389, 532)
        Form.setFixedSize(389,532)
        Form.setWindowIcon(QtGui.QIcon('icon.png'))
        self.label = QtWidgets.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(-190, -100, 751, 631))
        self.label.setStyleSheet("image: url(:/newPrefix/haytd.jpg);")
        self.label.setText("")
        self.label.setObjectName("label")
        self.btn_opencamera = QtWidgets.QPushButton(Form)
        self.btn_opencamera.setGeometry(QtCore.QRect(120, 440, 151, 23))
        self.btn_opencamera.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.btn_opencamera.setObjectName("btn_opencamera")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(50, 470, 51, 16))
        self.label_2.setObjectName("label_2")
        self.btn_browse = QtWidgets.QPushButton(Form)
        self.btn_browse.setGeometry(QtCore.QRect(110, 500, 75, 23))
        font = QtGui.QFont()
        font.setBold(True)
        font.setUnderline(False)
        font.setWeight(75)
        self.btn_browse.setFont(font)
        self.btn_browse.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.btn_browse.setObjectName("btn_browse")
        self.filenameLine = QtWidgets.QLineEdit(Form)
        self.filenameLine.setGeometry(QtCore.QRect(110, 470, 171, 20))
        self.filenameLine.setObjectName("filenameLine")
        self.btn_detect = QtWidgets.QPushButton(Form)
        self.btn_detect.setGeometry(QtCore.QRect(190, 500, 91, 23))
        self.btn_detect.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.btn_detect.setObjectName("btn_detect")

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

        #   Slots :
        self.btn_opencamera.clicked.connect(self.opencamera)
        self.btn_detect.clicked.connect(self.detect)
        self.btn_browse.clicked.connect(self.broswe) 
Example 41
Project: Watchdog   Author: marcardioid   File: watchdog.py    MIT License 5 votes vote down vote up
def add_exception(self, old, new):
        te = self.tableExceptions
        tr = te.rowCount()
        te.insertRow(tr)
        te.setItem(tr, 0, QtWidgets.QTableWidgetItem(old))
        te.setItem(tr, 1, QtWidgets.QTableWidgetItem(new))
        tb = QtWidgets.QPushButton("DEL")
        tb.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        tb.clicked.connect(lambda: te.removeRow([i for i in range(0, te.rowCount()) if te.cellWidget(i, 2) == tb][0]))
        te.setCellWidget(tr, 2, tb) 
Example 42
Project: linux-show-player   Author: FrancescoCeruti   File: media_cue_menus.py    GNU General Public License v3.0 5 votes vote down vote up
def add_uri_audio_media_cue():
        """Add audio MediaCue(s) form user-selected files"""

        if get_backend() is None:
            QMessageBox.critical(MainWindow(), 'Error', 'Backend not loaded')
            return

        # Default path to system "music" folder
        path = QStandardPaths.writableLocation(QStandardPaths.MusicLocation)

        # Get the backend extensions and create a filter for the Qt file-dialog
        extensions = get_backend().supported_extensions()
        filters = qfile_filters(extensions, anyfile=False)
        # Display a file-dialog for the user to choose the media-files
        files, _ = QFileDialog.getOpenFileNames(MainWindow(),
                                                translate('MediaCueMenus',
                                                          'Select media files'),
                                                path, filters)

        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))

        # Create media cues, and add them to the Application cue_model
        for file in files:
            cue = CueFactory.create_cue('URIAudioCue', uri='file://' + file)
            # Use the filename without extension as cue name
            cue.name = os.path.splitext(os.path.basename(file))[0]
            Application().cue_model.add(cue)

        QApplication.restoreOverrideCursor() 
Example 43
Project: RealTimeOpenControl   Author: Haschtl   File: pyqt_customlib.py    GNU General Public License v3.0 5 votes vote down vote up
def setHorScaleCursor():
    """
    Sets the mouse-cursor to 'Horizontal select cursor'
    """
    Qt.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.SizeHorCursor)) 
Example 44
Project: RealTimeOpenControl   Author: Haschtl   File: pyqt_customlib.py    GNU General Public License v3.0 5 votes vote down vote up
def setVerScaleCursor():
    """
    Sets the mouse-cursor to 'Vertical select cursor'
    """
    Qt.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.SizeVerCursor)) 
Example 45
Project: OnkoDICOM   Author: didymo   File: openpage.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def setupUi(self, WelcomePage):
        WelcomePage.setObjectName("WelcomePage")
        WelcomePage.setWindowIcon(QtGui.QIcon("src/Icon/DONE.png"))
        WelcomePage.setFixedSize(844, 528)
        WelcomePage.setStyleSheet("background-color: rgb(244, 245, 245);")
        self.centralwidget = QtWidgets.QWidget(WelcomePage)
        self.centralwidget.setObjectName("centralwidget")
        self.welcomeLabel = QtWidgets.QLabel(self.centralwidget)
        self.welcomeLabel.setGeometry(QtCore.QRect(270, 340, 351, 41))
        self.welcomeLabel.setStyleSheet("font: 57 18pt;\n"
                                        "font: 57 18pt;")
        self.welcomeLabel.setObjectName("welcomeLabel")
        # the sentence below welcome
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setGeometry(QtCore.QRect(80, 390, 671, 21))
        self.label_2.setObjectName("label_2")
        # button to open a patient
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(350, 440, 121, 31))
        self.pushButton.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                      "color:rgb(75,0,130);\n"
                                      "font-weight: bold;\n")
        self.pushButton.setObjectName("pushButton")
        self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        # logo holder
        self.logo = QtWidgets.QLabel(self.centralwidget)
        self.logo.setGeometry(QtCore.QRect(185, 60, 480, 261))
        self.logo.setText("")
        self.logo.setPixmap(QtGui.QPixmap("src/Icon/LOGOT.png"))
        self.logo.setScaledContents(True)
        self.logo.setObjectName("logo")
        WelcomePage.setCentralWidget(self.centralwidget)
        self.retranslateUi(WelcomePage)
        QtCore.QMetaObject.connectSlotsByName(WelcomePage)

    # this function inserts all the text in the welcome page 
Example 46
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def create_apply_button(self):
        """
        Create APPLY button to save all changes made.
        """
        self.apply_button = QtWidgets.QPushButton(self.widget)
        self.apply_button.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.apply_button.setFixedSize(111, 31)
        self.apply_button.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                        "font: 57 11pt \\\"Ubuntu\\\";\n"
                                        "color:rgb(75,0,130);\n"
                                        "font-weight: bold;")

        _translate = QtCore.QCoreApplication.translate
        self.apply_button.setText(_translate("Add_On_Options", "Apply")) 
Example 47
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def create_add_button(self):
        """
        Create a button to add a new standard organ name.
        """
        self.window.add_standard_organ_name = QtWidgets.QPushButton(self.window.widget)
        self.window.add_standard_organ_name.setFixedSize(161, 31)
        self.window.add_standard_organ_name.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.window.add_standard_organ_name.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                                   "font: 57 11pt \\\"Ubuntu\\\";\n"
                                                   "color:rgb(75,0,130);\n"
                                                   "font-weight: bold;")
        self.window.add_standard_organ_name.setVisible(False)

        _translate = QtCore.QCoreApplication.translate
        self.window.add_standard_organ_name.setText(_translate("Add_On_Options", "Add Standard Name")) 
Example 48
Project: OnkoDICOM   Author: didymo   File: Add_On_Options.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def create_add_button(self):
        """
        Create a button to add a new standard volume name.
        """
        self.window.add_standard_volume_name = QtWidgets.QPushButton(self.window.widget)
        self.window.add_standard_volume_name.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.window.add_standard_volume_name.setFixedSize(161, 31)
        self.window.add_standard_volume_name.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                                    "font: 57 11pt \\\"Ubuntu\\\";\n"
                                                    "color:rgb(75,0,130);\n"
                                                    "font-weight: bold;")
        self.window.add_standard_volume_name.setVisible(False)

        _translate = QtCore.QCoreApplication.translate
        self.window.add_standard_volume_name.setText(_translate("Add_On_Options", "Add Standard Name")) 
Example 49
Project: OnkoDICOM   Author: didymo   File: ClinicalDataForm.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def create_save_button(self):
        """
        Create Save Button.
        """
        self.Save_button = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
        self.Save_button.setFixedSize(89, 25)
        self.Save_button.setStyleSheet("background-color: rgb(238, 238, 236);\n"
                                       "color:rgb(75,0,130);\n"
                                       "font-weight: bold;\n")
        self.Save_button.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) 
Example 50
Project: parsec-cloud   Author: Scille   File: custom_widgets.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.full_text = ""