[PyQt] Error C2146 at nmake
Mamoru Inugami
inugami.mamoru at gmail.com
Fri Jan 31 02:51:54 GMT 2020
Dear list.
I am still encountering build errors.
Now I could run pyqt-build and qmake, but nmake failed error as shown below
.
xmlparse.c
C:\Program Files (x86)\Windows
Kits\10\include\10.0.18362.0\um\winuser.h(4383): error C2146: 構文エラー: ')'
が、識別子 'lpwcx' の前に必要です。
.
(Sorry, Japanese error message is included)
I have updated pyqtdeploy-2.4.1.dev2001291106 and pip list shows this.
byqt-build.pyqt-demo.py works perfectly and I could execute pyqt-demo.exe.
I add my python code for help.
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import time
import random
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.figure import Figure
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(500, 300)
MainWindow.setMaximumSize(QtCore.QSize(500, 300))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(60, 110, 75, 23))
self.pushButton.setObjectName("pushButton")
self.graphicsView = QtWidgets.QGraphicsView(self.centralwidget)
self.graphicsView.setGeometry(QtCore.QRect(190, 20, 300, 250))
self.graphicsView.setObjectName("graphicsView")
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_2.setGeometry(QtCore.QRect(60, 170, 75, 23))
self.pushButton_2.setObjectName("pushButton_2")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 500, 21))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.graphicsView = QtWidgets.QVBoxLayout(self.graphicsView)
self.canvas = FigureCanvas(Figure())
self.graphicsView.addWidget(self.canvas)
self.ax = self.canvas.figure.subplots()
self.canvas.figure.subplots_adjust(0.15,0.15)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.pushButton.setText(_translate("MainWindow", "ON"))
self.pushButton_2.setText(_translate("MainWindow", "OFF"))
self.pushButton.pressed.connect(start)
self.pushButton_2.pressed.connect(stop)
class Thread(QtCore.QThread):
def __init__(self):
QtCore.QThread.__init__(self)
def run(self):
ptime = []
value = []
ui.ax.clear()
now = time.time()
while True:
time.sleep(1)
data = str(random.random())
process_time = time.time()-now
ptime.append(process_time)
value.append(float(data))
ui.ax.plot(ptime, value, color = 'black')
ui.ax.figure.canvas.draw()
def start():
ui.th=Thread()
ui.th.start()
def stop():
ui.th.terminate()
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
Michiaki ENDO
Sapporo, Hokkaido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200131/aa516de8/attachment.html>
More information about the PyQt
mailing list