[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Error C2146 at nmake
From:       Mamoru Inugami <inugami.mamoru () gmail ! com>
Date:       2020-01-31 2:51:54
Message-ID: CAN895Wjs=r_YEEFCDUcgoPcesbJFy_NXcQ2dGp0f=Z06xqFj2g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

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


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic