def __init__(self, page): super(LogTool, self).__init__(page) layout = QVBoxLayout() self.setLayout(layout) self.fontLabel = QLabel() self.fontChooser = QFontComboBox(currentFontChanged=self.changed) self.fontSize = QDoubleSpinBox(valueChanged=self.changed) self.fontSize.setRange(6.0, 32.0) self.fontSize.setSingleStep(0.5) self.fontSize.setDecimals(1) box = QHBoxLayout() box.addWidget(self.fontLabel) box.addWidget(self.fontChooser, 1) box.addWidget(self.fontSize) layout.addLayout(box) self.showlog = QCheckBox(toggled=self.changed) layout.addWidget(self.showlog) self.rawview = QCheckBox(toggled=self.changed) layout.addWidget(self.rawview) self.hideauto = QCheckBox(toggled=self.changed) layout.addWidget(self.hideauto) app.translateUI(self)
def create_scedit(self, text, option, default=NoDefault, tip=None, without_layout=False): label = QLabel(text) clayout = ColorLayout(QColor(Qt.black), self) clayout.lineedit.setMaximumWidth(80) if tip is not None: clayout.setToolTip(tip) cb_bold = QCheckBox() cb_bold.setIcon(get_icon("bold.png")) cb_bold.setToolTip(_("Bold")) cb_italic = QCheckBox() cb_italic.setIcon(get_icon("italic.png")) cb_italic.setToolTip(_("Italic")) self.scedits[(clayout, cb_bold, cb_italic)] = (option, default) if without_layout: return label, clayout, cb_bold, cb_italic layout = QHBoxLayout() layout.addWidget(label) layout.addLayout(clayout) layout.addSpacing(10) layout.addWidget(cb_bold) layout.addWidget(cb_italic) layout.addStretch(1) layout.setContentsMargins(0, 0, 0, 0) widget = QWidget(self) widget.setLayout(layout) return widget
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, page, parent=None, selectedText: str = ""): super().__init__(parent) # create the labels and the text edit for the dialog self.wordToFind = selectedText self.findLineEdit = QLineEdit() # TODO: add find backward and forward buttons later self.matchCaseCheckBox = QCheckBox("Match &Case") self.wholeWordsCheckBox = QCheckBox("Whole &Words") # findButton = QPushButton("&Find") self.nextButton = QPushButton("&Next") self.previousButton = QPushButton("&Previous") self.document = page.document() # page is a QTextEdit self.page = page if self.wordToFind and not self.wordToFind.isspace(): self.findLineEdit.setText(self.wordToFind) self.findLineEdit.selectAll() # lay the dialog out layout = QHBoxLayout() layout.addWidget(self.findLineEdit) layout.addWidget(self.matchCaseCheckBox) layout.addWidget(self.wholeWordsCheckBox) layout.addWidget(self.nextButton) layout.addWidget(self.previousButton) self.setLayout(layout) # signal slot connections self.previousButton.clicked.connect(self.findTextBackwards) self.nextButton.clicked.connect(self.findText)
def __init__(self, parent=None): super(Options, self).__init__(parent) self.setWindowIcon(QIcon('res/opciones4.png')) self.setWindowTitle('Opciones') self.options = load_data()['options'] self.chk_mask = QCheckBox(u'Máscara por defecto.') self.line_mask = LineEdit(u'máscara', ['required', 'ms']) self.line_mask.focusInEvent = lambda _: self.block_focus_event() if self.options[0]: self.chk_mask.setChecked(True) self.line_mask.setText(self.options[1]) self.chk_dns = QCheckBox('Servidor dns por defecto.') self.line_dns = LineEdit('Servidor dns', ['required', 'ip']) self.line_dns.focusInEvent = lambda _: self.block_focus_event() self.line_mask.setCursor(QCursor(Qt.ForbiddenCursor)) if self.options[2]: self.chk_dns.setChecked(True) self.line_dns.setText(self.options[3]) self.status(self.chk_mask.isChecked(), self.line_mask) self.status(self.chk_dns.isChecked(), self.line_dns) lbl = QLabel('Cantidad de Configuraciones permitidas.') spin = QSpinBox() spin.setRange(1, 8) spin.setValue(self.options[4]) spin.setMaximumWidth(50) lbl.setBuddy(spin) btn_ok = QPushButton('OK') btn_ok.setMaximumWidth(200) btn_ok.setObjectName('btn_ok') btn_cancel = QPushButton('Cancel') btn_cancel.setMaximumWidth(200) btn_cancel.setObjectName('btn_cancel') layout = QGridLayout() layout.addWidget(self.chk_mask, 0, 0, 1, 3) layout.addWidget(self.line_mask, 1, 0, 1, 3) layout.addWidget(self.chk_dns, 2, 0, 1, 3) layout.addWidget(self.line_dns, 3, 0, 1, 3) layout.addWidget(lbl, 4, 0) layout.addWidget(spin, 4, 1) layout.addWidget(QLabel(''), 5, 0) layout.addWidget(btn_cancel, 6, 1) layout.addWidget(btn_ok, 6, 2) self.setLayout(layout) self.connect(self.chk_mask, SIGNAL('clicked(bool)'), self.set_disable_mask) self.connect(self.chk_dns, SIGNAL('clicked(bool)'), self.set_disable_dns) self.connect(btn_ok, SIGNAL('clicked()'), self.save_and_exit) self.connect(btn_ok, SIGNAL('returnPressed()'), self.save_and_exit) self.connect(spin, SIGNAL('valueChanged(int)'), self.spin_value) self.connect(btn_cancel, SIGNAL("clicked()"), self.reject)
def __init__(self, parent=None): super(MainForm, self).__init__(parent) self.words_to_be_learned_llist = [] self.words2sentence_list = [] self.files_table = QTableWidget() self.files_paths_list = [] self.refresh_files_table() self.files_Button = QPushButton(u"添加文章") self.zhong_kao_CheckBox = QCheckBox(u"中考词汇") self.gao_kao_CheckBox = QCheckBox(u"高考词汇") self.analysis_Button = QPushButton(u"分析") self.files_layout = QHBoxLayout() self.files_layout.addWidget(self.files_table) self.files_layout.addWidget(self.files_Button) self.a_g_layout = QHBoxLayout() self.a_g_layout.addWidget(self.zhong_kao_CheckBox) self.a_g_layout.addWidget(self.gao_kao_CheckBox) self.a_g_layout.addWidget(self.analysis_Button) # self.a_g_layout.addWidget(self.generate_Button) self.layout = QVBoxLayout() self.layout.addLayout(self.files_layout) self.layout.addLayout(self.a_g_layout) self.setLayout(self.layout) self.setWindowTitle(u"外文阅读工具") self.connect(self.files_Button, SIGNAL("clicked()"), self.addFiles) self.connect(self.analysis_Button, SIGNAL("clicked()"), self.analysis)
def __init__(self, config, parent, replication_checkbox=False, segmentation_checkbox=False): QDialog.__init__(self) self.setStyleSheet(parent.styleSheet()) self.setWindowTitle("Method Settings") self.data = config self.ui = {} self.area = QScrollArea() self.widget = QWidget() l = self._parseConfig(self.data, self.ui) self.widget.setLayout(l) self.area.setWidget(self.widget) self.area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) self.layout = QVBoxLayout() self.layout.addWidget(self.area) if replication_checkbox: self.replication_checkbox = QCheckBox(self.tr("Allow replication")) self.layout.addWidget(self.replication_checkbox) if segmentation_checkbox: self.segmentation_checkbox = QCheckBox( self.tr("Generate assegnments in segments")) self.layout.addWidget(self.segmentation_checkbox) self.buttons = QHBoxLayout() self.ok = QPushButton("OK") self.cancel = QPushButton("Cancel") self.buttons.addWidget(self.ok) self.buttons.addWidget(self.cancel) self.layout.addLayout(self.buttons) self.setLayout(self.layout) QObject.connect(self.ok, SIGNAL("clicked()"), self.OK) QObject.connect(self.cancel, SIGNAL("clicked()"), self.Cancel)
def __init__(self, value, parent=None): QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QComboBox(parent) self.size.setEditable(True) sizelist = list(range(6, 12)) + list(range(12, 30, 2)) + [36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
def __init__(self): QStatusBar.__init__(self) self.editor = None self.widgetStatus = QWidget() vbox = QVBoxLayout(self.widgetStatus) vbox.setContentsMargins(0, 0, 0, 0) #Search Layout hSearch = QHBoxLayout() self.line = TextLine(self) self.line.setMinimumWidth(250) self.checkBackward = QCheckBox('Find Backward') self.checkSensitive = QCheckBox('Respect Case Sensitive') self.checkWholeWord = QCheckBox('Find Whole Words') self.btnClose = QPushButton( self.style().standardIcon(QStyle.SP_DialogCloseButton), '') self.btnFind = QPushButton(QIcon(resources.images['find']), '') self.btnPrevious = QPushButton( self.style().standardIcon(QStyle.SP_ArrowLeft), '') self.btnNext = QPushButton( self.style().standardIcon(QStyle.SP_ArrowRight), '') hSearch.addWidget(self.btnClose) hSearch.addWidget(self.line) hSearch.addWidget(self.btnFind) hSearch.addWidget(self.btnPrevious) hSearch.addWidget(self.btnNext) hSearch.addWidget(self.checkBackward) hSearch.addWidget(self.checkSensitive) hSearch.addWidget(self.checkWholeWord) vbox.addLayout(hSearch) #Replace Layout hReplace = QHBoxLayout() self.lineReplace = TextLine(self) self.lineReplace.setMinimumWidth(250) self.btnCloseReplace = QPushButton( self.style().standardIcon(QStyle.SP_DialogCloseButton), '') self.btnReplace = QPushButton('Replace') self.btnReplaceAll = QPushButton('Replace All') hReplace.addWidget(self.btnCloseReplace) hReplace.addWidget(self.lineReplace) hReplace.addWidget(self.btnReplace) hReplace.addWidget(self.btnReplaceAll) vbox.addLayout(hReplace) self.replace_visibility(False) self.addWidget(self.widgetStatus) self.shortEsc = QShortcut(QKeySequence(Qt.Key_Escape), self) self.connect(self.btnClose, SIGNAL("clicked()"), self.hide_status) self.connect(self.btnFind, SIGNAL("clicked()"), self.find) self.connect(self.btnNext, SIGNAL("clicked()"), self.find_next) self.connect(self.btnPrevious, SIGNAL("clicked()"), self.find_previous) self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end) self.connect(self.btnCloseReplace, SIGNAL("clicked()"), lambda: self.replace_visibility(False)) self.connect(self.btnReplace, SIGNAL("clicked()"), self.replace) self.connect(self.btnReplaceAll, SIGNAL("clicked()"), self.replace_all) self.connect(self.shortEsc, SIGNAL("activated()"), self.hide_status)
def __init__(self, mainwindow): super(Search, self).__init__(mainwindow) self._currentView = None self._positions = None self._replace = False # are we in replace mode? mainwindow.currentViewChanged.connect(self.viewChanged) mainwindow.actionCollection.edit_find_next.triggered.connect( self.findNext) mainwindow.actionCollection.edit_find_previous.triggered.connect( self.findPrevious) # don't inherit looks from view self.setFont(QApplication.font()) self.setPalette(QApplication.palette()) grid = QGridLayout() grid.setContentsMargins(4, 0, 4, 0) grid.setVerticalSpacing(0) self.setLayout(grid) self.searchEntry = QLineEdit(textChanged=self.slotSearchChanged) self.searchLabel = QLabel() self.caseCheck = QCheckBox(checked=True, focusPolicy=Qt.NoFocus) self.regexCheck = QCheckBox(focusPolicy=Qt.NoFocus) self.countLabel = QLabel(alignment=Qt.AlignRight | Qt.AlignVCenter) self.countLabel.setMinimumWidth( QApplication.fontMetrics().width("9999")) self.closeButton = QToolButton(autoRaise=True, focusPolicy=Qt.NoFocus) self.hideAction = QAction(self, triggered=self.slotHide) self.hideAction.setShortcut(QKeySequence(Qt.Key_Escape)) self.hideAction.setIcon(self.style().standardIcon( QStyle.SP_DialogCloseButton)) self.closeButton.setDefaultAction(self.hideAction) grid.addWidget(self.searchLabel, 0, 0) grid.addWidget(self.searchEntry, 0, 1) grid.addWidget(self.caseCheck, 0, 2) grid.addWidget(self.regexCheck, 0, 3) grid.addWidget(self.countLabel, 0, 4) grid.addWidget(self.closeButton, 0, 5) self.caseCheck.toggled.connect(self.slotSearchChanged) self.regexCheck.toggled.connect(self.slotSearchChanged) self.replaceEntry = QLineEdit() self.replaceLabel = QLabel() self.replaceButton = QPushButton(clicked=self.slotReplace) self.replaceAllButton = QPushButton(clicked=self.slotReplaceAll) grid.addWidget(self.replaceLabel, 1, 0) grid.addWidget(self.replaceEntry, 1, 1) grid.addWidget(self.replaceButton, 1, 2) grid.addWidget(self.replaceAllButton, 1, 3) app.settingsChanged.connect(self.readSettings) self.readSettings() app.translateUI(self)
def getArguments(self, parent=None): description = "The CSV export requires some information before it starts:" dialog = CustomDialog("CSV Export", description, parent) default_csv_output_path = self.getDataKWValue("CSV_OUTPUT_PATH", default="output.csv") output_path_model = PathModel(default_csv_output_path) output_path_chooser = PathChooser(output_path_model) design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="") design_matrix_path_model = PathModel(design_matrix_default, is_required=False, must_exist=True) design_matrix_path_chooser = PathChooser(design_matrix_path_model) list_edit = ListEditBox(self.getAllCaseList()) infer_iteration_check = QCheckBox() infer_iteration_check.setChecked(True) infer_iteration_check.setToolTip(CSVExportJob.INFER_HELP) drop_const_columns_check = QCheckBox() drop_const_columns_check.setChecked(False) drop_const_columns_check.setToolTip( "If checked, exclude columns whose value is the same for every entry" ) dialog.addLabeledOption("Output file path", output_path_chooser) dialog.addLabeledOption("Design matrix path", design_matrix_path_chooser) dialog.addLabeledOption("List of cases to export", list_edit) dialog.addLabeledOption("Infer iteration number", infer_iteration_check) dialog.addLabeledOption("Drop constant columns", drop_const_columns_check) dialog.addButtons() success = dialog.showAndTell() if success: design_matrix_path = design_matrix_path_model.getPath() if design_matrix_path.strip() == "": design_matrix_path = None case_list = ",".join(list_edit.getItems()) return [ output_path_model.getPath(), case_list, design_matrix_path, infer_iteration_check.isChecked(), drop_const_columns_check.isChecked(), ] raise CancelPluginException("User cancelled!")
def __init__(self, parent=None): super(Dialog, self).__init__(parent) self._filename = None self._page = None self._rect = None self.imageViewer = widgets.imageviewer.ImageViewer() self.dpiLabel = QLabel() self.dpiCombo = QComboBox(insertPolicy=QComboBox.NoInsert, editable=True) self.dpiCombo.lineEdit().setCompleter(None) self.dpiCombo.setValidator( QDoubleValidator(10.0, 1200.0, 4, self.dpiCombo)) self.dpiCombo.addItems( [format(i) for i in (72, 100, 200, 300, 600, 1200)]) self.colorButton = widgets.colorbutton.ColorButton() self.colorButton.setColor(QColor(Qt.white)) self.crop = QCheckBox() self.antialias = QCheckBox(checked=True) self.dragfile = QPushButton(icons.get("image-x-generic"), None, None) self.fileDragger = FileDragger(self.dragfile) self.buttons = QDialogButtonBox(QDialogButtonBox.Close) self.copyButton = self.buttons.addButton('', QDialogButtonBox.ApplyRole) self.copyButton.setIcon(icons.get('edit-copy')) self.saveButton = self.buttons.addButton('', QDialogButtonBox.ApplyRole) self.saveButton.setIcon(icons.get('document-save')) layout = QVBoxLayout() self.setLayout(layout) layout.addWidget(self.imageViewer) controls = QHBoxLayout() layout.addLayout(controls) controls.addWidget(self.dpiLabel) controls.addWidget(self.dpiCombo) controls.addWidget(self.colorButton) controls.addWidget(self.crop) controls.addWidget(self.antialias) controls.addStretch() controls.addWidget(self.dragfile) layout.addWidget(widgets.Separator()) layout.addWidget(self.buttons) app.translateUI(self) self.readSettings() self.finished.connect(self.writeSettings) self.dpiCombo.editTextChanged.connect(self.drawImage) self.colorButton.colorChanged.connect(self.drawImage) self.antialias.toggled.connect(self.drawImage) self.crop.toggled.connect(self.cropImage) self.buttons.rejected.connect(self.reject) self.copyButton.clicked.connect(self.copyToClipboard) self.saveButton.clicked.connect(self.saveAs) qutil.saveDialogSize(self, "copy_image/dialog/size", QSize(480, 320))
def __init__(self, parent=None): super( FindDialog, self, ).__init__(parent) self.label = QLabel(str("Find &what:")) self.lineEdit = QLineEdit() self.label.setBuddy(self.lineEdit) self.caseCheckBox = QCheckBox(str("Match &case")) self.backwardCheckBox = QCheckBox(str("Search &backward")) self.findButton = QPushButton(str("&Find")) self.findButton.setDefault(True) self.findButton.setEnabled(False) closeButton = QPushButton(str("Close")) #-------------------------------------------------------- # 1. 连接的槽 必须 指定 @pyqtSlot(QString) self.connect(self.lineEdit, SIGNAL("textChanged(QString)"), self, SLOT("enableFindButton(QString)")) # 2. 不必指定 @pyqtSlot(QString) # self.connect(self.lineEdit, SIGNAL("textChanged(QString)"), # self.enableFindButton) #--------------------------------------------------------- self.connect(self.findButton, SIGNAL("clicked()"), self, SLOT("findClicked()")) self.connect(closeButton, SIGNAL("clicked()"), self, SLOT("close()")) #------------- 布局 ------------------------- topLeftLayout = QHBoxLayout() topLeftLayout.addWidget(self.label) topLeftLayout.addWidget(self.lineEdit) leftLayout = QVBoxLayout() leftLayout.addLayout(topLeftLayout) leftLayout.addWidget(self.caseCheckBox) leftLayout.addWidget(self.backwardCheckBox) rightLayout = QVBoxLayout() rightLayout.addWidget(self.findButton) rightLayout.addWidget(closeButton) rightLayout.addStretch() # 添加 分割 符号 mainLayout = QHBoxLayout() mainLayout.addLayout(leftLayout) mainLayout.addLayout(rightLayout) self.setLayout(mainLayout) #------------------------------- self.setWindowTitle(str("Find")) # 设置 固定 高度 # sizeHint().height() 返回一个 窗口 "理想"的尺寸 self.setFixedHeight(self.sizeHint().height())
def __init__(self, parent=None): super().__init__(parent) layout = QFormLayout() self.tagSelect = eu4cd.gamedata.TagSelect() layout.addRow(QLabel("Tag:"), self.tagSelect) self.name = QLineEdit() layout.addRow(QLabel("Name:"), self.name) self.adjective = QLineEdit() layout.addRow(QLabel("Adjective:"), self.adjective) writeCountryNameToolTipText = "Will change country name and adjective only if checked (slow save, does not work well with other mods)." writeCountryNameLabel = QLabel("Change name/adjective:") writeCountryNameLabel.setToolTip(writeCountryNameToolTipText) self.writeCountryName = QCheckBox() self.writeCountryName.setToolTip(writeCountryNameToolTipText) layout.addRow(writeCountryNameLabel, self.writeCountryName) technologyGroupToolTipText = "Upgrading starting technology group will give a penalty card." technologyGroupLabel = QLabel("Technology group:") technologyGroupLabel.setToolTip(technologyGroupToolTipText) self.technologyGroupSelect = eu4cd.gamedata.TechnologyGroupSelect() self.technologyGroupSelect.setToolTip(technologyGroupToolTipText) layout.addRow(technologyGroupLabel, self.technologyGroupSelect) self.religionSelect = eu4cd.gamedata.ReligionSelect() layout.addRow(QLabel("Religion:"), self.religionSelect) religionConvertToolTipText = "If checked, all provinces will be converted via event at game start." religionConvertLabel = QLabel("Convert religion:") religionConvertLabel.setToolTip(religionConvertToolTipText) self.religionConvert = QCheckBox() self.religionConvert.setToolTip(religionConvertToolTipText) layout.addRow(religionConvertLabel, self.religionConvert) self.governmentSelect = eu4cd.gamedata.GovernmentSelect() layout.addRow(QLabel("Government:"), self.governmentSelect) mercantilismToolTip = "Republics start with higher mercantilism." mercantilismLabel = QLabel("Mercantilism:") mercantilismLabel.setToolTip(mercantilismToolTip) self.mercantilism = QLineEdit() self.mercantilism.setToolTip(mercantilismToolTip) self.mercantilism.setReadOnly(True) layout.addRow(mercantilismLabel, self.mercantilism) self.setLayout(layout) # signals self.tagSelect.currentIndexChanged.connect(self.loadCountry) self.governmentSelect.currentIndexChanged.connect(self.handleGovernmentChanged) self.technologyGroupSelect.currentIndexChanged.connect(self.handleTechnologyGroupChanged) self.adjective.textChanged.connect(self.handleAdjectiveChanged)
def __init__(self, parent=None): super(SessionEditor, self).__init__(parent) self.setWindowModality(Qt.WindowModal) layout = QVBoxLayout() self.setLayout(layout) grid = QGridLayout() layout.addLayout(grid) self.name = QLineEdit() self.nameLabel = l = QLabel() l.setBuddy(self.name) grid.addWidget(l, 0, 0) grid.addWidget(self.name, 0, 1) self.autosave = QCheckBox() grid.addWidget(self.autosave, 1, 1) self.basedir = widgets.urlrequester.UrlRequester() self.basedirLabel = l = QLabel() l.setBuddy(self.basedir) grid.addWidget(l, 2, 0) grid.addWidget(self.basedir, 2, 1) self.inclPaths = ip = QGroupBox(self, checkable=True, checked=False) ipLayout = QVBoxLayout() ip.setLayout(ipLayout) self.replPaths = QCheckBox() ipLayout.addWidget(self.replPaths) self.replPaths.toggled.connect(self.toggleReplace) self.include = widgets.listedit.FilePathEdit() self.include.listBox.setDragDropMode(QAbstractItemView.InternalMove) ipLayout.addWidget(self.include) grid.addWidget(ip, 3, 1) self.revt = QPushButton(self) self.clear = QPushButton(self) self.revt.clicked.connect(self.revertPaths) self.clear.clicked.connect(self.clearPaths) self.include.layout().addWidget(self.revt, 5, 1) self.include.layout().addWidget(self.clear, 6, 1) layout.addWidget(widgets.Separator()) self.buttons = b = QDialogButtonBox(self) layout.addWidget(b) b.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) b.accepted.connect(self.accept) b.rejected.connect(self.reject) userguide.addButton(b, "sessions") app.translateUI(self)
def setupGUI(self): self.scrollArea = QScrollArea(self) self.scrollArea.setWidgetResizable(True) self.aWidget = QWidget(self.scrollArea) self._main_layout = QGridLayout(self.aWidget) self.aWidget.setMinimumSize(480, 800) self.aWidget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.scrollArea.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.scrollArea.setWidget(self.aWidget) try: scroller = self.scrollArea.property( "kineticScroller") #.toPyObject() scroller.setEnabled(True) except: pass gridIndex = 0 self._main_layout.addWidget(QLabel('Font :'), gridIndex, 0) gridIndex += 1 self.fontName = QFontComboBox() self._main_layout.addWidget(self.fontName, gridIndex, 0) gridIndex += 1 self.fontSize = QSpinBox() self._main_layout.addWidget(self.fontSize, gridIndex, 0) gridIndex += 1 self._main_layout.addWidget(QLabel('Plugins :'), gridIndex, 0) gridIndex += 1 init_plugin_system() self.plugins_widgets = [] for plugin in find_plugins(): aCheckBox = QCheckBox(plugin.__name__ + ' ' + plugin.__version__) self.plugins_widgets.append(aCheckBox) self._main_layout.addWidget(aCheckBox, gridIndex, 0) gridIndex += 1 self._main_layout.addWidget(QLabel('Others preferences :'), gridIndex, 0) gridIndex += 1 self.wrapLine = QCheckBox('Wrap Lines') self._main_layout.addWidget(self.wrapLine, gridIndex, 0) gridIndex += 1 self.qt18720 = QCheckBox('Work Arround QTBUG-18720') self._main_layout.addWidget(self.qt18720, gridIndex, 0) gridIndex += 1 self.aWidget.setLayout(self._main_layout) self.setCentralWidget(self.scrollArea)
def createWidget(self): """ Create qt widget """ self.screenResolutionLabel = QLabel(self) self.screenTapLabel = QLabel(self) mobileLayout = QVBoxLayout() self.mobileDockToolbar = QToolBar(self) self.mobileDockToolbar.setStyleSheet("QToolBar { border: 0px }"); self.mobileDockToolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.mobileImageLabel = QLabel(self) self.mobileImageLabel.setMouseTracking(True) self.mobileImageLabel.installEventFilter(self) self.mobileImageLabel.setScaledContents(True) self.mobileImageLabel.mousePressEvent = self.pixelSelect self.refreshCheckbox = QCheckBox("Automatic Refresh", self) self.refreshCheckbox.setEnabled(False) self.refreshCheckbox.stateChanged.connect(self.onRefreshChanged) self.clickCheckbox = QCheckBox("Enable Tap", self) self.clickCheckbox.setEnabled(False) self.model = DomModel(QDomDocument(), self) self.mobileTreeView = QTreeView(self) self.mobileTreeView.setMinimumWidth(300) self.mobileTreeView.setModel(self.model) self.mobileTreeView.clicked.connect(self.onTreeViewClicked) header=["Attribute", "Value"] self.tableModel = MyTableModel(self, [], header) self.mobileTableView = QTableView(self) self.mobileTableView.setSelectionMode(QAbstractItemView.SingleSelection) self.mobileTableView.setModel(self.tableModel) self.mobileTableView.setContextMenuPolicy(Qt.CustomContextMenu) self.mobileTableView.customContextMenuRequested.connect( self.onContextMenuEvent ) self.mobileTableView.setMinimumWidth(300) mobileViewLayout = QHBoxLayout() mobileViewLayout.addWidget(self.mobileImageLabel) mobileViewLayout.addWidget(self.mobileTreeView) mobileViewLayout.addWidget(self.mobileTableView) mobileLayout.addWidget(self.mobileDockToolbar) mobileLayout.addLayout(mobileViewLayout) self.setLayout(mobileLayout)
def addFilterBox(self, layout): hbox = QHBoxLayout() layout.addLayout(hbox) # hbox.setAlignment(Qt.AlignLeft|Qt.AlignVCenter) self.filterButton=QCheckBox("Filter", self.canMonitor) self.filterButton.setToolTip('Enable filter') self.filterButton.resize(self.filterButton.sizeHint()) self.filterButton.clicked.connect(self._enableFilter) hbox.addWidget(self.filterButton) self.filterEdit=QLineEdit(self.canMonitor) self.filterEdit.setToolTip('Id Filter') self.filterEdit.setDisabled(self.filter==False) self.filterEdit.returnPressed.connect(self._applyFilter) hbox.addWidget(self.filterEdit) self.applyFilterButton = QPushButton('Apply', self.canMonitor) self.applyFilterButton.setToolTip('Use Id filter') self.applyFilterButton.resize(self.applyFilterButton.sizeHint()) self.applyFilterButton.clicked.connect(self._applyFilter) self.applyFilterButton.setDisabled(self.filter==False) hbox.addWidget(self.applyFilterButton) self.filterKnown=QRadioButton("Known", self.canMonitor) self.filterKnown.clicked.connect(self._applyFilter) self.filterKnown.setDisabled(self.filter==False) hbox.addWidget(self.filterKnown) self.filterUnknown=QRadioButton("Unknown", self.canMonitor) self.filterUnknown.clicked.connect(self._applyFilter) self.filterUnknown.setDisabled(self.filter==False) hbox.addWidget(self.filterUnknown) self.filterAll=QRadioButton("All", self.canMonitor) self.filterAll.clicked.connect(self._applyFilter) self.filterAll.setDisabled(self.filter==False) self.filterAll.setChecked(True) hbox.addWidget(self.filterAll) self.filterRingIdsButton=QCheckBox("Ring Ids", self.canMonitor) self.filterRingIdsButton.resize(self.filterRingIdsButton.sizeHint()) self.filterRingIdsButton.clicked.connect(self._enableFilterRingIds) self.filterRingIdsButton.setDisabled(self.filter==False) self.filterRingIdsButton.setChecked(self.filterRingIds) hbox.addWidget(self.filterRingIdsButton) if self.withChanged==True: self.filterChangedButton=QCheckBox("Changed", self.canMonitor) self.filterChangedButton.resize(self.filterChangedButton.sizeHint()) self.filterChangedButton.clicked.connect(self._enableFilterChanged) self.filterChangedButton.setDisabled(self.filter==False) self.filterChangedButton.setChecked(self.filterChanged) hbox.addWidget(self.filterChangedButton)
def createOptions(self): self.optbox = QGroupBox("Options") self.optgrid = QGridLayout() self.fromcursor = QCheckBox("From cursor") self.backwards = QCheckBox("Backwards") self.optgrid.addWidget(self.fromcursor, 0, 0) self.optgrid.addWidget(self.backwards, 1, 0) self.optbox.setLayout(self.optgrid) self.vbox.addWidget(self.optbox)
def __createLayout( self, bpoint ): """ Creates the dialog layout """ self.resize( 400, 150 ) self.setSizeGripEnabled( True ) # Top level layout layout = QVBoxLayout( self ) gridLayout = QGridLayout() fileLabel = QLabel( "File name:" ) gridLayout.addWidget( fileLabel, 0, 0 ) fileValue = QLabel( bpoint.getAbsoluteFileName() ) gridLayout.addWidget( fileValue, 0, 1 ) lineLabel = QLabel( "Line:" ) gridLayout.addWidget( lineLabel, 1, 0 ) lineValue = QLabel( str( bpoint.getLineNumber() ) ) gridLayout.addWidget( lineValue, 1, 1 ) conditionLabel = QLabel( "Condition:" ) gridLayout.addWidget( conditionLabel, 2, 0 ) self.__conditionValue = CDMComboBox( True ) self.__conditionValue.lineEdit().setText( bpoint.getCondition() ) gridLayout.addWidget( self.__conditionValue, 2, 1 ) ignoreLabel = QLabel( "Ignore count:" ) gridLayout.addWidget( ignoreLabel, 3, 0 ) self.__ignoreValue = QSpinBox() self.__ignoreValue.setMinimum( 0 ) self.__ignoreValue.setValue( bpoint.getIgnoreCount() ) gridLayout.addWidget( self.__ignoreValue, 3, 1 ) layout.addLayout( gridLayout ) # Checkboxes part self.__tempCheckbox = QCheckBox( "&Temporary" ) self.__tempCheckbox.setChecked( bpoint.isTemporary() ) layout.addWidget( self.__tempCheckbox ) self.__enabled = QCheckBox( "&Enabled" ) self.__enabled.setChecked( bpoint.isEnabled() ) layout.addWidget( self.__enabled ) # Buttons at the bottom buttonBox = QDialogButtonBox( self ) buttonBox.setOrientation( Qt.Horizontal ) buttonBox.setStandardButtons( QDialogButtonBox.Ok | QDialogButtonBox.Cancel ) self.__OKButton = buttonBox.button( QDialogButtonBox.Ok ) self.__OKButton.setDefault( True ) buttonBox.accepted.connect( self.accept ) buttonBox.rejected.connect( self.close ) layout.addWidget( buttonBox ) self.__conditionValue.setFocus() return
def __init__(self, id): super(CatalogFilterStatus, self).__init__(id) self.label = QLabel(TEXT_LABEL_IS) self.available_checkbox = QCheckBox(TEXT_STATUS_AVAILABLE) self.ordered_checkbox = QCheckBox(TEXT_STATUS_ORDERED) self.unordered_checkbox = QCheckBox(TEXT_STATUS_UNORDERED) value_item = QGridLayout() value_item.addWidget(self.available_checkbox, 0, 0) value_item.addWidget(self.ordered_checkbox, 0, 1) value_item.addWidget(self.unordered_checkbox, 0, 2) self.expand_layout(value_item) self.value_item = value_item
def createWidgets(self, layout): self.label = QLabel(wordWrap=True) self.voicingLabel = QLabel() self.voicing = QComboBox(editable=True) self.voicingLabel.setBuddy(self.voicing) self.voicing.setCompleter(None) self.voicing.setValidator( QRegExpValidator(QRegExp("[SATB]+(-[SATB]+)*", Qt.CaseInsensitive), self.voicing)) self.voicing.addItems(( 'SA-TB', 'S-A-T-B', 'SA', 'S-A', 'SS-A', 'S-S-A', 'TB', 'T-B', 'TT-B', 'T-T-B', 'SS-A-T-B', 'S-A-TT-B', 'SS-A-TT-B', 'S-S-A-T-T-B', 'S-S-A-A-T-T-B-B', )) self.lyricsLabel = QLabel() self.lyrics = QComboBox() self.lyricsLabel.setBuddy(self.lyrics) self.lyrics.setModel( listmodel.ListModel(lyricStyles, self.lyrics, display=listmodel.translate_index(0), tooltip=listmodel.translate_index(1))) self.lyrics.setCurrentIndex(0) self.pianoReduction = QCheckBox() self.rehearsalMidi = QCheckBox() layout.addWidget(self.label) box = QHBoxLayout() layout.addLayout(box) box.addWidget(self.voicingLabel) box.addWidget(self.voicing) self.createStanzaWidget(layout) box = QHBoxLayout() layout.addLayout(box) box.addWidget(self.lyricsLabel) box.addWidget(self.lyrics) self.createAmbitusWidget(layout) layout.addWidget(self.pianoReduction) layout.addWidget(self.rehearsalMidi)
def __init__(self, parent=None): super(CustomAttributes, self).__init__(parent) grid = QGridLayout() self.setLayout(grid) self.toplabel = QLabel() self.toplabel.setEnabled(False) self.toplabel.setAlignment(Qt.AlignCenter) grid.addWidget(self.toplabel, 0, 0, 1, 3) self.textColor = ColorButton() l = self.textLabel = QLabel() l.setBuddy(self.textColor) grid.addWidget(l, 1, 0) grid.addWidget(self.textColor, 1, 1) c = ClearButton(iconSize=QSize(16, 16)) c.clicked.connect(self.textColor.clear) grid.addWidget(c, 1, 2) self.backgroundColor = ColorButton() l = self.backgroundLabel = QLabel() l.setBuddy(self.backgroundColor) grid.addWidget(l, 2, 0) grid.addWidget(self.backgroundColor, 2, 1) c = ClearButton(iconSize=QSize(16, 16)) c.clicked.connect(self.backgroundColor.clear) grid.addWidget(c, 2, 2) self.bold = QCheckBox() self.italic = QCheckBox() self.underline = QCheckBox() grid.addWidget(self.bold, 3, 0) grid.addWidget(self.italic, 4, 0) grid.addWidget(self.underline, 5, 0) self.underlineColor = ColorButton() grid.addWidget(self.underlineColor, 5, 1) c = ClearButton(iconSize=QSize(16, 16)) c.clicked.connect(self.underlineColor.clear) grid.addWidget(c, 5, 2) grid.setRowStretch(6, 2) self.textColor.colorChanged.connect(self.changed) self.backgroundColor.colorChanged.connect(self.changed) self.underlineColor.colorChanged.connect(self.changed) self.bold.stateChanged.connect(self.changed) self.italic.stateChanged.connect(self.changed) self.underline.stateChanged.connect(self.changed) app.translateUI(self)
def createExtractionTab(self): extractDeckLabel = QLabel('Extracts Deck') self.extractDeckComboBox = QComboBox() deckNames = sorted([d['name'] for d in mw.col.decks.all()]) self.extractDeckComboBox.addItem('[Current Deck]') self.extractDeckComboBox.addItems(deckNames) if self.settings['extractDeck']: setComboBoxItem(self.extractDeckComboBox, self.settings['extractDeck']) else: setComboBoxItem(self.extractDeckComboBox, '[Current Deck]') extractDeckLayout = QHBoxLayout() extractDeckLayout.addWidget(extractDeckLabel) extractDeckLayout.addWidget(self.extractDeckComboBox) self.editExtractButton = QRadioButton('Edit Extracted Note') enterTitleButton = QRadioButton('Enter Title Only') if self.settings['editExtract']: self.editExtractButton.setChecked(True) else: enterTitleButton.setChecked(True) radioButtonsLayout = QHBoxLayout() radioButtonsLayout.addWidget(self.editExtractButton) radioButtonsLayout.addWidget(enterTitleButton) radioButtonsLayout.addStretch() self.editSourceCheckBox = QCheckBox('Edit Source Note') self.plainTextCheckBox = QCheckBox('Extract as Plain Text') if self.settings['editSource']: self.editSourceCheckBox.setChecked(True) if self.settings['plainText']: self.plainTextCheckBox.setChecked(True) layout = QVBoxLayout() layout.addLayout(extractDeckLayout) layout.addLayout(radioButtonsLayout) layout.addWidget(self.editSourceCheckBox) layout.addWidget(self.plainTextCheckBox) layout.addStretch() tab = QWidget() tab.setLayout(layout) return tab
def createOptions(self): self.woptions = QWidget() self.optgrid = QGridLayout() lopt = QLabel("Options:") self.fromcursor = QCheckBox("From cursor") self.back = QCheckBox("Backwards") self.optgrid.addWidget(lopt, 0, 0) self.optgrid.addWidget(self.fromcursor, 0, 1) self.woptions.setLayout(self.optgrid) self.vbox.addWidget(self.woptions)
def __init__(self, parent): super(ImageTab, self).__init__(parent) self.parent = parent self.name = 'Images' self.formats = config.image_formats self.extra_img = config.image_extra_formats validator = QRegExpValidator(QRegExp(r'^[1-9]\d*'), self) converttoQL = QLabel(self.tr('Convert to:')) self.extQCB = QComboBox() self.extQCB.addItems(self.formats) commandQL = QLabel(self.tr('Extra options:')) self.commandQLE = QLineEdit() hlayout2 = utils.add_to_layout('h', converttoQL, self.extQCB, commandQL, self.commandQLE) sizeQL = QLabel('<html><p align="center">' + self.tr('Image Size:') + '</p></html>') self.widthQLE = utils.create_LineEdit((50, 16777215), validator, 4) self.heightQLE = utils.create_LineEdit((50, 16777215), validator, 4) label = QLabel('<html><p align="center">x</p></html>') label.setMaximumWidth(25) hlayout1 = utils.add_to_layout('h', self.widthQLE, label, self.heightQLE) sizelayout = utils.add_to_layout('v', sizeQL, hlayout1) self.imgaspectQChB = QCheckBox(self.tr("Maintain aspect ratio")) self.autocropQChB = QCheckBox(self.tr("Auto-crop")) vlayout = utils.add_to_layout('v', self.imgaspectQChB, self.autocropQChB) rotateQL = QLabel("<html><div align='center'>" + self.tr("Rotate") + ":</div><br>(" + self.tr("degrees - clockwise") + ")</html>") self.rotateQLE = utils.create_LineEdit((100, 16777215), validator, 3) self.vflipQChB = QCheckBox(self.tr('Vertical flip')) self.hflipQChB = QCheckBox(self.tr('Horizontal flip')) vlayout2 = utils.add_to_layout('v', self.vflipQChB, self.hflipQChB) hlayout3 = utils.add_to_layout('h', sizelayout, vlayout, rotateQL, self.rotateQLE, vlayout2, None) final_layout = utils.add_to_layout('v', hlayout2, hlayout3) self.setLayout(final_layout)
def __init__(self, tool): super(Widget, self).__init__(tool) layout = QVBoxLayout(spacing=1) self.setLayout(layout) # manual mode UI elements that need special treatment self.CBverbose = QCheckBox(clicked=self.optionsChanged) self.CBpointandclick = QCheckBox(clicked=self.optionsChanged) self.CBcustomfile = QCheckBox(clicked=self.optionsChanged) self.LEcustomfile = QLineEdit(enabled=False) # run Lily button self.engraveButton = QToolButton() self.engraveButton.setDefaultAction( engrave.engraver(tool.mainwindow()).actionCollection.engrave_debug) # help button self.helpButton = QToolButton(clicked=self.helpButtonClicked) self.helpButton.setIcon(icons.get('help-contents')) # add manual widgets hbox = QHBoxLayout() hbox.setContentsMargins(0, 0, 0, 0) hbox.addWidget(self.engraveButton) hbox.addWidget(self.helpButton) hbox.addStretch(1) layout.addLayout(hbox) layout.addWidget(self.CBverbose) layout.addWidget(self.CBpointandclick) # automatically processed modes self.checkboxes = {} for mode in layoutcontrol.modelist(): self.checkboxes[mode] = cb = QCheckBox(clicked=self.optionsChanged) layout.addWidget(cb) # add manual widgets layout.addWidget(self.CBcustomfile) layout.addWidget(self.LEcustomfile) layout.addStretch(1) # connect manual widgets self.CBcustomfile.toggled.connect(self.LEcustomfile.setEnabled) self.LEcustomfile.textEdited.connect(self.optionsChanged) app.translateUI(self) self.loadSettings() tool.mainwindow().aboutToClose.connect(self.saveSettings)
def __createLayout( self ): """ Creates the dialog layout """ self.resize( 400, 100 ) self.setSizeGripEnabled( True ) verticalLayout = QVBoxLayout( self ) # Check boxes self.includeClassesBox = QCheckBox( self ) self.includeClassesBox.setText( "Show &classes in modules" ) self.includeClassesBox.setChecked( self.options.includeClasses ) self.includeClassesBox.stateChanged.connect( self.__updateOptions ) self.includeFuncsBox = QCheckBox( self ) self.includeFuncsBox.setText( "Show &functions in modules" ) self.includeFuncsBox.setChecked( self.options.includeFuncs ) self.includeFuncsBox.stateChanged.connect( self.__updateOptions ) self.includeGlobsBox = QCheckBox( self ) self.includeGlobsBox.setText( "Show &global variables in modules" ) self.includeGlobsBox.setChecked( self.options.includeGlobs ) self.includeGlobsBox.stateChanged.connect( self.__updateOptions ) self.includeDocsBox = QCheckBox( self ) self.includeDocsBox.setText( "Show modules &docstrings" ) self.includeDocsBox.setChecked( self.options.includeDocs ) self.includeDocsBox.stateChanged.connect( self.__updateOptions ) self.includeConnTextBox = QCheckBox( self ) self.includeConnTextBox.setText( "Show connection &labels" ) self.includeConnTextBox.setChecked( self.options.includeConnText ) self.includeConnTextBox.stateChanged.connect( self.__updateOptions ) verticalLayout.addWidget( self.includeClassesBox ) verticalLayout.addWidget( self.includeFuncsBox ) verticalLayout.addWidget( self.includeGlobsBox ) verticalLayout.addWidget( self.includeDocsBox ) verticalLayout.addWidget( self.includeConnTextBox ) # Buttons at the bottom buttonBox = QDialogButtonBox( self ) buttonBox.setOrientation( Qt.Horizontal ) buttonBox.setStandardButtons( QDialogButtonBox.Cancel ) generateButton = buttonBox.addButton( "Generate", QDialogButtonBox.ActionRole ) generateButton.setDefault( True ) generateButton.clicked.connect( self.accept ) verticalLayout.addWidget( buttonBox ) buttonBox.rejected.connect( self.close ) return
def __init__(self, page): super(MusicView, self).__init__(page) layout = QGridLayout() self.setLayout(layout) self.newerFilesOnly = QCheckBox(toggled=self.changed) layout.addWidget(self.newerFilesOnly, 0, 0, 1, 3) self.magnifierSizeLabel = QLabel() self.magnifierSizeSlider = QSlider(Qt.Horizontal, valueChanged=self.changed) self.magnifierSizeSlider.setSingleStep(50) self.magnifierSizeSlider.setRange( *popplerview.MagnifierSettings.sizeRange) self.magnifierSizeSpinBox = QSpinBox() self.magnifierSizeSpinBox.setRange( *popplerview.MagnifierSettings.sizeRange) self.magnifierSizeSpinBox.valueChanged.connect( self.magnifierSizeSlider.setValue) self.magnifierSizeSlider.valueChanged.connect( self.magnifierSizeSpinBox.setValue) layout.addWidget(self.magnifierSizeLabel, 1, 0) layout.addWidget(self.magnifierSizeSlider, 1, 1) layout.addWidget(self.magnifierSizeSpinBox, 1, 2) self.magnifierScaleLabel = QLabel() self.magnifierScaleSlider = QSlider(Qt.Horizontal, valueChanged=self.changed) self.magnifierScaleSlider.setSingleStep(50) self.magnifierScaleSlider.setRange( *popplerview.MagnifierSettings.scaleRange) self.magnifierScaleSpinBox = QSpinBox() self.magnifierScaleSpinBox.setRange( *popplerview.MagnifierSettings.scaleRange) self.magnifierScaleSpinBox.valueChanged.connect( self.magnifierScaleSlider.setValue) self.magnifierScaleSlider.valueChanged.connect( self.magnifierScaleSpinBox.setValue) layout.addWidget(self.magnifierScaleLabel, 2, 0) layout.addWidget(self.magnifierScaleSlider, 2, 1) layout.addWidget(self.magnifierScaleSpinBox, 2, 2) self.enableKineticScrolling = QCheckBox(toggled=self.changed) layout.addWidget(self.enableKineticScrolling) self.showScrollbars = QCheckBox(toggled=self.changed) layout.addWidget(self.showScrollbars) app.translateUI(self)
def __init__(self, parent=None): super(SearchWidget, self).__init__(parent) hSearch = QHBoxLayout(self) hSearch.setContentsMargins(0, 0, 0, 0) self._checkSensitive = QCheckBox(translations.TR_SEARCH_CASE_SENSITIVE) self._checkWholeWord = QCheckBox(translations.TR_SEARCH_WHOLE_WORDS) self._line = TextLine(self) self._line.setMinimumWidth(250) self._btnClose = QPushButton( self.style().standardIcon(QStyle.SP_DialogCloseButton), '') self._btnClose.setIconSize(QSize(16, 16)) self._btnFind = QPushButton(QIcon(":img/find"), '') self._btnFind.setIconSize(QSize(16, 16)) self.btnPrevious = QPushButton( self.style().standardIcon(QStyle.SP_ArrowLeft), '') self.btnPrevious.setIconSize(QSize(16, 16)) self.btnPrevious.setToolTip( self.trUtf8("Press %s") % resources.get_shortcut("Find-previous").toString( QKeySequence.NativeText)) self.btnNext = QPushButton( self.style().standardIcon(QStyle.SP_ArrowRight), '') self.btnNext.setIconSize(QSize(16, 16)) self.btnNext.setToolTip( self.trUtf8("Press %s") % resources.get_shortcut("Find-next").toString( QKeySequence.NativeText)) hSearch.addWidget(self._btnClose) hSearch.addWidget(self._line) hSearch.addWidget(self._btnFind) hSearch.addWidget(self.btnPrevious) hSearch.addWidget(self.btnNext) hSearch.addWidget(self._checkSensitive) hSearch.addWidget(self._checkWholeWord) self.totalMatches = 0 self.index = 0 self._line.counter.update_count(self.index, self.totalMatches) self.connect(self._btnFind, SIGNAL("clicked()"), self.find_next) self.connect(self.btnNext, SIGNAL("clicked()"), self.find_next) self.connect(self.btnPrevious, SIGNAL("clicked()"), self.find_previous) self.connect(self._checkSensitive, SIGNAL("stateChanged(int)"), self._checks_state_changed) self.connect(self._checkWholeWord, SIGNAL("stateChanged(int)"), self._checks_state_changed) IDE.register_service('status_search', self)