本文整理汇总了Python中python_qt_binding.QtGui.QWidget.width方法的典型用法代码示例。如果您正苦于以下问题:Python QWidget.width方法的具体用法?Python QWidget.width怎么用?Python QWidget.width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QWidget
的用法示例。
在下文中一共展示了QWidget.width方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import width [as 别名]
def main():
global logger
global item
global rpc_client
global linphone_wrap
global config
args = sys.argv[1:]
parser = mk_parser()
options = parser.parse_args(args)
setup_logging(options.log_config)
logger = logging.getLogger(__name__)
import mhlinphone_wrapper
from linphone import linphone
from wrappers import common
from lp_rpc_server import lp_rpc_server
from lp_config import LPConfig
from python_qt_binding.QtGui import QApplication
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtGui import QDesktopWidget
app = QApplication(sys.argv)
preview_widget=QWidget()
view_widget=QWidget()
for w in [preview_widget,view_widget]:
w.setBaseSize(300,300)
w.show()
wid = w.winId()
print("WID %s %s" % (hex(wid), int(wid)))
screen = QDesktopWidget()
preview_widget.move(screen.width() - preview_widget.width(), 0)
view_widget.move(screen.width() - view_widget.width(), screen.height() - view_widget.height())
config=None
if options.config_file:
config = LPConfig(options.config_file)
linphone_wrap = mhlinphone_wrapper.MHLinphoneWrapper(rc_config_file=options.linphonerc,
config=config)
linphone_wrap.init()
if options.xmlrpcsrv:
rpc_funcs = lp_rpc_server.MHLPFuncs(linphone_wrap,
quit_func=quit_app, show_func=show)
addr, port = (options.xmlrpcsrv + ':8000').split(':')[:2]
rpc_server = lp_rpc_server.LPRpcServer(linphone_wrap, addr, int(port),
rpc_funcs)
rpc_server.start_in_thread()
else:
rpc_server = None
if options.auto_answer:
linphone_wrap.register_callback(linphone_wrap.EVT.INCOMING,
auto_answer)
linphone_wrap.set_vvideo(int(view_widget.winId()))
linphone_wrap.set_pvideo(int(preview_widget.winId()))
linphone_wrap.register_callback(linphone_wrap.EVT.RMT_PREVIEW_SNAPSHOT, unzip_test)
addr = linphone_wrap.config.get('test.address')
port = linphone_wrap.config.get('test.port')
rpc_client = xmlrpclib.ServerProxy('http://'+addr+':'+str(port)+'/MH_LP')
def dirfind(str, *objs):
ret = []
if not objs:
objs = dir(linphone)
for obj in objs:
ret.extend([ (obj, v) for v in dir(obj) if str in v.lower() ])
return ret
def start(fname): #open file under win
os.system('cmd /c start ' + fname)
if options.cli:
from mh_cli import CLI
namespace = dict(
dirfind=dirfind,
start=start,
linphone=linphone,
os=os,
app=app,
preview_widget=preview_widget,
view_widget=view_widget,
mhlinphone_wrapper=mhlinphone_wrapper,
lin=linphone_wrap,
args=args,
options=options,
logger=logger,
rpc_server=rpc_server,
rpc_client=rpc_client,
#.........这里部分代码省略.........