Comments (8)
Sorry, I'm not very clear about your description.
if you want like this:
add this code view.setDragMode(QGraphicsView.RubberBandDrag)
from pyqt.
here is a good project to study
https://github.com/jchanvfx/NodeGraphQt
from pyqt.
Sorry, I'm not very clear about your description.
if you want like this:
add this codeview.setDragMode(QGraphicsView.RubberBandDrag)
I'm sorry I didn't make myself clear enough.
I need a menu bar that is located outside the scene from where I can take a shape and drag it onto the scene by mouse. As in the Paint program or drawio. Menu with shapes in the graphic editor.
from pyqt.
Sorry, I'm not very clear about your description. if you want like this: add this code
view.setDragMode(QGraphicsView.RubberBandDrag)
I try to explain again.
I am trying to implement a graphic editor. As a canvas for drawing, I use QGraphicsScene together with QGraphicsView.
There was a problem with the implementation of the panel, which is essentially a menu of shapes, from where it would be possible to drag shapes to QGraphicsView. It is located outside of QGraphicsView.
I would also like this menu to be divided into several sections so that they can be opened and closed by a button.
Is there an example of implementing this custom shapes menu? Or maybe thoughts with which it can be implemented?
This gif is the example of how I would like it to work (I use drawio as an example):
from pyqt.
- for left panel, you can use
QTreeView
andQListView
icon model to show different icon. - you can see this example draggableicons to solve drag from left and drop on the right.
- when drop on the right, You can determine which type of graph is based on the
event.mimeData()
type
from pyqt.
I will write simple example latter
from pyqt.
https://github.com/PyQt5/PyQt/blob/master/QGraphicsView/DragGraphics.py
like this?
from pyqt.
https://github.com/PyQt5/PyQt/blob/master/QGraphicsView/DragGraphics.py
like this?
Yes, this is what I need. Thank you very much.
from pyqt.
Related Issues (20)
- feature request: give the ability to accept cookie file directly from QWebEngineView HOT 3
- Release of profile requested but WebEnginePage still not deleted. Expect troubles ! HOT 1
- PyQt5 QWebEngineView does NOT print the same thing shows in the browser HOT 1
- [讨论]交流群怎么打不开 HOT 1
- QDialog crashes when dragged across two monitors when resizing is disabled. [讨论] HOT 5
- 无边框窗口在Mac平台时无法最小化 HOT 5
- [QProcessBar-ColourfulProgress执行时,最小化切换后报错]
- Please add support for Apple Silicon HOT 1
- [PyQt5 vs PyQt6 Widget Resize not suit] HOT 9
- [问题] FramelessWindow Bug 无边框窗体Bug HOT 4
- pyqtdeploy demo? HOT 2
- QProcess Demo
- PyQt有办法内嵌cocoa的红绿灯组件吗 HOT 4
- How to implement expansion points and the resizing process for shapes on QGraphicsScene? HOT 1
- How do I implement my own custom element for QGraphicsScene? HOT 1
- failed to start because no Qt platform plugin could be initialized HOT 4
- PyQt5 cannot be installed HOT 11
- 关于QTabWidget文件夹中是空的 HOT 1
- 窗口贴边隐藏demo在ubuntu系统中不行 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyqt.