当前位置: 首页>>代码示例>>Python>>正文


Python QDialog.Accepted方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QDialog.Accepted方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.Accepted方法的具体用法?Python QDialog.Accepted怎么用?Python QDialog.Accepted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QDialog的用法示例。


在下文中一共展示了QDialog.Accepted方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addToFavourites

# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import Accepted [as 别名]
def addToFavourites(self):
        dialog = QDialog(self)
        addbmkdialog = Add_Bookmark_Dialog()
        addbmkdialog.setupUi(dialog)
        dialog.setWindowTitle('Add to HomePage')
        addbmkdialog.titleEdit.setMaxLength(31)
        addbmkdialog.titleEdit.setText(self.tabWidget.currentWidget().page().mainFrame().title())
        addbmkdialog.addressEdit.setText(self.line.text())
        if (dialog.exec_() == QDialog.Accepted):
            title = unicode(addbmkdialog.titleEdit.text())
            addr = unicode(addbmkdialog.addressEdit.text())
            imgfile = str(time()) + '.jpg'
            viewportsize = self.tabWidget.currentWidget().page().viewportSize()
            contentsize = QSize(640, 640)
            self.tabWidget.currentWidget().page().setViewportSize(contentsize)
            img = QPixmap(contentsize)
            painter = QPainter(img)
            self.tabWidget.currentWidget().page().mainFrame().render(painter, 0xff)# 0xff=QWebFrame.AllLayers
            painter.end()
            self.tabWidget.currentWidget().page().setViewportSize(viewportsize)
            icon = img.scaledToWidth(184, 1).copy(0,0, 180, 120)
            icon.save(thumbnails_dir + imgfile)
            self.favourites = importFavourites(configdir + 'favourites.txt')
            self.favourites.append([title, addr, imgfile])
            exportFavourites(configdir + 'favourites.txt', self.favourites) 
开发者ID:ksharindam,项目名称:quartz-browser,代码行数:27,代码来源:main.py

示例2: addbookmark

# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import Accepted [as 别名]
def addbookmark(self):
        """ Opens add bookmark dialog and gets url from url box"""
        dialog = QDialog(self)
        addbmkdialog = Add_Bookmark_Dialog()
        addbmkdialog.setupUi(dialog)
        addbmkdialog.titleEdit.setText(self.tabWidget.currentWidget().page().mainFrame().title())
        addbmkdialog.addressEdit.setText(self.line.text())
        if (dialog.exec_() == QDialog.Accepted):
            url = unicode(addbmkdialog.addressEdit.text())
            bmk = [unicode(addbmkdialog.titleEdit.text()), url]
            self.bookmarks = importBookmarks(configdir+"bookmarks.txt")
            self.bookmarks.insert(0, bmk)
            exportBookmarks(configdir+"bookmarks.txt", self.bookmarks)
            icon = self.tabWidget.currentWidget().icon()
            if not icon.isNull():
                icon.pixmap(16, 16).save(icon_dir + url.split('/')[2] + '.png') 
开发者ID:ksharindam,项目名称:quartz-browser,代码行数:18,代码来源:main.py

示例3: test_dialog_ok

# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import Accepted [as 别名]
def test_dialog_ok(self):
        """Test we can click OK."""

        button = self.dialog.button_box.button(QDialogButtonBox.Ok)
        button.click()
        result = self.dialog.result()
        self.assertEqual(result, QDialog.Accepted) 
开发者ID:MACBIO,项目名称:GeoWrap,代码行数:9,代码来源:test_geometry_wrapper_dialog.py

示例4: setExt

# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import Accepted [as 别名]
def setExt(parent=None):
        dialog = CalibrationDialog(parent)
        result = dialog.exec_()
        bg, bgstd, las, time, conc = dialog.evalTable()
        return (bg, bgstd, las, time, conc, result == QDialog.Accepted) 
开发者ID:jungmannlab,项目名称:picasso,代码行数:7,代码来源:simulate.py

示例5: settingseditor

# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import Accepted [as 别名]
def settingseditor(self):  
        """ Opens the settings manager dialog, then applies the change"""
        dialog = QDialog(self)
        websettingsdialog = Ui_SettingsDialog()
        websettingsdialog.setupUi(dialog)
        # Enable AdBlock
        websettingsdialog.checkAdBlock.setChecked(webkit.enable_adblock)
        # Fonts blocking
        websettingsdialog.checkFontLoad.setChecked(webkit.block_fonts)
        # Popups blocking
        websettingsdialog.checkBlockPopups.setChecked(webkit.block_popups)
        # Custom user agent
        websettingsdialog.checkUserAgent.setChecked(webkit.use_custom_useragent)
        websettingsdialog.useragentEdit.setText(webkit.user_agent)
        # External download manager
        websettingsdialog.checkDownMan.setChecked(self.useexternaldownloader)
        websettingsdialog.downManEdit.setText(self.externaldownloader)
        # RTSP media player command
        websettingsdialog.mediaPlayerEdit.setText(webkit.video_player_command)
        websettingsdialog.mediaPlayerEdit.setCursorPosition(0)
        # Maximize on startup
        websettingsdialog.checkMaximize.setChecked(self.maximizeonstartup)
        # Font settings
        websettingsdialog.spinFontSize.setValue(self.minfontsizeval)
        websettingsdialog.standardfontCombo.setCurrentFont(QFont(self.standardfontval))
        websettingsdialog.sansfontCombo.setCurrentFont(QFont(self.sansfontval))
        websettingsdialog.seriffontCombo.setCurrentFont(QFont(self.seriffontval))
        websettingsdialog.fixedfontCombo.setCurrentFont(QFont(self.fixedfontval))
        # Clear Data buttons
        websettingsdialog.clearCacheButton.clicked.connect(self.websettings.clearMemoryCaches)
        websettingsdialog.cookiesButton.clicked.connect(cookiejar.clearCookies)
        websettingsdialog.iconDBButton.clicked.connect(self.websettings.clearIconDatabase)

        if dialog.exec_() == QDialog.Accepted:
            # Enable AdBlock
            webkit.enable_adblock = websettingsdialog.checkAdBlock.isChecked()
            # Block Fonts
            webkit.block_fonts = websettingsdialog.checkFontLoad.isChecked()
            # Block Popups
            webkit.block_popups = websettingsdialog.checkBlockPopups.isChecked()
            # User Agent
            webkit.use_custom_useragent = websettingsdialog.checkUserAgent.isChecked()
            webkit.user_agent = websettingsdialog.useragentEdit.text()
            # Download Manager
            self.useexternaldownloader = websettingsdialog.checkDownMan.isChecked()
            self.externaldownloader = websettingsdialog.downManEdit.text()
            # Media Player Command
            webkit.video_player_command = websettingsdialog.mediaPlayerEdit.text()
            # Maximize on startup
            self.maximizeonstartup = websettingsdialog.checkMaximize.isChecked()

            self.minfontsizeval = websettingsdialog.spinFontSize.value()
            self.standardfontval = websettingsdialog.standardfontCombo.currentText()
            self.sansfontval = websettingsdialog.sansfontCombo.currentText()
            self.seriffontval = websettingsdialog.seriffontCombo.currentText()
            self.fixedfontval = websettingsdialog.fixedfontCombo.currentText()
            self.applysettings()
            self.savesettings() 
开发者ID:ksharindam,项目名称:quartz-browser,代码行数:60,代码来源:main.py


注:本文中的PyQt4.QtGui.QDialog.Accepted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。