         didSet { self.setNeedsDisplay() }
     }
     public var source: QImageSource? {
-        willSet {
-            if self.isDownloading == true {
-                if let loader = self.loader {
-                    loader.cancel(self)
-                }
-            }
-            self.isDownloading = false
-        }
+        willSet { self.stopDownloading() }
         didSet {
             if let source = self.source {
                 if let image = source.image {

        self.verticalAlignment = .center
        self.horizontalAlignment = .center
        self.source = source

        super.init()
    }


        self.frame = frame
    }

    open func startDownloading() {
        if self.isDownloading == false {
            if let source = self.source, let loader = self.loader, let url = source.url {
                loader.download(url, filter: self.filter, target: self)
                self.isDownloading = true
            }
        }
    }

    open func stopDownloading() {
        if self.isDownloading == true {
            if let loader = self.loader {
                loader.cancel(self)
            }
            self.isDownloading = false
        }
    }

    open func imageLoader(_ imageLoader: QImageLoader, cacheImage: UIImage) {
        self.image = cacheImage
        self.isDownloading = false
