本文整理汇总了Python中spyderlib.qt.QtGui.QHBoxLayout类的典型用法代码示例。如果您正苦于以下问题:Python QHBoxLayout类的具体用法?Python QHBoxLayout怎么用?Python QHBoxLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QHBoxLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup_page
def setup_page(self):
# Widgets
self.table = ShortcutsTable(self)
self.finder = ShortcutFinder(self.table, self.table.set_regex)
self.table.finder = self.finder
self.label_finder = QLabel(_('Search: '))
self.reset_btn = QPushButton(_("Reset to default values"))
# Layout
hlayout = QHBoxLayout()
vlayout = QVBoxLayout()
hlayout.addWidget(self.label_finder)
hlayout.addWidget(self.finder)
vlayout.addWidget(self.table)
vlayout.addLayout(hlayout)
vlayout.addWidget(self.reset_btn)
self.setLayout(vlayout)
self.setTabOrder(self.table, self.finder)
self.setTabOrder(self.finder, self.reset_btn)
# Signals and slots
self.table.proxy_model.dataChanged.connect(
lambda i1, i2, opt='': self.has_been_modified(opt))
self.reset_btn.clicked.connect(self.reset_to_default)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:25,代码来源:shortcuts.py
示例2: __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
示例3: __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
示例4: __init__
def __init__(self, parent=None, show_fullpath=True, fullpath_sorting=True,
show_all_files=True, show_comments=True):
QWidget.__init__(self, parent)
self.treewidget = OutlineExplorerTreeWidget(self,
show_fullpath=show_fullpath,
fullpath_sorting=fullpath_sorting,
show_all_files=show_all_files,
show_comments=show_comments)
self.visibility_action = create_action(self,
_("Show/hide outline explorer"),
icon='outline_explorer_vis.png',
toggled=self.toggle_visibility)
self.visibility_action.setChecked(True)
btn_layout = QHBoxLayout()
btn_layout.setAlignment(Qt.AlignRight)
for btn in self.setup_buttons():
btn_layout.addWidget(btn)
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.treewidget)
layout.addLayout(btn_layout)
self.setLayout(layout)
开发者ID:jromang,项目名称:retina-old,代码行数:26,代码来源:editortools.py
示例5: __init__
def __init__(self, parent,
search_text = r"# ?TODO|# ?FIXME|# ?XXX",
search_text_regexp=True, search_path=None,
include=[".", ".py"], include_idx=None, include_regexp=True,
exclude=r"\.pyc$|\.orig$|\.hg|\.svn", exclude_idx=None,
exclude_regexp=True,
supported_encodings=("utf-8", "iso-8859-1", "cp1252"),
in_python_path=False, more_options=False):
QWidget.__init__(self, parent)
self.setWindowTitle(_('Find in files'))
self.search_thread = None
self.get_pythonpath_callback = None
self.find_options = FindOptions(self, search_text, search_text_regexp,
search_path,
include, include_idx, include_regexp,
exclude, exclude_idx, exclude_regexp,
supported_encodings, in_python_path,
more_options)
self.connect(self.find_options, SIGNAL('find()'), self.find)
self.connect(self.find_options, SIGNAL('stop()'),
self.stop_and_reset_thread)
self.result_browser = ResultsBrowser(self)
collapse_btn = create_toolbutton(self)
collapse_btn.setDefaultAction(self.result_browser.collapse_all_action)
expand_btn = create_toolbutton(self)
expand_btn.setDefaultAction(self.result_browser.expand_all_action)
restore_btn = create_toolbutton(self)
restore_btn.setDefaultAction(self.result_browser.restore_action)
# collapse_sel_btn = create_toolbutton(self)
# collapse_sel_btn.setDefaultAction(
# self.result_browser.collapse_selection_action)
# expand_sel_btn = create_toolbutton(self)
# expand_sel_btn.setDefaultAction(
# self.result_browser.expand_selection_action)
btn_layout = QVBoxLayout()
btn_layout.setAlignment(Qt.AlignTop)
for widget in [collapse_btn, expand_btn, restore_btn]:
# collapse_sel_btn, expand_sel_btn]:
btn_layout.addWidget(widget)
hlayout = QHBoxLayout()
hlayout.addWidget(self.result_browser)
hlayout.addLayout(btn_layout)
layout = QVBoxLayout()
left, _x, right, bottom = layout.getContentsMargins()
layout.setContentsMargins(left, 0, right, bottom)
layout.addWidget(self.find_options)
layout.addLayout(hlayout)
self.setLayout(layout)
开发者ID:jromang,项目名称:retina-old,代码行数:56,代码来源:findinfiles.py
示例6: __init__
def __init__(self, color, parent=None):
QHBoxLayout.__init__(self)
assert isinstance(color, QColor)
self.lineedit = QLineEdit(color.name(), parent)
self.lineedit.textChanged.connect(self.update_color)
self.addWidget(self.lineedit)
self.colorbtn = ColorButton(parent)
self.colorbtn.color = color
self.colorbtn.colorChanged.connect(self.update_text)
self.addWidget(self.colorbtn)
开发者ID:ming-hai,项目名称:spyder,代码行数:10,代码来源:formlayout.py
示例7: __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)
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:jromang,项目名称:spyderlib,代码行数:27,代码来源:importwizard.py
示例8: add_button_box
def add_button_box(self, stdbtns):
"""Create dialog button box and add it to the dialog layout"""
bbox = QDialogButtonBox(stdbtns)
run_btn = bbox.addButton(_("Run"), QDialogButtonBox.AcceptRole)
run_btn.clicked.connect(self.run_btn_clicked)
bbox.accepted.connect(self.accept)
bbox.rejected.connect(self.reject)
btnlayout = QHBoxLayout()
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
self.layout().addLayout(btnlayout)
开发者ID:gyenney,项目名称:Tools,代码行数:11,代码来源:runconfig.py
示例9: add_button_box
def add_button_box(self, stdbtns):
"""Create dialog button box and add it to the dialog layout"""
bbox = QDialogButtonBox(stdbtns)
run_btn = bbox.addButton(_("Run"), QDialogButtonBox.AcceptRole)
self.connect(run_btn, SIGNAL('clicked()'), self.run_btn_clicked)
self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
btnlayout = QHBoxLayout()
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
self.layout().addLayout(btnlayout)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:11,代码来源:runconfig.py
示例10: __init__
def __init__(self, parent, statusbar):
QWidget.__init__(self, parent)
self.label_font = font = get_font('editor')
font.setPointSize(self.font().pointSize())
font.setBold(True)
layout = QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
statusbar.addPermanentWidget(self)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:12,代码来源:status.py
示例11: __init__
def __init__(self, parent):
self.tabwidget = None
self.menu_actions = None
self.dockviewer = None
self.wrap_action = None
self.editors = []
self.filenames = []
self.icons = []
if PYQT5:
SpyderPluginWidget.__init__(self, parent, main = parent)
else:
SpyderPluginWidget.__init__(self, parent)
# Initialize plugin
self.initialize_plugin()
self.set_default_color_scheme()
layout = QVBoxLayout()
self.tabwidget = Tabs(self, self.menu_actions)
self.tabwidget.currentChanged.connect(self.refresh_plugin)
self.tabwidget.move_data.connect(self.move_tab)
if sys.platform == 'darwin':
tab_container = QWidget()
tab_container.setObjectName('tab-container')
tab_layout = QHBoxLayout(tab_container)
tab_layout.setContentsMargins(0, 0, 0, 0)
tab_layout.addWidget(self.tabwidget)
layout.addWidget(tab_container)
else:
layout.addWidget(self.tabwidget)
self.tabwidget.setStyleSheet("QTabWidget::pane {border: 0;}")
# Menu as corner widget
options_button = create_toolbutton(self, text=_('Options'),
icon=ima.icon('tooloptions'))
options_button.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, self.menu_actions)
options_button.setMenu(menu)
self.tabwidget.setCornerWidget(options_button)
# Find/replace widget
self.find_widget = FindReplace(self)
self.find_widget.hide()
self.register_widget_shortcuts("Editor", self.find_widget)
layout.addWidget(self.find_widget)
self.setLayout(layout)
开发者ID:Codemon88,项目名称:spyder,代码行数:53,代码来源:history.py
示例12: __init__
def __init__(self, parent):
QFrame.__init__(self, parent)
self._webview = WebView(self)
layout = QHBoxLayout()
layout.addWidget(self._webview)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
self.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
self._webview.linkClicked.connect(self.linkClicked)
开发者ID:CVML,项目名称:spyder,代码行数:13,代码来源:browser.py
示例13: __init__
def __init__(self, parent, args, kernel_widget, kernel_name):
super(IPythonPlugin, self).__init__(parent)
self.kernel_widget = kernel_widget
self.kernel_name = kernel_name
self.ipython_widget = create_widget(argv=args.split())
layout = QHBoxLayout()
layout.addWidget(self.ipython_widget)
self.setLayout(layout)
# Initialize plugin
self.initialize_plugin()
开发者ID:jromang,项目名称:retina-old,代码行数:14,代码来源:ipython.py
示例14: __init__
def __init__(self, parent=None, pathlist=None, ro_pathlist=None, sync=True):
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)
assert isinstance(pathlist, list)
self.pathlist = pathlist
if ro_pathlist is None:
ro_pathlist = []
self.ro_pathlist = ro_pathlist
self.last_path = getcwd()
self.setWindowTitle(_("PYTHONPATH manager"))
self.setWindowIcon(get_icon('pythonpath.png'))
self.resize(500, 300)
self.selection_widgets = []
layout = QVBoxLayout()
self.setLayout(layout)
top_layout = QHBoxLayout()
layout.addLayout(top_layout)
self.toolbar_widgets1 = self.setup_top_toolbar(top_layout)
self.listwidget = QListWidget(self)
self.connect(self.listwidget, SIGNAL("currentRowChanged(int)"),
self.refresh)
layout.addWidget(self.listwidget)
bottom_layout = QHBoxLayout()
layout.addLayout(bottom_layout)
self.sync_button = None
self.toolbar_widgets2 = self.setup_bottom_toolbar(bottom_layout, sync)
# Buttons configuration
bbox = QDialogButtonBox(QDialogButtonBox.Close)
self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
bottom_layout.addWidget(bbox)
self.update_list()
self.refresh()
开发者ID:jromang,项目名称:spyderlib,代码行数:47,代码来源:pathmanager.py
示例15: __init__
def __init__(self, parent=None):
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.contents_widget = QListWidget()
self.contents_widget.setMovement(QListView.Static)
self.contents_widget.setSpacing(1)
bbox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Apply
|QDialogButtonBox.Cancel)
self.apply_btn = bbox.button(QDialogButtonBox.Apply)
bbox.accepted.connect(self.accept)
bbox.rejected.connect(self.reject)
bbox.clicked.connect(self.button_clicked)
self.pages_widget = QStackedWidget()
self.pages_widget.currentChanged.connect(self.current_page_changed)
self.contents_widget.currentRowChanged.connect(
self.pages_widget.setCurrentIndex)
self.contents_widget.setCurrentRow(0)
hsplitter = QSplitter()
hsplitter.addWidget(self.contents_widget)
hsplitter.addWidget(self.pages_widget)
btnlayout = QHBoxLayout()
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
vlayout = QVBoxLayout()
vlayout.addWidget(hsplitter)
vlayout.addLayout(btnlayout)
self.setLayout(vlayout)
self.setWindowTitle(_('Preferences'))
self.setWindowIcon(ima.icon('configure'))
# Ensures that the config is present on spyder first run
CONF.set('main', 'interface_language', load_lang_conf())
开发者ID:beyondliyang,项目名称:spyder,代码行数:46,代码来源:configdialog.py
示例16: set_corner_widgets
def set_corner_widgets(self, corner_widgets):
"""
Set tabs corner widgets
corner_widgets: dictionary of (corner, widgets)
corner: Qt.TopLeftCorner or Qt.TopRightCorner
widgets: list of widgets (may contains integers to add spacings)
"""
assert isinstance(corner_widgets, dict)
assert all(key in (Qt.TopLeftCorner, Qt.TopRightCorner)
for key in corner_widgets)
self.corner_widgets.update(corner_widgets)
for corner, widgets in list(self.corner_widgets.items()):
cwidget = QWidget()
cwidget.hide()
prev_widget = self.cornerWidget(corner)
if prev_widget:
prev_widget.close()
self.setCornerWidget(cwidget, corner)
clayout = QHBoxLayout()
clayout.setContentsMargins(0, 0, 0, 0)
for widget in widgets:
if isinstance(widget, int):
clayout.addSpacing(widget)
else:
clayout.addWidget(widget)
cwidget.setLayout(clayout)
cwidget.show()
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:27,代码来源:tabs.py
示例17: create_spinbox
def create_spinbox(self, prefix, suffix, option, default=NoDefault,
min_=None, max_=None, step=None, tip=None):
if prefix:
plabel = QLabel(prefix)
else:
plabel = None
if suffix:
slabel = QLabel(suffix)
else:
slabel = None
spinbox = QSpinBox()
if min_ is not None:
spinbox.setMinimum(min_)
if max_ is not None:
spinbox.setMaximum(max_)
if step is not None:
spinbox.setSingleStep(step)
if tip is not None:
spinbox.setToolTip(tip)
self.spinboxes[spinbox] = (option, default)
layout = QHBoxLayout()
for subwidget in (plabel, spinbox, slabel):
if subwidget is not None:
layout.addWidget(subwidget)
layout.addStretch(1)
layout.setContentsMargins(0, 0, 0, 0)
widget = QWidget(self)
widget.setLayout(layout)
return widget
开发者ID:jromang,项目名称:spyderlib,代码行数:29,代码来源:configdialog.py
示例18: __init__
def __init__(self, parent=None):
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.contents_widget = QListWidget()
self.contents_widget.setMovement(QListView.Static)
self.contents_widget.setSpacing(1)
bbox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Apply
|QDialogButtonBox.Cancel)
self.apply_btn = bbox.button(QDialogButtonBox.Apply)
self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
self.connect(bbox, SIGNAL("clicked(QAbstractButton*)"),
self.button_clicked)
self.pages_widget = QStackedWidget()
self.connect(self.pages_widget, SIGNAL("currentChanged(int)"),
self.current_page_changed)
self.connect(self.contents_widget, SIGNAL("currentRowChanged(int)"),
self.pages_widget.setCurrentIndex)
self.contents_widget.setCurrentRow(0)
hsplitter = QSplitter()
hsplitter.addWidget(self.contents_widget)
hsplitter.addWidget(self.pages_widget)
btnlayout = QHBoxLayout()
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)
vlayout = QVBoxLayout()
vlayout.addWidget(hsplitter)
vlayout.addLayout(btnlayout)
self.setLayout(vlayout)
self.setWindowTitle(_("Preferences"))
self.setWindowIcon(get_icon("configure.png"))
开发者ID:jromang,项目名称:spyderlib,代码行数:45,代码来源:configdialog.py
示例19: __init__
def __init__(self, parent):
QWidget.__init__(self, parent)
vert_layout = QVBoxLayout()
hor_layout = QHBoxLayout()
self.array_box = QCheckBox(_("Import as array"))
self.array_box.setEnabled(ndarray is not FakeObject)
self.array_box.setChecked(ndarray is not FakeObject)
hor_layout.addWidget(self.array_box)
h_spacer = QSpacerItem(40, 20,
QSizePolicy.Expanding, QSizePolicy.Minimum)
hor_layout.addItem(h_spacer)
self._table_view = PreviewTable(self)
vert_layout.addLayout(hor_layout)
vert_layout.addWidget(self._table_view)
self.setLayout(vert_layout)
开发者ID:jromang,项目名称:retina-old,代码行数:18,代码来源:importwizard.py
示例20: create_coloredit
def create_coloredit(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)
self.coloredits[clayout] = (option, default)
if without_layout:
return label, clayout
layout = QHBoxLayout()
layout.addWidget(label)
layout.addLayout(clayout)
layout.addStretch(1)
layout.setContentsMargins(0, 0, 0, 0)
widget = QWidget(self)
widget.setLayout(layout)
return widget
开发者ID:gyenney,项目名称:Tools,代码行数:18,代码来源:configdialog.py
注:本文中的spyderlib.qt.QtGui.QHBoxLayout类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论