我正在研究PyQT应用程序,并且我不得不尝试在其框架中实现CV类。这是带有问题的类,以及错误发生的地方。
self.signal.emit(qt_image)
AttributeError: 'bool' object has no attribute 'signal'
Abort trap: 6
我收到错误:
class VidViewer(QWidget):
def __init__(self):
super().__init__()
self.layout = QGridLayout()
self.image = QImage()
self.initUI()
def paintEvent(self, _):
print("paint image")
painter = QPainter(self)
painter.drawImage(0, 0, self.image)
self.paintImage = QImage()
def initUI(self):
print("INIT UI")
#image = self.image
self.push_button = QPushButton("Start")
self.push_button.clicked.connect(ShowVid.startVideo)
self.layout.addWidget(self.push_button, 0, 0,1,1)
self.setLayout(self.layout)
self.setWindowTitle('Test')
self.show()
@pyqtSlot(QImage)
def setImage(self, image):
self.image = image
self.paintEvent()
class Main(QMainWindow):
def __init__(self):
super().__init__()
self.central_widget = QStackedWidget()
self.setCentralWidget(self.central_widget)
self.viewer = VidViewer()
self.vid = ShowVid()
self.central_widget.addWidget(self.viewer)
self.central_widget.setCurrentWidget(self.viewer)
self.vid.signal.connect(self.viewer.setImage)
self.setGeometry(10,10,1280,720)
self.setFixedSize(1280,720)
app = QApplication(sys.argv)
run = Main()
run.show()
sys.exit(app.exec_())
使用Main和VidViewer类中的代码进行更新。 VidViewer类使用相机捕获的帧绘制图像。帧由setImage槽刷新。主类使用布局构建窗口小部件并运行应用程序。
[ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.9.5:generate (default) on project myproject-db-model: Execution default of goal org.jooq:jooq-codegen-maven:3.9.5:generate failed: A required class was missing while executing org.jooq:jooq-codegen-maven:3.9.5:generate: javax/xml/bind/JAXB
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jooq:jooq-codegen-maven:3.9.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-codegen-maven/3.9.5/jooq-codegen-maven-3.9.5.jar
[ERROR] urls[1] = file:/Users/jeanvaljean/.m2/repository/org/postgresql/postgresql/42.1.1/postgresql-42.1.1.jar
[ERROR] urls[2] = file:/Users/jeanvaljean/Workspace/MyProjects/myproject/model/dbms-strategies/target/myproject-dbms-strategies-0.2.0-SNAPSHOT.jar
[ERROR] urls[3] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.5.7.RELEASE/spring-boot-starter-data-jpa-1.5.7.RELEASE.jar
[ERROR] urls[4] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter/1.5.7.RELEASE/spring-boot-starter-1.5.7.RELEASE.jar
[ERROR] urls[5] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot/1.5.7.RELEASE/spring-boot-1.5.7.RELEASE.jar
[ERROR] urls[6] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.7.RELEASE/spring-boot-autoconfigure-1.5.7.RELEASE.jar
[ERROR] urls[7] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.5.7.RELEASE/spring-boot-starter-logging-1.5.7.RELEASE.jar
[ERROR] urls[8] = file:/Users/jeanvaljean/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar
[ERROR] urls[9] = file:/Users/jeanvaljean/.m2/repository/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar
[ERROR] urls[10] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar
[ERROR] urls[11] = file:/Users/jeanvaljean/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar
[ERROR] urls[12] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.5.7.RELEASE/spring-boot-starter-aop-1.5.7.RELEASE.jar
[ERROR] urls[13] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-aop/4.3.11.RELEASE/spring-aop-4.3.11.RELEASE.jar
[ERROR] urls[14] = file:/Users/jeanvaljean/.m2/repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar
[ERROR] urls[15] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.5.7.RELEASE/spring-boot-starter-jdbc-1.5.7.RELEASE.jar
[ERROR] urls[16] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.5.20/tomcat-jdbc-8.5.20.jar
[ERROR] urls[17] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/tomcat-juli/8.5.20/tomcat-juli-8.5.20.jar
[ERROR] urls[18] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-jdbc/4.3.11.RELEASE/spring-jdbc-4.3.11.RELEASE.jar
[ERROR] urls[19] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-core/5.0.12.Final/hibernate-core-5.0.12.Final.jar
[ERROR] urls[20] = file:/Users/jeanvaljean/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar
[ERROR] urls[21] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar
[ERROR] urls[22] = file:/Users/jeanvaljean/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
[ERROR] urls[23] = file:/Users/jeanvaljean/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar
[ERROR] urls[24] = file:/Users/jeanvaljean/.m2/repository/org/jboss/jandex/2.0.0.Final/jandex-2.0.0.Final.jar
[ERROR] urls[25] = file:/Users/jeanvaljean/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[ERROR] urls[26] = file:/Users/jeanvaljean/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
[ERROR] urls[27] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar
[ERROR] urls[28] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-entitymanager/5.0.12.Final/hibernate-entitymanager-5.0.12.Final.jar
[ERROR] urls[29] = file:/Users/jeanvaljean/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] urls[30] = file:/Users/jeanvaljean/.m2/repository/org/springframework/data/spring-data-jpa/1.11.7.RELEASE/spring-data-jpa-1.11.7.RELEASE.jar
[ERROR] urls[31] = file:/Users/jeanvaljean/.m2/repository/org/springframework/data/spring-data-commons/1.13.7.RELEASE/spring-data-commons-1.13.7.RELEASE.jar
[ERROR] urls[32] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-orm/4.3.11.RELEASE/spring-orm-4.3.11.RELEASE.jar
[ERROR] urls[33] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-context/4.3.11.RELEASE/spring-context-4.3.11.RELEASE.jar
[ERROR] urls[34] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-tx/4.3.11.RELEASE/spring-tx-4.3.11.RELEASE.jar
[ERROR] urls[35] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-beans/4.3.11.RELEASE/spring-beans-4.3.11.RELEASE.jar
[ERROR] urls[36] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-aspects/4.3.11.RELEASE/spring-aspects-4.3.11.RELEASE.jar
[ERROR] urls[37] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq/3.9.5/jooq-3.9.5.jar
[ERROR] urls[38] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-meta/3.9.5/jooq-meta-3.9.5.jar
[ERROR] urls[39] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter-hystrix/1.1.5.RELEASE/spring-cloud-starter-hystrix-1.1.5.RELEASE.jar
[ERROR] urls[40] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.1.RELEASE/spring-cloud-starter-1.1.1.RELEASE.jar
[ERROR] urls[41] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.1.RELEASE/spring-cloud-context-1.1.1.RELEASE.jar
[ERROR] urls[42] = file:/Users/jeanvaljean/.m2/repository/org/springframework/security/spring-security-crypto/4.0.4.RELEASE/spring-security-crypto-4.0.4.RELEASE.jar
[ERROR] urls[43] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.1.RELEASE/spring-cloud-commons-1.1.1.RELEASE.jar
[ERROR] urls[44] = file:/Users/jeanvaljean/.m2/repository/org/springframework/security/spring-security-rsa/1.0.1.RELEASE/spring-security-rsa-1.0.1.RELEASE.jar
[ERROR] urls[45] = file:/Users/jeanvaljean/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47.jar
[ERROR] urls[46] = file:/Users/jeanvaljean/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar
[ERROR] urls[47] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.5.RELEASE/spring-cloud-netflix-core-1.1.5.RELEASE.jar
[ERROR] urls[48] = file:/Users/jeanvaljean/.m2/repository/org/springframework/cloud/spring-cloud-starter-archaius/1.1.5.RELEASE/spring-cloud-starter-archaius-1.1.5.RELEASE.jar
[ERROR] urls[49] = file:/Users/jeanvaljean/.m2/repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar
[ERROR] urls[50] = file:/Users/jeanvaljean/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar
[ERROR] urls[51] = file:/Users/jeanvaljean/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[52] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.3/hystrix-core-1.5.3.jar
[ERROR] urls[53] = file:/Users/jeanvaljean/.m2/repository/io/reactivex/rxjava/1.1.1/rxjava-1.1.1.jar
[ERROR] urls[54] = file:/Users/jeanvaljean/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.7/HdrHistogram-2.1.7.jar
[ERROR] urls[55] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.3/hystrix-metrics-event-stream-1.5.3.jar
[ERROR] urls[56] = file:/Users/jeanvaljean/.m2/repository/com/netflix/hystrix/hystrix-javanica/1.5.3/hystrix-javanica-1.5.3.jar
[ERROR] urls[57] = file:/Users/jeanvaljean/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
[ERROR] urls[58] = file:/Users/jeanvaljean/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
[ERROR] urls[59] = file:/Users/jeanvaljean/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
[ERROR] urls[60] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.5.7.RELEASE/spring-boot-starter-web-1.5.7.RELEASE.jar
[ERROR] urls[61] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.5.7.RELEASE/spring-boot-starter-tomcat-1.5.7.RELEASE.jar
[ERROR] urls[62] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.20/tomcat-embed-core-8.5.20.jar
[ERROR] urls[63] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.20/tomcat-embed-el-8.5.20.jar
[ERROR] urls[64] = file:/Users/jeanvaljean/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.20/tomcat-embed-websocket-8.5.20.jar
[ERROR] urls[65] = file:/Users/jeanvaljean/.m2/repository/org/hibernate/hibernate-validator/5.3.5.Final/hibernate-validator-5.3.5.Final.jar
[ERROR] urls[66] = file:/Users/jeanvaljean/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar
[ERROR] urls[67] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar
[ERROR] urls[68] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-web/4.3.11.RELEASE/spring-web-4.3.11.RELEASE.jar
[ERROR] urls[69] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-webmvc/4.3.11.RELEASE/spring-webmvc-4.3.11.RELEASE.jar
[ERROR] urls[70] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-expression/4.3.11.RELEASE/spring-expression-4.3.11.RELEASE.jar
[ERROR] urls[71] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.5.7.RELEASE/spring-boot-starter-actuator-1.5.7.RELEASE.jar
[ERROR] urls[72] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-actuator/1.5.7.RELEASE/spring-boot-actuator-1.5.7.RELEASE.jar
[ERROR] urls[73] = file:/Users/jeanvaljean/.m2/repository/org/springframework/retry/spring-retry/1.2.1.RELEASE/spring-retry-1.2.1.RELEASE.jar
[ERROR] urls[74] = file:/Users/jeanvaljean/.m2/repository/org/springframework/spring-core/4.3.9.RELEASE/spring-core-4.3.9.RELEASE.jar
[ERROR] urls[75] = file:/Users/jeanvaljean/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[76] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.10/jackson-databind-2.8.10.jar
[ERROR] urls[77] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar
[ERROR] urls[78] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.10/jackson-core-2.8.10.jar
[ERROR] urls[79] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.8.10/jackson-datatype-jdk8-2.8.10.jar
[ERROR] urls[80] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.8.10/jackson-datatype-jsr310-2.8.10.jar
[ERROR] urls[81] = file:/Users/jeanvaljean/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr353/2.8.10/jackson-datatype-jsr353-2.8.10.jar
[ERROR] urls[82] = file:/Users/jeanvaljean/.m2/repository/org/glassfish/javax.json/1.1/javax.json-1.1.jar
[ERROR] urls[83] = file:/Users/jeanvaljean/.m2/repository/javax/json/javax.json-api/1.1/javax.json-api-1.1.jar
[ERROR] urls[84] = file:/Users/jeanvaljean/.m2/repository/com/google/code/gson/gson/2.8.1/gson-2.8.1.jar
[ERROR] urls[85] = file:/Users/jeanvaljean/.m2/repository/com/jayway/jsonpath/json-path/2.2.0/json-path-2.2.0.jar
[ERROR] urls[86] = file:/Users/jeanvaljean/.m2/repository/net/minidev/json-smart/2.2.1/json-smart-2.2.1.jar
[ERROR] urls[87] = file:/Users/jeanvaljean/.m2/repository/net/minidev/accessors-smart/1.1/accessors-smart-1.1.jar
[ERROR] urls[88] = file:/Users/jeanvaljean/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/1.5.7.RELEASE/spring-boot-starter-log4j2-1.5.7.RELEASE.jar
[ERROR] urls[89] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar
[ERROR] urls[90] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-api/2.7/log4j-api-2.7.jar
[ERROR] urls[91] = file:/Users/jeanvaljean/.m2/repository/org/apache/logging/log4j/log4j-core/2.7/log4j-core-2.7.jar
[ERROR] urls[92] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar
[ERROR] urls[93] = file:/Users/jeanvaljean/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar
[ERROR] urls[94] = file:/Users/jeanvaljean/.m2/repository/com/javax0/immutator/1.0.1/immutator-1.0.1.jar
[ERROR] urls[95] = file:/Users/jeanvaljean/.m2/repository/com/javax0/djcproxy/2.0.3/djcproxy-2.0.3.jar
[ERROR] urls[96] = file:/Users/jeanvaljean/.m2/repository/com/javax0/jscc/1.0.1/jscc-1.0.1.jar
[ERROR] urls[97] = file:/Users/jeanvaljean/.m2/repository/com/javax0/jscglib/1.0.1/jscglib-1.0.1.jar
[ERROR] urls[98] = file:/Users/jeanvaljean/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
[ERROR] urls[99] = file:/Users/jeanvaljean/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar
[ERROR] urls[100] = file:/Users/jeanvaljean/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar
[ERROR] urls[101] = file:/Users/jeanvaljean/.m2/repository/com/google/guava/guava/22.0/guava-22.0.jar
[ERROR] urls[102] = file:/Users/jeanvaljean/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
[ERROR] urls[103] = file:/Users/jeanvaljean/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar
[ERROR] urls[104] = file:/Users/jeanvaljean/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[105] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[ERROR] urls[106] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jool/0.9.12/jool-0.9.12.jar
[ERROR] urls[107] = file:/Users/jeanvaljean/.m2/repository/org/jooq/joor/0.9.6/joor-0.9.6.jar
[ERROR] urls[108] = file:/Users/jeanvaljean/.m2/repository/com/github/ben-manes/caffeine/caffeine/2.3.5/caffeine-2.3.5.jar
[ERROR] urls[109] = file:/Users/jeanvaljean/.m2/repository/org/jooq/jooq-codegen/3.9.5/jooq-codegen-3.9.5.jar
[ERROR] urls[110] = file:/Users/jeanvaljean/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[111] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[112] = file:/Users/jeanvaljean/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
[ERROR] urls[113] = file:/Users/jeanvaljean/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: javax.xml.bind.JAXB