#pyqt | Logs for 2019-04-22

Back
[05:28:36] -!- frispete has quit [Ping timeout: 250 seconds]
[05:32:47] -!- frispete has joined #pyqt
[05:42:33] -!- frispete has quit [Ping timeout: 245 seconds]
[05:46:42] -!- frispete has joined #pyqt
[09:04:24] -!- nsizemor has joined #pyqt
[09:06:44] -!- nsizemor has quit [Remote host closed the connection]
[10:25:18] -!- AbleBacon has joined #pyqt
[11:13:12] -!- cottoneyejim has quit [Ping timeout: 268 seconds]
[11:40:00] -!- cottoneyejim has joined #pyqt
[11:49:09] -!- cottoneyejim has quit [Ping timeout: 244 seconds]
[12:16:24] -!- cottoneyejim has joined #pyqt
[12:25:44] -!- cottoneyejim has quit [Ping timeout: 246 seconds]
[12:39:26] -!- Thaodan has quit [Quit: ZNC - https://znc.in]
[12:41:06] -!- Thaodan has joined #pyqt
[12:53:03] -!- cottoneyejim has joined #pyqt
[13:12:17] -!- cottoneyejim has quit [Ping timeout: 246 seconds]
[13:39:33] -!- cottoneyejim has joined #pyqt
[13:56:37] -!- Thaodan has quit [Ping timeout: 268 seconds]
[13:59:14] -!- Thaodan has joined #pyqt
[14:06:19] -!- Thaodan has quit [Ping timeout: 246 seconds]
[14:23:11] -!- Thaodan has joined #pyqt
[14:28:16] -!- Thaodan has quit [Excess Flood]
[14:28:42] -!- Thaodan has joined #pyqt
[15:07:47] -!- cottoneyejim has quit [Ping timeout: 246 seconds]
[15:25:11] -!- kallesbar has quit [Quit: Konversation terminated!]
[15:34:59] -!- cottoneyejim has joined #pyqt
[15:36:57] -!- Thaodan has quit [Ping timeout: 252 seconds]
[15:37:06] -!- Thaodan_ has joined #pyqt
[15:41:17] -!- cottoneyejim has quit [Ping timeout: 245 seconds]
[15:47:10] -!- Thaodan_ has quit [Ping timeout: 276 seconds]
[16:08:29] -!- cottoneyejim has joined #pyqt
[16:17:42] -!- stochastix has joined #pyqt
[16:19:40] -!- Thaodan has joined #pyqt
[16:22:59] -!- TheStraying11 has joined #pyqt
[16:24:19] <TheStraying11> Hi, how do i make it so that when i trigger a QFileDialog i can open an actual directory instead of a file? .setFileMode(QFileDialog.Directory) doesnt work
[16:26:17] -!- Thaodan has quit [Ping timeout: 245 seconds]
[16:28:43] -!- Thaodan has joined #pyqt
[16:30:09] <Avaris> TheStraying11: what does "doesn't work" mean?
[16:32:42] <TheStraying11> like ive got this code
[16:32:43] <TheStraying11> def browse_0(): browse = QFileDialog() browse.setFileMode(QFileDialog.Directory) browse.setAcceptMode(QFileDialog.AcceptOpen)
[16:33:03] <TheStraying11> yikes, how do i format that properly i've never used this before
[16:33:15] <Avaris> use a paste site: dpaste.de
[16:34:12] <TheStraying11> okay, so i got https://pastebin.com when i call that function i get an open file dialogue that will only open files i.e. main.py, i want it to open a directory instead.
[16:35:22] <Avaris> open as in "select"?
[16:35:34] <TheStraying11> yeah, like, hold one
[16:35:43] <Avaris> also, what's the rest of the code? that can't be all :)
[16:38:22] -!- cottoneyejim has quit [Ping timeout: 245 seconds]
[16:38:22] <TheStraying11> like, i have https://pastebin.com and if i browse to /usr/share/applications i want the text of the QLineEdit 'data_folder_input' to be /user/share/applications
[16:38:39] <TheStraying11> */usr/share/applications
[16:39:44] <Avaris> ugh... you're using .getOpenFilename
[16:40:15] <Avaris> first, that's for file. getOpenDirectory is for folders
[16:40:28] <TheStraying11> ah, i didnt know that existed
[16:40:30] <Avaris> second, you don't need to create QFileDialog instance for that
[16:40:45] <Avaris> QFileDialog.getOpenDirectory(...) is enough
[16:41:28] <Avaris> sorry, getExistingDirectory
[16:42:01] <Avaris> (writing from memory isn't the best :|)
[16:42:11] <Avaris> https://doc.qt.io
[16:43:04] <Avaris> (ooh factorio)
[16:43:27] <TheStraying11> hahaha, yeah im making a modpack launcher
[16:45:00] <Avaris> you might want to put those in some class for tidying it up
[16:47:02] <TheStraying11> yeah, i have no idea how to do that xD
[16:48:00] <TheStraying11> so, i have this now https://imgur.com how can i make the browse buttons go to the right of the QLineEdits?
[16:48:03] <Avaris> submit_button_1.clicked.connect(lambda: submit_1())
[16:48:22] <Avaris> did you put lambda because you got errors?
[16:48:59] <Avaris> normally .connect(submit_1) is enough. but function definition need to come before
[16:49:15] <TheStraying11> no, thats what the example on this tutorial i found said
[16:49:29] <TheStraying11> oh yeah, my functions are defined afterwards.
[16:50:13] <Avaris> QGridLayout or a bunch of QHBoxLayouts in QVBoxLayout
[16:50:31] <Avaris> ^ for button position
[16:51:05] <TheStraying11> so i make a QVBoxLayout and then each label, line edit and button group goes in a QHBoxLayout?
[16:51:18] <TheStraying11> inside the vertical one
[16:51:48] <Avaris> label + lineedit + button in QHBoxLayout, and you add those layouts to QVBoxLayout
[16:52:31] <TheStraying11> https://pastebin.com
[16:52:32] <TheStraying11> ??
[16:54:15] <Avaris> nope: https://dpaste.de
[16:54:31] <Avaris> repeat for the other
[16:56:04] <Avaris> or: https://dpaste.de
[16:56:38] <TheStraying11> yeah gridlayouts confuse the shit out of me xD
[16:56:41] <TheStraying11> thanks though
[16:57:46] <Avaris> if you lived through the "html design by tables" era they seem very natural :)
[16:59:20] <Avaris> by the way, which tutorial are you using?
[16:59:33] <TheStraying11> nah, i didn't haha, i mean... they work pretty similar to matrices don't they? - i do ALevel maths so i could probably understand them if i tried
[16:59:54] <TheStraying11> erm, https://www.tutorialspoint.com
[17:01:56] -!- TheStraying11 has quit [Quit: Page closed]
[17:02:03] -!- TheStraying11 has joined #pyqt
[17:02:21] <TheStraying11> Sorry, just had to switch to my phone
[17:05:22] -!- cottoneyejim has joined #pyqt
[17:06:39] <Avaris> tutorial seems ok-ish. their naming convention (or the lack of) annoys me quite a bit though
[17:07:11] <TheStraying11> Yeah, definitely
[17:07:39] <Avaris> also, that's for pyqt4 if i'm not mistaken
[17:08:44] -!- cottoney1 has joined #pyqt
[17:10:08] <TheStraying11> Yeah they had nothing about .getExistingDirectory()
[17:11:34] <Avaris> well (py)qt4 definitely had that
[17:11:40] -!- cottoneyejim has quit [Ping timeout: 258 seconds]
[17:14:27] -!- TheStraying11 has quit [Ping timeout: 256 seconds]
[17:24:19] -!- mintograde has joined #pyqt
[17:29:23] -!- AbleBacon has quit [Quit: Leaving]
[17:35:19] -!- cottoney1 has quit [Ping timeout: 244 seconds]
[17:43:00] -!- BPL has joined #pyqt
[18:01:43] -!- BPL has quit [Ping timeout: 246 seconds]
[18:01:43] -!- BPL has joined #pyqt
[18:01:43] -!- ilbelkyr has quit [Read error: Connection reset by peer]
[18:09:28] -!- grateful_ has joined #pyqt
[18:16:34] -!- Avaris has quit [Ping timeout: 250 seconds]
[18:16:35] -!- grateful has quit [Ping timeout: 250 seconds]
[18:17:33] -!- Avaris has joined #pyqt
[18:23:39] -!- BPL has quit [Quit: Leaving]
[19:32:59] -!- lee_76 has joined #pyqt
[19:36:41] <lee_76> I'm trying to figure out what is the simplest way to move my main GUI to the front of another GUI from the same app, but not successful. Is there a way I can take action when I click on a GUI that is behind another GUI that moves in front of it?
[19:38:32] <altendky> lee_76: normally that's automatic at the window manager level afaik
[19:39:45] <lee_76> altendky, that's what I thought.. You know I let me convert my code to an executable and see if it behaves differently.
[19:40:03] <altendky> lee_76: did you try to force always in front?
[19:40:39] <altendky> Hopefully pyinstaller would not affect this
[19:41:22] <lee_76> altendky, no, actually I have set the 'window modality' in designer to 'non modal'
[19:42:04] <altendky> lee_76: did you set one as the parent of the other?
[19:45:38] <lee_76> altendky, this is my main file: https://pastebin.com
[19:46:24] <lee_76> altendky, this is my main GUI app: https://pastebin.com
[19:47:20] <lee_76> altendky, and this is the subGUI tha opens from the main GUI
[19:47:33] <altendky> lee_76: avoid multiple inheritance and always use super() to call up the mro (instead of manually calling Parent.method(self, blah))
[19:48:18] <altendky> lee_76: WindowStaysOnTopHint...
[19:50:11] <altendky> And I don't even know what a 'drawer' is (beyond Mac only)
[19:53:36] <lee_76> altendky, how would I go about opening the second GUI from the second GUI?
[19:53:53] <lee_76> altendky, how would I go about opening the second GUI from the primary GUI?
[19:54:55] <altendky> lee_76: I thought you already did that and the problem was it was staying on top even when you clicked the first window. Yes?
[19:57:41] <lee_76> altendky, correct
[19:58:10] <altendky> lee_76: WindowStaysOnTopHint you tell it to stay on top
[20:06:49] <lee_76> altendky, Thank You Thank You Thank You!!!!!
[20:07:28] <altendky> lee_76: sure thing
[21:00:22] -!- JT-Shop has joined #pyqt
[22:17:56] -!- mintograde has quit [Ping timeout: 258 seconds]
[22:52:24] -!- kallesbar has joined #pyqt