Hi,

I'm working on a custom widget, I've created a file plugin and I can use
my widget into the Designer.

So, this widget has a property 'orientation' wich may take two values:
'east' or 'west'.

Into the properties editor this property appears with a lineEdit, how
can make
to change this lineEdit to a comboBox with the two values?

This is the code for this property:

    def getOrientation(self):
         return self.orientation_

    def setOrientation(self, orientation):
        """Sets the orientation of the widgets.

        Args:
        orientation -- str() 'east', the widgets are placed from left to
                        right (default) or 'west'
        """

        if orientation not in ('east', 'west'):
            raise ValueError('VToolHeader.setOrientation(orientation)
arg 1 has'
                                ' unexpected value {0}'.format(orientation))

        if orientation != self.orientation_:
            self.orientation_ = orientation
            self.__set_direction()

            if self.collapsible_:
                self.collapse_btn.update_icon()

    orientation = pyqtProperty('QString', getOrientation, setOrientation)


Thanks for all advices

-- 
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>

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

Reply via email to