本文整理汇总了Python中spyderlib.qt.QtGui.QVBoxLayout类的典型用法代码示例。如果您正苦于以下问题:Python QVBoxLayout类的具体用法?Python QVBoxLayout怎么用?Python QVBoxLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QVBoxLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
self.setWindowTitle("Breakpoints")
self.dictwidget = BreakpointTableView(self, self._load_all_breakpoints())
layout = QVBoxLayout()
layout.addWidget(self.dictwidget)
self.setLayout(layout)
self.connect(
self.dictwidget, SIGNAL("clear_all_breakpoints()"), lambda: self.emit(SIGNAL("clear_all_breakpoints()"))
)
self.connect(
self.dictwidget,
SIGNAL("clear_breakpoint(QString,int)"),
lambda s1, lino: self.emit(SIGNAL("clear_breakpoint(QString,int)"), s1, lino),
)
self.connect(
self.dictwidget,
SIGNAL("edit_goto(QString,int,QString)"),
lambda s1, lino, s2: self.emit(SIGNAL("edit_goto(QString,int,QString)"), s1, lino, s2),
)
self.connect(
self.dictwidget,
SIGNAL("set_or_edit_conditional_breakpoint()"),
lambda: self.emit(SIGNAL("set_or_edit_conditional_breakpoint()")),
)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:26,代码来源:breakpointsgui.py
示例2: __init__
def __init__(self, parent=None):
QDialog.__init__(self, parent)
SizeMixin.__init__(self)
# Destroying the C++ object right after closing the dialog box,
# otherwise it may be garbage-collected in another QThread
# (e.g. the editor's analysis thread in Spyder), thus leading to
# a segmentation fault on UNIX or an application crash on Windows
self.setAttribute(Qt.WA_DeleteOnClose)
self.filename = None
self.runconfigoptions = RunConfigOptions(self)
bbox = QDialogButtonBox(QDialogButtonBox.Cancel)
bbox.addButton(_("Run"), QDialogButtonBox.AcceptRole)
self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
btnlayout = QHBoxLayout()
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
layout = QVBoxLayout()
layout.addWidget(self.runconfigoptions)
layout.addLayout(btnlayout)
self.setLayout(layout)
self.setWindowIcon(get_icon("run.png"))
开发者ID:jromang,项目名称:retina-old,代码行数:29,代码来源:runconfig.py
示例3: __init__
def __init__(self, parent=None, name_filters=['*.py', '*.pyw'],
valid_types=('.py', '.pyw'), show_all=False,
show_cd_only=None, show_toolbar=True, show_icontext=True):
QWidget.__init__(self, parent)
self.treewidget = ExplorerTreeWidget(self, show_cd_only=show_cd_only)
self.treewidget.setup(name_filters=name_filters,
valid_types=valid_types, show_all=show_all)
self.treewidget.chdir(os.getcwdu())
toolbar_action = create_action(self, _("Show toolbar"),
toggled=self.toggle_toolbar)
icontext_action = create_action(self, _("Show icons and text"),
toggled=self.toggle_icontext)
self.treewidget.common_actions += [None,
toolbar_action, icontext_action]
# Setup toolbar
self.toolbar = QToolBar(self)
self.toolbar.setIconSize(QSize(16, 16))
self.previous_action = create_action(self, text=_("Previous"),
icon=get_icon('previous.png'),
triggered=self.treewidget.go_to_previous_directory)
self.toolbar.addAction(self.previous_action)
self.previous_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_previous_enabled(bool)"),
self.previous_action.setEnabled)
self.next_action = create_action(self, text=_("Next"),
icon=get_icon('next.png'),
triggered=self.treewidget.go_to_next_directory)
self.toolbar.addAction(self.next_action)
self.next_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_next_enabled(bool)"),
self.next_action.setEnabled)
parent_action = create_action(self, text=_("Parent"),
icon=get_icon('up.png'),
triggered=self.treewidget.go_to_parent_directory)
self.toolbar.addAction(parent_action)
options_action = create_action(self, text=_("Options"),
icon=get_icon('tooloptions.png'))
self.toolbar.addAction(options_action)
widget = self.toolbar.widgetForAction(options_action)
widget.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, self.treewidget.common_actions)
options_action.setMenu(menu)
toolbar_action.setChecked(show_toolbar)
self.toggle_toolbar(show_toolbar)
icontext_action.setChecked(show_icontext)
self.toggle_icontext(show_icontext)
vlayout = QVBoxLayout()
vlayout.addWidget(self.toolbar)
vlayout.addWidget(self.treewidget)
self.setLayout(vlayout)
开发者ID:jromang,项目名称:retina-old,代码行数:60,代码来源:explorer.py
示例4: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
vert_layout = QVBoxLayout()
# Type frame
type_layout = QHBoxLayout()
type_label = QLabel(_("Import as"))
type_layout.addWidget(type_label)
self.array_btn = array_btn = QRadioButton(_("array"))
array_btn.setEnabled(ndarray is not FakeObject)
array_btn.setChecked(ndarray is not FakeObject)
type_layout.addWidget(array_btn)
list_btn = QRadioButton(_("list"))
list_btn.setChecked(not array_btn.isChecked())
type_layout.addWidget(list_btn)
if pd:
self.df_btn = df_btn = QRadioButton(_("DataFrame"))
df_btn.setChecked(False)
type_layout.addWidget(df_btn)
h_spacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
type_layout.addItem(h_spacer)
type_frame = QFrame()
type_frame.setLayout(type_layout)
self._table_view = PreviewTable(self)
vert_layout.addWidget(type_frame)
vert_layout.addWidget(self._table_view)
self.setLayout(vert_layout)
开发者ID:gyenney,项目名称:Tools,代码行数:33,代码来源:importwizard.py
示例5: setup_page
def setup_page(self):
tabs = QTabWidget()
names = self.get_option("names")
names.pop(names.index(CUSTOM_COLOR_SCHEME_NAME))
names.insert(0, CUSTOM_COLOR_SCHEME_NAME)
fieldnames = {
"background": _("Background:"),
"currentline": _("Current line:"),
"currentcell": _("Current cell:"),
"occurence": _("Occurence:"),
"ctrlclick": _("Link:"),
"sideareas": _("Side areas:"),
"matched_p": _("Matched parentheses:"),
"unmatched_p": _("Unmatched parentheses:"),
"normal": _("Normal text:"),
"keyword": _("Keyword:"),
"builtin": _("Builtin:"),
"definition": _("Definition:"),
"comment": _("Comment:"),
"string": _("String:"),
"number": _("Number:"),
"instance": _("Instance:"),
}
from spyderlib.utils import syntaxhighlighters
assert all([key in fieldnames
for key in syntaxhighlighters.COLOR_SCHEME_KEYS])
for tabname in names:
cs_group = QGroupBox(_("Color scheme"))
cs_layout = QGridLayout()
for row, key in enumerate(syntaxhighlighters.COLOR_SCHEME_KEYS):
option = "%s/%s" % (tabname, key)
value = self.get_option(option)
name = fieldnames[key]
if is_text_string(value):
label, clayout = self.create_coloredit(name, option,
without_layout=True)
label.setAlignment(Qt.AlignRight|Qt.AlignVCenter)
cs_layout.addWidget(label, row+1, 0)
cs_layout.addLayout(clayout, row+1, 1)
else:
label, clayout, cb_bold, cb_italic = self.create_scedit(
name, option, without_layout=True)
label.setAlignment(Qt.AlignRight|Qt.AlignVCenter)
cs_layout.addWidget(label, row+1, 0)
cs_layout.addLayout(clayout, row+1, 1)
cs_layout.addWidget(cb_bold, row+1, 2)
cs_layout.addWidget(cb_italic, row+1, 3)
cs_group.setLayout(cs_layout)
if tabname in sh.COLOR_SCHEME_NAMES:
def_btn = self.create_button(_("Reset to default values"),
lambda: self.reset_to_default(tabname))
tabs.addTab(self.create_tab(cs_group, def_btn), tabname)
else:
tabs.addTab(self.create_tab(cs_group), tabname)
vlayout = QVBoxLayout()
vlayout.addWidget(tabs)
self.setLayout(vlayout)
开发者ID:gyenney,项目名称:Tools,代码行数:58,代码来源:configdialog.py
示例6: create_tab
def create_tab(self, *widgets):
"""Create simple tab widget page: widgets added in a vertical layout"""
widget = QWidget()
layout = QVBoxLayout()
for widg in widgets:
layout.addWidget(widg)
layout.addStretch(1)
widget.setLayout(layout)
return widget
开发者ID:gyenney,项目名称:Tools,代码行数:9,代码来源:configdialog.py
示例7: __init__
def __init__(self, parent=None):
QWidget.__init__(self, parent)
vlayout = QVBoxLayout()
self.setLayout(vlayout)
self.treewidget = FilteredDirView(self)
self.treewidget.setup_view()
self.treewidget.set_root_path(osp.dirname(osp.abspath(__file__)))
self.treewidget.set_folder_names(["variableexplorer", "sourcecode"])
vlayout.addWidget(self.treewidget)
开发者ID:sonofeft,项目名称:spyder,代码行数:9,代码来源:explorer.py
示例8: setup_page
def setup_page(self):
self.table = ShortcutsTable(self)
self.table.model.dataChanged.connect(lambda i1, i2, opt="": self.has_been_modified(opt))
vlayout = QVBoxLayout()
vlayout.addWidget(self.table)
reset_btn = QPushButton(_("Reset to default values"))
reset_btn.clicked.connect(self.reset_to_default)
vlayout.addWidget(reset_btn)
self.setLayout(vlayout)
开发者ID:ftsiadimos,项目名称:spyder,代码行数:9,代码来源:shortcuts.py
示例9: __init__
def __init__(self, parent=None):
QWidget.__init__(self, parent)
vlayout = QVBoxLayout()
self.setLayout(vlayout)
self.treewidget = FilteredDirView(self)
self.treewidget.setup_view()
self.treewidget.set_root_path(r'D:\Python')
self.treewidget.set_folder_names(['spyder', 'spyder-2.0'])
vlayout.addWidget(self.treewidget)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:9,代码来源:explorer.py
示例10: __init__
def __init__(self, plugin, history_filename, connection_file=None,
kernel_widget_id=None, menu_actions=None):
super(IPythonClient, self).__init__(plugin)
SaveHistoryMixin.__init__(self)
self.options_button = None
self.connection_file = connection_file
self.kernel_widget_id = kernel_widget_id
self.name = ''
self.shellwidget = IPythonShellWidget(config=plugin.ipywidget_config(),
local_kernel=False)
self.shellwidget.hide()
self.infowidget = WebView(self)
self.menu_actions = menu_actions
self.history_filename = get_conf_path(history_filename)
self.history = []
self.namespacebrowser = None
self.set_infowidget_font()
self.loading_page = self._create_loading_page()
self.infowidget.setHtml(self.loading_page)
vlayout = QVBoxLayout()
toolbar_buttons = self.get_toolbar_buttons()
hlayout = QHBoxLayout()
for button in toolbar_buttons:
hlayout.addWidget(button)
vlayout.addLayout(hlayout)
vlayout.setContentsMargins(0, 0, 0, 0)
vlayout.addWidget(self.shellwidget)
vlayout.addWidget(self.infowidget)
self.setLayout(vlayout)
self.exit_callback = lambda: plugin.close_console(client=self)
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:34,代码来源:ipython.py
示例11: TextEditor
class TextEditor(QDialog):
"""Array Editor Dialog"""
def __init__(self, text, title='', font=None, parent=None,
readonly=False, size=(400, 300)):
QDialog.__init__(self, parent)
# Destroying the C++ object right after closing the dialog box,
# otherwise it may be garbage-collected in another QThread
# (e.g. the editor's analysis thread in Spyder), thus leading to
# a segmentation fault on UNIX or an application crash on Windows
self.setAttribute(Qt.WA_DeleteOnClose)
self.text = None
self._conv = str if isinstance(text, str) else to_text_string
self.layout = QVBoxLayout()
self.setLayout(self.layout)
# Text edit
self.edit = QTextEdit(parent)
self.connect(self.edit, SIGNAL('textChanged()'), self.text_changed)
self.edit.setReadOnly(readonly)
self.edit.setPlainText(text)
if font is None:
font = get_font('texteditor')
self.edit.setFont(font)
self.layout.addWidget(self.edit)
# Buttons configuration
buttons = QDialogButtonBox.Ok
if not readonly:
buttons = buttons | QDialogButtonBox.Cancel
bbox = QDialogButtonBox(buttons)
self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
self.layout.addWidget(bbox)
# Make the dialog act as a window
self.setWindowFlags(Qt.Window)
self.setWindowIcon(get_icon('edit.png'))
self.setWindowTitle(_("Text editor") + \
"%s" % (" - "+str(title) if str(title) else ""))
self.resize(size[0], size[1])
def text_changed(self):
"""Text has changed"""
self.text = self._conv(self.edit.toPlainText())
def get_value(self):
"""Return modified text"""
# It is import to avoid accessing Qt C++ object as it has probably
# already been destroyed, due to the Qt.WA_DeleteOnClose attribute
return self.text
开发者ID:dhirschfeld,项目名称:spyderlib,代码行数:55,代码来源:texteditor.py
示例12: setup_page
def setup_page(self):
self.table = ShortcutsTable(self)
self.connect(self.table.model,
SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
lambda i1, i2, opt='': self.has_been_modified(opt))
vlayout = QVBoxLayout()
vlayout.addWidget(self.table)
reset_btn = QPushButton(_("Reset to default values"))
self.connect(reset_btn, SIGNAL('clicked()'), self.reset_to_default)
vlayout.addWidget(reset_btn)
self.setLayout(vlayout)
开发者ID:jromang,项目名称:spyderlib,代码行数:11,代码来源:shortcuts.py
示例13: __init__
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.main = parent
# Widgets
self.pages_widget = QStackedWidget()
self.contents_widget = QListWidget()
self.button_reset = QPushButton(_('Reset to defaults'))
bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Apply |
QDialogButtonBox.Cancel)
self.apply_btn = bbox.button(QDialogButtonBox.Apply)
# Widgets setup
# Destroying the C++ object right after closing the dialog box,
# otherwise it may be garbage-collected in another QThread
# (e.g. the editor's analysis thread in Spyder), thus leading to
# a segmentation fault on UNIX or an application crash on Windows
self.setAttribute(Qt.WA_DeleteOnClose)
self.setWindowTitle(_('Preferences'))
self.setWindowIcon(ima.icon('configure'))
self.contents_widget.setMovement(QListView.Static)
self.contents_widget.setSpacing(1)
self.contents_widget.setCurrentRow(0)
# Layout
hsplitter = QSplitter()
hsplitter.addWidget(self.contents_widget)
hsplitter.addWidget(self.pages_widget)
btnlayout = QHBoxLayout()
btnlayout.addWidget(self.button_reset)
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
vlayout = QVBoxLayout()
vlayout.addWidget(hsplitter)
vlayout.addLayout(btnlayout)
self.setLayout(vlayout)
# Signals and slots
self.button_reset.clicked.connect(self.main.reset_spyder)
self.pages_widget.currentChanged.connect(self.current_page_changed)
self.contents_widget.currentRowChanged.connect(
self.pages_widget.setCurrentIndex)
bbox.accepted.connect(self.accept)
bbox.rejected.connect(self.reject)
bbox.clicked.connect(self.button_clicked)
# Ensures that the config is present on spyder first run
CONF.set('main', 'interface_language', load_lang_conf())
开发者ID:gyenney,项目名称:Tools,代码行数:53,代码来源:configdialog.py
示例14: __init__
def __init__(
self, parent=None, namespace=None, commands=[], message=None, exitfunc=None, profile=False, multithreaded=False
):
if PYQT5:
SpyderPluginWidget.__init__(self, parent, main=parent)
else:
SpyderPluginWidget.__init__(self, parent)
debug_print(" ..internal console: initializing")
self.dialog_manager = DialogManager()
# Shell
light_background = self.get_option("light_background")
self.shell = InternalShell(
parent,
namespace,
commands,
message,
self.get_option("max_line_count"),
self.get_plugin_font(),
exitfunc,
profile,
multithreaded,
light_background=light_background,
)
self.shell.status.connect(lambda msg: self.show_message.emit(msg, 0))
self.shell.go_to_error.connect(self.go_to_error)
self.shell.focus_changed.connect(lambda: self.focus_changed.emit())
# Redirecting some signals:
self.shell.redirect_stdio.connect(lambda state: self.redirect_stdio.emit(state))
# Initialize plugin
self.initialize_plugin()
# Find/replace widget
self.find_widget = FindReplace(self)
self.find_widget.set_editor(self.shell)
self.find_widget.hide()
self.register_widget_shortcuts("Editor", self.find_widget)
# Main layout
layout = QVBoxLayout()
layout.addWidget(self.shell)
layout.addWidget(self.find_widget)
self.setLayout(layout)
# Parameters
self.shell.toggle_wrap_mode(self.get_option("wrap"))
# Accepting drops
self.setAcceptDrops(True)
开发者ID:gyenney,项目名称:Tools,代码行数:52,代码来源:console.py
示例15: setup_page
def setup_page(self):
"""
Create the Spyder Config page for this plugin.
As of Dec 2014, there are no options available to set, so we only
display the data path.
"""
results_group = QGroupBox(_("Results"))
results_label1 = QLabel(_("Results are stored here:"))
results_label1.setWordWrap(True)
# Warning: do not try to regroup the following QLabel contents with
# widgets above -- this string was isolated here in a single QLabel
# on purpose: to fix Issue 863
results_label2 = QLabel(CoverageWidget.DATAPATH)
results_label2.setTextInteractionFlags(Qt.TextSelectableByMouse)
results_label2.setWordWrap(True)
results_layout = QVBoxLayout()
results_layout.addWidget(results_label1)
results_layout.addWidget(results_label2)
results_group.setLayout(results_layout)
vlayout = QVBoxLayout()
vlayout.addWidget(results_group)
vlayout.addStretch(1)
self.setLayout(vlayout)
开发者ID:dougthor42,项目名称:spyder-coverage-plugin,代码行数:28,代码来源:p_coverage.py
示例16: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
self.setWindowTitle("Breakpoints")
self.dictwidget = BreakpointTableView(self, self._load_all_breakpoints())
layout = QVBoxLayout()
layout.addWidget(self.dictwidget)
self.setLayout(layout)
self.dictwidget.clear_all_breakpoints.connect(lambda: self.clear_all_breakpoints.emit())
self.dictwidget.clear_breakpoint.connect(lambda s1, lino: self.clear_breakpoint.emit(s1, lino))
self.dictwidget.edit_goto.connect(lambda s1, lino, s2: self.edit_goto.emit(s1, lino, s2))
self.dictwidget.set_or_edit_conditional_breakpoint.connect(
lambda: self.set_or_edit_conditional_breakpoint.emit()
)
开发者ID:rachelqhuang,项目名称:spyder,代码行数:14,代码来源:breakpointsgui.py
示例17: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
SpyderPluginMixin.__init__(self, parent)
# Widgets
self.stack = QStackedWidget(self)
self.shellwidgets = {}
# Layout
layout = QVBoxLayout()
layout.addWidget(self.stack)
self.setLayout(layout)
# Initialize plugin
self.initialize_plugin()
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:15,代码来源:variableexplorer.py
示例18: __init__
def __init__(self, datalist, comment="", parent=None):
QWidget.__init__(self, parent)
layout = QVBoxLayout()
self.tabwidget = QTabWidget()
layout.addWidget(self.tabwidget)
self.setLayout(layout)
self.widgetlist = []
for data, title, comment in datalist:
if len(data[0])==3:
widget = FormComboWidget(data, comment=comment, parent=self)
else:
widget = FormWidget(data, comment=comment, parent=self)
index = self.tabwidget.addTab(widget, title)
self.tabwidget.setTabToolTip(index, comment)
self.widgetlist.append(widget)
开发者ID:ming-hai,项目名称:spyder,代码行数:15,代码来源:formlayout.py
示例19: __init__
def __init__(self, parent, order):
super(LayoutSaveDialog, self).__init__(parent)
# variables
self._parent = parent
# widgets
self.combo_box = QComboBox(self)
self.combo_box.addItems(order)
self.combo_box.setEditable(True)
self.combo_box.clearEditText()
self.button_box = QDialogButtonBox(QDialogButtonBox.Ok |
QDialogButtonBox.Cancel,
Qt.Horizontal, self)
self.button_ok = self.button_box.button(QDialogButtonBox.Ok)
self.button_cancel = self.button_box.button(QDialogButtonBox.Cancel)
# widget setup
self.button_ok.setEnabled(False)
self.dialog_size = QSize(300, 100)
self.setWindowTitle('Save layout as')
self.setModal(True)
self.setMinimumSize(self.dialog_size)
self.setFixedSize(self.dialog_size)
# layouts
self.layout = QVBoxLayout()
self.layout.addWidget(self.combo_box)
self.layout.addWidget(self.button_box)
self.setLayout(self.layout)
# signals and slots
self.button_box.accepted.connect(self.accept)
self.button_box.rejected.connect(self.close)
self.combo_box.editTextChanged.connect(self.check_text)
开发者ID:ming-hai,项目名称:spyder,代码行数:35,代码来源:layoutdialog.py
示例20: __init__
def __init__(self, parent):
QWidget.__init__(self, parent=parent)
self.setWindowTitle("Example")
# Widgets
self.button = QPushButton('Current editor')
self.table = QTableWidget(self)
# Widget setup
self.button.setIcon(ima.icon('spyder'))
# Layouts
layout = QVBoxLayout()
layout.addWidget(self.button)
layout.addWidget(self.table)
self.setLayout(layout)
开发者ID:Nodd,项目名称:spyder.example,代码行数:17,代码来源:example.py
注:本文中的spyderlib.qt.QtGui.QVBoxLayout类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论