Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] Qt Designer - embedded ui
QtWS25 Last Chance

[Solved] Qt Designer - embedded ui

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 1 Posters 5.4k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    Hello, World! :-D

    well I have the following problem:

    I created a Widget (the main one as QWidget) and designed the ui with Qt Designer. I have custom components in that Widget. For now, the custom components are just buttons (QPushButton) but there will be more advanced and personalized ones later, so I have to extract those components to an extra class. Using Qt Designer, I drop those custom components using the QWidget component and I use the Widget Promotion technique. The functionality works fine this way. So far so good.

    Now! I want to create a custom template for the appearance and layout of the custom component (I mean I need a custom *.ui file for just that sub-component that I want later to drop into the main layout many times) and of course I want to use Qt Designer for this. So let stick with the simple "customized QPushButton" (of course I actually need this for more complicated stuff).

    1. First problem: Qt Designer doesn't allow the creation of a QPushButton (because that's the element I want the *.ui for) as top level element. If I just use QWidget, I can not change it to QPushButton. As workaround I edited the *.ui file by hand and changed the type. Ok, Qt Designer recognised it afterwards. But...

    2. Second (and main) problem: I can not promote the top level widget to my custom-widget-class. I need to do this, so I can drop the custom element in another widget, and the droped in element uses it's own *.ui class.

    I'm not really new to Qt, but I am absolutely new to the *.ui and qt-xml-stuff. I can achieve the result I want very easily with standard C++-coding, but as the project grows, I guess It is wise to use the Qt-Designer technique.

    So is there a solution to my problem. Did I miss something?

    Sorry for the bad english, I'm not a native english speaker.

    Pat

    [edit: [solved] added in title to show how we do that, Eddy]

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      have a look at "this topic":http://developer.qt.nokia.com/forums/viewthread/6536.

      It is similar to what you want.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        Exactly what I was looking to achieve. It seems to work now.

        Thank you very much!

        How do I close the topic?

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          Well you don't have to "close" it. We are happy when you edit your title and add [solved] in front of it. There is no button at this moment to do that yet.the site is still beta ;)

          In the future the Trolls can pass through all titles and add the mark programmatically using that search string.

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            Roger that! Thx again.

            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