Skip to content

Commit 547d122

Browse files
authored
Merge pull request #6 from galou/master
Fix eval-file-pyqt5-set-value
2 parents 352de41 + 4454f8d commit 547d122

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

eval-file-pyqt5-set-value/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.4)
22
project(scripting)
33

4-
set(PYBIND11_PYTHON_VERSION 3.7)
4+
set(PYBIND11_PYTHON_VERSION 3)
55

66
find_package(pybind11 CONFIG)
77

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import sys
2-
3-
def get_the_value(locals):
1+
def get_the_value(locals_):
42
from PyQt5.QtWidgets import QInputDialog
5-
num,ok = QInputDialog.getInt(None, "The number to be set", "enter a number")
3+
num, ok = QInputDialog.getInt(None, 'The number to be set', 'enter a number')
64
if ok:
7-
locals["set_the_answer"](num)
8-
set_the_answer(num)
5+
locals['set_the_answer'](num)
96

107
if __name__ == '__main__':
118
from PyQt5.QtWidgets import QApplication
12-
# app = QApplication(sys.argv)
139
app = QApplication(['myname'])
1410
get_the_value(locals())

eval-file-pyqt5-set-value/src/main.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33

44
namespace py = pybind11;
55

6-
class Dog
7-
{
8-
public:
9-
void setName(std::string n) { name = n; }
10-
std::string getName() { return name; }
11-
private:
12-
std::string name;
13-
};
14-
156
int main()
167
{
178
py::scoped_interpreter guard{};

0 commit comments

Comments
 (0)