#pyqt | Logs for 2020-03-20
Back
[03:53:27] -!- cottoneyejim has joined #pyqt
[03:57:20] -!- mandeep has quit [Quit: Connection closed for inactivity]
[04:03:53] -!- yustin has joined #pyqt
[04:15:04] -!- jmarsac has joined #pyqt
[04:24:37] -!- cottoneyejim has quit [Ping timeout: 250 seconds]
[04:52:27] -!- cottoneyejim has joined #pyqt
[05:11:02] -!- cottoneyejim has quit [Ping timeout: 256 seconds]
[07:04:16] -!- BPL has joined #pyqt
[07:29:58] -!- honigkuchen has joined #pyqt
[07:44:35] -!- M4rtinK has joined #pyqt
[07:53:55] -!- cottoneyejim has joined #pyqt
[07:58:41] -!- cottoneyejim has quit [Ping timeout: 250 seconds]
[08:24:55] -!- yustin has quit [Read error: Connection reset by peer]
[08:25:13] -!- yustin_ has joined #pyqt
[09:31:39] yustin_ is now known as yustin
[13:39:30] -!- rngmaster has joined #pyqt
[13:43:22] <rngmaster> hi im trying to build an ui in qtdisigner for my program in python i want to know what is the best method to organize. i started to build uis for the diferent pages then open them with window.show() and hide the previous one but i dont like the looks of it since it
[13:44:13] <rngmaster> leaves traces hiding and opening windows
[13:45:20] <altendky> rngmaster: if it's leaving traces then something is wrong. can you describe your program? might want a wizard (i think qt has something for this?) or a stacked widget or tab widget or...
[13:47:28] <rngmaster> it just doesnt feel normal because im hiding and showing another window when i instance the other ui page class
[13:48:35] <rngmaster> i tried with stacked widgets i like the look but i cant code all ui program at the same time need to separate pages
[13:49:23] <altendky> rngmaster: sure, creating a new window each time isn't obviously good. i'm not sure what issue you are describing about 'at the same time' though
[13:49:52] <altendky> rngmaster: you can make separate .ui files for each 'page' and make a widget that uses that and put instances of all those widgets into the stacked widget
[13:50:07] <altendky> (so maybe i did understand right as i sent...)
[13:50:53] <rngmaster> is that how other complex programs work?
[13:51:34] <altendky> rngmaster: i don't know. it's how i do my program. github.com/altendky/st
[13:51:58] <rngmaster> thanks very much im going to take a look
[13:52:08] <altendky> rngmaster: along with the pyqt designer plugin you can actually do this in designer and see not only your separate 'pages' but also the window where you glue them all together
[13:54:11] <rngmaster> designer does the glue of my pages?
[13:55:17] <altendky> rngmaster: you could do the layout. create a window, add a layout with a stacked widget (or just a stacked layout) then add your custom widgets to it just as you would any others.
[13:55:32] <altendky> rngmaster: what os are you on?
[13:55:41] <rngmaster> ubuntu
[13:56:52] <altendky> rngmaster: python3-pyqt5 should get you a compiled copy of the pyqt designer plugin if you want. i also have some in-development linux wheels for pyqt5-tools that includes designer and the plugin and can be installed into a virtualenv or venv
[13:57:03] <altendky> but, the latter is very much in work :[
[13:57:16] <altendky> you could also be aware of this option and not use it
[14:00:10] <rngmaster> so for example for you to start the ui for that program you create a main window then other widgets for the "control" "setup and status" .. then how did you glue them all in a stacked widget?
[14:01:25] <altendky> rngmaster: i have widgets that use my .ui files. i have 'plugins' for those widgets so the pyqt designer plugin can understand them. they then show up in the widget list in designer just like buttons and text boxes do. you can then create a .ui for your main window, add a layout to it, add a stacked widget to that, and add your custom page widgets into the stacked widget.
[14:02:04] <rngmaster> oh i see
[14:02:21] <altendky> if you go this route, do use pyuic5 to generate .ui files. the runtime loading code in the uic module is... kinda insane and can run into issues loading nested custom widgets like this. it's bit me a few times and i finally gave in and precompile my .ui files :[
[14:06:17] <altendky> rngmaster: even without the pyqt designer plugin etc you can mark 'regular' widgets to be ... i forget, escalated? i'll look up the term. so you layout in designer with a standard widget but it knows at runtime to actually use some custom widget you provide.
[14:06:20] <altendky> kind of a middle ground
[14:06:58] <altendky> promote, that's it
[14:07:36] <rngmaster> i understand
[14:08:27] <rngmaster> can i also say what a button does on qtdesigner?
[14:16:25] <altendky> you can specify what to connect to afaik. i think there are some caveats and i personally don't do that and it doesn't seem obviously good
[14:16:42] <altendky> i look at my .ui files as a resource to define the gui. beyond that is code for me.
[14:27:07] -!- mandeep has joined #pyqt
[14:47:59] -!- frispete_ has quit [Quit: Konversation terminated!]
[14:49:40] -!- frispete has joined #pyqt
[15:43:19] -!- cottoneyejim has joined #pyqt
[16:20:37] -!- cottoneyejim has quit [Ping timeout: 264 seconds]
[16:31:16] -!- cottoneyejim has joined #pyqt
[16:35:20] -!- mintograde has joined #pyqt
[18:01:01] -!- totte has quit [Ping timeout: 272 seconds]
[18:01:48] -!- BPL has quit [Quit: Leaving]
[18:02:01] -!- cottoneyejim has quit [Ping timeout: 264 seconds]
[18:03:38] -!- rngmaster has quit [Remote host closed the connection]
[18:04:56] -!- totte has joined #pyqt
[18:16:05] -!- jmarsac has quit [Ping timeout: 246 seconds]
[18:16:14] -!- honigkuchen has quit [Ping timeout: 240 seconds]
[19:13:04] -!- honigkuchen has joined #pyqt
[19:14:27] -!- honigkuchen has quit [Remote host closed the connection]
[19:25:27] -!- altendky has quit [Ping timeout: 246 seconds]
[19:26:44] -!- altendky has joined #pyqt
[19:35:42] -!- Bjander has joined #pyqt
[19:37:07] -!- Belxjander has quit [Ping timeout: 246 seconds]
[19:37:10] Bjander is now known as Belxjander
[20:00:37] -!- yustin has quit [Ping timeout: 250 seconds]
[23:41:37] -!- M4rtinK has quit [Ping timeout: 264 seconds]