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. Creating Custom Widgets
Forum Updated to NodeBB v4.3 + New Features

Creating Custom Widgets

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.4k Views 3 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.
  • S Offline
    S Offline
    StabbAmonte
    wrote on 19 Oct 2015, 22:45 last edited by
    #1

    Hello all

    I am looking into the custom widget functionality of the QT Designer. I want to create a custom widget with a combo box, tool button, label and a few other widgets. Is it possible to create this custom widget within the designer and then create the plug in for it show it shows up as a custom widget? All the examples I find are creating a widget from scratch or inheriting and modifying a single widget. I would like this widget to be a collection of existing QT widgets and create/edit it within the QT designer.

    Any help is appreciated.
    Thanks.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 20 Oct 2015, 07:09 last edited by mrjj
      #2

      Hi
      The examples are just showing with one widget. but there is nothing different if that
      Widget creates internal widgets and insert into itself via a layout. One widget can be parent
      of as many other widgets you like. Sort of a composite widget.

      Note that if you are on windows, you must use Visual Studio to create such plugin as Creator
      is compiled with it and to load the plugins, it must be same compiler.

      But do you need a full blown plugin ?

      Its possible to create a UI file (widget as parent)
      where you place the wanted controls. (lets call it MyWid)

      You can then on any other screen, place a widget as place holder and then use the promote feature to make it turn into MyWid when you run the program.

      That is sort of a composite widget but of cause all properties will be the same as
      for the master MyWid and only via code, can you make properties
      different for each screen.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Andy314
        wrote on 20 Oct 2015, 08:19 last edited by Andy314
        #3

        You can take a QFrame as base widget and design it as usual with the form-designer and put subwidgets in it.
        Then you can promote this class or you can make a custom designer pluging for it. This work straight forward.

        1 Reply Last reply
        0

        1/3

        19 Oct 2015, 22:45

        • Login

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