[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Setting QComboBox "clicked on" width
From:       Nick Gaens <mail () nickgaens ! com>
Date:       2010-05-27 11:08:12
Message-ID: AANLkTikSoE85yk9qKsaK9u75DRw_gIDtkXc9-NwYpI0u () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello, try something like:

self.comboBox.currentIndexChanged.connect(self.onCurrentIndexChanged)


> def onCurrentIndexChanged(self, newIndex):

    self.comboBox.adjustSize() # Don't know if this works automagically, but
> given the newIndex argument,

                                                you could fetch the current
> selected string and calculate the required width yourself in the worst case



On Thu, May 27, 2010 at 12:01 PM, aaron barclay <aaron.diplopic@gmail.com>wrote:

> Hello,
>
> I am having trouble setting a QComboBox. I would like the ComboBox to be
> quite narrow, that is easy enough, but when clicked on I would like the
> combobox to expand the listed results to full width of the text. Is this
> possible? Any help appreciated.
>
> Regards,
> aaron.
>
>
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



-- 
Nick Gaens

[Attachment #5 (text/html)]

Hello, try something like:<div><br></div><blockquote class="gmail_quote" \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; \
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: \
solid; padding-left: 1ex; "> \
self.comboBox.currentIndexChanged.connect(self.onCurrentIndexChanged)</blockquote><blockquote \
class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); \
border-left-style: solid; padding-left: 1ex; "> <br></blockquote><blockquote \
class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); \
border-left-style: solid; padding-left: 1ex; "> def onCurrentIndexChanged(self, \
newIndex):  </blockquote><blockquote class="gmail_quote" style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; \
border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; \
">  self.comboBox.adjustSize() # Don&#39;t know if this works automagically, but \
given the newIndex argument, </blockquote><blockquote class="gmail_quote" \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; \
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: \
solid; padding-left: 1ex; ">  you could fetch the current selected string and \
calculate the required width yourself in the worst \
case</blockquote><div><br></div><div><br><div class="gmail_quote">On Thu, May 27, \
2010 at 12:01 PM, aaron barclay <span dir="ltr">&lt;<a \
href="mailto:aaron.diplopic@gmail.com">aaron.diplopic@gmail.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;">Hello,<br><br>I am having trouble setting a QComboBox. \
I would like the ComboBox to be quite narrow, that is easy enough, but when clicked \
on I would like the combobox to expand the listed results to full width of the text. \
Is this possible? Any help appreciated.<br>

<br>Regards,<br><font color="#888888">aaron.<br><br>
</font><br>_______________________________________________<br>
PyQt mailing list    <a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br><br \
clear="all"><br>-- <br>Nick Gaens<br> </div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic