怎么把QLabel添加进QGraphicsItem
来源:互联网 发布:可牛影像软件下载 编辑:程序博客网 时间:2024/04/30 11:57
从国外网站找的答案;元标题是:How to add QLabel to QGraphicsItem
The QGraphicsProxyWidget forwards events to its widget and handles conversion between the different coordinate systems.
Now that you're looking at using a QLineEdit in the QGraphicsScene, you need to decide if you want to add it directly: -
QGraphicsScene* pScene = new QGraphicsScene;QLineEdit* pLineEdit = new QLineEdit("Some Text");// add the widget - internally, the QGraphicsProxyWidget is created and returnedQGraphicsProxyWidget* pProxyWidget = pScene->AddWidget(pLineEdit);//Or just add it to your current QGraphicsItem. Here, you can either add it as a child of the QGraphicsItem: -MyQGraphicsItem* pMyItem = new MyQGraphicsItem;QGraphicsProxyWidget* pMyProxy = new QGraphicsProxyWidget(pMyItem); // the proxy's parent is pMyItempMyProxy->setWidget(pLineEdit); // adding the QWidget based object to the proxy
Or you could add the QGraphicsProxyWidget as a member of your class and call its relevant functions, but adding it as a child is probably much simpler.
0 0
- 怎么把QLabel添加进QGraphicsItem
- Qt QGraphicsItem 添加 gif图片
- Qlabel添加动图
- QGraphicsItem
- QGraphicsItem
- QGraphicsItem
- QGraphicsItem
- QGraphicsItem
- 怎么把UltraEdit添加到右键菜单
- 为QLabel添加鼠标事件
- js怎么把几个li标签按顺序添加进一个div中?
- QLabel 怎么设置底色和字体颜色
- QLabel
- QLabel
- QLabel
- QLabel
- QLabel
- Qlabel
- BIEE EM 报错 ADF_FACES-60097 的解决方法
- 网摘》SetWindowPos函数
- 解决apt-get的E: Could not get lock /var/lib/dpkg/lock方法
- Linux系统应用经验总结
- PopupWindow弹出框
- 怎么把QLabel添加进QGraphicsItem
- Docker学习笔记之一,搭建一个JAVA Tomcat运行环境
- 那些在开发中用到的正则表达式
- RandomAccessFile 源码分析
- Note for Dos
- 在项目中用到datatables比较多,但是当datatables加载超过1000多的时候就会出现有点缓慢的的样子,这个时候如果继续增加数据量让datatables去处理,那会是一个让人抓狂的事情,幸
- String的intern()方法
- Chrome中的RunnableAdapter模板类适配多种函数
- Linux程序开发经验总结