博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Orange的扩展插件Widgets开发(七)-GUI Control
阅读量:7115 次
发布时间:2019-06-28

本文共 3691 字,大约阅读时间需要 12 分钟。

hot3.png

Orange的扩展插件Widgets开发(七)

-Library of Common GUI Controls

gui is a library of functions which allow constructing a control (like check box, line edit or a combo), inserting it into the parent’s layout, setting tooltips, callbacks and so forth, establishing synchronization with a Python object’s attribute (including saving and retrieving when the widgets is closed and reopened) ... in a single call.

Almost all functions need three arguments:

  • thewidgetinto which the control is inserted,

  • themasterwidget with one whose attributes the control’s value is synchronized,

  • the name of that attribute (value).

All other arguments should be given as keyword arguments for clarity and also for allowing the potential future compatibility-breaking changes in the module. Several arguments that are common to all functions must always be given as keyword arguments.

Common options

All controls accept the following arguments that can only be given as keyword arguments.

tooltip: A string for a tooltip that appears when mouse is over the control.
disabled: Tells whether the control be disabled upon the initialization.
addSpace: Gives the amount of space that is inserted after the control (or the box that encloses it). IfTrue, a space of 8 pixels is inserted. Default is 0.
addToLayout: The control is added to the parent’s layout unless this flag is set toFalse.
stretch: The stretch factor for this widget, used when adding to the layout. Default is 0.
sizePolicy: The size policy for the box or the control.

Common Arguments

Many functions share common arguments.

widget: Widget on which control will be drawn.
master: Object which includes the attribute that is used to store the control’s value; most often theselfof the widget into which the control is inserted.
value: String with the name of the master’s attribute that synchronizes with the the control’s value..
box: Indicates if there should be a box that around the control. If boxisFalse(default), no box is drawn; if it is a string, it is also used as the label for the box’s name; if box is any other true value (such as :), an unlabeled box is drawn.
callback: A function that is called when the state of the control is changed. This can be a single function or a list of functions that will be called in the given order. The callback function should not change the value of the controlled attribute (the one given as the value argument described above) to avoid a cycle (a workaround is shown in the description oflistBox function.
label: A string that is displayed as control’s label.
labelWidth: The width of the label. This is useful for aligning the controls.
orientation: When the label is given used, this argument determines the relative placement of the label and the control. Label can be above the control, (“vertical”orTrue- this is the default) or in the same line with control, (“horizontal”orFalse). Orientation can also be an instance of QLayout.

Common Attributes

box: If the constructed widget is enclosed into a box, the attributeboxrefers to the box.

Widgets

This section describes the wrappers for controls like check boxes, buttons and similar. Using them is preferred over calling Qt directly, for convenience, readability, ease of porting to newer versions of Qt and, in particular, because they set up a lot of things that happen in behind.

Other widgets

Utility functions

Internal functions and classes

This part of documentation describes some classes and functions that are used internally. The classes will likely maintain compatibility in the future, while the functions may be changed.

Wrappers for Qt classes

Wrappers for Python classes

Other functions

转载于:https://my.oschina.net/u/2306127/blog/596151

你可能感兴趣的文章
ethereumjs/ethereumjs-block-1-简介
查看>>
块元素和内联元素
查看>>
Ubuntu的LAMP与相关软件安装设置
查看>>
配置环境变量
查看>>
Task 的用法
查看>>
Linux rpm yum
查看>>
HTML文档中嵌入CSS的几种方法
查看>>
修改Firebug字体
查看>>
Socket get http request
查看>>
cocos creator 底部按钮touch延迟
查看>>
caffe配置
查看>>
你有学习者综合征吗?Web 开发是重灾区
查看>>
CF1043
查看>>
《R语言实战》读书笔记-- 第六章 基本图形
查看>>
#Sublime Text && Markdown 设置
查看>>
HCIA-Storage:第三章ICT架构体系
查看>>
Bean之间的关系
查看>>
2019.4.29 区块链论文翻译
查看>>
2、工厂方法模式
查看>>
我的XML学习笔记
查看>>