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. Create/Preview Custom Widget without using forms
QtWS25 Last Chance

Create/Preview Custom Widget without using forms

Scheduled Pinned Locked Moved Solved General and Desktop
custom widgetpreview
6 Posts 3 Posters 2.5k Views
  • 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
    Sh1gs
    wrote on 1 Mar 2017, 17:16 last edited by
    #1

    Hello,

    I have created custom widgets using forms before with great success. However, my current work project is to create custom widgets without the use of the form. Is there a way to preview the custom widget to see how it looks before actually building the plugin project, and then adding it to another application? Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 1 Mar 2017, 19:27 last edited by
      #2

      Hi
      If you don't use UI file and all looks comes from code,
      how would you be able to
      preview it before code is running ?

      But!

      You can use promotion feature to see it running very easy without adding the an actual plugin. (to creator/designer)
      http://doc.qt.io/qt-5/designer-using-custom-widgets.html

      See "Promoting Widgets"

      S 1 Reply Last reply 1 Mar 2017, 19:51
      1
      • M mrjj
        1 Mar 2017, 19:27

        Hi
        If you don't use UI file and all looks comes from code,
        how would you be able to
        preview it before code is running ?

        But!

        You can use promotion feature to see it running very easy without adding the an actual plugin. (to creator/designer)
        http://doc.qt.io/qt-5/designer-using-custom-widgets.html

        See "Promoting Widgets"

        S Offline
        S Offline
        Sh1gs
        wrote on 1 Mar 2017, 19:51 last edited by
        #3

        @mrjj

        The document you provided is a little confusing. I assume that the promotion feature is done on the application side? Is it possible to do so, while still in the development stage of the widget? Let's say I'm building a calculator, but I want to see how my layouts are looking so far, but my entire calculator widget is not yet complete. Is there a way to view what is created up to that point?

        J 1 Reply Last reply 2 Mar 2017, 06:02
        0
        • S Sh1gs
          1 Mar 2017, 19:51

          @mrjj

          The document you provided is a little confusing. I assume that the promotion feature is done on the application side? Is it possible to do so, while still in the development stage of the widget? Let's say I'm building a calculator, but I want to see how my layouts are looking so far, but my entire calculator widget is not yet complete. Is there a way to view what is created up to that point?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 2 Mar 2017, 06:02 last edited by
          #4

          @Sh1gs The promotion feature is for Qt Designer. That means it is used during designing your widget in Qt Designer. So, you would need to use Designer. As @mrjj said it is just not possible to preview widgets created manually in code without executing the app.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply 2 Mar 2017, 15:57
          2
          • J jsulm
            2 Mar 2017, 06:02

            @Sh1gs The promotion feature is for Qt Designer. That means it is used during designing your widget in Qt Designer. So, you would need to use Designer. As @mrjj said it is just not possible to preview widgets created manually in code without executing the app.

            S Offline
            S Offline
            Sh1gs
            wrote on 2 Mar 2017, 15:57 last edited by
            #5

            @jsulm

            I figured that was the case, but I wanted to be sure. I will just make a test application of the widget I want to create and when all that coding works, I'll go ahead and make the custom plugin. Thanks for your inputs!

            M 1 Reply Last reply 2 Mar 2017, 15:59
            0
            • S Sh1gs
              2 Mar 2017, 15:57

              @jsulm

              I figured that was the case, but I wanted to be sure. I will just make a test application of the widget I want to create and when all that coding works, I'll go ahead and make the custom plugin. Thanks for your inputs!

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 2 Mar 2017, 15:59 last edited by
              #6

              @Sh1gs
              Just as a note.
              You can visually design the UI in Designer and then just grab the c++ code. ;)
              If you look inside the setupUI, there is the code for what u have"drawn"

              1 Reply Last reply
              0

              6/6

              2 Mar 2017, 15:59

              • Login

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