예제 #1
0
    def makeWidget(self, parent=None):
        self.main_widget = self.ContainerWidget(parent)
        # self.signals.close.connect(self.close_slot) # not closed by clicking
        # the close symbol
        # this layout includes VideoWidget, buttons, alerts, etc.
        self.main_layout = QtWidgets.QVBoxLayout(self.main_widget)
        self.video = self.VideoWidget(
            parent=self.main_widget,
            mouse_gesture_handler=self.mouseGestureHandler)

        self.define_analyzer_button = QtWidgets.QPushButton(
            "Define Analyzer", self.main_widget)
        self.main_layout.addWidget(self.define_analyzer_button)

        self.main_layout.addWidget(self.video)
        self.video.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                 QtWidgets.QSizePolicy.Expanding)

        self.video.signals.drop.connect(self.setDevice)
        self.define_analyzer_button.clicked.connect(
            self.right_double_click_slot)  # show the analyzer widget windows

        # this VideoContainer was initialized with a device id, so we stream the video now
        if self.device_id > -1:
            self.setDeviceById(self.device_id)
예제 #2
0
    def makeWidget(self):
        super().makeWidget()

        self.button_row = QtWidgets.QWidget(self.widget)
        self.button_lay = QtWidgets.QHBoxLayout(self.button_row)
        self.lay.addWidget(self.button_row)

        self.reset_button = QtWidgets.QPushButton("Reset", self.button_row)
        self.save_button = QtWidgets.QPushButton("Save", self.button_row)
        self.button_lay.addWidget(self.reset_button)
        self.button_lay.addWidget(self.save_button)
        self.save_button.setEnabled(False)
        # row class instance => column (blocksize)=> corresponding widget
        # ValkkaFSConfigRow has "blocksize" widget that is QSpinBox
        self.row_instance["blocksize"].widget.valueChanged.connect(
            self.mod_slot)
        self.row_instance["n_blocks"].widget.valueChanged.connect(
            self.mod_slot)
        # should fix cutemongoforms: SpinBoxIntegerColumn should have
        # getNotifySignal implemented..
        st = (
            "- Recording streams is experimental; please report bugs\n"
            "- Modifying & saving the new parameters will clear all your recordings\n"
        )
        self.info_label = QtWidgets.QLabel(st, self.widget)
        self.lay.addWidget(self.info_label)

        self.reset_button.clicked.connect(self.row_instance.clear)
        self.save_button.clicked.connect(self.save_slot)
예제 #3
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 800, 800))
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.timelinewidget = TimeLineWidget(datetime.date.today(),
                                             parent=self.w)
        self.timelinewidget.setLogLevel(logging.DEBUG)
        self.lay.addWidget(self.timelinewidget)

        t = int(time.mktime(datetime.date.today().timetuple()) * 1000)
        self.timelinewidget.setFSTimeLimits(
            (t + int(1000 * 2 * 3600), t + int(1000 * 20 * 3600)))

        t = int(time.mktime(datetime.date.today().timetuple()) * 1000)
        self.timelinewidget.setBlockTimeLimits(
            (t + int(1000 * 6 * 3600), t + int(1000 * 14 * 3600)))

        self.calendarwidget = CalendarWidget(datetime.date.today(),
                                             parent=self.w)
        self.lay.addWidget(self.calendarwidget)

        d = datetime.date.today()
        d0 = datetime.date(year=d.year, month=d.month, day=d.day - 2)
        d1 = datetime.date(year=d.year, month=d.month, day=d.day + 3)

        t0 = int(time.mktime(d0.timetuple()) * 1000)
        t1 = int(time.mktime(d1.timetuple()) * 1000)

        self.calendarwidget.set_fs_time_limits_slot((t0, t1))
예제 #4
0
    def __init__(self, lis, form, title="", parent=None):
        self.title = title
        self.lis = lis
        self.form = form

        self.widget = QtWidgets.QWidget(parent)  # create a new widget
        self.lay = QtWidgets.QVBoxLayout(
            self.widget)  # attach layout to that widget
        self.label = QtWidgets.QLabel(self.title, self.widget)

        self.subwidget = QtWidgets.QWidget(self.widget)
        self.sublay = QtWidgets.QHBoxLayout(self.subwidget)

        self.lay.addWidget(self.label)
        self.lay.addWidget(self.subwidget)

        self.subwidget.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                     QtWidgets.QSizePolicy.Expanding)
        self.lis.widget.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                      QtWidgets.QSizePolicy.Minimum)
        self.lis.widget.setMaximumWidth(100)

        # get widget from List and set its parent to widget
        self.lis.widget.setParent(self.subwidget)
        self.form.widget.setParent(self.subwidget)
        # add List's internal widget to widget's layout
        self.sublay.addWidget(self.lis.widget)
        self.sublay.addWidget(self.form.widget)
        self.lis.widget.currentItemChanged.connect(
            self.form.chooseForm_slot)  # connections between list and the form
        self.form.signals.modified.connect(self.lis.update_slot)
        self.modified = self.form.signals.modified  # shorthand
예제 #5
0
    def makeWidget(self, qscreen: QtGui.QScreen, geom: tuple = ()):
        # (re)create the widget, do the same for children
        # how children are placed on the parent widget, depends on the subclass
        self.window = self.ContainerWindow(self.signals, self.title,
                                           self.parent)

        # send to correct x-screen
        self.window.show()
        self.window.windowHandle().setScreen(qscreen)
        self.n_xscreen = self.gpu_handler.getXScreenNum(
            qscreen
        )  # the correct x-screen number must be passed upstream, to the VideoContainer

        # continue window / widget construction in the correct x screen
        self.main_widget = self.ContainerWidget(self.window)
        self.main_layout = QtWidgets.QVBoxLayout(self.main_widget)
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.window.setCentralWidget(self.main_widget)

        if len(geom) >= 4:
            self.setGeom(geom[0], geom[1], geom[2], geom[3])

        # add here any extra turf to the widget you want in addition to the
        # grid

        # create the grid
        self.grid_widget = self.GridWidget(self.main_widget)
        self.main_layout.addWidget(self.grid_widget)

        self.grid_layout = QtWidgets.QGridLayout(self.grid_widget)
        self.grid_layout.setHorizontalSpacing(2)
        self.grid_layout.setVerticalSpacing(2)
        # ( int left, int top, int right, int bottom )
        self.grid_layout.setContentsMargins(0, 0, 0, 0)

        class ScreenMenu(QuickMenu):
            title = "Change Screen"
            elements = [
                QuickMenuElement(title="Screen 1"),
                QuickMenuElement(title="Screen 2")
            ]

        """ TODO: activate after gpu-hopping has been debugged
        self.screenmenu = ScreenMenu(self.window)
        self.screenmenu.screen_1.triggered.connect(self.test_slot)
        self.screenmenu.screen_2.triggered.connect(self.test_slot)
        """

        if (len(self.gpu_handler.true_screens) > 1):
            # so, there's more than a single x screen: create a button for
            # changing x-screens
            self.button = QtWidgets.QPushButton("Change Screen",
                                                self.main_widget)
            self.main_layout.addWidget(self.button)
            self.button.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                      QtWidgets.QSizePolicy.Minimum)
            self.button.clicked.connect(self.change_xscreen_slot)

        self.placeChildren()
예제 #6
0
    def setupUi(self):
        # self.setGeometry(QtCore.QRect(100,100,500,500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.container = self.dm.getDeviceListAndForm(self.w)
        self.lay.addWidget(self.container.widget)
예제 #7
0
 def __init__(self, blocking = False, parent = None):
     super().__init__(parent)
     self.propagate = True # send signals or not
     self.setStyleSheet(style.main_gui)
     if (blocking):
         self.setWindowModality(QtCore.Qt.ApplicationModal)
     self.signals = self.Signals()
     self.tab = QtWidgets.QTabWidget()
     self.setCentralWidget(self.tab)
     self.setLayout(QtWidgets.QHBoxLayout())
예제 #8
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        # self.video = SimpleVideoWidget(parent=self.w)
        self.video = LineCrossingVideoWidget(parent=self.w)
        self.lay.addWidget(self.video)
예제 #9
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.setCentralWidget(self.w)

        # self.device_list_form = self.dm.getDeviceListAndForm(self.w)
        # self.lay.addWidget(self.device_list_form.widget)

        self.device_list_form = self.dm.getDeviceListAndForm(None)
        self.device_list_form.widget.show()
예제 #10
0
 def __init__(self, def_pixmap=None, parent=None):
     super().__init__(parent)
     self.signals = self.Signals()
     self.pre = "SimpleVideoWidget : "
     self.lay = QtWidgets.QVBoxLayout(self)
     self.canvas = CanvasWidget(self.signals, def_pixmap, parent=self)
     self.lay.addWidget(self.canvas)
예제 #11
0
    def __init__(self,
                 parent=None,
                 analyzer_video_widget_class=SimpleVideoWidget):
        super().__init__(parent)

        self.w = QtWidgets.QWidget(self)
        self.main_lay = QtWidgets.QVBoxLayout(self)
        self.main_lay.addWidget(self.w)
        # self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)
        self.video = analyzer_video_widget_class(parent=self.w)
        self.signals = self.Signals()
        self.lay.addWidget(self.video)
        self.thread_ = None  # woops.. thread seems to be a member of QWidget..!
        self.first_show_event = True
예제 #12
0
 def setupUi(self):
   self.setGeometry(QtCore.QRect(100,100,500,500))
   
   self.w=QtWidgets.QWidget(self)
   self.setCentralWidget(self.w)
   
   QtWidgets.QMessageBox.about(self.w, "About it", constant.valkka_core_not_found)
예제 #13
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        # lets create another window with a widget inside
        self.another_window = QtWidgets.QMainWindow()
        self.w2 = QtWidgets.QFrame(self.another_window)
        self.w2.setAutoFillBackground(True)
        self.w2.setStyleSheet("QFrame {background-color: green;}")
        self.another_window.setCentralWidget(self.w2)
        self.another_window.show()
예제 #14
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        # here's the demo ..
        class FileMenu(QuickMenu):
            title = "File"
            elements = [QuickMenuElement(title="Exit")]

        class GridMenu(QuickMenu):
            title = "Video Grid"
            elements = [
                QuickMenuElement(title="Grid 1x1"),
                QuickMenuElement(title="Grid 2x2"),
                QuickMenuElement(title="Grid 3x3"),
                QuickMenuElement(title="Grid 4x4")
            ]

        class ViewMenu(QuickMenu):
            title = "View"
            elements = [QuickMenuElement(title="Camera List"), GridMenu]

        self.filemenu = FileMenu(parent=self)
        self.viewmenu = ViewMenu(parent=self)

        # the attributes were autogenerated:
        self.filemenu.exit.triggered.connect(self.exit_slot)
        self.viewmenu.video_grid.grid_1x1.triggered.connect(self.grid1x1_slot)
예제 #15
0
    def makeWidget(self):
        super().makeWidget()
        i = self.lay.count()
        self.info_label = QtWidgets.QLabel(
            ("Cameralists and services are reinitiated\n"
             "once you save & close this window\n"), self.widget)
        self.lay.insertWidget(i, self.info_label)

        # give a signal thats emitted once discovery has modified the camera list
        self.discovery_win = QCapsulate(
            DiscoveryWidget(sig=self.signals.modified), "Camera Discovery")
        self.discovery_win.hide()
        self.discovery_button = QtWidgets.QPushButton("Camera Search",
                                                      self.widget)
        self.discovery_button.clicked.connect(self.discovery_slot)
        self.lay.insertWidget(i + 1, self.discovery_button)
예제 #16
0
def main():
    from valkka.live.local import ValkkaLocalDir
    singleton.logs_dir = ValkkaLocalDir("live", "logs")
    singleton.ipc_dir = ValkkaLocalDir("live", "ipc")
    app = QtWidgets.QApplication(["test_app"])
    mg = MyGui()
    mg.show()
    app.exec_()
예제 #17
0
def main():
  app=QtWidgets.QApplication(["test_app"])
  # mg=MyGui()
  # mg.show()
  mg=CopyToDialog("192.168.1.24", slot=4, max_slot=10)
  lis=mg.exec_()
  for l in lis:
      print(l)
예제 #18
0
 def __init__(self, def_pixmap=None, parent=None):
     QtWidgets.QWidget.__init__(self, parent)
     self.signals = self.Signals()
     self.pre = "SimpleVideoWidget : "
     self.lay = QtWidgets.QVBoxLayout(self)
     self.canvas = LineCrossingCanvasWidget(self.signals,
                                            def_pixmap,
                                            parent=self)
     self.lay.addWidget(self.canvas)
예제 #19
0
    def makeWidget(self):
        super().makeWidget()

        self.button_row = QtWidgets.QWidget(self.widget)
        self.button_lay = QtWidgets.QHBoxLayout(self.button_row)
        self.lay.addWidget(self.button_row)

        self.reset_button = QtWidgets.QPushButton("Reset", self.button_row)
        self.save_button = QtWidgets.QPushButton("Save", self.button_row)
        self.button_lay.addWidget(self.reset_button)
        self.button_lay.addWidget(self.save_button)

        self.info_label = QtWidgets.QLabel(
            "Saving restarts all Valkka services", self.widget)
        self.lay.addWidget(self.info_label)

        self.reset_button.clicked.connect(self.row_instance.clear)
        self.save_button.clicked.connect(self.save_slot)
예제 #20
0
    def makeWidget(self):
        """Subclassed from Row : custom form.  Add a total disk space field.
        """
        self.widget = FormWidget()
        self.lay = QtWidgets.QGridLayout(self.widget)

        cc = 0
        # self.placeWidget(cc, "record"); cc+=1
        self.placeWidget(cc, "blocksize")
        cc += 1
        self.placeWidget(cc, "n_blocks")
        cc += 1

        self.label_total_size = QtWidgets.QLabel("Total Size (MB)",
                                                 self.widget)
        self.label_total_size_value = QtWidgets.QLabel("", self.widget)
        self.placeWidgetPair(
            cc, (self.label_total_size, self.label_total_size_value))
        cc += 1

        #self.placeWidget(cc, "fs_flavor"); cc+=1
        #self.placeWidget(cc, "partition_uuid"); cc+=1

        self.connectNotifications()

        def fs_size_changed():
            total_size_mb = self["blocksize"].getValue(
            ) * self["n_blocks"].getValue()
            self.label_total_size_value.setText(str(total_size_mb))

        """
        def block_device_slot():
            self["partition_uuid"].updateWidget()
            n_devs = self["partition_uuid"].widget.count() # QComboBox.count()
            if n_devs < 1:
                self["fs_flavor"]["file"].setChecked(True)
        """
        self["blocksize"].widget.valueChanged.connect(fs_size_changed)
        self["n_blocks"].widget.valueChanged.connect(fs_size_changed)
        # self["fs_flavor"]["valkkafs"].clicked.connect(block_device_slot)

        fs_size_changed()
        # block_device_slot()
        """
예제 #21
0
    def __init__(self, parent=None):
        """
        :param parent:  Where this menu will be placed
        """
        if (issubclass(parent.__class__, QtWidgets.QMainWindow)
            ):  # i.e. the current menu will be placed in the main menu bar
            self.menu = parent.menuBar().addMenu(self.title)
        elif (parent is None):  # this is a popup menu
            self.menu = QtWidgets.QMenu()
        else:  # a submenu
            # print("QuickMenu: submenu")
            assert (issubclass(parent.__class__, QtWidgets.QMenu))
            self.menu = parent.addMenu(self.title)

        for element in self.elements:
            # print("QuickMenu :",element)
            if (isinstance(element, QuickMenuElement)):
                # create menu entry / action, and find the callback / slot if defined
                # If name in EasyMenuElement was "Open File", create a
                # method_name that is "open_file"
                if (element.method_name is None):
                    method_name = element.getTitle().lower().replace(
                        " ", "_").strip(
                        )  # title is converted into an attribute name
                else:
                    method_name = element.method_name
                # self.open_file =QMenu.addAction("Open File")
                setattr(self, method_name,
                        self.menu.addAction(element.getTitle()))
                # print("QuickMenu: method_name", method_name)
                # now we have "self.method_name" .. lets refer to it as
                # "method"
                method = getattr(self, method_name)
                """ # connect automatically to instances methods .. not really useful
        # callback functions name: self.open_file_called
        cbname = method_name + "_called"
        if (hasattr(self, cbname)):
          # if self.open_file_called exists, make connection: self.open_file.triggered.connect(self.open_file_called)
          method.triggered.connect(getattr(self, cbname))
        """
            elif (isinstance(element, QuickMenuSection)):
                self.menu.addSection(element.title)
            # recursion: this is a subclass of MyMenu.  We instantiate it here
            elif (issubclass(element, QuickMenu)):
                # this constructor called for another subclass of QuickMenu
                submenu = element(parent=self.menu)
                submenu_title = element.title.lower().replace(
                    " ",
                    "_").strip()  # title is converted into an attribute name
                # now we can access menus hierarchically:
                # menu.submenu.subsubmenu.etc
                setattr(self, submenu_title, submenu)
            else:  # must be an EasyMenuElement instance
                raise (AssertionError(
                    "Use QuickMenu subclasses or QuickMenuElement instances"))
예제 #22
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = QOnvifThread(user="******",
                                   password="******",
                                   ip="192.168.0.134")

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.thread.start()
예제 #23
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 800, 800))

        self.valkkafs = ValkkaSingleFS.loadFromDirectory(
            dirname="/home/sampsa/tmp/testvalkkafs")
        self.manager = ValkkaFSManager(self.valkkafs)
        self.manager.setOutput_(925412, 1)  # id => slot

        gpu_handler = GPUHandler()

        pvc = PlayVideoContainerNxM(n_dim=3,
                                    m_dim=3,
                                    valkkafsmanager=self.manager,
                                    gpu_handler=gpu_handler,
                                    filterchain_group=None)

        # dummy window
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)
예제 #24
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = IPCQThread(
            "/tmp/test-socket.ipc"
        )

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.thread.start()
예제 #25
0
 def getWidget(self):
     """Some ideas for your widget:
     - Textual information (alert, license place number)
     - Check boxes : if checked, send e-mail to your mom when the analyzer spots something
     - .. or send an sms to yourself
     - You can include the cv2.imshow window to the widget to see how the analyzer proceeds
     """
     self.widget = QtWidgets.QTextEdit()
     self.widget.setStyleSheet(style.detector_test)
     self.widget.setReadOnly(True)
     self.signals.objects.connect(self.objects_slot)
     return self.widget
예제 #26
0
 def getWidget(self):
     """Some ideas for your widget:
     - Textual information (alert, license place number)
     - Check boxes : if checked, send e-mail to your mom when the analyzer spots something
     - .. or send an sms to yourself
     - You can include the cv2.imshow window to the widget to see how the analyzer proceeds
     """
     widget = QtWidgets.QLabel("nada de nada")
     # widget.setStyleSheet(style.detector_test)
     #self.signals.start_move.connect(lambda : widget.setText("MOVEMENT START"))
     #self.signals.stop_move. connect(lambda : widget.setText("MOVEMENT STOP"))
     return widget
예제 #27
0
def main():
    parsed_args, unparsed_args = process_cl_args()

    #print(parsed_args, unparsed_args)
    #return

    #"""
    if len(unparsed_args) > 0:
        print("Unknown command-line argument", unparsed_args[0])
        return
    #"""

    if parsed_args.quiet:
        # core.setLogLevel_valkkafslogger(loglevel_debug)
        print("libValkka verbosity set to fatal messages only")
        core.fatal_log_all()

    if parsed_args.reset:
        singleton.config_dir.reMake()

    if parsed_args.playback:
        singleton.use_playback = True
    else:
        singleton.use_playback = False

    if parsed_args.load:
        singleton.load_layout = True
    else:
        singleton.load_layout = False

    if parsed_args.www:
        singleton.start_www = True
        singleton.www_module = web
    else:
        singleton.start_www = False

    #print(singleton.start_www)
    #return

    from valkka.live.gui import MyGui as MyGuiBase

    class MyGui(MyGuiBase):
        def __init__(self, parent=None):
            print("\n*** Welcome to Valkka Live ***\n")
            super().__init__(parent)

    setproctitle("valkka-live")
    app = QtWidgets.QApplication(["Valkka Live"])
    mg = MyGui()
    mg.show()
    app.exec_()
예제 #28
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        self.filemenu = FileMenu(parent=self)
        self.viewmenu = ViewMenu(parent=self)
        self.configmenu = ConfigMenu(parent=self)
        self.aboutmenu = AboutMenu(parent=self)

        self.filemenu.exit.triggered.connect(self.exit_slot)

        self.viewmenu.video_grid.grid_1x1.triggered.connect(self.grid1x1_slot)
예제 #29
0
def QCapsulate(widget, name, blocking = False, nude = False):
    """Helper function that encapsulates QWidget into a QMainWindow
    """

    class QuickWindow(QtWidgets.QMainWindow):

        class Signals(QtCore.QObject):
            close = Signal()
            show  = Signal()

        def __init__(self, blocking = False, parent = None, nude = False):
            super().__init__(parent)
            self.propagate = True # send signals or not
            self.setStyleSheet(style.main_gui)
            if (blocking):
                self.setWindowModality(QtCore.Qt.ApplicationModal)
            if (nude):
                # http://doc.qt.io/qt-5/qt.html#WindowType-enum
                # TODO: create a widget for a proper splashscreen (omitting X11 and centering manually)
                # self.setWindowFlags(QtCore.Qt.Popup) # Qt 5.9+ : setFlags()
                # self.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
                self.setWindowFlags(QtCore.Qt.Dialog)
            self.signals = self.Signals()
            

        def closeEvent(self, e):
            if (self.propagate):
                self.signals.close.emit()
            e.accept()
            
        def showEvent(self, e):
            if (self.propagate):
                self.signals.show.emit()
            e.accept()
            
        def setPropagate(self):
            self.propagate = True
            
        def unSetPropagate(self):
            self.propagate = False
            
        def getWidget(self):
            return self.centralWidget() 


    win = QuickWindow(blocking = blocking, nude = nude)
    win.setCentralWidget(widget)
    win.setLayout(QtWidgets.QHBoxLayout())
    win.setWindowTitle(name)
    return win
예제 #30
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = WWWQThread(singleton.ipc_dir.getFile("pyramid.ipc"),
                                 inspect.currentframe())
        self.ws_thread = WebSocketThread(singleton.ipc_dir.getFile("ws.ipc"))

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.ws_thread.signals.base.connect(self.ws_message)

        self.thread.start()
        time.sleep(1)
        self.ws_thread.start()