2018年11月16日 星期五

(轉貼)windows 10 firewall keeps turning itself ON how to stop it

Hello sosolola

You can disable the Windows Firewall from the Services window. To do so:

> In the Cortana search bar, type SERVICES.MSC.

> Click the Services option that appears in the suggestion list.

> From the opened Services window, from the right pane, double-click the Windows Firewallservice.

> On the Windows Firewall Properties box, ensure that you are on the General tab.

> Click the Stop button from under the Service status label and click Apply. (Accept any prompt or confirmation that/if appears to stop any dependencies.)

> After this, choose Disabled from the Startup type drop-down list and click Apply again.

> Click OK and close all the opened boxes.

> Restart the computer and see if this keeps Windows Firewall from turning on automatically.

Also, here you can find a few other methods to turn Windows Firewall off. You may want to give them a try if the above solution doesn't work for you.

Ref: http://www.tomshardware.com/forum/id-2977635/windows-firewall-turning-stop.html

2018年11月11日 星期日

Pyqt5, Signal有分Unbound and Bound Signals

A bound signal has connect()disconnect() and emit() methods that implement the associated functionality.

New signals should only be defined in sub-classes of QObject.They must be part of the class definition and cannot be dynamically added as class attributes after the class has been defined.

==>
在PyQt5中,
class QTd(QtCore.QThread):
    msig = QtCore.pyqtSignal(str, str)
    psig = QtCore.pyqtSignal(QtWidgets.QPushButton, bool)

    def __init__(self, fi, table, pbutton, sbox, parent = None):
        super().__init__(parent)
        self.fi = fi
        self.table = table
        self.pbutton = pbutton
        self.sbox = sbox
        self.msig.connect(self.showmbox)
        self.psig.connect(self.setpb)

==>
msig和psig是class variable, 
self.fi, self.table, self.pbutton, self.sbox是instance variable,
在此msig和psig是bound signal, 
(<class 'PyQt5.QtCore.pyqtBoundSignal'>)
如果宣告在class QTd的__init__底下,變成
self.msig = QtCore.pyqtSignal(str, str)
self.psig = QtCore.pyqtSignal(QtWidgets.QPushButton, bool)

那麼self.msig和self.psig就變成unbound signal, 
(<class 'PyQt5.QtCore.pyqtSignal'>)
unbound signal就沒有connect() method了。

詳參:

2018年11月10日 星期六

PyQt5, different thread可能解法

如果在QThread裡要更新Qt GUI的元件,正規方法是使用Signal,才不會出現different thread的錯誤,以下是使用signal的步驟:
1.  sig = QtCore.pyqtSignal()
2.  sig.connect(func)
3.  sig.emit()

但要注意,如果把整個程式連接到Signal, 例如叫做sig_all, 並把sig_all.emt放到QThread的run裡面,將不會有一直更新的效果。一般要正常,是把整個function放到QThread的run裡面,而function裡面再用Signal,才會正常。

詳參: