예제 #1
0
    def _init_ui(self):
        self._dialog.setWindowFlags(Qt.Dialog)
        self._dialog.setAttribute(Qt.WA_TranslucentBackground)
        self._dialog.setAttribute(Qt.WA_MacFrameworkScaled)
        self._dialog.setWindowTitle(self._dialog.windowTitle() + self._folder)

        self._ui.colleagues_list.setAlternatingRowColors(True)
        self._colleagues_list = ColleaguesList(self._parent,
                                               self._ui.colleagues_list,
                                               self._dp, self._show_menu)

        self._loader_movie = QMovie(":/images/loader.gif")
        self._ui.loader_label.setMovie(self._loader_movie)
        self._set_fonts()

        self._ui.add_frame.setVisible(False)
        self._set_add_button_background(self.ADD_BUTTON_PASSIVE_COLOR)
        self._ui.add_button.clicked.connect(self._on_add_button_clicked)
        self._ui.add_button.setVisible(False)
        self._ui.close_button.clicked.connect(self._on_close_button_clicked)
        self._ui.refresh_button.clicked.connect(self._on_refresh)

        self._line_edit_style = "background-color: {};"
        self._ui.error_label.setStyleSheet("color: {};".format(
            self.ERROR_COLOR))
예제 #2
0
    def __init__(self, parentWindow, address=None, port=None):
        self.widget = parentWindow.findChild(QWidget, 'connectPage')
        self.errorLabel = parentWindow.findChild(QLabel, 'connect_errorLabel')
        self.confirmButton = parentWindow.findChild(QPushButton, 'connect_confirmButton')
        self.connectIndicator = parentWindow.findChild(QLabel, 'connect_indicator')
        self.hostLineEdit = parentWindow.findChild(QLineEdit, 'connect_hostnameLineEdit')
        self.portLineEdit = parentWindow.findChild(QLineEdit, 'connect_portLineEdit')
        self.logo = parentWindow.findChild(QLabel, 'connect_logoImage')
        self.hostLabel = parentWindow.findChild(QLabel, 'hostLabel')
        self.portLabel = parentWindow.findChild(QLabel, 'hostPortLabel')

        self.logo.setPixmap(QPixmap("resources/icon-256.png"))
        self.logo.setVisible(False)

        movie = QMovie("resources/loader-small.gif")
        movie.start()
        self.connectIndicator.setMovie(movie)
        self.connectIndicator.setVisible(False)

        self.errorLabel.setVisible(False)

        self.hostLineEdit.setText(constants.DEFAULT_ADDRESS)
        self.portLineEdit.setText(str(constants.DEFAULT_TCP_PORT))

        self.confirmButton.clicked.connect(self.onConfirm)
        self.hostLineEdit.returnPressed.connect(self.onConfirm)
        self.portLineEdit.returnPressed.connect(self.onConfirm)
예제 #3
0
class StatusWidget(QWidget):
    def __init__(self):
        super().__init__()
        self.status_label = QLabel("0%")
        self.load_icon_movie = QMovie(SpinnerIconPath)
        self.load_icon_label = QLabel()
        self.load_icon_label.setMovie(self.load_icon_movie)
        self.layout = QHBoxLayout()
        self.layout.addStretch(2)
        self.layout.addWidget(self.load_icon_label)
        self.layout.addWidget(self.status_label)
        self.layout.addStretch(3)
        self.layout.setSpacing(0)
        self.layout.setMargin(0)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

    def update_progress(self, new_progress):
        self.status_label.setText(str(new_progress) + "%")

    def start_loading(self):
        self.load_icon_movie.start()

    def stop_loading(self):
        self.load_icon_movie.stop()
예제 #4
0
    def __init__(self, parent):
        self._dialog = QDialog(parent)
        self._dialog.setWindowIcon(QIcon(':/images/icon.png'))
        self._ui = Ui_Dialog()
        self._ui.setupUi(self._dialog)

        self._ui.centralWidget.setFrameShape(QFrame.NoFrame)
        self._ui.centralWidget.setLineWidth(1)

        self._model = None
        self._proxy_model = QSortFilterProxyModel()

        self._view = self._ui.folder_list_view
        self._view.setModel(self._proxy_model)
        self._view.expanded.connect(self.on_item_expanded)

        self._offline_paths = None

        # for frameless window moving
        self._x_coord = 0
        self._y_coord = 0
        self._dialog.mousePressEvent = self.on_mouse_press_event
        self._dialog.mouseMoveEvent = self.on_mouse_move_event

        self._loader_movie = QMovie(":/images/loader.gif")
        self._ui.loader_label.setMovie(self._loader_movie)
    def __init__(self, *args, **kwargs):
        super(MenuWindow, self).__init__(*args, **kwargs)

        # Loading Fonts
        QFontDatabase.addApplicationFont("fonts/BebasNeue-Light.ttf")

        # Window Settings 
        self.setFixedSize(1280, 720)
        self.setWindowTitle("Systeme d'apprentissage base sur les reseaux de neurones")
        #background = QPixmap("images/menu")
        #palette = QPalette()
        #palette.setBrush(QPalette.Background, background)
        #self.setAttribute(Qt.WA_StyledBackground, True)
        #self.setPalette(palette)
        self.setAutoFillBackground(True)
        background = QLabel(self)
        movie = QMovie("images/menu")
        background.setMovie(movie)
        self.setCentralWidget(background)
        movie.start()

        # Stylesheet Settings
        styleFile = QFile( "stylesheets/menu.qss" )
        styleFile.open( QFile.ReadOnly )
        style = str( styleFile.readAll() )
        self.setStyleSheet( style )

        # Title Settings
        self.title = QLabel("Neural networks based learning system", self)
        self.title.setFont(QFont("BebasNeue", 45, QFont.Bold))
        self.title.setAlignment(Qt.AlignCenter)
        self.title.setGeometry(0, 60, 1280, 120)

        # Button Settings 
        self.buttons = []
        for x in range(5) :
           self.buttons.append(x)
           self.buttons[x] = QPushButton(self)
           self.buttons[x].setCursor(Qt.PointingHandCursor)
           self.buttons[x].setObjectName("select")
           self.buttons[x].setFont(QFont("BebasNeue", 15, QFont.Bold))
           self.buttons[x].setGeometry(400, 210 + x * 100, 550, 80)
           #self.buttons[x].clicked.connect(lambda : self.notifyMe(x))
        self.buttons[0].setText("Image preprocessing")        
        self.buttons[1].setText("Text preprocessing")        
        self.buttons[2].setText("Learning")
        self.buttons[3].setText("Testing")
        self.buttons[4].setText("Quit")

       

        



#app = QApplication(sys.argv)
#window = MenuWindow()
#window.show()
#app.exec_()
예제 #6
0
 def __init__(self, parent=None):
     super().__init__(parent)
     lbl = QLabel(self)
     movie = QMovie('../example_data/sample.gif')
     lbl.setMovie(movie)
     lbl.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
     movie.start()
     self.setCentralWidget(lbl)
예제 #7
0
 def setGif(self, filename):
     if not hasattr(self, "gifBtn"):
         self.gifBtn = QMovie(self)
         self.gifBtn.setFileName(filename)
         self.gifBtn.frameChanged.connect(self.on_frameChanged)
         if self.gifBtn.loopCount() != -1:
             self.gifBtn.finished.connect(self.start)
     self.stop()
예제 #8
0
    def __init__(self, path):

        self.__movie = QMovie(path)
        self.__movie.jumpToFrame(0)

        pixmap = QPixmap(self.__movie.frameRect().size())
        QSplashScreen.__init__(self, pixmap)
        self.__movie.frameChanged.connect(self.repaint)
예제 #9
0
    def __init__(self) -> None:
        super().__init__()

        self.setupUi(self)

        movie = QMovie(icons.get_icon_path("loader.gif"))
        self.load_image_label.setMovie(movie)

        movie.start()
 def stackStart(self):
     self.setButton(self.ui.btn_left, show=False)
     self.setButton(self.ui.btn_right, show=False)
     self.ui.lbl_notification.hide()
     self.playSound('audio11')
     gif_start = QMovie("animations/slider1.gif")
     self.ui.lbl_slider_start.setMovie(gif_start)
     gif_start.start()
     self.delivery_state = 'default'
     self.ui.Stack.setCurrentWidget(self.ui.pageStart)
class SplashScreen(QSplashScreen):
    def __init__(self):
        super(SplashScreen, self).__init__()
        self.movie = QMovie(r'20190320111722218.gif')
        self.movie.frameChanged.connect(
            lambda: self.setPixmap(self.movie.currentPixmap()))
        self.movie.start()

    def mousePressed(self, event):
        pass
예제 #12
0
 def setPicContent(self, path: str):
     if path.split(".")[-1] in suffix:
         pixmap = QPixmap(path)
         self.picLab.setPixmap(pixmap)
     elif path.split(".")[-1] in suffix2:
         movie = QMovie(path)
         self.picLab.setMovie(movie)
         movie.start()  # 播放,必须在show之前
     else:
         pass
예제 #13
0
def show_splash_screen_movie(app):
    movie = QMovie(Resource.icon_paths['Knecht_splash'])
    splash = MovieSplashScreen(movie, app)
    splash.show()

    start = time.time()

    while movie.state() == QMovie.Running and time.time() < start + 1.1:
        app.processEvents()

    return splash
예제 #14
0
class CustomButton(QPushButton):
   
    def __init__(self):
        super(CustomButton, self).__init__()
        self.setMinimumSize(290, 70)
        self.setMaximumSize(290, 70)
        self.setStyleSheet('QPushButton{background-color: #28a745; color: rgb(255, 255, 255); font: 24pt "IRANSans"; '
                           'padding: 3px; border: none; border-radius: 6px; outline-style: none;}'
                           'QPushButton:pressed {background-color: #145222;border-style: inset;}')
    @Slot ()
    def start(self):
        if hasattr(self, "gifBtn"):
            self.setText(None)
            self.gifBtn.start()

    @Slot ()
    def stop(self):
        if hasattr(self, "gifBtn"):
            self.setText('ورود')
            self.gifBtn.stop()
            self.setIcon(QIcon())

    def setGif(self, filename):
        if not hasattr(self, "gifBtn"):
            self.gifBtn = QMovie(self)
            self.gifBtn.setFileName(filename)
            self.gifBtn.frameChanged.connect(self.on_frameChanged)
            if self.gifBtn.loopCount() != -1:
                self.gifBtn.finished.connect(self.start)
        self.stop()

    @Slot (int)
    def on_frameChanged(self, frameNumber):
        self.setIcon(QIcon(self.gifBtn.currentPixmap()))
        self.setIconSize(QSize(70, 70))

#if __name__ == '__main__':
#    import sys
#    import random
#    app = QApplication(sys.argv)
#    w = QWidget()
#    lay = QVBoxLayout(w)
#    for i in range(5):
#        button = CustomButton()
#        button.setGif("animations/Rolling-white.gif")
#        button.clicked.connect(button.start)
#        #QTimer.singleShot(random.randint(3000, 6000), button.start)
#        #QTimer.singleShot(random.randint(8000, 12000), button.stop)
#        lay.addWidget(button)
#    w.show()
#    sys.exit(app.exec_())
예제 #15
0
 def __init__(self):
     super().__init__()
     self.status_label = QLabel("0%")
     self.load_icon_movie = QMovie(SpinnerIconPath)
     self.load_icon_label = QLabel()
     self.load_icon_label.setMovie(self.load_icon_movie)
     self.layout = QHBoxLayout()
     self.layout.addStretch(2)
     self.layout.addWidget(self.load_icon_label)
     self.layout.addWidget(self.status_label)
     self.layout.addStretch(3)
     self.layout.setSpacing(0)
     self.layout.setMargin(0)
     self.layout.setContentsMargins(0, 0, 0, 0)
     self.setLayout(self.layout)
예제 #16
0
    def _init_ui(self):
        self._dialog.setWindowFlags(Qt.Dialog)
        self._dialog.setAttribute(Qt.WA_TranslucentBackground)
        self._dialog.setAttribute(Qt.WA_MacFrameworkScaled)

        self._notifications_list = NotificationsList(self._dp)
        self._ui.notifications_area.setWidget(self._notifications_list)
        self._ui.notifications_area.verticalScrollBar().valueChanged.connect(
            self._on_list_scroll_changed)

        self._old_main_resize_event = self._ui.centralwidget.resizeEvent
        self._ui.centralwidget.resizeEvent = self._main_resize_event

        self._loader_movie = QMovie(":/images/loader.gif")
        self._ui.loader_label.setMovie(self._loader_movie)
예제 #17
0
    def __init__(self, parent):
        super(Overlay, self).__init__(parent)

        self.parent = parent

        # Setup overlay movies
        # ref_created, copy_created
        movies = [
            # 0
            ':/anim/link_animation.gif',
            # 1
            ':/anim/copy_animation.gif',
            # 2
            ':/anim/coffee_animation.gif',
            # 3
            ':/anim/save_animation.gif',
        ]
        self.mov = []

        for i, m in enumerate(movies):
            self.mov.append(QMovie(m))
            self.mov[i].setCacheMode(QMovie.CacheAll)
            self.mov[i].setSpeed(100)
            self.mov[i].finished.connect(self.movie_finished)

        self.movie_screen.setMovie(self.mov[0])
        self.movie_screen.setGeometry(5, 20, 64, 64)

        self.show()
예제 #18
0
    def __init__(self, path):
        self.__path = str(path)

        supported_formats = (format.data().decode()
                             for format in QMovie.supportedFormats())
        if self.__path.lower().endswith(tuple(supported_formats)):
            self.splash = AnimatedSplash(path)
        else:
            self.splash = ImageSplash(path)
예제 #19
0
 def show_loading(self):
     screen = QApplication.desktop().screenNumber(self)
     centerPoint = QApplication.desktop().screenGeometry(screen).center()
     self.loading = MovieSplashScreen(QMovie(':/123/images/810.gif'), Qt.WindowStaysOnTopHint)
     # 移动到当前活动窗口的正中央
     frameGm = self.loading.frameGeometry()
     frameGm.moveCenter(centerPoint)
     self.loading.move(frameGm.topLeft())
     self.loading.show()
예제 #20
0
 def setupProgressSection(self):
     self.progress_layout = QHBoxLayout()
     progress_vertical_layout = QVBoxLayout()
     progress_wrapper_layout = QHBoxLayout()
     self.progress_label = QLabel()
     movie = QMovie('icons/ajax-loader.gif')
     self.progress_label.setMovie(movie)
     movie.start()
     self.progress_label.setSizePolicy(QSizePolicy.Maximum,
                                       QSizePolicy.Maximum)
     self.progress_description_label = QLabel()
     self.progress_description_label.setText(
         "Transaction is being confirmed. Please wait!")
     self.progress_description_label.setSizePolicy(QSizePolicy.Maximum,
                                                   QSizePolicy.Maximum)
     progress_wrapper_layout.addWidget(self.progress_label)
     progress_wrapper_layout.addWidget(self.progress_description_label)
     progress_vertical_layout.addLayout(progress_wrapper_layout, 1)
     self.progress_layout.addLayout(progress_vertical_layout)
     self.sendTransactionFinished()
예제 #21
0
    def makeView(self):
        layout = QVBoxLayout()
        btnLayout = QHBoxLayout()
        self.centStack = QStackedWidget()
        self.updateButton = QPushButton('Update')
        self.cancelButton = QPushButton('Cancel')
        notifyLabel = QLabel('There are upgrades scheduled')
        self.inputBox = QLineEdit()
        self.outputBox = QTextBrowser()
        #refreshIcon = QIcon.fromTheme('process-working')
        self.refreshIcon = QMovie('assets/spin3.gif')
        refreshAnimation = QLabel()

        layout.addWidget(notifyLabel)
        layout.addWidget(self.centStack)
        layout.addWidget(self.inputBox)
        layout.addLayout(btnLayout)
        btnLayout.addWidget(self.cancelButton)
        btnLayout.addWidget(self.updateButton)

        self.centStack.addWidget(refreshAnimation)
        self.centStack.addWidget(self.outputBox)
        refreshAnimation.setMovie(self.refreshIcon)
        refreshAnimation.setAlignment(Qt.AlignCenter)
        self.refreshIcon.start()

        self.inputBox.setEchoMode(QLineEdit.Password)
        self.inputBox.setFocus()
        self.inputBox.returnPressed.connect(self.pkgUpdates)
        self.updateButton.clicked.connect(self.pkgUpdates)
        self.cancelButton.clicked.connect(self.cancelUpdates)
        self.updateButton.setDefault(True)

        self.centStack.setCurrentIndex(1)
        notifyLabel.setAlignment(Qt.AlignTop)
        self.outputBox.setReadOnly(True)
        #self.outputBox.setAlignment(Qt.AlignTop)
        self.setWindowTitle('Package Upgrades')
        self.setLayout(layout)
        self.resize(450, 250)
        return
예제 #22
0
    def __init__(self, window_title, parent):
        """Initializes class.

        Args:
            window_title (str)
            parent (QMainWindow)
        """
        super().__init__(window_title, parent)
        self.setObjectName(window_title)
        self.label_msg = QLabel(self)
        self.label_msg.setFont(QFont("arial,helvetica", 12))
        self.label_msg.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.label_msg.setWordWrap(True)
        self.button_left = QPushButton(self)
        self.button_right = QPushButton(self)
        self.label_loader = QLabel(self)
        self.label_loader.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        movie = QMovie(":/animated_gifs/ajax-loader.gif")
        movie.start()
        self.label_loader.setMovie(movie)
        button_container = QWidget(self)
        button_layout = QHBoxLayout(button_container)
        button_layout.addStretch()
        button_layout.addWidget(self.button_left)
        button_layout.addWidget(self.button_right)
        button_layout.addStretch()
        widget = QWidget(self)
        layout = QVBoxLayout(widget)
        layout.addStretch()
        layout.addWidget(self.label_msg)
        layout.addStretch()
        layout.addWidget(self.label_loader)
        layout.addStretch()
        layout.addWidget(button_container)
        self.setWidget(widget)
        self.machine = None
        self.welcome = None
        self._welcome_text = "<html><p>Welcome!</p></html>"
        self._current_state = None
        self.setAttribute(Qt.WA_DeleteOnClose)
예제 #23
0
 def __init__(self, videos_list):
     super().__init__()
     self.setWindowTitle("Loading Media Info")
     self.videos_list = videos_list
     self.videos_count = len(self.videos_list)
     self.current_video_done_index = 0
     self.status_label = QLabel("Scanning Video " +
                                str(self.current_video_done_index) + "/" +
                                str(self.videos_count))
     self.load_icon_movie = QMovie(SpinnerIconPath)
     self.load_icon_label = QLabel()
     self.load_icon_label.setMovie(self.load_icon_movie)
     self.layout = QHBoxLayout()
     self.layout.addStretch(2)
     self.layout.addWidget(self.load_icon_label)
     self.layout.addWidget(self.status_label)
     self.layout.addStretch(3)
     self.layout.setSpacing(0)
     self.layout.setContentsMargins(8, 12, 8, 12)
     self.setLayout(self.layout)
     self.disable_question_mark_window()
     self.generate_media_info_files()
예제 #24
0
    def submit(self):
        _movie = QMovie(os.getcwd()+'/loading.gif')
        _movie.setScaledSize(QSize(50, 50))
        self.text.setMovie(_movie)
        _movie.start()

        t = threading.Thread(target=self.processEmployee)
        t.start()
    def __init__(self):
        super(InstallerProgressPage, self).__init__()

        self._main_layout = QtW.QVBoxLayout()
        self._progress_bar_layout = QtW.QVBoxLayout()

        self._close_btn = QtW.QPushButton()
        self._close_btn.setText("CLOSE")
        self._close_btn.setEnabled(False)
        self._close_btn.clicked.connect(self._close_btn_handler)

        self._main_image_lb = QtW.QLabel()
        self._main_gif_mov = QMovie(resource_path("UI\\dog_haircut.gif"))
        self._main_image_lb.setAlignment(Qt.AlignCenter)

        self._main_image_lb.setMovie(self._main_gif_mov)
        self._main_gif_mov.start()

        self._progress_bar = QtW.QProgressBar()
        self._progress_bar.setRange(0, 0)
        self._progress_bar.setTextVisible(False)

        self._main_lb = QtW.QLabel()
        self._main_lb.setProperty('Title', True)
        self.set_install()
        self._task_lb = QtW.QLabel()
        self._task_lb.setText(str())

        self.setLayout(self._main_layout)

        self._main_layout.addLayout(self._progress_bar_layout)
        self._progress_bar_layout.insertStretch(-1, 0)
        self._progress_bar_layout.addWidget(self._main_image_lb)
        self._progress_bar_layout.addWidget(self._main_lb)
        self._progress_bar_layout.addWidget(self._progress_bar)
        self._progress_bar_layout.addWidget(self._task_lb)
        self._progress_bar_layout.insertStretch(-1, 0)
        self._main_layout.addWidget(self._close_btn)
예제 #26
0
def main():
    # print('minha main')

    movie = QMovie('EYE_WALLEroxo.gif')
    ui.label_2.setMovie(movie)
    movie.setSpeed(160)
    rect = ui.label_2.geometry()
    size = QSize(min(rect.width(), rect.height()),
                 min(rect.width(), rect.height()))
    movie.setScaledSize(size)
    movie.start()
    movieLoading(False)
    inicializarWarningMSG(False)

    ui.pushButton_2.setEnabled(False)
    ui.pushButton.clicked.connect(procurar_diretorio)
    ui.pushButton_2.clicked.connect(converter_py_exe)
    def __init__(self,
                 filepath,
                 parent=None,
                 alignment=Qt.AlignLeft,
                 h_offset=0,
                 v_offset=5,
                 initial_movie_size=None):
        """
        A modified QLabel which features a GIF movie that can be played

            Parameters:
                • filepath: The filepath to the .gif file which will be played
                • parent: The parent of this widget
                • alignment: The alignment of the movie w.r.t the label itself
                • h_offset: When resizing based on a buddy widget, the additional horizontal size that should be given
                • v_offset: When resizing based on a buddy widget, the additional vertical size that should be given
                • initial_movie_size: None, QSize or a 2-element tuple to indicate the initial pixel dimensions that
                the movie should be set to
        """
        super(xASL_ImagePlayer, self).__init__(parent=parent)
        self.h_offset, self.v_offset = h_offset, v_offset
        self.setContentsMargins(0, 0, 0, 0)
        self.setAlignment(alignment)

        # Load the file into a QMovie with the appropriate size
        self.movie = QMovie(str(filepath), QByteArray(), self)
        self.movie.setCacheMode(QMovie.CacheAll)
        self.movie.setSpeed(100)

        self.setMovie(self.movie)
        self.ping()

        if initial_movie_size is not None:
            if isinstance(initial_movie_size, tuple):
                initial_movie_size = QSize(*initial_movie_size)
            self.movie.setScaledSize(initial_movie_size)
예제 #28
0
class AnimatedSplash(QSplashScreen):
    def __init__(self, path):

        self.__movie = QMovie(path)
        self.__movie.jumpToFrame(0)

        pixmap = QPixmap(self.__movie.frameRect().size())
        QSplashScreen.__init__(self, pixmap)
        self.__movie.frameChanged.connect(self.repaint)

    def showEvent(self, event):
        self.__movie.start()

    def hideEvent(self, event):
        self.__movie.stop()

    def paintEvent(self, event):
        painter = QPainter(self)
        pixmap = self.__movie.currentPixmap()
        self.setMask(pixmap.mask())
        painter.drawPixmap(0, 0, pixmap)
 def stackWallet(self):
     self.setButton(self.ui.btn_left,
                    function=self.stackWalletServices,
                    text='بازگشت',
                    icon='images/icon/back.png',
                    show=True)
     self.setButton(self.ui.btn_right, show=False)
     self.ui.lbl_notification.hide()
     gif_wallet = QMovie("animations/wallet.gif")
     gif_wallet.setScaledSize(QSize().scaled(256, 256, Qt.KeepAspectRatio))
     self.ui.lbl_gif_wallet.setMovie(gif_wallet)
     gif_wallet.start()
     self.ui.lbl_wallet.setText(str(
         ("{:,.0f}").format(self.user['wallet'])))
     self.ui.Stack.setCurrentWidget(self.ui.pageWallet)
 def __init__(self):
     super(SplashScreen, self).__init__()
     self.movie = QMovie(r'20190320111722218.gif')
     self.movie.frameChanged.connect(
         lambda: self.setPixmap(self.movie.currentPixmap()))
     self.movie.start()