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

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.
  • Sh1gsS Offline
    Sh1gsS Offline
    Sh1gs
    wrote on 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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"

      Sh1gsS 1 Reply Last reply
      1
      • mrjjM mrjj

        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"

        Sh1gsS Offline
        Sh1gsS Offline
        Sh1gs
        wrote on 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?

        jsulmJ 1 Reply Last reply
        0
        • Sh1gsS Sh1gs

          @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?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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

          Sh1gsS 1 Reply Last reply
          2
          • jsulmJ jsulm

            @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.

            Sh1gsS Offline
            Sh1gsS Offline
            Sh1gs
            wrote on 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!

            mrjjM 1 Reply Last reply
            0
            • Sh1gsS Sh1gs

              @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!

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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

              • Login

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