Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Qt Designer - embedded ui

    Tools
    1
    5
    5040
    Loading More Posts
    • 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.
    • ?
      Guest last edited by

      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 Reply Quote 0
      • E
        Eddy last edited by

        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 Reply Quote 0
        • ?
          Guest last edited by

          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 Reply Quote 0
          • E
            Eddy last edited by

            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 Reply Quote 0
            • ?
              Guest last edited by

              Roger that! Thx again.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post