!NrxVElNJCZavzUPyDz:matrix.org

Qt for Python

116 Members
Qt for Python (PySide2), more information in https://pyside.org22 Servers

Load older messages


SenderMessageTime
2 Jul 2020
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> str(PosixPath) will give you the path as a string 06:32:52
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> also has a .as_uri() method. Would be great for QUrl to support PathLike stuff. 06:40:47
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> xrogaan: but QUrl("/some/path") doesn't make sense 08:39:38
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> it doesn't? 08:39:55
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> most likely it doesn't, no 08:40:21
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> PosixPath.as_uri() returns file:///some/path 08:40:25
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> yes, which is different from QUrl("/some/path"), it's what you'd get from QUrl.fromPath("/some/path") 08:40:53
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> QUrl taking a path object and then doing something entirely different than what it does when called with a string seems like quite a bit of magic 08:41:21
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> sorry, .fromLocalFile, not .fromPath 08:42:35
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> what you'd want right now is probably either QUrl.fromLocalFile(str(path)) or QUrl(path.as_uri()) - I guess it'd make some sense for QUrl.fromLocalFile to take a pathlib.Path 08:43:11
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> Or no QUrl at all, redundant. 08:58:55
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <The-Compiler> depends on what you want to do with it afterwards - IMHO it makes a lot of sense to have a class for URLs rather than having them as strings (just like it makes sense to have a class for paths instead of strings) 10:05:40
@gitter_manpython:matrix.orgMan Python (Gitter) joined the room.13:00:37
@gitter_manpython:matrix.orgMan Python (Gitter)

self.ui.tableWidget_x.clicked.connect(self.on_tableWidget_clicked)
self.ui.tableWidget_y.clicked.connect(self.on_tableWidget_clicked)

def on_tableWidget_clicked(self, index):
print(index.row()," - ", index.data(), " - ", "widget_name", widget_name)

13:00:38
@gitter_manpython:matrix.orgMan Python (Gitter) Want sent information about x and y in this same function - is this possible in some simplest way as possible?13:00:58
@gitter_manpython:matrix.orgMan Python (Gitter)eg. self.on_tableWidget_clicked(widget_name)13:01:17
@gitter_manpython:matrix.orgMan Python (Gitter)I have problem with usage on this with lambda13:01:44
@gitter_manpython:matrix.orgMan Python (Gitter) (edited) I have problem with usage on this with lambda => self.ui.tableWidget_x.clicked.connect(self.on_tableWidget_clicked) self.ui.tableWidget_y.clicked.connect(self.on_tableWidget_clicked) def on_tableWidget_clicked(self, index): print(index.row()," - ", index.data(), " - ", "widget_name", widget_name) 13:20:19
@gitter_manpython:matrix.orgMan Python (Gitter)Should bu like this:13:20:20
@gitter_manpython:matrix.orgMan Python (Gitter) (edited) Should bu like this: => self.ui.tableWidget_x.clicked.connect(self.on_tableWidget_clicked) self.ui.tableWidget_y.clicked.connect(self.on_tableWidget_clicked) def on_tableWidget_clicked(self, index): print(index.row()," - ", index.data(), " - ", "widget_name", widget_name) 13:20:23
@gitter_manpython:matrix.orgMan Python (Gitter) self.ui.tableWidget_x.clicked.connect(lambda x: self.on_tableWidget_clicked (x, "widget_name")) 13:20:24
@gitter_manpython:matrix.orgMan Python (Gitter) (edited) self.ui.tableWidget_x.clicked.connect(lambda x: self.on_tableWidget_clicked (x, "widget_name")) => I have problem with usage on this with lambda 13:21:55
@gitter_manpython:matrix.orgMan Python (Gitter)The problem is coz declaration lambda not sending index, hvr any var is not recevied by function13:21:55
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <z41nt> I'd say that's an antipattern, and a known issue. https://bugreports.qt.io/browse/PYSIDE-909 13:41:01
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <z41nt> you can always connect the clicked to a method called "update_values' and there you obtain the new value from X and Y, depending on where you have those. 13:41:21
@gitter_manpython:matrix.orgMan Python (Gitter) Thx for show this issue. But I'm still not sure about correct solution for this problem (I need do this for 20 widgets ;/ ) 13:54:38
@gitter_cmaureir:matrix.orgCristián Maureira-Fredes (Gitter)if 20 widgets have the same method, why not using a base widget with that signal/slot so the 20 inherit that mechanism14:43:23
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <altendky> xrogaan: The-Compiler: side note, to get a string from a path-like there's os.fspath(). for pathlib it does the same thing afaik but it is the actual protocol. 14:46:36
@gitter_fromirc:matrix.orgFrom IRC (bridge bot) (Gitter) <xrogaan> PathLike is a little bit more specific as to what the data is. If you get such object, you know it's supposed to be a path. 14:52:03
@alexandros:asra.gralexandros 19:02:42

There are no newer messages yet.


Back to Room List