#pyqt | Logs for 2018-12-20

Back
[02:12:51] -!- Dave_Elec has joined #pyqt
[02:52:13] -!- Dave_Elec has quit [Ping timeout: 250 seconds]
[03:01:06] -!- swalladge_ has joined #pyqt
[03:02:08] -!- swalladge has quit [Ping timeout: 250 seconds]
[03:12:54] -!- BPL has joined #pyqt
[03:40:10] -!- Lauxley has joined #pyqt
[03:50:10] -!- Bjander has joined #pyqt
[03:53:54] -!- Belxjander has quit [Ping timeout: 272 seconds]
[03:53:55] Bjander is now known as Belxjander
[05:00:01] swalladge_ is now known as swalladge
[05:41:41] -!- kallesbar has joined #pyqt
[06:44:24] -!- nimbleark has quit [Quit: iQuit]
[06:46:27] -!- mintograde has joined #pyqt
[07:28:23] -!- mintograde has quit [Ping timeout: 245 seconds]
[08:49:12] -!- Siecje has joined #pyqt
[10:39:57] -!- kallesbar has quit [Ping timeout: 246 seconds]
[10:46:12] -!- ilbelkyr has quit [Killed (Sigyn (BANG!))]
[10:50:12] -!- ilbelkyr has joined #pyqt
[10:50:56] -!- kallesbar has joined #pyqt
[11:39:09] -!- TechSmurf has quit [Ping timeout: 250 seconds]
[12:43:04] -!- Toerkeium has joined #pyqt
[12:45:54] <Toerkeium> guys, I need to place in a main window a widget which contains a list of items, where each item is an image, followed by data that should be put aside of the image. it's like a list of hotels where you have the image in the left, and in the right you have the hotel name, below the hotel address and some information about it, where all information about the hotel must be within the heigth of the image. This, repeated many times dymanic
[12:46:52] <Toerkeium> I'm using the PyQt5 Designer
[13:07:03] -!- BPL has quit [Read error: Connection reset by peer]
[13:09:29] -!- BPL has joined #pyqt
[13:43:32] -!- Siecje has quit [Ping timeout: 272 seconds]
[14:24:00] <altendky> Toerkeium: I think I've seen examples of either list or table view or widget with images
[14:26:23] <Toerkeium> altendky: is it possible to put make a widget with all information, and repeat this widget in a vertical layout many times and that it scrolls vertically when the max height reached?
[14:26:38] <Toerkeium> I'm not sure if I'm using the correct words
[14:27:09] <Toerkeium> for a table, I've tried but it looks complex to insert other than text in a cell
[14:27:15] <Toerkeium> complex to me, of course
[14:27:56] <Toerkeium> also checked the custom widget plugin, which look useful for what I need, I think, but also too complex :P
[14:29:25] <Toerkeium> what I want to accomplish is something like the accordions in jquery https://jqueryui.com but with more information in every accordion header
[14:30:02] <Toerkeium> there's no need to be collapsible and no need for content
[14:32:11] <Toerkeium> if I could just make an area vertically aligned, that alows to put a widget which contains many widgets, it could work
[14:33:06] <altendky> Toerkeium: you can add regular widgets to a vbox layout in a scroll view iirc. But I let me check for an example
[14:34:35] <altendky> Toerkeium: check icon mode for the list view and or widget maybe
[14:36:07] <altendky> Toerkeium: this is qt4 but maybe useful https://stackoverflow.com
[14:37:12] <Toerkeium> wow, that's what I need
[14:37:17] <Toerkeium> how did you find that altendky ?
[14:38:33] <Toerkeium> I'll see if I can make it works in pyqt5
[14:45:09] <Toerkeium> excellent altendky, replaced the QtGui for QtWidgets and it works. That's what I needed, thank you!
[14:56:36] <altendky> Toerkeium: sure thing, i knew i had looked it up before. searched for `pyqt5 list custom widget` or somesuch
[14:56:49] <altendky> Toerkeium: but yeah, doing the custom widget approach gives you the flexibility to put anything in there.
[14:58:39] <Toerkeium> I know I'm probably in the wrong channel but, does the PyQt Desginer worth learning? Or just learning how to make it by python in the code seems easier?
[14:59:52] <altendky> Toerkeium: it's qt designer... but i personally use designer for most of my gui layout that isn't intended to be a micro-example for someone here. when i do have dynamic things i still use designer for the overall ui and then just dynamically stick widgets into the proper sections
[15:00:12] <altendky> Toerkeium: there are certainly people that feel otherwise and think it all belongs right in the code
[15:03:15] <Toerkeium> thanks altendky, I'm very new to all this desktop development. I got to the point it was really easy till I needed this custom widget
[15:03:22] <Toerkeium> like always happens
[15:03:47] <altendky> Toerkeium: at least we got you going again fairly quickly. :] hopefully it actually works out
[15:04:27] <altendky> i would wonder about doing it as a table rather than a list such that columns are preserved. at present, image in one column and text in another.
[15:06:04] <Toerkeium> yes you did, helped me a lot. I'll play with that example and try tables instead
[15:12:39] -!- Siecje has joined #pyqt
[15:26:59] -!- kushal has quit [Remote host closed the connection]
[15:27:13] -!- kushal has joined #pyqt
[15:32:11] -!- nimbleark has joined #pyqt
[15:33:22] <Toerkeium> altendky: this is how that code makes the list items? https://snag.gy
[15:35:31] <altendky> Toerkeium: close. instead of a mainwindow you should use a regular qwidget when you create the designer file.
[15:36:11] <altendky> Toerkeium: and then instead of adding in a hbox layout, do averything else, select the widgets, then right click int the widget background and select layout->horizontal
[15:37:35] <Toerkeium> hmm let me see!
[15:41:50] <Toerkeium> like this? https://snag.gy
[15:42:24] <altendky> Toerkeium: sure. presumably you'll tweak various stuff but that's the basic structure they had.
[15:42:31] <Toerkeium> am I a good student or not?
[15:42:44] <Toerkeium> :D
[15:42:45] <altendky> Toerkeium: you're doing well :]
[15:44:26] <altendky> Toerkeium: hmm. so i actually overlooked your jquery accordions link. hmm... you really want the expansion?
[15:45:36] <Toerkeium> no no, no needed, it wasn't an accurated example
[15:45:50] <Toerkeium> I believe with this example, I'm pretty close to do what I need
[15:46:14] <altendky> Toerkeium: alrighty. i was thinking it through though and that might be something you could implement in the custom widget itself if needed. otherwise maybe end up with a tree instead of a table
[15:46:18] <Toerkeium> doing this with Qt Designer, I can load the widget ui, and then connect it when I need to
[15:46:20] <Toerkeium> isn't it?
[15:47:07] <altendky> Toerkeium: you would write code for a widget and would get the .ui from the file, yes. this is my default at this point for loading .ui files https://github.com
[15:47:19] <altendky> Toerkeium: then that widget class you wrote would be your custom widget
[15:47:28] <Toerkeium> I can't get ride of thinking in a "web" way yet, I need to change a bit the way I think working for desktop, I could do many things instead of the collapsible thing, much easier
[15:50:04] <Toerkeium> saved in my "stolen" folder :D
[15:50:43] <Toerkeium> I hope you don't mind if I take a look at your git repo
[15:51:21] <altendky> Toerkeium: that's why i linked it. my 'real' code is in st, stlib, and pm.
[15:52:24] <altendky> Toerkeium: i'm in the middle right now of setting up a new class and i did it a touch differently. i like the attrs library in general so i was trying to apply it here and see if i can get a 'tidy' solution. https://gist.github.com
[15:53:17] <altendky> Toerkeium: i've got plenty of mess so... be ware
[15:55:06] <Toerkeium> Who doesn't
[15:55:29] <Toerkeium> I need to study your code, I can't understand it totally
[15:55:37] <altendky> Toerkeium: which?
[15:57:19] <Toerkeium> target(*args, **kw) for example, but it's ok, remember I'm really new to python, a couple of weeks dealing mostly with ui and examples taken from the python install, I have a nice mess in my head
[15:57:32] <Toerkeium> I'm not used to python syntax
[15:58:53] <altendky> Toerkeium: yeah, i'm not sure that's a good thing. i don't recall finding a 'satisfactory solution'. the issue being that, for example, a button's clicked signal actually passes a boolean parameter. normally you don't care and connect it to `self.button_click(self):` or whatever.
[15:59:06] <altendky> Toerkeium: that's fine, the boolean you don't care about gets thrown away.
[16:00:07] <altendky> Toerkeium: then you refactor and have `self.button_clicked(self, my_name='altendky'):` and suddenly ny_name is `True`... huh? the default is 'altendky' and it's a new parameter so nobody should be passing it... so yeah, i got confused by that a couple times and got frustrated.
[16:00:22] <altendky> Toerkeium: but i don't really like drop_args, nor other solutions. so, maybe just ignore that aspect
[16:01:38] <altendky> Toerkeium: but, `def f(blah, *args, blue=None, **kwargs):` means that you have a regular parameter `blah`. any other positional arguments passed to the function will end up in the tuple named `args`. you have a keyword only parameter blue (with a default of None) and any other keyword arguments passed to the function will be stored in a dict named `kwargs`.
[16:05:48] <Toerkeium> I'll have to use it and test it
[16:06:24] <Toerkeium> homework at night will be exhausting :)
[16:07:04] <altendky> Toerkeium: there's also `def blue(a, b, *, c, d):` which makes `c` and `d` accessible only via keyword args. `*args` has the same affect by way of consuming all remaining positional args.
[16:07:27] <altendky> then there's also `/` instead of `*` to indicate positional only for parameters listed before it.
[16:08:00] <altendky> Toerkeium: but mostly, if you can stay away from this stuff i'd tend to. though some might argue making all parameters positional only would be good. i think it sometimes myself
[16:11:38] <Toerkeium> I believe I'll do it, at least till I get used to
[16:17:07] <Toerkeium> Time to go home, thanks a for your help altendky. I'll play with all info at night!
[16:17:25] <altendky> Toerkeium: good luck, enjoy
[16:24:47] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[16:25:10] -!- Belxjander has joined #pyqt
[16:32:40] -!- mintograde has joined #pyqt
[16:52:42] -!- Toerkeium has quit [Quit: Page closed]
[17:37:49] -!- Lauxley has quit [Remote host closed the connection]
[18:02:09] -!- kallesbar has quit [Quit: Konversation terminated!]
[18:03:07] -!- snowcat_mobile has joined #pyqt
[18:27:40] -!- Siecje has quit [Quit: Leaving.]
[19:19:22] -!- snowcat_mobile has quit [Read error: Connection reset by peer]
[20:13:49] -!- BPL has quit [Read error: Connection reset by peer]
[20:21:24] -!- Siecje has joined #pyqt
[20:22:12] -!- Siecje has parted #pyqt
[20:45:04] -!- mandeep has joined #pyqt
[21:31:15] -!- snowcatman has quit []
[22:07:26] -!- mintograde has quit [Ping timeout: 250 seconds]