Qt World Summit: Submit your Presentation

[Solved] Drag & Drop Widget Designer Application

  • Hi all,
    I am trying to create a custom designer in which i will have my own custom widgets which are created using QML & C++. My Widget Designer will have drag & Drop property. User can create a new form and drag & Drop these widgets into it.. Now i am able to do this, its working fine. Next thing i need is to do is re-sizing these widgets(similar to the re-sizing option in Qt Designer). Here i am attaching the sample style in which i need the selecting and re-sizing rectangle...So when i click on any of my widget it should display that rectangular boarder for re-sizing these widgets..

    Please help me to solve this problem..
    Thank you..

  • Why don't you integrate your widgets into the Qt Designer?

  • Qt Designer is not an option for me.... I need to make my own designer so many additional features i need to add to my designer...I know that i can integrate new widgets in qt designer, but i don't want to use that...

  • Well, if you're that sure that QtDesigner isn't a good starting point for you, perhaps you can still look at its source code for inspiration on how it works?

  • Actually i took a look at the Qt Designer code. But they were using some classes which can only be used for modifying the existing Qt Designer. Such as adding new widgets to the designer. They are using different approach for the designer. Only thing i need to know how can i re-size the widgets at run time by using a frame selecting that particular widget (same as the blue selection available in Qt Designer.) "Please check this post...":http://www.qtforum.org/article/38498/designer-application.html?s=72fe4d50cba3f4274a075144f348ec0b1c39ba9c .

  • Is there any way to do this by using normal QWidget architecture......
    Anyone know about how did they implemented "resize handles" in the Qt Designer... i Searched the entire Qt Designer code,but no use, I didn't find the code how did they implemented that re-size handles in that..... AFAIK they used purely QWidget based code for that and not using QGraphicsView framework.....

  • Indeed. From building a Qt Designer plugin at one point that needed to display the widget differently in designer mode than it did when running in a normal application, I learned that designer inserts a lot of other widgets in the object tree when running in design mode. My guess is, that the resize handles are actually rendered by some sort of container widget that is placed around each of the normal widgets (as in: the normal widget is created as a child widget of the container widget that is responsible for the resize handles). However, I did not verify this in the source code, it is just a hunch that I got from inspecting the object tree for my plug in widget.

  • At last i have got the solution how to do it.... I dig the Qt Designer code very hard and found out how did they do that by using QWidget method. I am really happy to get it working. Thanks for all who gave me suggestions... They have done this by using WidgetHandle class & WidgetSelection class which you can find in the designer source code.... Hope this will help others too.....

Log in to reply