Example #1
0
    def __init__(self, url, username, password):
        MustChooseDialog.__init__(self, None)
        self.setWindowTitle(m18n('Create User Account') + ' - Kajongg')
        self.buttonBox = KDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        vbox = QVBoxLayout(self)
        grid = QFormLayout()
        self.lbServer = QLabel()
        self.lbServer.setText(url)
        grid.addRow(m18n('Game server:'), self.lbServer)
        self.lbUser = QLabel()
        grid.addRow(m18n('Username:'******'Password:'******'Repeat password:'), self.edPassword2)
        vbox.addLayout(grid)
        vbox.addWidget(self.buttonBox)
        pol = QSizePolicy()
        pol.setHorizontalPolicy(QSizePolicy.Expanding)
        self.lbUser.setSizePolicy(pol)

        self.edPassword.textChanged.connect(self.passwordChanged)
        self.edPassword2.textChanged.connect(self.passwordChanged)
        StateSaver(self)
        self.username = username
        self.password = password
        self.passwordChanged()
        self.edPassword2.setFocus()
Example #2
0
 def setupUi(self):
     """create all Ui elements but do not fill them"""
     buttonBox = KDialogButtonBox(self)
     buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
     # Ubuntu 11.10 unity is a bit strange - without this, it sets focus on
     # the cancel button (which it shows on the left). I found no obvious
     # way to use setDefault and setAutoDefault for fixing this.
     buttonBox.button(QDialogButtonBox.Ok).setFocus(True)
     buttonBox.accepted.connect(self.accept)
     buttonBox.rejected.connect(self.reject)
     vbox = QVBoxLayout(self)
     self.grid = QFormLayout()
     self.cbServer = QComboBox()
     self.cbServer.setEditable(True)
     self.grid.addRow(m18n('Game server:'), self.cbServer)
     self.cbUser = QComboBox()
     self.cbUser.setEditable(True)
     self.grid.addRow(m18n('Username:'******'Password:'******'kajongg', 'Ruleset:'), self.cbRuleset)
     vbox.addLayout(self.grid)
     vbox.addWidget(buttonBox)
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     self.cbUser.setSizePolicy(pol)
Example #3
0
 def setupUi(self):
     """create all Ui elements but do not fill them"""
     buttonBox = KDialogButtonBox(self)
     buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                  | QDialogButtonBox.Ok)
     # Ubuntu 11.10 unity is a bit strange - without this, it sets focus on
     # the cancel button (which it shows on the left). I found no obvious
     # way to use setDefault and setAutoDefault for fixing this.
     buttonBox.button(QDialogButtonBox.Ok).setFocus(True)
     buttonBox.accepted.connect(self.accept)
     buttonBox.rejected.connect(self.reject)
     vbox = QVBoxLayout(self)
     self.grid = QFormLayout()
     self.cbServer = QComboBox()
     self.cbServer.setEditable(True)
     self.grid.addRow(m18n('Game server:'), self.cbServer)
     self.cbUser = QComboBox()
     self.cbUser.setEditable(True)
     self.grid.addRow(m18n('Username:'******'Password:'******'kajongg', 'Ruleset:'), self.cbRuleset)
     vbox.addLayout(self.grid)
     vbox.addWidget(buttonBox)
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     self.cbUser.setSizePolicy(pol)
Example #4
0
 def __init__(self, parent):
     # initialize the super class
     super(XViewPanel,self).__init__( parent )
     
     # create custom properties
     self._locked = False
     
     # set the size policy for this widget to always maximize space
     sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     sizePolicy.setHorizontalStretch(1)
     sizePolicy.setVerticalStretch(1)
     
     self.setSizePolicy(sizePolicy)
     self.setTabsClosable(True)
     self.setMovable(True)
     self.setAcceptDrops(True)
     
     # update the tab bar
     self.tabBar().installEventFilter(self)
     self.tabBar().setAcceptDrops(True)
     
     # create connections
     self.tabCloseRequested.connect( self.closeView )
     self.addRequested.connect( self.showAddMenu )
     self.currentChanged.connect( self.markCurrentChanged )
     self.optionsRequested.connect( self.showOptionsMenu )
     
     self.tabBar().customContextMenuRequested.connect( self.showTabMenu )
Example #5
0
    def __init__(self, url, username, password):
        MustChooseDialog.__init__(self, None)
        self.setWindowTitle(m18n('Create User Account') + ' - Kajongg')
        self.buttonBox = KDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        vbox = QVBoxLayout(self)
        grid = QFormLayout()
        self.lbServer = QLabel()
        self.lbServer.setText(url)
        grid.addRow(m18n('Game server:'), self.lbServer)
        self.lbUser = QLabel()
        grid.addRow(m18n('Username:'******'Password:'******'Repeat password:'), self.edPassword2)
        vbox.addLayout(grid)
        vbox.addWidget(self.buttonBox)
        pol = QSizePolicy()
        pol.setHorizontalPolicy(QSizePolicy.Expanding)
        self.lbUser.setSizePolicy(pol)

        self.edPassword.textChanged.connect(self.passwordChanged)
        self.edPassword2.textChanged.connect(self.passwordChanged)
        StateSaver(self)
        self.username = username
        self.password = password
        self.passwordChanged()
        self.edPassword2.setFocus()
Example #6
0
    def __init__(self, parent=None):
        super(ActionWidget, self).__init__(parent)
        self.drawButton = QPushButton("Draw")
        self.cardButton = QPushButton("Use\nCard")
        self.healMainButton = QPushButton("Heal\nMain")

        # Button dimensions
        button_policy = QSizePolicy(QSizePolicy.Preferred,
                                    QSizePolicy.Preferred)
        button_policy.setHeightForWidth(True)
        self.drawButton.setSizePolicy(button_policy)
        self.cardButton.setSizePolicy(button_policy)
        self.healMainButton.setSizePolicy(button_policy)

        # dimensions
        policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        self.setSizePolicy(policy)

        # layout
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.addWidget(self.drawButton)
        self.horizontalLayout.addWidget(self.cardButton)
        self.horizontalLayout.addWidget(self.healMainButton)
        self.setLayout(self.horizontalLayout)

        self.show()
Example #7
0
    def __init__(self,parent = None,flags = Qt.Widget):
        super(ZTextWidget,self).__init__(parent,flags)
        sp = QSizePolicy()
        sp.setHorizontalPolicy(QSizePolicy.Fixed)
        sp.setVerticalPolicy(QSizePolicy.Fixed)
        self.setSizePolicy(sp)
        self.setFocusPolicy(Qt.StrongFocus)
        self.pbuffer[0] = QImage(640,480,QImage.Format_RGB32)
        self.pbuffer[0].fill(0)
        font = self.font()
        self.normal_font = font
        self.fixed_font = QFont(font)
        self.fixed_font.setStyleHint(QFont.Monospace)
        self.fixed_font.setFamily(self.fixed_font.defaultFamily())
        self.fixed_font.setPointSize(9)
        print self.fixed_font.family()
        #self.setFont(self.normal_font)
        self.setFont(self.fixed_font)
        self.pbuffer_painter[0] = QPainter(self.pbuffer[0])
        self.pbuffer_painter[0].setFont(self.fixed_font)

        self.font_metrics = self.pbuffer_painter[0].fontMetrics()

        self.linesize = self.font_metrics.height()
        self.avgwidth = self.font_metrics.averageCharWidth()
        print self.font_metrics.averageCharWidth(), self.linesize, self.avgwidth
        print self.font_metrics.height()
        self.width = (self.pbuffer[0].width() - 4) / self.font_metrics.averageCharWidth()
        self.height = self.pbuffer[0].height() / self.linesize

        self.pbuffer_painter[0].setFont(self.normal_font)
        self.set_text_colour(self.cur_fg, 0)
        self.set_text_background_colour(self.cur_bg, 0)
    def __init__(self, parameter, parent=None):
        """Constructor

        .. versionadded:: 2.2

        :param parameter: A NumericParameter object.
        :type parameter: NumericParameter

        """
        super(NumericParameterWidget, self).__init__(parameter, parent)

        self._input = QWidget()

        self._unit_widget = QLabel()
        self.set_unit()

        # Size policy
        self._spin_box_size_policy = QSizePolicy(QSizePolicy.Fixed,
                                                 QSizePolicy.Fixed)

        label_policy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        self._unit_widget.setSizePolicy(label_policy)

        # Add unit description to description
        description = self._description_label.text()
        description += '<br><br>Available units:'
        description += '<ul>'
        for allowed_unit in self._parameter.allowed_units:
            description += '<li>'
            description += '<b>' + allowed_unit.name + '</b>: '
            description += allowed_unit.description
            description += '</li>'
        description += '</ul>'
        self._description_label.setText(description)
 def _drawButtons(self, logoFnam):
     gbox = QGroupBox()
     spol = QSizePolicy()
     spol.horizontalPolicy = QSizePolicy.Maximum
     gbox.setSizePolicy(spol)
     vbox = QVBoxLayout()
     
     if os.path.isfile(logoFnam):
         img = QPixmap(logoFnam)    #.scaled(64, 64)
         lblLogo = QLabel()
         lblLogo.setPixmap(img)
         lblLogo.setAlignment(Qt.AlignTop | Qt.AlignRight)
         vbox.addWidget(lblLogo)
         #vbox.addSpacing(3) 
     
     self.butSave = self._drawButton(vbox, "M&odify", 'closeSave')
     font = QFont()
     font.setBold(True)
     self.butSave.setFont(font)
     self.butCancel = self._drawButton(vbox, "Cancel", 'closeCancel', True)
     vbox.addSpacing(36)
     self.butAddRule = self._drawButton(vbox, "Add Rule", 'addRule', True)
     self.butCopyRule = self._drawButton(vbox, "Copy Rule", 'copyRule')
     self.butDelRule = self._drawButton(vbox, "Delete Rule", 'delRule')
     self.butMoveRuleUp = self._drawButton(vbox, "Move Rule Up", 'moveRuleUp')
     self.butMoveRuleDn = self._drawButton(vbox, "Move Rule Down", 'moveRuleDown')
     vbox.addSpacing(24)
     self.butAddCond = self._drawButton(vbox, "Add Condition", 'addCond')
     self.butDelCond = self._drawButton(vbox, "Delete Condition", 'delCond')
     vbox.addSpacing(15)
     self.butAddAction = self._drawButton(vbox, "Add Action", 'addAction')
     self.butDelAction = self._drawButton(vbox, "Delete Action", 'delAction')
     
     gbox.setLayout(vbox)
     self.mainHSplit.addWidget(gbox) 
    def __init__(self, values):
        figure = Figure()
        FigureCanvasQTAgg.__init__(self, figure)
        prop = font_manager.FontProperties(fname='resources/fonts/FUTURA_LT_LIGHT.TTF')
        
        sizePolicy = QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred)
        sizePolicy.setHeightForWidth(True)
        self.setSizePolicy(sizePolicy)
        
        self.subplot = Axes3D(figure)
        self.figure = figure
        
        xs, ys, zs = zip(*values)
        self.subplot.scatter(xs, ys, zs)

        self.xlabel = self.subplot.set_xlabel('COORDENADA X')
        self.ylabel = self.subplot.set_ylabel('COORDENADA Y')
        self.zlabel = self.subplot.set_zlabel('COORDENADA Z')
        
        for label in [self.xlabel, self.ylabel, self.zlabel]:
            label.set_color(Color.matplotlib('DARK_DARK_GRAY'))
            label.set_fontproperties(prop)
            label.set_fontsize(12)
        
        for axis in [self.subplot.w_xaxis, self.subplot.w_yaxis, self.subplot.w_zaxis]:
            axis.set_pane_color(Color.matplotlib('SOFT_SOFT_GRAY'))
            for tick in axis.get_major_ticks():
                tick.label1.set_color(Color.matplotlib('DARK_DARK_GRAY'))
                tick.label1.set_fontproperties(prop)
                tick.label1.set_fontsize(9)
Example #11
0
    def __init__(self, image_width, image_height, parent=None):
        super(UserButtonMenu, self).__init__(parent)

        self.image_width = image_width
        self.image_height = image_height

        self.label = QLabel(self)
        self.label.setScaledContents(True)
        self.label.setSizePolicy(
            QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored))

        self.imageLabel = QLabel(self)
        self.imageLabel.setScaledContents(True)
        self.imageLabel.setSizePolicy(
            QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum))

        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum))

        self.userMenu = QMenu('user accounts menu')  # TODO Remove magic

        hbox = QHBoxLayout()
        hbox.addWidget(self.imageLabel)
        hbox.addWidget(self.label)
        self.setLayout(hbox)
        self.setMenu(self.userMenu)
Example #12
0
 def initui(self):
     self.setObjectName("Snapshot%d" % self.num)
     self.screenshot.setText("Snapshot %d" % self.num)
     sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding,
                              QSizePolicy.MinimumExpanding)
     sizePolicy.setHeightForWidth(True)
     self.setSizePolicy(sizePolicy)
Example #13
0
 def __init__(self, game, parent = None):
     QWidget.__init__(self, parent)
     self.game = game
     self.currentTerritory = None
     self.coloredMaskCache = ColoredMaskCache()
     self.animations = []
     self.source = None
     self.sourceAnimation = None
     self.scaleFactor = 1.0
     self.showRegionMap = False
     policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     policy.setHeightForWidth(True)
     self.setSizePolicy(policy)
     self.setMouseTracking(True)
     self.setFocusPolicy(Qt.StrongFocus)
     self.setEnabled(False)
     self.loadImages()
     toggleRegionMap = QAction(self,
                               shortcutContext=Qt.ApplicationShortcut,
                               shortcut=Qt.Key_B,
                               triggered=self.toggleShowRegionMap)
     cancelSelection = QAction(self,
                               shortcutContext=Qt.ApplicationShortcut,
                               shortcut=Qt.Key_Escape,
                               triggered=self.cancelSelection)
     self.addAction(toggleRegionMap)
     self.addAction(cancelSelection)
Example #14
0
    def buildToolBar(self):
        self.toolBar = QToolBar()
        self.toolBar.layout().setContentsMargins(0, 0, 0, 0)

        # Reload button
        self.reloadButton = QToolButton(self.toolBar)
        self.reloadButton.setIcon(QIcon(self.reloadPixmap))
        self.reloadButton.setSizePolicy(
            QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.reloadButton.setAutoRaise(True)
        self.reloadButton.setBackgroundRole(self.backgroundRole())
        self.reloadButton.setToolTip(self.str_RELOAD)
        self.connect(self.reloadButton, SIGNAL("clicked()"), self.refreshView)
        self.toolBar.addWidget(self.reloadButton)

        # Save button
        self.saveButton = QToolButton(self.toolBar)
        self.saveButton.setIcon(QIcon(self.savePixmap))
        self.saveButton.setSizePolicy(
            QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.saveButton.setAutoRaise(True)
        self.saveButton.setBackgroundRole(self.backgroundRole())
        self.saveButton.setToolTip(self.str_SAVE)
        self.connect(self.saveButton, SIGNAL("clicked()"), self.saveObject)
        self.toolBar.addWidget(self.saveButton)

        self.toolBar.addSeparator()

        # Add attribute button
        self.addAttributeButton = QToolButton(self.toolBar)
        self.addAttributeButton.setIcon(QIcon(self.addPixmap))
        self.addAttributeButton.setSizePolicy(
            QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.addAttributeButton.setAutoRaise(True)
        self.addAttributeButton.setBackgroundRole(self.backgroundRole())
        self.addAttributeButton.setToolTip(self.str_ADD)
        self.connect(self.addAttributeButton, SIGNAL("clicked()"),
                     self.addAttribute)
        self.toolBar.addWidget(self.addAttributeButton)

        # Delete button
        self.deleteObjectButton = QToolButton(self.toolBar)
        self.deleteObjectButton.setIcon(QIcon(self.deleteSmallPixmap))
        self.deleteObjectButton.setSizePolicy(
            QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.deleteObjectButton.setAutoRaise(True)
        self.deleteObjectButton.setBackgroundRole(self.backgroundRole())
        self.deleteObjectButton.setToolTip(self.str_DELETE)
        self.connect(self.deleteObjectButton, SIGNAL("clicked()"),
                     self.deleteObject)
        self.toolBar.addWidget(self.deleteObjectButton)

        self.comboBox.setToolTip(self.str_SWITCH_VIEWS)
        self.connect(self.comboBox, SIGNAL("currentIndexChanged(int)"),
                     self.changeView)
        self.toolBar.addWidget(self.comboBox)

        self.enableToolButtons(False)
        self.layout().insertWidget(0, self.toolBar)
Example #15
0
    def __changePlotWidget(self):
        """
        When plot widget is change (qwt <-> matplotlib)
        """
        self.__activateMouseTracking(False)
        while self.__frameLayout.count():
            child = self.__frameLayout.takeAt(0)
            child.widget().deleteLater()
        self.__plotWdg = None

        if self.__lib == 'Qwt5':
            self.__plotWdg = QwtPlot(self.__plotFrame)
            sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
            sizePolicy.setHorizontalStretch(10)
            sizePolicy.setVerticalStretch(0)
            self.__plotWdg.setSizePolicy(sizePolicy)
            self.__plotWdg.setAutoFillBackground(False)
            # Decoration
            self.__plotWdg.setCanvasBackground(Qt.white)
            self.__plotWdg.plotLayout().setAlignCanvasToScales(False)
            self.__plotWdg.plotLayout().setSpacing(100)
            self.__plotWdg.plotLayout().setCanvasMargin(10, QwtPlot.xBottom)
            self.__plotWdg.plotLayout().setCanvasMargin(10, QwtPlot.yLeft)
            title = QwtText(QCoreApplication.translate("VDLTools", "Distance [m]"))
            title.setFont(QFont("Helvetica", 10))
            self.__plotWdg.setAxisTitle(QwtPlot.xBottom, title)
            title.setText(QCoreApplication.translate("VDLTools", "Elevation [m]"))
            title.setFont(QFont("Helvetica", 10))
            self.__plotWdg.setAxisTitle(QwtPlot.yLeft, title)
            self.__zoomer = QwtPlotZoomer(QwtPlot.xBottom, QwtPlot.yLeft, QwtPicker.DragSelection, QwtPicker.AlwaysOff,
                                          self.__plotWdg.canvas())
            self.__zoomer.setRubberBandPen(QPen(Qt.blue))
            grid = QwtPlotGrid()
            grid.setPen(QPen(QColor('grey'), 0, Qt.DotLine))
            grid.attach(self.__plotWdg)
            self.__frameLayout.addWidget(self.__plotWdg)

        elif self.__lib == 'Matplotlib':
            fig = Figure((1.0, 1.0), linewidth=0.0, subplotpars=SubplotParams(left=0, bottom=0, right=1, top=1,
                                                                              wspace=0, hspace=0))

            font = {'family': 'arial', 'weight': 'normal', 'size': 12}
            rc('font', **font)

            rect = fig.patch
            rect.set_facecolor((0.9, 0.9, 0.9))

            self.__axes = fig.add_axes((0.07, 0.16, 0.92, 0.82))
            self.__axes.set_xbound(0, 1000)
            self.__axes.set_ybound(0, 1000)
            self.__manageMatplotlibAxe(self.__axes)
            self.__plotWdg = FigureCanvasQTAgg(fig)
            sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            self.__plotWdg.setSizePolicy(sizePolicy)
            self.__frameLayout.addWidget(self.__plotWdg)
Example #16
0
 def __init__(self, parent=None):
     QStackedWidget.__init__(self, parent)
     sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding,
                              QSizePolicy.MinimumExpanding)
     sizePolicy.setVerticalStretch(1)
     self.setSizePolicy(sizePolicy)
     self.currentWidget = None
     self.loader = loader()
     self.moduleName = None
Example #17
0
 def __init__(self, parent=None):
     QTableView.__init__(self, parent)
     self.horizontalHeader().setStretchLastSection(True)
     self.setAlternatingRowColors(True)
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     pol.setVerticalPolicy(QSizePolicy.Expanding)
     self.setSizePolicy(pol)
     self.verticalHeader().hide()
Example #18
0
 def __init__(self,parent = None,flags = Qt.Widget):
     super(ZTextWidget,self).__init__(parent,flags)
     sp = QSizePolicy()
     sp.setHorizontalPolicy(QSizePolicy.Fixed)
     sp.setVerticalPolicy(QSizePolicy.Fixed)
     self.set_fixed_font("DeJa Vu Sans Mono", 9)
     self.setSizePolicy(sp)
     self.setFocusPolicy(Qt.StrongFocus)
     self._ostream = [ZStream(), ZStream(), ZStream(), ZStream()]
     self._ostream[0].selected = True
     for i in xrange(self.width *  self.height * 4):
         self.buf.append(0)
Example #19
0
 def sizepolicy(value):
     """
     Returns a string representation of a QSizePolicy.
     @param value QSizePolicy
     @returns str
     """
     horiz = QSizePolicy.Policy(value.horizontalPolicy())
     vert = QSizePolicy.Policy(value.verticalPolicy())
     return '{}, {}, Stretch: {} x {}'.format(SizePolicies[horiz],
                                              SizePolicies[vert],
                                              value.horizontalStretch(),
                                              value.verticalStretch())
Example #20
0
    def __init__( self, parent = None ):
        QComboBox.__init__( self, parent )
        self.setSizeAdjustPolicy( QComboBox.AdjustToMinimumContentsLength )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
        sizePolicy.setHeightForWidth(
                self.sizePolicy().hasHeightForWidth() )
        self.setSizePolicy( sizePolicy )
        self.activated.connect( self.onActivated )

        self.view().installEventFilter( self )

        self.pathIndex = None
        return
Example #21
0
    def settings(self, parent):
        # CRIANDO LABEL PARA SELECIONAR O TEMPO DE AMOSTRAGEM
        self.lbTimeAmostragem = QLabel(parent)
        mensagem = "Digite o tempo de amostragem em segundos (Deve ser no mínimo 2 segundos): "
        self.lbTimeAmostragem.setText(mensagem)
        self.lbTimeAmostragem.setAlignment(Qt.AlignCenter)

        # CRIANDO O LINEEDIT PARA SELECIONAR O TEMPO DE AMOSTRAGEM
        self.LETimeAmostragem = QLineEdit(parent)
        sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.LETimeAmostragem.sizePolicy().hasHeightForWidth())
        self.LETimeAmostragem.setSizePolicy(sizePolicy)
        self.LETimeAmostragem.setMaximumSize(QSize(40, 16777215))
        self.LETimeAmostragem.setLayoutDirection(Qt.LeftToRight)
        self.validator = QIntValidator(0, 999999, self)
        self.LETimeAmostragem.setValidator(self.validator)

        # CRIANDO UM SPACER PARA ORGANIZAR DENTRO DO LAYOUT OS ITENS
        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                 QSizePolicy.Minimum)

        # ADICIONANDO OS WIDGETS NO LAYOUT
        self.addWidget(self.lbTimeAmostragem)
        self.addWidget(self.LETimeAmostragem)
        self.addItem(spacerItem)
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        while not isinstance(parent, QDialog):
            parent = parent.parent()
        self.setObjectName("CheckedListBox" +
                           str(len(parent.findChildren(CheckedListBox))))

        self.setObjectName("checkBoxWidget")
        self.hLayout = QHBoxLayout(self)
        self.hLayout.setObjectName("hLayout")

        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)

        # self.frame = Frame()
        self.listView = QListView(self)
        self.hLayout.addWidget(self.listView)

        self.stdModel = QStandardItemModel()
        self.listView.setModel(self.stdModel)

        self.hasObject = False
        self.objList = []

        self.checkBoxList = []

        self.listView.pressed.connect(self.listView_clicked)
Example #23
0
    def __getIDEWideGroupbox(self):
        " Creates the IDE wide groupbox "
        ideGroupbox = QGroupBox(self)
        ideGroupbox.setTitle("IDE Wide Settings")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            ideGroupbox.sizePolicy().hasHeightForWidth())
        ideGroupbox.setSizePolicy(sizePolicy)

        layoutIDE = QHBoxLayout(ideGroupbox)

        termGroupbox = self.__getTermGroupbox()
        termGroupbox.setTitle("Terminal to run in")
        layoutIDE.addWidget(termGroupbox)

        if self.__action == "profile":
            # Profile version of the dialog
            limitsGroupbox = self.__getProfileLimitsGroupbox()
            layoutIDE.addWidget(limitsGroupbox)
        else:
            # Debug version of the dialog
            dbgGroupbox = self.__getDebugGroupbox()
            layoutIDE.addWidget(dbgGroupbox)
        return ideGroupbox
Example #24
0
    def __getTermGroupbox(self):
        " Creates the term groupbox "
        termGroupbox = QGroupBox(self)
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            termGroupbox.sizePolicy().hasHeightForWidth())
        termGroupbox.setSizePolicy(sizePolicy)

        layoutTerm = QVBoxLayout(termGroupbox)
        self.__redirectRButton = QRadioButton(termGroupbox)
        self.__redirectRButton.setText("&Redirect to IDE")
        self.__redirectRButton.toggled.connect(self.__redirectedChanged)
        layoutTerm.addWidget(self.__redirectRButton)
        self.__autoRButton = QRadioButton(termGroupbox)
        self.__autoRButton.setText("Aut&o detection")
        layoutTerm.addWidget(self.__autoRButton)
        self.__konsoleRButton = QRadioButton(termGroupbox)
        self.__konsoleRButton.setText("Default &KDE konsole")
        layoutTerm.addWidget(self.__konsoleRButton)
        self.__gnomeRButton = QRadioButton(termGroupbox)
        self.__gnomeRButton.setText("gnome-&terminal")
        layoutTerm.addWidget(self.__gnomeRButton)
        self.__xtermRButton = QRadioButton(termGroupbox)
        self.__xtermRButton.setText("&xterm")
        layoutTerm.addWidget(self.__xtermRButton)
        return termGroupbox
Example #25
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)

        self.resize(290, 136)
        self.setWindowTitle("Surfaces")
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.lstSurfaces = CheckedListBox(self)
        verticalLayoutDlg.addWidget(self.lstSurfaces)

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)

        self.btnOK = self.btnBoxOkCancel.button(QDialogButtonBox.Ok)

        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)
        self.connect(self.btnBoxOkCancel, SIGNAL("rejected()"), self.reject)

        verticalLayoutDlg.addWidget(self.btnBoxOkCancel)
    def __init__(self, parent=None, string_0=None):
        QDialog.__init__(self, parent)

        self.resize(100, 70)
        self.setWindowTitle("Edit Comment")
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.txtComment = TextBoxPanel(self)
        self.txtComment.Caption = ""
        self.txtComment.LabelWidth = 0
        verticalLayoutDlg.addWidget(self.txtComment)

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)
        self.btnOK = self.btnBoxOkCancel.button(QDialogButtonBox.Ok)
        # btnOK.setText("Create")
        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)
        self.connect(self.btnBoxOkCancel, SIGNAL("rejected()"), self.reject)
        self.connect(self.txtComment, SIGNAL("Event_0"),
                     self.txtComment_TextChanged)

        self.txtComment.Value = string_0
        self.btnOK.setEnabled(False)
    def __init__(self, parent, title, valueList=None):
        QDialog.__init__(self, parent)

        self.resize(100, 70)
        self.setWindowTitle(title)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.frameBasic = Frame(self)
        verticalLayoutDlg.addWidget(self.frameBasic)

        self.pnlName = TextBoxPanel(self.frameBasic)
        self.pnlName.Caption = "Name"
        self.pnlName.LabelWidth = 120
        self.frameBasic.Add = self.pnlName

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)
        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)
        self.connect(self.btnBoxOkCancel, SIGNAL("rejected()"), self.reject)

        verticalLayoutDlg.addWidget(self.btnBoxOkCancel)

        self.name = ""

        if valueList != None:
            self.pnlName.Value = valueList[0]
Example #28
0
    def __getDebugGroupbox(self):
        " Creates the debug settings groupbox "
        dbgGroupbox = QGroupBox(self)
        dbgGroupbox.setTitle("Debugger")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            dbgGroupbox.sizePolicy().hasHeightForWidth())
        dbgGroupbox.setSizePolicy(sizePolicy)

        dbgLayout = QVBoxLayout(dbgGroupbox)
        self.__reportExceptionCheckBox = QCheckBox("Report &exceptions")
        self.__reportExceptionCheckBox.stateChanged.connect(
            self.__onReportExceptionChanged)
        self.__traceInterpreterCheckBox = QCheckBox("T&race interpreter libs")
        self.__traceInterpreterCheckBox.stateChanged.connect(
            self.__onTraceInterpreterChanged)
        self.__stopAtFirstCheckBox = QCheckBox("Stop at first &line")
        self.__stopAtFirstCheckBox.stateChanged.connect(
            self.__onStopAtFirstChanged)
        self.__autoforkCheckBox = QCheckBox("&Fork without asking")
        self.__autoforkCheckBox.stateChanged.connect(self.__onAutoforkChanged)
        self.__debugChildCheckBox = QCheckBox("Debu&g child process")
        self.__debugChildCheckBox.stateChanged.connect(self.__onDebugChild)

        dbgLayout.addWidget(self.__reportExceptionCheckBox)
        dbgLayout.addWidget(self.__traceInterpreterCheckBox)
        dbgLayout.addWidget(self.__stopAtFirstCheckBox)
        dbgLayout.addWidget(self.__autoforkCheckBox)
        dbgLayout.addWidget(self.__debugChildCheckBox)
        return dbgGroupbox
Example #29
0
    def __getProfileLimitsGroupbox(self):
        " Creates the profile limits groupbox "
        limitsGroupbox = QGroupBox(self)
        limitsGroupbox.setTitle("Profiler diagram limits")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            limitsGroupbox.sizePolicy().hasHeightForWidth())
        limitsGroupbox.setSizePolicy(sizePolicy)

        layoutLimits = QGridLayout(limitsGroupbox)
        self.__nodeLimitEdit = QLineEdit()
        self.__nodeLimitEdit.textEdited.connect(self.__setRunButtonProps)
        self.__nodeLimitValidator = QDoubleValidator(0.0, 100.0, 2, self)
        self.__nodeLimitValidator.setNotation(
            QDoubleValidator.StandardNotation)
        self.__nodeLimitEdit.setValidator(self.__nodeLimitValidator)
        nodeLimitLabel = QLabel("Hide nodes below")
        self.__edgeLimitEdit = QLineEdit()
        self.__edgeLimitEdit.textEdited.connect(self.__setRunButtonProps)
        self.__edgeLimitValidator = QDoubleValidator(0.0, 100.0, 2, self)
        self.__edgeLimitValidator.setNotation(
            QDoubleValidator.StandardNotation)
        self.__edgeLimitEdit.setValidator(self.__edgeLimitValidator)
        edgeLimitLabel = QLabel("Hide edges below")
        layoutLimits.addWidget(nodeLimitLabel, 0, 0)
        layoutLimits.addWidget(self.__nodeLimitEdit, 0, 1)
        layoutLimits.addWidget(QLabel("%"), 0, 2)
        layoutLimits.addWidget(edgeLimitLabel, 1, 0)
        layoutLimits.addWidget(self.__edgeLimitEdit, 1, 1)
        layoutLimits.addWidget(QLabel("%"), 1, 2)
        return limitsGroupbox
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)

        self.resize(290, 136)
        self.setWindowTitle("Effective Date")
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.groupBox = GroupBox(self)
        verticalLayoutDlg.addWidget(self.groupBox)

        self.dtpDate = QDateTimeEdit(self.groupBox)
        self.dtpDate.setObjectName(("dtpDate"))
        self.dtpDate.setDateTime(QDateTime.currentDateTime())
        self.groupBox.Add = self.dtpDate

        self.calendar = QCalendarWidget(self.groupBox)
        self.groupBox.Add = self.calendar
        self.calendar.clicked.connect(self.calendar_clicked)

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)
        # btnOK = self.btnBoxOkCancel.button(QDialogButtonBox.Ok)
        # btnOK.setText("Create")
        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)
        self.connect(self.btnBoxOkCancel, SIGNAL("rejected()"), self.reject)

        verticalLayoutDlg.addWidget(self.btnBoxOkCancel)
Example #31
0
    def __init__(self, parent, title, valueList=None):
        QDialog.__init__(self, parent)

        self.resize(100, 70)
        self.setWindowTitle(title)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.frameBasic = Frame(self)
        verticalLayoutDlg.addWidget(self.frameBasic)

        self.pnlName = TextBoxPanel(self.frameBasic)
        self.pnlName.Caption = "Name"
        self.pnlName.LabelWidth = 120
        self.frameBasic.Add = self.pnlName

        self.pnlLowerLimit = DistanceBoxPanel(self.frameBasic, DistanceUnits.M)
        self.pnlLowerLimit.Caption = "Lower Limit"
        self.pnlLowerLimit.Button = None
        self.pnlLowerLimit.LabelWidth = 120
        self.frameBasic.Add = self.pnlLowerLimit

        self.pnlUpperLimit = DistanceBoxPanel(self.frameBasic, DistanceUnits.M)
        self.pnlUpperLimit.Caption = "Upper Limit"
        self.pnlUpperLimit.Button = None
        self.pnlUpperLimit.LabelWidth = 120
        self.frameBasic.Add = self.pnlUpperLimit

        self.pnlRadius = DistanceBoxPanel(self.frameBasic, DistanceUnits.M)
        self.pnlRadius.Caption = "Radius"
        self.pnlRadius.Button = None
        self.pnlRadius.LabelWidth = 120
        self.frameBasic.Add = self.pnlRadius

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)
        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)
        self.connect(self.btnBoxOkCancel, SIGNAL("rejected()"), self.reject)

        verticalLayoutDlg.addWidget(self.btnBoxOkCancel)

        self.name = ""
        self.lowerLimit = ""
        self.upperLimit = ""
        self.radius = ""

        if valueList != None:
            self.pnlName.Value = valueList[0]
            self.pnlLowerLimit.Value = Distance(float(valueList[1]))
            self.pnlUpperLimit.Value = Distance(float(valueList[2]))
            if valueList[3] != None and valueList[3] != "":
                self.pnlRadius.Value = Distance(float(valueList[3]))
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.resize(100, 70)
        self.setWindowTitle("Request Activation Code")
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        verticalLayoutDlg = QVBoxLayout(self)
        verticalLayoutDlg.setObjectName(("verticalLayoutDlg"))

        self.groupBox1 = GroupBox(self)
        self.groupBox1.Caption = ""
        verticalLayoutDlg.addWidget(self.groupBox1)

        self.txtName = TextBoxPanel(self.groupBox1)
        self.txtName.Caption = "Name"
        self.txtName.LabelWidth = 80
        self.txtName.Width = 200
        self.groupBox1.Add = self.txtName

        self.txtCompany = TextBoxPanel(self.groupBox1)
        self.txtCompany.Caption = "Company"
        self.txtCompany.LabelWidth = 80
        self.txtCompany.Width = 200
        self.groupBox1.Add = self.txtCompany

        self.txtAddress = TextBoxPanel(self.groupBox1, True)
        self.txtAddress.Caption = "Address"
        self.txtAddress.LabelWidth = 80
        self.txtAddress.Width = 200
        self.groupBox1.Add = self.txtAddress

        self.txtPhoneNo = TextBoxPanel(self.groupBox1)
        self.txtPhoneNo.Caption = "Phone No."
        self.txtPhoneNo.LabelWidth = 80
        self.txtPhoneNo.Width = 200
        self.groupBox1.Add = self.txtPhoneNo

        self.txtEmail = TextBoxPanel(self.groupBox1)
        self.txtEmail.Caption = "Email"
        self.txtEmail.LabelWidth = 80
        self.txtEmail.Width = 200
        self.groupBox1.Add = self.txtEmail

        self.btnBoxOkCancel = QDialogButtonBox(self)
        self.btnBoxOkCancel.setObjectName(("btnBoxOkCancel"))
        self.btnBoxOkCancel.setStandardButtons(QDialogButtonBox.Cancel
                                               | QDialogButtonBox.Ok)
        btnSendRequest = self.btnBoxOkCancel.button(QDialogButtonBox.Ok)
        btnSendRequest.setText("Send Request")
        btnCancel = self.btnBoxOkCancel.button(QDialogButtonBox.Cancel)
        btnCancel.setVisible(False)

        self.connect(self.btnBoxOkCancel, SIGNAL("accepted()"), self.acceptDlg)

        verticalLayoutDlg.addWidget(self.btnBoxOkCancel)
Example #33
0
 def _button(self, action):
     b = ActionToolBarButton(toolButtonStyle=Qt.ToolButtonIconOnly,
                             sizePolicy=QSizePolicy(QSizePolicy.Minimum,
                                                    QSizePolicy.Minimum))
     b.setDefaultAction(action)
     b.setPopupMode(QtGui.QToolButton.InstantPopup)
     return b
Example #34
0
 def __init__(self, numerator=0, denominator=10, parent=None):
     super(FractionSlider, self).__init__(parent)
     self.__numerator = numerator
     self.__denominator = denominator
     self.setFocusPolicy(Qt.WheelFocus)
     self.setSizePolicy(
         QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed))
Example #35
0
    def __init__(self, parameter, parent=None):
        """Constructor

        .. versionadded:: 2.2

        :param parameter: A IntegerParameter object.
        :type parameter: IntegerParameter

        """
        # Size policy
        self._spin_box_size_policy = QSizePolicy(
            QSizePolicy.Fixed, QSizePolicy.Fixed)

        super(PointParameterWidget, self).__init__(parameter, parent)

        self._input_x = QSpinBox()
        self._input_x.setValue(self._parameter.value[0])
        tool_tip = 'X'
        self._input_x.setToolTip(tool_tip)
        self._input_x.setSizePolicy(self._spin_box_size_policy)

        self._input_y = QSpinBox()
        self._input_y.setValue(self._parameter.value[1])
        tool_tip = 'Y'
        self._input_y.setToolTip(tool_tip)
        self._input_y.setSizePolicy(self._spin_box_size_policy)

        self._inner_input_layout.addWidget(self._input_x)
        self._inner_input_layout.addWidget(self._input_y)
Example #36
0
    def __init__(self):
        super().__init__()
        self.cap = None
        self.snapshot_flash = 0
        self.IMAGE_DIR = tempfile.mkdtemp(prefix='Orange-WebcamCapture-')

        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)
        box = self.controlArea
        image = self.imageLabel = QLabel(margin=0,
                                         alignment=Qt.AlignCenter,
                                         sizePolicy=QSizePolicy(
                                             QSizePolicy.Ignored,
                                             QSizePolicy.Ignored))
        box.layout().addWidget(image, 100)

        self.name_edit = line_edit = gui.lineEdit(box,
                                                  self,
                                                  'image_title',
                                                  'Title:',
                                                  orientation=Qt.Horizontal)
        line_edit.setPlaceholderText(self.DEFAULT_TITLE)

        hbox = gui.hBox(box)
        gui.checkBox(hbox, self, 'avatar_filter', 'Avatar filter')
        button = self.capture_button = QPushButton('Capture',
                                                   self,
                                                   clicked=self.capture_image)
        hbox.layout().addWidget(button, 1000)
        box.layout().addWidget(hbox)

        timer = QTimer(self, interval=40)
        timer.timeout.connect(self.update_webcam_image)
        timer.start()
Example #37
0
 def __init__(self, parent=None):
     """generate a fitting view with our favourite properties"""
     QGraphicsView.__init__(self, parent)
     self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     vpol = QSizePolicy()
     vpol.setHorizontalPolicy(QSizePolicy.Expanding)
     vpol.setVerticalPolicy(QSizePolicy.Expanding)
     self.setSizePolicy(vpol)
     self.setRenderHint(QPainter.Antialiasing)
     self.setRenderHint(QPainter.SmoothPixmapTransform)
     self.setStyleSheet('background: transparent')
     self.setFrameStyle(QFrame.NoFrame)
     self.tilePressed = None
     self.dragObject = None
     self.setFocus()
Example #38
0
    def __init__(self, type_key, title, select_min_time_value=False):
        QWidget.__init__(self)

        self.__type_key = type_key
        self.__type = None

        self.__double_spinner = self.createDoubleSpinner(minimum=-1e15, maximum=1e15)
        self.__integer_spinner = self.createIntegerSpinner(minimum=0, maximum=1e10)

        self.__time_map = ReportStepsModel().getList()
        self.__time_index_map = {}
        for index in range(len(self.__time_map)):
            time = self.__time_map[index]
            self.__time_index_map[time] = index

        self.__time_spinner = self.createTimeSpinner(select_minimum_value=select_min_time_value)

        layout = QVBoxLayout()
        self.setLayout(layout)

        self.__label = QLabel(title)
        self.__label.setAlignment(Qt.AlignHCenter)

        self.__stack = QStackedWidget()
        self.__stack.setSizePolicy(QSizePolicy(QSizePolicy.Preferred))
        self.__stack.addWidget(self.__integer_spinner)
        self.__stack.addWidget(self.__double_spinner)
        self.__stack.addWidget(self.__time_spinner)

        layout.addWidget(self.__stack)
        layout.addWidget(self.__label)

        self.setLayout(layout)
Example #39
0
    def __init__(self, application=None, title="VISPA"):
        #logging.debug(__name__ + ": __init__")

        self._justActivated = False
        self._startupScreen = None
        self._application = application
        QMainWindow.__init__(self)

        self._tabWidget = QTabWidget(self)
        self._tabWidget.setSizePolicy(
            QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
        self._tabWidget.setUsesScrollButtons(True)
        self.setCentralWidget(self._tabWidget)
        if hasattr(self._tabWidget, "setTabsClosable"):
            self._tabWidget.setTabsClosable(True)

        if "vispa" in title.lower():
            self.createStartupScreen()

        self._fileMenu = self.menuBar().addMenu("&File")
        self._editMenu = self.menuBar().addMenu("&Edit")
        self._helpMenu = self.menuBar().addMenu("&Help")

        self._fileToolBar = self.addToolBar("File")

        self.ensurePolished()
        self.setWindowIcon(QIcon(":/resources/vispabutton.png"))
        self.setWindowTitle(title)
        self.statusBar()

        self._loadIni()
        if self._startupScreen:
            self._startupScreen.raise_()
            self.updateStartupScreenGeometry()
Example #40
0
    def __init__(self, leftFlow=0, rightFlow=0, maxFlow=100, parent=None):
        super(YPipeWidget, self).__init__(parent)

        self.leftSpinBox = QSpinBox(self)
        self.leftSpinBox.setRange(0, maxFlow)
        self.leftSpinBox.setValue(leftFlow)
        self.leftSpinBox.setSuffix(" l/s")
        self.leftSpinBox.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
        self.connect(self.leftSpinBox, SIGNAL("valueChanged(int)"),
                     self.valueChanged)

        self.rightSpinBox = QSpinBox(self)
        self.rightSpinBox.setRange(0, maxFlow)
        self.rightSpinBox.setValue(rightFlow)
        self.rightSpinBox.setSuffix(" l/s")
        self.rightSpinBox.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
        self.connect(self.rightSpinBox, SIGNAL("valueChanged(int)"),
                     self.valueChanged)

        self.label = QLabel(self)
        self.label.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
        self.label.setAlignment(Qt.AlignCenter)
        fm = QFontMetricsF(self.font())
        self.label.setMinimumWidth(fm.width(" 999 l/s "))

        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
        self.setMinimumSize(self.minimumSizeHint())
        self.valueChanged()
Example #41
0
 def __init__(self, tab, default_icon, mouse_over_icon, parent=None):
     super(IconButton, self).__init__(parent)
     self.default_icon = default_icon
     self.mouse_over_icon = mouse_over_icon
     self.setIcon(default_icon)
     self.sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
     self.setMouseTracking(True)
Example #42
0
 def __init__(self, parent=None):
     super(CountersWidget, self).__init__(parent)
     self.setSizePolicy(
         QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
     self.grid = [[BLANK] * 3 for i in range(3)]
     self.selected = [0, 0]
     self.setMinimumSize(self.minimumSizeHint())
 def _setupUi(self):
     if ISWINDOWS:
         self.resize(250, 140)
     else:
         self.resize(340, 165)
     self.setWindowTitle(tr("Re-assign Account"))
     self.verticalLayout = QVBoxLayout(self)
     self.label = QLabel(self)
     self.label.setWordWrap(True)
     self.label.setText(tr("You\'re about to delete a non-empty account. Select an account to re-assign its transactions to."))
     self.verticalLayout.addWidget(self.label)
     self.accountComboBoxView = QComboBox(self)
     sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(self.accountComboBoxView.sizePolicy().hasHeightForWidth())
     self.accountComboBoxView.setSizePolicy(sizePolicy)
     self.accountComboBoxView.setMinimumSize(QSize(200, 0))
     self.verticalLayout.addWidget(self.accountComboBoxView)
     spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
     self.verticalLayout.addItem(spacerItem)
     self.horizontalLayout = QHBoxLayout()
     spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
     self.horizontalLayout.addItem(spacerItem1)
     self.cancelButton = QPushButton(self)
     self.cancelButton.setText(tr("Cancel"))
     self.cancelButton.setShortcut("Esc")
     self.horizontalLayout.addWidget(self.cancelButton)
     self.continueButton = QPushButton(self)
     self.continueButton.setDefault(True)
     self.continueButton.setText(tr("Continue"))
     self.horizontalLayout.addWidget(self.continueButton)
     self.verticalLayout.addLayout(self.horizontalLayout)
Example #44
0
    def __getTermGroupbox( self ):
        " Creates the term groupbox "
        termGroupbox = QGroupBox( self )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                        termGroupbox.sizePolicy().hasHeightForWidth() )
        termGroupbox.setSizePolicy( sizePolicy )

        layoutTerm = QVBoxLayout( termGroupbox )
        self.__redirectRButton = QRadioButton( termGroupbox )
        self.__redirectRButton.setText( "&Redirect to IDE" )
        self.__redirectRButton.toggled.connect( self.__redirectedChanged )
        layoutTerm.addWidget( self.__redirectRButton )
        self.__autoRButton = QRadioButton( termGroupbox )
        self.__autoRButton.setText( "Aut&o detection" )
        layoutTerm.addWidget( self.__autoRButton )
        self.__konsoleRButton = QRadioButton( termGroupbox )
        self.__konsoleRButton.setText( "Default &KDE konsole" )
        layoutTerm.addWidget( self.__konsoleRButton )
        self.__gnomeRButton = QRadioButton( termGroupbox )
        self.__gnomeRButton.setText( "gnome-&terminal" )
        layoutTerm.addWidget( self.__gnomeRButton )
        self.__xtermRButton = QRadioButton( termGroupbox )
        self.__xtermRButton.setText( "&xterm" )
        layoutTerm.addWidget( self.__xtermRButton )
        return termGroupbox
Example #45
0
    def __getIDEWideGroupbox( self ):
        " Creates the IDE wide groupbox "
        ideGroupbox = QGroupBox( self )
        ideGroupbox.setTitle( "IDE Wide Settings" )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                        ideGroupbox.sizePolicy().hasHeightForWidth() )
        ideGroupbox.setSizePolicy( sizePolicy )

        layoutIDE = QHBoxLayout( ideGroupbox )

        termGroupbox = self.__getTermGroupbox()
        termGroupbox.setTitle( "Terminal to run in" )
        layoutIDE.addWidget( termGroupbox )

        if self.__action == "profile":
            # Profile version of the dialog
            limitsGroupbox = self.__getProfileLimitsGroupbox()
            layoutIDE.addWidget( limitsGroupbox )
        else:
            # Debug version of the dialog
            dbgGroupbox = self.__getDebugGroupbox()
            layoutIDE.addWidget( dbgGroupbox )
        return ideGroupbox
Example #46
0
    def __getProfileLimitsGroupbox( self ):
        " Creates the profile limits groupbox "
        limitsGroupbox = QGroupBox( self )
        limitsGroupbox.setTitle( "Profiler diagram limits" )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                limitsGroupbox.sizePolicy().hasHeightForWidth() )
        limitsGroupbox.setSizePolicy( sizePolicy )

        layoutLimits = QGridLayout( limitsGroupbox )
        self.__nodeLimitEdit = QLineEdit()
        self.__nodeLimitEdit.textEdited.connect( self.__setRunButtonProps )
        self.__nodeLimitValidator = QDoubleValidator( 0.0, 100.0, 2, self )
        self.__nodeLimitValidator.setNotation( QDoubleValidator.StandardNotation )
        self.__nodeLimitEdit.setValidator( self.__nodeLimitValidator )
        nodeLimitLabel = QLabel( "Hide nodes below" )
        self.__edgeLimitEdit = QLineEdit()
        self.__edgeLimitEdit.textEdited.connect( self.__setRunButtonProps )
        self.__edgeLimitValidator = QDoubleValidator( 0.0, 100.0, 2, self )
        self.__edgeLimitValidator.setNotation( QDoubleValidator.StandardNotation )
        self.__edgeLimitEdit.setValidator( self.__edgeLimitValidator )
        edgeLimitLabel = QLabel( "Hide edges below" )
        layoutLimits.addWidget( nodeLimitLabel, 0, 0 )
        layoutLimits.addWidget( self.__nodeLimitEdit, 0, 1 )
        layoutLimits.addWidget( QLabel( "%" ), 0, 2 )
        layoutLimits.addWidget( edgeLimitLabel, 1, 0 )
        layoutLimits.addWidget( self.__edgeLimitEdit, 1, 1 )
        layoutLimits.addWidget( QLabel( "%" ), 1, 2 )
        return limitsGroupbox
Example #47
0
    def __getDebugGroupbox( self ):
        " Creates the debug settings groupbox "
        dbgGroupbox = QGroupBox( self )
        dbgGroupbox.setTitle( "Debugger" )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                    dbgGroupbox.sizePolicy().hasHeightForWidth() )
        dbgGroupbox.setSizePolicy( sizePolicy )

        dbgLayout = QVBoxLayout( dbgGroupbox )
        self.__reportExceptionCheckBox = QCheckBox( "Report &exceptions" )
        self.__reportExceptionCheckBox.stateChanged.connect(
                                            self.__onReportExceptionChanged )
        self.__traceInterpreterCheckBox = QCheckBox( "T&race interpreter libs" )
        self.__traceInterpreterCheckBox.stateChanged.connect(
                                            self.__onTraceInterpreterChanged )
        self.__stopAtFirstCheckBox = QCheckBox( "Stop at first &line" )
        self.__stopAtFirstCheckBox.stateChanged.connect(
                                            self.__onStopAtFirstChanged )
        self.__autoforkCheckBox = QCheckBox( "&Fork without asking" )
        self.__autoforkCheckBox.stateChanged.connect(self.__onAutoforkChanged )
        self.__debugChildCheckBox = QCheckBox( "Debu&g child process" )
        self.__debugChildCheckBox.stateChanged.connect( self.__onDebugChild )

        dbgLayout.addWidget( self.__reportExceptionCheckBox )
        dbgLayout.addWidget( self.__traceInterpreterCheckBox )
        dbgLayout.addWidget( self.__stopAtFirstCheckBox )
        dbgLayout.addWidget( self.__autoforkCheckBox )
        dbgLayout.addWidget( self.__debugChildCheckBox )
        return dbgGroupbox
    def __init__(self,parent=None):
        QWidget.__init__(self,parent)
        self.ui=uic.loadUi("Beamshutter.ui",self)
        self.control = QAxContainer.QAxWidget(self)
        self.control.setControl('{3CE35BF3-1E13-4D2C-8C0B-DEF6314420B3}')
        self.control.setProperty("HWSerialNum",85845031)
        self.control.setGeometry(0,0,600,400)
        self.mutex=QMutex(mode =QMutex.Recursive)
        self.shutterReplied=False


        self.shut=Beamshutter(self)
        self.worker=WorkerThread()

        self.ui.mainLayout.addWidget(self.control)

        self.layout().setAlignment(Qt.AlignCenter)
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHeightForWidth(True)
        self.setSizePolicy(sizePolicy)
Example #49
0
    def setupUi (self, MainWindow):
        '''sets up the Maya UI.
        
        @param MainWindow
        '''
        MainWindow.setObjectName ('MainWindow')
        MainWindow.resize (800, 1396)
        sizePolicy = QSizePolicy (QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch (0)
        sizePolicy.setVerticalStretch (0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        font = QFont ()
        font.setPointSize (11)
        MainWindow.setFont (font)
        MainWindow.setWindowTitle (QApplication.translate("MainWindow", "Location Tool", None, QApplication.UnicodeUTF8))
        MainWindow.setTabShape (QTabWidget.Rounded)
        MainWindow.setDockOptions (QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks)
        
        self.scrollAreaWidgetContents_3 = QWidget (MainWindow)
        self.scrollAreaWidgetContents_3.setGeometry (QRect(10, 10, 900, 940))
        self.scrollAreaWidgetContents_3.setObjectName ('scrollAreaWidgetContents_3')
        self._view = View0.View ("JADEview", self.graph_view, self.scene, self.scrollAreaWidgetContents_3)
        self._view.setObjectName ('JADEview')  # real ui name
        self._view.graphicsView.setObjectName ('JADEInnerView')
        self.connect (self.scene, SIGNAL("selectionChanged()"), self._view.selectionChanged)
        
        self._view.wireViewItemsUp ()
        self._view.getGraphicsView().setScene (self.scene)
        self._view.setToolboxCSSColorScheme ('background-color: rgb(68,68,68);color: rgb(200,200,200)') # this needs to be done since the toolbox's background didn't have a uniform colour otherwise.
        #self._view.setGraphicsViewCSSBackground () # the CSS background doesn't seem to work in Maya as there seems to be a problem with cleaning QGraphicsLineItems when they move, that doesn't happen when there's no CSS applied to the background.

        self.graphicsView = self._view.getGraphicsView ()
        self.node_coords = QPoint (0,0)
        
        layout = QHBoxLayout (self.scrollAreaWidgetContents_3)
        layout.setContentsMargins (QMargins(0,0,0,0));
        layout.addWidget (self._view)
        
        QMetaObject.connectSlotsByName (MainWindow)
        
        """
        cmds.control('JADEInnerView', edit=True, ebg=True, bgc=[.5,.5,.9])
        print cmds.control('JADEInnerView', query=True, p=True)
        """
        
        # wiring the Maya Contextual pop-up Menus - yes, in Maya we've split the pop-up menu definition in three pop-up menus although only one will be present at any time.
        self.menu        = cmds.popupMenu ('JADEmenu',        parent='JADEInnerView', button=3, pmc = 'ClientMaya.ui.ctxMenu()',        aob=True)
        self.menuAddOuts = cmds.popupMenu ('JADEmenuAddOuts', parent='JADEInnerView', button=3, pmc = 'ClientMaya.ui.ctxMenuAddOuts()', aob=True, alt=True)
        self.menuAddIns  = cmds.popupMenu ('JADEmenuAddIns',  parent='JADEInnerView', button=3, pmc = 'ClientMaya.ui.ctxMenuAddIns()',  aob=True, ctl=True)
        
        # this class property is used to keep track of the mouse position.
        self._mouse = QCursor
        
        # self._view's zoom slider (we need this to correct the bias added to sort the mouse position when the zoom changes - ONLY in Maya)
        self._zoom_slider = self._view.getZoomSlider()
Example #50
0
 def setupUi(self):
     """layout the window"""
     self.setContentsMargins(0, 0, 0, 0)
     vlayout = QVBoxLayout(self)
     vlayout.setContentsMargins(0, 0, 0, 0)
     sliderLayout = QHBoxLayout()
     self.kcfg_showShadows = QCheckBox(m18n('Show tile shadows'), self)
     self.kcfg_showShadows.setObjectName('kcfg_showShadows')
     self.kcfg_rearrangeMelds = QCheckBox(m18n('Rearrange undisclosed tiles to melds'), self)
     self.kcfg_rearrangeMelds.setObjectName('kcfg_rearrangeMelds')
     self.kcfg_showOnlyPossibleActions = QCheckBox(m18n('Show only possible actions'))
     self.kcfg_showOnlyPossibleActions.setObjectName('kcfg_showOnlyPossibleActions')
     self.kcfg_propose = QCheckBox(m18n('Propose what to do'))
     self.kcfg_propose.setObjectName('kcfg_propose')
     self.kcfg_animationSpeed = QSlider(self)
     self.kcfg_animationSpeed.setObjectName('kcfg_animationSpeed')
     self.kcfg_animationSpeed.setOrientation(Qt.Horizontal)
     self.kcfg_animationSpeed.setSingleStep(1)
     lblSpeed = QLabel(m18n('Animation speed:'))
     lblSpeed.setBuddy(self.kcfg_animationSpeed)
     sliderLayout.addWidget(lblSpeed)
     sliderLayout.addWidget(self.kcfg_animationSpeed)
     self.kcfg_useSounds = QCheckBox(m18n('Use sounds if available'), self)
     self.kcfg_useSounds.setObjectName('kcfg_useSounds')
     self.kcfg_uploadVoice = QCheckBox(m18n('Let others hear my voice'), self)
     self.kcfg_uploadVoice.setObjectName('kcfg_uploadVoice')
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     pol.setVerticalPolicy(QSizePolicy.Expanding)
     spacerItem = QSpacerItem(20, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)
     vlayout.addWidget(self.kcfg_showShadows)
     vlayout.addWidget(self.kcfg_rearrangeMelds)
     vlayout.addWidget(self.kcfg_showOnlyPossibleActions)
     vlayout.addWidget(self.kcfg_propose)
     vlayout.addWidget(self.kcfg_useSounds)
     vlayout.addWidget(self.kcfg_uploadVoice)
     vlayout.addLayout(sliderLayout)
     vlayout.addItem(spacerItem)
     self.setSizePolicy(pol)
     self.retranslateUi()
Example #51
0
 def setupUILastTileMeld(self, pGrid):
     """setup UI elements for last tile and last meld"""
     self.lblLastTile = QLabel(m18n('&Last Tile:'))
     self.cbLastTile = QComboBox()
     self.cbLastTile.setMinimumContentsLength(1)
     vpol = QSizePolicy()
     vpol.setHorizontalPolicy(QSizePolicy.Fixed)
     self.cbLastTile.setSizePolicy(vpol)
     self.cbLastTile.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLengthWithIcon)
     self.lblLastTile.setBuddy(self.cbLastTile)
     self.lblLastMeld = QLabel(m18n('L&ast Meld:'))
     self.prevLastTile = None
     self.cbLastMeld = QComboBox()
     self.cbLastMeld.setMinimumContentsLength(1)
     self.cbLastMeld.setSizePolicy(vpol)
     self.cbLastMeld.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLengthWithIcon)
     self.lblLastMeld.setBuddy(self.cbLastMeld)
     self.comboTilePairs = set()
     pGrid.setRowStretch(6, 5)
     pGrid.addWidget(self.lblLastTile, 7, 0, 1, 2)
     pGrid.addWidget(self.cbLastTile, 7, 2, 1, 1)
     pGrid.addWidget(self.lblLastMeld, 8, 0, 1, 2)
     pGrid.addWidget(self.cbLastMeld, 8, 2, 1, 2)
Example #52
0
    def __init__(self, char, parent=None):
        super(CharWidget, self).__init__(parent)
        self.char = char
        self.charButton = QPushButton(char.name)
        self.healthLabel = QLabel("{0}/{1}".format(self.char.hp,
                                                   self.char.max_hp))

        # Button dimensions
        button_policy = QSizePolicy(QSizePolicy.Preferred,
                                    QSizePolicy.Preferred)
        button_policy.setHeightForWidth(True)
        self.charButton.setSizePolicy(button_policy)
        # dimensions
        policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        self.setSizePolicy(policy)

        # layout
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.addWidget(self.charButton)
        self.horizontalLayout.addWidget(self.healthLabel)
        self.setLayout(self.horizontalLayout)

        self.show()
Example #53
0
 def __tuneCombo( comboBox ):
     " Sets the common settings for a combo box "
     sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
     sizePolicy.setHorizontalStretch( 0 )
     sizePolicy.setVerticalStretch( 0 )
     sizePolicy.setHeightForWidth(
                         comboBox.sizePolicy().hasHeightForWidth() )
     comboBox.setSizePolicy( sizePolicy )
     comboBox.setEditable( True )
     comboBox.setInsertPolicy( QComboBox.InsertAtTop )
     comboBox.setAutoCompletion( False )
     comboBox.setDuplicatesEnabled( False )
     return
Example #54
0
    def __init__(self, parent = None, config=None):
        """
        Constructor
        """
        QFrame.__init__(self, parent)
        self.layout = QHBoxLayout()
        self.setLayout(self.layout)
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(1)
        self.layout.setStretch(1,1)
        self.setAutoFillBackground(False)
        #self.setStyleSheet("    background-color: #0000FF;\n}")
        
        #sizePolicy.setHeightForWidth(self.ucTime.sizePolicy().hasHeightForWidth())
        pal = self.palette();
        br = QBrush(Qt.NoBrush)
        pal.setBrush(QPalette.Background, br);
        self.setPalette(pal);

        self.setSizePolicy(sizePolicy)

        self.clock = AnalogClock(self)
        self.addWidget(self.clock)
Example #55
0
    def __init__( self, editorsManager, parent = None ):

        QWidget.__init__( self, parent )
        self.editorsManager = editorsManager

        self.__gotoHistory = []

        # Common graphics items
        closeButton = QToolButton( self )
        closeButton.setToolTip( "Click to close the dialog (ESC)" )
        closeButton.setIcon( PixmapCache().getIcon( "close.png" ) )
        closeButton.clicked.connect( self.hide )

        lineLabel = QLabel( self )
        lineLabel.setText( "Goto line:" )

        self.linenumberEdit = QComboBox( self )
        self.linenumberEdit.setEditable( True )
        self.linenumberEdit.setInsertPolicy( QComboBox.InsertAtTop )
        self.linenumberEdit.setAutoCompletion( False )
        self.linenumberEdit.setDuplicatesEnabled( False )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                self.linenumberEdit.sizePolicy().hasHeightForWidth() )
        self.linenumberEdit.setSizePolicy( sizePolicy )
        self.validator = QIntValidator( 1, 100000, self )
        self.linenumberEdit.setValidator( self.validator )
        self.linenumberEdit.editTextChanged.connect( self.__onEditTextChanged )
        self.linenumberEdit.lineEdit().returnPressed.connect( self.__onEnter )

        self.goButton = QToolButton( self )
        self.goButton.setToolTip( "Click to jump to the line (ENTER)" )
        self.goButton.setIcon( PixmapCache().getIcon( "gotoline.png" ) )
        self.goButton.setFocusPolicy( Qt.NoFocus )
        self.goButton.setEnabled( False )
        self.goButton.clicked.connect( self.__onGo )

        spacer = QWidget()
        spacer.setFixedWidth( 1 )

        horizontalLayout = QHBoxLayout( self )
        horizontalLayout.setMargin( 0 )

        horizontalLayout.addWidget( closeButton )
        horizontalLayout.addWidget( lineLabel )
        horizontalLayout.addWidget( self.linenumberEdit )
        horizontalLayout.addWidget( self.goButton )
        horizontalLayout.addWidget( spacer )
        return
Example #56
0
    def __createLayout( self ):
        """ Creates the dialog layout """

        self.resize( 450, 220 )
        self.setSizeGripEnabled( True )

        self.verticalLayout = QVBoxLayout( self )

        # Info label
        self.infoLabel = FitPathLabel( self )
        #sizePolicy = QSizePolicy( QSizePolicy.Expanding,
        #                          QSizePolicy.Preferred )
        sizePolicy = QSizePolicy( QSizePolicy.Minimum,
                                  QSizePolicy.Preferred )
        sizePolicy.setHorizontalStretch( 0 )
        sizePolicy.setVerticalStretch( 0 )
        sizePolicy.setHeightForWidth(
                    self.infoLabel.sizePolicy().hasHeightForWidth() )
        self.infoLabel.setSizePolicy( sizePolicy )
        self.verticalLayout.addWidget( self.infoLabel )

        # Progress bar
        self.progressBar = QProgressBar( self )
        self.progressBar.setValue( 0 )
        self.progressBar.setOrientation( Qt.Horizontal )
        self.verticalLayout.addWidget( self.progressBar )

        # Result window
        self.resultEdit = QTextEdit( self )
        self.resultEdit.setTabChangesFocus( False )
        self.resultEdit.setAcceptRichText( False )
        self.resultEdit.setReadOnly( True )
        self.resultEdit.setFontFamily( GlobalData().skin.baseMonoFontFace )
        font = self.resultEdit.font()

        # Calculate the vertical size
        fontMetrics = QFontMetrics( font )
        rect = fontMetrics.boundingRect( "W" )
        # 6 lines, 5 line spacings, 2 frames
        self.resultEdit.setMinimumHeight( rect.height() * 7 + 4 * 5 +
                                          self.resultEdit.frameWidth() * 2 )
        self.verticalLayout.addWidget( self.resultEdit )

        # Buttons
        self.buttonBox = QDialogButtonBox( self )
        self.buttonBox.setOrientation( Qt.Horizontal )
        self.buttonBox.setStandardButtons( QDialogButtonBox.Close )
        self.verticalLayout.addWidget( self.buttonBox )

        self.buttonBox.rejected.connect( self.__onClose )
        return
Example #57
0
    def __init__(self, position=None, active=False,
                 state=SqState.empty, parent=None):
        super(Square, self).__init__()

        # square data
        self.position = position
        self.state = state
        self.active = False

        # dimensions
        policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        policy.setHeightForWidth(True)
        self.setSizePolicy(policy)

        # set behavior
        self.setMouseTracking(True)
        self.setToolTip("game square")
        self.setStatusTip(self.position.__repr__())
        QObject.connect(self, SIGNAL("clicked()"), self.square_click)

        # default color
        self.set_state_color()

        self.show()
Example #58
0
    def __init__(self, dice, parent=None):
        super(DiceWidget, self).__init__(parent)
        self.dice = dice

        # dimensions
        policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        policy.setHeightForWidth(True)
        self.setSizePolicy(policy)
        self.resize(70, 70)

        # text and font
        self.font = QFont()
        self.font.setBold(True)
        self.font.setPixelSize(self.height() * 0.4)

        # set behavior
        self.setToolTip("Game Dice")
        QObject.connect(self, SIGNAL("clicked()"), self.dice_click)

        # default color/text
        self.setText("{0}\nAll".format(self.dice.num()))
        self.setStyleSheet("background-color: rgb(135, 5, 45);")

        self.show()
    def creatTextBrowser(self):
        # DEFININDO O TAMANHO DA FONTE
        font = QFont()
        font.setPointSize(11)

        # CRIANDO O TEXTO DE LOG
        self.TextLog = QTextEdit(self.groupBoxInfos)
        sizePolicy = QSizePolicy(QSizePolicy.Minimum,  QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.TextLog.sizePolicy().hasHeightForWidth())
        self.TextLog.setReadOnly(True)
        # self.TextLog.setEnabled(False)
        self.TextLog.setFont(font)
        self.TextLog.setSizePolicy(sizePolicy)
        self.TextLog.setMaximumSize(QSize(600, 100))
 def _setupPreferenceWidgets(self):
     scanTypeLabels = [
         tr("Filename"),
         tr("Contents"),
         tr("Folders"),
     ]
     self._setupScanTypeBox(scanTypeLabels)
     self._setupFilterHardnessBox()
     self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
     self.widget = QWidget(self)
     self.widget.setMinimumSize(QSize(0, 136))
     self.verticalLayout_4 = QVBoxLayout(self.widget)
     self._setupAddCheckbox('wordWeightingBox', tr("Word weighting"), self.widget)
     self.verticalLayout_4.addWidget(self.wordWeightingBox)
     self._setupAddCheckbox('matchSimilarBox', tr("Match similar words"), self.widget)
     self.verticalLayout_4.addWidget(self.matchSimilarBox)
     self._setupAddCheckbox('mixFileKindBox', tr("Can mix file kind"), self.widget)
     self.verticalLayout_4.addWidget(self.mixFileKindBox)
     self._setupAddCheckbox('useRegexpBox', tr("Use regular expressions when filtering"), self.widget)
     self.verticalLayout_4.addWidget(self.useRegexpBox)
     self._setupAddCheckbox('removeEmptyFoldersBox', tr("Remove empty folders on delete or move"), self.widget)
     self.verticalLayout_4.addWidget(self.removeEmptyFoldersBox)
     self.horizontalLayout_2 = QHBoxLayout()
     self._setupAddCheckbox('ignoreSmallFilesBox', tr("Ignore files smaller than"), self.widget)
     self.horizontalLayout_2.addWidget(self.ignoreSmallFilesBox)
     self.sizeThresholdEdit = QLineEdit(self.widget)
     sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed)
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(self.sizeThresholdEdit.sizePolicy().hasHeightForWidth())
     self.sizeThresholdEdit.setSizePolicy(sizePolicy)
     self.sizeThresholdEdit.setMaximumSize(QSize(50, 16777215))
     self.horizontalLayout_2.addWidget(self.sizeThresholdEdit)
     self.label_6 = QLabel(self.widget)
     self.label_6.setText(tr("KB"))
     self.horizontalLayout_2.addWidget(self.label_6)
     spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
     self.horizontalLayout_2.addItem(spacerItem1)
     self.verticalLayout_4.addLayout(self.horizontalLayout_2)
     self._setupAddCheckbox('ignoreHardlinkMatches', tr("Ignore duplicates hardlinking to the same file"), self.widget)
     self.verticalLayout_4.addWidget(self.ignoreHardlinkMatches)
     self._setupAddCheckbox('debugModeBox', tr("Debug mode (restart required)"), self.widget)
     self.verticalLayout_4.addWidget(self.debugModeBox)
     self.widgetsVLayout.addWidget(self.widget)
     self._setupBottomPart()