Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

qtoverlay

from PyQt5 import QtCore, QtWidgets, QtGui

import qtawesome as qta

class overlay(QtWidgets.QWidget):
    def __init__(self, parent=None):
        super(overlay, self).__init__(parent)
        self.parent = parent

        child_alignmenet = QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop
        
        layout = QtWidgets.QVBoxLayout()
        self.spin_widget = qta.IconWidget()
        
        self.progress_text = QtWidgets.QLabel()
        font = QtGui.QFont()
        font.setPointSize(12)
        self.progress_text.setFont(font)

        self.progress_text.setAlignment(child_alignmenet)
        self.progress_bar = QtWidgets.QProgressBar()
        self.progress_bar.setFixedWidth(220)
        self.progress_bar.setAlignment(child_alignmenet)
                
        spin_icon = qta.icon('mdi.loading', color='blue',
                           animation=qta.Spin(self.spin_widget, step=25))
        self.spin_widget.setIcon(spin_icon)
        self.spin_widget.setIconSize(QtCore.QSize(96, 96))
        self.spin_widget.setAlignment(child_alignmenet)
                
        layout.addWidget(self.spin_widget)
        layout.addWidget(self.progress_text)
        layout.addWidget(self.progress_bar)
        layout.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)    
        
        self.setLayout(layout)              
    
    def update_text(self,text):
        self.progress_text.setText(text)

    def update_progress(self, value):
        self.progress_bar.setValue(value)

    def paintEvent(self, event):
        painter = QtGui.QPainter()
        painter.begin(self)
        painter.setRenderHint(QtGui.QPainter.Antialiasing)       
        painter.fillRect(event.rect(), QtGui.QBrush(QtGui.QColor(255, 255, 255, 127)))
    
Comment

PREVIOUS NEXT
Code Example
Python :: pandas replace % with calculated 
Python :: bs.newtag() inner html 
Python :: how fast is iglob 
Python :: how save second sheet in excel using python 
Python :: codeforces 233 a solution python 
Python :: How to make boxplot using seaborne 
Python :: vs python 
Python :: mechanize python LE #3 
Python :: convert ui to py 
Python :: python profile is not defined line_profiler 
Python :: divisibility by 13 in python 
Python :: how to insert ele in python 
Python :: np v stack 
Python :: Run flask on docker with postgres and guinicorn 
Python :: Return monthly sales value in Django 
Python :: pandas from multiindex to single index 
Python :: pairplot hide original legend 
Python :: menjumlahkan elemen tertentu pada list dalam dictionary python 
Python :: pyttsx3 interrupting an utterance 
Python :: Code example of Python Modulo Operator with Exception handling 
Python :: Simple Example to Plot Python Treemap with lables 
Python :: cubic interpolation python 
Python :: testing grepper python 
Python :: velocity field gradient 
Python :: python is x string methods 
Python :: Broadcasting with NumPy Arrays Example 
Python :: regex re speed 
Python :: Python NumPy asscalar Function Syntax 
Python :: Python NumPy insert Function Example Using insertion at different points 
Python :: Python __div__ magic method 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =