#pyqt | Logs for 2020-06-12

Back
[01:38:20] -!- honigkuchen has quit [Ping timeout: 256 seconds]
[02:28:27] -!- yustin has joined #pyqt
[02:34:45] -!- honigkuchen has joined #pyqt
[02:36:22] -!- honigkuchen has quit [Remote host closed the connection]
[02:49:31] -!- SpinTronix has joined #pyqt
[02:58:29] -!- jmarsac has joined #pyqt
[04:01:56] -!- Bjander has joined #pyqt
[04:03:04] -!- Belxjander has quit [Ping timeout: 256 seconds]
[04:03:20] Bjander is now known as Belxjander
[04:30:17] -!- ali1234 has joined #pyqt
[04:47:13] -!- jmarsac has quit [Read error: Connection reset by peer]
[04:49:17] -!- jmarsac has joined #pyqt
[05:25:52] -!- cottoneyejim has joined #pyqt
[05:35:26] -!- cottoneyejim has quit [Ping timeout: 256 seconds]
[07:05:13] -!- jmarsac has quit [Ping timeout: 272 seconds]
[07:57:58] -!- honigkuchen has joined #pyqt
[07:58:57] -!- honigkuchen has quit [Remote host closed the connection]
[08:00:17] -!- cottoneyejim has joined #pyqt
[08:00:52] -!- jmarsac has joined #pyqt
[08:17:00] -!- honigkuchen has joined #pyqt
[08:51:28] -!- sazawal has joined #pyqt
[08:51:52] -!- sazawal has quit [Read error: Connection reset by peer]
[08:52:23] -!- sazawal has joined #pyqt
[08:54:28] -!- cottoneyejim has quit [Ping timeout: 258 seconds]
[08:57:21] <sazawal> Hi all. I am using certain standard QStyle-SP icons, like QApplication.style().standardIcon(QStyle.SP_MessageBoxWarning). The problem is that on different systems, the available sizes of the icons are different, which throws an error on launching the gui. Is there a way I can use a standard set of icons which work across systems? Or maybe include the icon with the source?
[08:57:45] <altendky> sazawal: what error?
[08:57:55] <altendky> and what code?
[09:16:53] <sazawal> Hi altendky, the icons in QApplication.style().standardIcon(QStyle.SP_MessageBoxWarning) come in different sizes. I am getting a list of sizes when I call availableSizes() function on this icon. And then I am choosing one say at index-2 of this list. Now in another system this availableSizes list has only one element, and I cannot choose the one at index-2. I hope I make sense.
[09:18:24] <altendky> sazawal: sounds like you need a different way to choose the proper size. i wouldn't generally assume that a fixed position in a list would always be the right size anyways.
[09:18:51] <sazawal> yes
[09:19:00] <altendky> sazawal: so how do you want to pick a size?
[09:19:14] <altendky> sazawal: where are you using this icon?
[09:19:29] <sazawal> Are there any standard icons included in pyqt apart from QStyle.SP?
[09:19:54] <sazawal> I chose one which looked apt in the gui. I am using the icon in place of the QPushButton.
[09:20:00] <altendky> sazawal: presumably whatever qt provides
[09:20:18] <altendky> sazawal: can you link the docs describing the list of icons?
[09:20:57] <sazawal> altendky, I followed this article, https://joekuan.wordpress.com
[09:21:27] <altendky> sazawal: ok, but the docs would be a good place to look and see if they describe what the options in the list correspond to or how to pick one
[09:22:16] <sazawal> Sorry I looked but I didn't find it in the docs. Although I only searched via google.
[09:22:51] <altendky> sazawal: alrighty, you have the function so you ought to be able to find something in the chain and walk through the links. :]
[09:26:55] <sazawal> Hmm so the SP icons I found in https://doc.qt.io at >> enum QStyle::StandardPixmap
[09:27:12] <sazawal> Sorry I will be back in half an hour
[09:27:20] <altendky> https://doc.qt.io there's a direct link
[09:38:16] <Avaris> sazawal: why do you need to specify a size? qt defines standard icon sizes with style and since you're using standard icons, just let qt deal with that based on the style
[09:54:27] <altendky> "in place of the push button" but maybe I'm reading something other than what was meant
[10:48:54] -!- BPL has joined #pyqt
[11:00:46] <sazawal> altendky, Avaris Yes you are right, qt automatically assigns the size of the icon. What mistake I made was I was setting the size of the push button based on the icon size, because of the ugly appearance. I am still not sure how to set a good size of the push button. Let me show you the code and it will be more clear.
[11:01:38] <altendky> sazawal: i default to not messing with sizes at all. that gives qt the best chance to just do the right thing. but yeah, seeing the code and the sort of thing you are trying to create may help
[11:02:31] <sazawal> Here, https://dpaste.org
[11:04:02] <sazawal> The ugly appearance is not really visible here. But you can see the difference in the three cases. I have created a PushIcon class, which is nothing but the push button with the icon (no text, no borders).
[11:05:17] <altendky> sazawal: is there a screenshot of what you are trying to achieve? or text description at least?
[11:05:33] <altendky> i thought QPushButton let you set an icon itself
[11:06:46] <sazawal> altendky, Sorry don't have a description.
[11:07:10] <altendky> sazawal: ok, i'll lead you through it... why aren't you just using a QPushButton?
[11:07:29] <sazawal> Well, if I let qt decide the icon sizes, I would just comment line number-20 (that is setFixedWidth)
[11:08:16] <sazawal> altendky, Not using QPushButton because it needs text and occupies a relatively bigger size.
[11:08:55] <altendky> sazawal: what is the context in which you are going to use this new thing?
[11:10:01] <altendky> icons that are used to express the sort of message shown by a message box don't seem like they would make a clear ux in a place where you are expected to click them since in normal use clicking them does nothing.
[11:10:19] <sazawal> altendky, This is only a sample code. I am using the PushIcon class in another class I am calling EquationEditor. It has textfields and pushbuttons to enter an equation.
[11:12:31] <sazawal> Let me see if I can show you a screenshot of the actual ui I am working on.
[11:12:53] <altendky> pasteboard.co is reasonable
[11:30:37] <sazawal> altendky, https://pasteboard.co
[11:31:30] <altendky> sazawal: maybe a https://doc.qt.io would be relevant
[11:31:40] <altendky> i'm not sure
[11:33:09] <sazawal> altendky, Thanks, this looks useful
[11:35:07] <altendky> sazawal: see how little tweaking you can get away with. None if possible.
[11:35:39] -!- jmarsac has quit [Ping timeout: 272 seconds]
[11:56:14] <sazawal> altendky, Wow, smooth. This is perfect!
[12:06:59] -!- yustin has quit [Ping timeout: 260 seconds]
[12:16:47] <altendky> sazawal: good deal. were you able to not inherit? how much did you have to tweak parameters or pick out specific icons?
[12:40:27] <sazawal> altendky, Just subclassed QToolButton and used setIcon() to set the same icon to it.
[12:40:45] <altendky> sazawal: why can't you not subclass and just set the icon?
[12:41:05] <sazawal> Now I am thinking I don't need a separate class, I will just create a QToolButton object whenever I need, instead of PushIcon.
[12:41:58] <sazawal> altendky, sorry didn't get your last question, too many negatives :P
[12:43:24] <altendky> sazawal: it seems you figured it out. No need to subclass
[12:44:24] <sazawal> Yes, afterall I subclassed it because there were too many statements of setting the icon size, removing borders and outlines. I don't need them now.
[12:54:02] -!- lemoldu has joined #pyqt
[13:00:00] -!- sazawal has quit [Quit: Leaving]
[13:04:56] -!- sazawal has joined #pyqt
[13:07:58] <sazawal> At another place in the ui, I want to place an icon in QLabel. I have used the setPixmap function of QLabel, but it requires the icon size too. Is there a way I can avoid it and let qt decide the size, just like QToolButton?
[13:08:52] <sazawal> The syntax is something like this, mylabel.setPixmap(myicon.pixmap(myicon.availableSizes()[1]))
[13:36:31] <altendky> sazawal: is there text in the label? or... screenshot for context could be useful maybe
[13:36:57] <sazawal> altendky, No text, only icon
[13:37:49] <altendky> sazawal: maybe it relates to something you can mention in your previous screenshot?
[13:39:39] <sazawal> This is something different. No buttons. I only want to show an icon in QLabel instead of text. The icon appears when there is an error in the QLineEdit entry. This appearing/disappearing I am doing with QLabel.hide() and QLabel.show()
[13:40:47] <altendky> as reference, i just don't like qlabel being an image showing thing... but i'm trying to think here. thanks for the context
[13:41:26] <altendky> sazawal: maybe a https://doc.qt.io ? if it really shouldn't do anything then the action can just not get connected to anything.
[13:41:30] <sazawal> I see. The error icon must be in some container, and QLabel is the first I thought for it.
[13:43:10] <sazawal> Hmm, yes I have used this at couple of places. But in my case the error icon depends on the entries of two QLineEdits (one should be greater than the other)
[13:43:47] <altendky> sazawal: where are you looking to show it? maybe i misread and thought you meant it should be inside the line edit
[13:43:59] <sazawal> or I can use it and show the error in second one, that it should be greater than first.
[13:44:18] <altendky> could show in both
[13:44:26] <sazawal> yea
[13:45:12] <sazawal> Hey you must have seen that in some webpages the error in textfields are shown as red border, can I do it in Qt?
[13:46:22] <altendky> there's probably some way. or a background color. icons next to the edit in a web page are also common i think.
[13:46:38] <sazawal> yes
[13:46:52] -!- ali1234 has parted #pyqt
[13:47:28] -!- ali1234 has joined #pyqt
[13:48:02] <sazawal> Hmm I just noticed that I have already used this addAction in the two QLineEdits I was talking about lol.
[13:48:18] <sazawal> And they buttons to wipe the text
[13:48:31] <altendky> is it limited to one action? or can you have multiple? being add i think you can have multiple
[13:48:46] <altendky> there's an existing feature for clearing the text, you shouldn't need a custom action i don't think
[13:49:00] <altendky> https://doc.qt.io
[13:49:39] <sazawal> oohh, let me enable it quickly
[13:51:17] <Avaris> should be easy to add red border with css
[13:52:16] <altendky> Don't you end up having to control everything then?
[13:54:20] <sazawal> No, it should be okay. Will just clear up some mess from the code.
[13:55:19] <altendky> when you add css it doesn't 'change the one thing you specify' unless you have specified all the relevant css a layer up
[13:55:42] <altendky> so the existing 'defaults' from when you don't have any css aren't necessarily carried in when you set one thing via css
[13:55:47] <altendky> aiui
[14:06:46] -!- LionOpeter has quit [Ping timeout: 260 seconds]
[14:09:44] -!- sazawal has quit [Ping timeout: 256 seconds]
[14:29:38] -!- jmarsac has joined #pyqt
[14:52:33] -!- sazawal has joined #pyqt
[15:17:57] -!- jmarsac has quit [Ping timeout: 272 seconds]
[15:50:38] -!- jmarsac has joined #pyqt
[15:52:27] -!- yustin has joined #pyqt
[16:35:11] -!- sazawal has quit [Quit: Leaving]
[16:35:30] -!- sazawal has joined #pyqt
[16:51:12] -!- sazawal has quit [Quit: Leaving]
[17:13:22] -!- lemoldu has quit [Quit: Leaving]
[17:14:37] -!- honigkuchen has quit [Read error: Connection reset by peer]
[17:14:56] -!- honigkuchen has joined #pyqt
[17:19:39] -!- honigkuchen has quit [Ping timeout: 260 seconds]
[17:20:36] -!- honigkuchen has joined #pyqt
[17:23:25] -!- honigkuchen has quit [Read error: Connection reset by peer]
[17:31:16] -!- honigkuchen has joined #pyqt
[17:40:16] -!- yustin has quit [Ping timeout: 256 seconds]
[17:46:04] -!- SpinTronix has quit [Quit: Konversation terminated!]
[18:01:48] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[18:02:24] -!- Belxjander has joined #pyqt
[19:01:07] -!- jmarsac has quit [Read error: Connection reset by peer]
[19:56:12] -!- plutopotamus has joined #pyqt
[20:05:46] -!- BPL has quit [Quit: Leaving]
[20:31:25] -!- plutopotamus has quit [Remote host closed the connection]
[22:57:40] -!- OleBlue89 has joined #pyqt
[23:01:57] <OleBlue89> Hello, is it possible to press a qpushbutton and open a phone or desktop application? Such as Amazon Music and miscellaneous smart controllers.
[23:02:34] <altendky> OleBlue89: you can subprocess.Popen or QProcess to launch processes
[23:04:29] <OleBlue89> Theres an app on the google play store called myQ. It is a garage door opener and light system. Can I get that to work on it?
[23:04:46] <altendky> OleBlue89: are you running this on android?
[23:05:31] <OleBlue89> Yes
[23:06:58] <altendky> OleBlue89: i'm guessing something here https://doc.qt.io
[23:16:19] -!- OleBlue89 has quit [Ping timeout: 245 seconds]