#pyqt | Logs for 2018-09-04

Back
[01:01:18] -!- mandeep has quit [Ping timeout: 245 seconds]
[01:30:36] -!- pwood22 has joined #pyqt
[01:32:20] -!- pwood22 has quit [Client Quit]
[02:40:05] -!- anqxyr has joined #pyqt
[02:50:38] -!- kallesbar has joined #pyqt
[03:25:46] -!- kallesbar has quit [Quit: Konversation terminated!]
[04:03:37] -!- Flaghacker has joined #pyqt
[04:03:55] <Flaghacker> Is there a way to give the parameters of a pyqtSignal names too for documentation purposes?
[04:31:50] -!- kallesbar has joined #pyqt
[06:15:07] <The-Compiler> Flaghacker: what do you mean exactly?
[06:17:45] <Flaghacker> The-Compiler, I have a bunch of signals in my code, eg pyqtSignal(str, int), but it's difficult to see what each parameter is suppsed to mean. Right now I write a comment next to the definitions, but something like pyqtSignal(newValue: str, rowIndex: int) would be better.
[06:17:52] <Flaghacker> Is it possible to do somehting like that?
[06:26:22] -!- mintograde has joined #pyqt
[06:37:40] -!- Dave_Elec has joined #pyqt
[06:38:15] <The-Compiler> Flaghacker: nope, that wouldn't be valid Python syntax
[06:38:46] <The-Compiler> hmm, I wonder if you could do a quick pyqtSignal wrapper which accepts newValue=str, rowIndex=int
[06:39:03] <The-Compiler> not sure if Python lets you access keyword arguments positionally though
[06:44:36] -!- anqxyr has quit [Read error: Connection reset by peer]
[06:45:17] -!- anqxyr has joined #pyqt
[06:55:47] -!- ren0v0 has quit [Ping timeout: 240 seconds]
[07:09:42] <Flaghacker> The-Compiler, Yeah I know that's not valid syntax, just looking for something similar.
[07:10:11] <Flaghacker> And actually yeah you can access keyword arguments in order, dicts are insertion-ordered now!
[07:13:24] -!- mintograde has quit [Ping timeout: 252 seconds]
[08:22:16] -!- frispete_ has joined #pyqt
[08:25:43] -!- frispete has quit [Ping timeout: 244 seconds]
[08:45:44] <altendky> Flaghacker: kwargs order was guaranteed in 3.6, dict order in 3.7
[08:47:17] <altendky> Flaghacker: but that order would be the passed order I would guess? Which wouldn't be what you want?
[08:47:39] <altendky> Err maybe it is. Hmm
[08:47:44] <Flaghacker> yeah it is
[08:48:32] <Flaghacker> I could create a wrapper function that discards the **kwargs names and passes the values (the types) to pyqtsignal in the same order.
[08:49:15] <Flaghacker> Although maybe wrapper functions don't work because of the magic that pyqtsignal does, I'll have to check that.
[09:03:07] -!- Dave_Elec has quit [Ping timeout: 246 seconds]
[09:03:44] -!- Dave_Elec has joined #pyqt
[09:08:56] -!- Siecje has joined #pyqt
[09:22:13] <Flaghacker> Is it possible to access private properties with python code? I'm extending a widget and I need some of the varaibles of the Q_D-guarded object.
[09:27:34] <Flaghacker> https://riverbankcomputing.com
[09:27:40] <Flaghacker> not possible? really?
[09:45:57] -!- BPL has joined #pyqt
[10:27:50] <The-Compiler> Flaghacker: if Qt doesn't expose it, you won't be able to access it from PyQt
[10:28:50] <Flaghacker> Too bad, that makes it difficult to inherit stuff.
[10:29:06] <The-Compiler> why?
[10:29:22] <Flaghacker> I think Qt does expose it to other C++ code, with the https://wiki.qt.io stuff.
[10:29:45] <The-Compiler> you can do this kind of stuff in C++, but you really shouldn't there either (and almost nobody does it)
[10:30:04] <The-Compiler> you lose binary compatibility (and maybe even source compatibility) between Qt releases, even minor ones
[10:30:31] <Flaghacker> I want to extend QLineEdit and change the size hint calculation, but it uses a bunch of private (?) propertie like topTextMargin, verticalMargin, effectiveLeftTextMargin, ...
[10:30:33] <The-Compiler> that wiki page looks like it's aimed at people who develop on Qt itself
[10:31:17] <The-Compiler> (hmm, actually I'm not even sure if you can do this in C++ when using Qt)
[10:32:05] <The-Compiler> there's QLineEdit::getTextMargins() which exposes those
[10:34:29] <Flaghacker> Ah didn't notice that, thanks!
[10:36:11] <Flaghacker> I stil need effectiveLeftTextMargin() though :(
[10:36:34] <Flaghacker> Which is even a private method.
[10:55:12] <altendky> Flaghacker: on the signal, you could make a function that returns a regular pyqtSignal. If you want to do something such that the emit takes keyword args, probably something special, yeah.
[10:56:06] <Flaghacker> I might be misunderstanding, but doesn't the pyqtsignal() function do some magic to figure out what class to bind to?
[10:56:12] <altendky> Flaghacker: pyqtSignal is a descriptor. I'm not sure exactly what would work while still being the signal on the object.
[10:57:52] <altendky> Flaghacker: for just having kwargs in the creation of pyqtSignal, just `def my_signal(*args, **kwargs): return pyqtSignal(*args, *kwargs)` (or maybe `*kwargs.keys()`)
[10:58:52] <altendky> Flaghacker: maybe I'll try to do a quick kwargs for emit thing when I get home
[10:59:36] <Flaghacker> Ah I didn't even thing about also having kwargs in the emit calls! Good idea
[11:01:33] <Flaghacker> Yeak the creation just works™.
[11:01:44] <Flaghacker> (although it's *kwargs.values())
[11:02:30] <Flaghacker> I have to go now but I'll look into how descriptors actually work tonight, thanks for the help altendky
[11:10:08] -!- Flaghacker has quit [Quit: Leaving]
[13:10:27] -!- Dave_Elec has quit [Ping timeout: 240 seconds]
[14:02:52] -!- Dave_Elec has joined #pyqt
[14:43:02] -!- Dave_Elec has quit [Ping timeout: 272 seconds]
[14:46:15] -!- Dave_Elec has joined #pyqt
[14:54:36] -!- Dave_Elec has quit [Ping timeout: 260 seconds]
[15:38:10] -!- anqxyr has quit [Ping timeout: 244 seconds]
[15:48:53] -!- anqxyr has joined #pyqt
[16:20:06] -!- daegontaven has joined #pyqt
[16:37:15] -!- mintograde has joined #pyqt
[17:05:31] -!- beeman has quit []
[17:08:09] -!- Siecje has quit [Quit: Leaving.]
[17:11:25] -!- beeman has joined #pyqt
[17:22:50] -!- anqxyr has quit [Read error: Connection reset by peer]
[17:42:16] -!- kallesbar has quit [Ping timeout: 272 seconds]
[19:07:09] -!- BPL has quit [Ping timeout: 272 seconds]
[19:08:14] -!- BPL has joined #pyqt
[19:51:35] -!- BPL has quit [Read error: Connection reset by peer]
[20:09:37] -!- daegontaven has quit [Quit: Connection closed for inactivity]
[21:33:17] -!- pennTeller has joined #pyqt
[21:34:42] <pennTeller> Hi guys, is it possible to create a Python project in Qt Creator?
[21:35:35] <altendky> pennTeller: sure, though I'm guessing their python ide isn't great. Why do you want it in creator?
[21:36:32] <altendky> pennTeller: a python project is just a bunch of text files so it could be done with pretty much any editor.
[21:36:32] <pennTeller> altendky because I would like to move things around in my MainWindow and be able to click play and run the project
[21:37:08] <altendky> pennTeller: you can use designer to edit .ui files
[21:37:45] <pennTeller> altendky yes but I am looking for an experience like when you create c++ project in creator
[21:37:55] <altendky> pennTeller: I just got the pyqt5-tools package built again which provides designer in a python package
[21:38:18] <pennTeller> oh I didn't know about that
[21:38:27] <altendky> pennTeller: it's with using a probably bad ide to not have designer in a separate window?
[21:38:45] <altendky> pennTeller: designer is the standalone copy of the GUI editor in creator
[21:39:21] <pennTeller> altendky I like having everything in one window and to be able to flip from designer to "coding" in a click
[21:40:30] <altendky> pennTeller: I'll suggest that that isn't significantly enough better than alt+tab to restrict yourself to a non-Python ide. But your call.
[21:40:46] <altendky> pennTeller: or, a click in the task bar. Etc
[21:41:42] <altendky> pennTeller: maybe try creator and see what it provides for python. *shrug*
[21:43:08] <altendky> pennTeller: in case you want pyqt5-tools, heres the latest build https://ci.appveyor.com
[21:43:27] <altendky> It'll probably get to pypi this week or next
[21:43:29] <pennTeller> thanks, yeah that's more like am looking for thanks
[21:44:04] <altendky> pennTeller: readme has a brief overview https://github.com
[21:44:18] <pennTeller> at the moment I have to modify the UI in designer then save it and turn it to a .py file and only then use it
[21:44:42] <altendky> pennTeller: you don't, regardless where you edit it :]
[21:44:45] <pennTeller> I am looking more for a modify UI -> click to run approach
[21:44:50] <altendky> pennTeller: pyqt5 yes?
[21:44:55] <pennTeller> yes pyqt5
[21:44:57] <pennTeller> 11
[21:46:05] <altendky> pennTeller: there are various options and pyuic5 is only one.
[21:46:08] <altendky> https://github.com
[21:46:20] <altendky> That's how I tend to load .ui files anymore
[21:46:30] <TurBoss> altendky: hello
[21:46:53] <pennTeller> I see, interesting
[21:47:00] <altendky> pennTeller: if you want to actually have a .py file for ide completion etc there are compiler functions in the uic module.
[21:47:24] <altendky> pennTeller: on a branch of that example project I made an import hook that would compile on the fly based on the import
[21:47:28] <altendky> TurBoss: hey
[21:48:04] <pennTeller> altendky thanks I am checking your repo
[21:48:22] <altendky> pennTeller: https://github.com you'd still have to run to get the build but... Not too bad
[21:49:07] <altendky> pennTeller: it's pretty exclusively a project reference not coding. Though the .ui loading sort of crosses over both
[21:49:43] <pennTeller> cool I appreciate it man
[21:50:25] <altendky> pennTeller: sure thing, I'm happy to explain what I've figured out and share. All my code is public, pretty much.
[21:50:48] <altendky> Still hope to reorganize into actually usable libraries but... Not yet
[21:52:04] <pennTeller> Nice, I am working on a Calorie Counter app and am about to put it out as GPL.. I figured there are no good non-java calorie counters out there
[21:52:30] <altendky> pennTeller: trying to pyqtdeploy to Android etc?
[21:52:56] <pennTeller> no so far I am looking at Windows/Mac and Linux as platforms
[21:53:57] <altendky> pennTeller: I dev in Linux and deploy in windows. Been a few hiccups but honestly not much for quite awhile
[21:55:23] <pennTeller> yeah the same thing happend to me actually I first made the program using GTK but I was never fully satisfied with the look
[21:55:38] <pennTeller> so I decide it to use Qt
[21:56:20] <altendky> It's too bad qt dropped the native gtk look
[21:56:35] <altendky> I think it just got too complicated
[22:07:42] <pennTeller> yeah, I am fairly new but am loving Qt so far
[22:07:44] <pennTeller> big time
[22:10:58] <altendky> pennTeller: fwiw, I now try to focus on writing good python code, then have a pyqt GUI in front.
[22:17:18] <pennTeller> altendky that's good
[22:45:21] -!- beeman has quit [Ping timeout: 260 seconds]
[22:48:04] -!- beeman has joined #pyqt
[23:10:38] -!- pennTeller has quit [Quit: The early bird may get the worm, but the second mouse gets the cheese]
[23:12:48] -!- mintograde has quit [Ping timeout: 252 seconds]