Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Some kind of drag'n'drop and "linking" in a GUI
Forum Updated to NodeBB v4.3 + New Features

Some kind of drag'n'drop and "linking" in a GUI

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 254 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tempas
    wrote on last edited by Tempas
    #1

    Hello everyone,

    Sorry for my bad english, I'm not a native... bla bla bla you know the end ;)

    I am practicing my Qt skills (with Python) and I try to make an easy electrical software. By electrical software, in reality I just want to be able to draw simple objects (like resistors) and connect them by clicking on the edge of one and on the edge of another one.

    Well nothing too complicated for someone familiar with Qt I guess... This is what it could look like : https://www.edrawsoft.com/fr/images/electrial-drawing-software.png (just way simpler, I don't want to make a real program, this is just practising for fun and I have already made some other softwares but nothing with this kind of behaviour).

    Now that you know everything, I am not asking the full source code for an already made software (I will still thank you if you can provide that). I would like to know what is the :
    1 - easiest
    2 - good
    3 - best
    way to do it ?

    What I think (but it is a pain in the...) : Use a QPainter and draw the resistor each time the user click on the resitor icon. This would be an object and we should be able to select it and move it in the QPainter (the object would be redrawn each time its position changes). For the link between them it would be a simple line drawn between the extremity of the first object and the extremity of the second object.

    That sounds just like an absolute mess, I can't believe this is how electrical software handle their drawings/movements/connections/... But I really don't know how this is usually done... Anyone have an idea ?

    edit : I found QElectroTech, for the moment, and it seems that they use a QPainter...

    Thanks :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You might want to check the Elastic Nodes Example.

      The Graphics View Framework will be of interest as it provides a lot of the underlying mechanisms like movable objects, easy to draw image objects, etc.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • T Offline
        T Offline
        Tempas
        wrote on last edited by
        #3

        Just to know if someone else have an idea (not that the previous one does not please me but I just want to know if someone else can have another type of answer).

        Thanks

        mrjjM 1 Reply Last reply
        0
        • T Tempas

          Just to know if someone else have an idea (not that the previous one does not please me but I just want to know if someone else can have another type of answer).

          Thanks

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Tempas
          Hi
          There is also
          https://forum.qt.io/topic/104100/diagram-schematic-components-library

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved