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. How to create copy of Ui and class or import existing one.
Forum Updated to NodeBB v4.3 + New Features

How to create copy of Ui and class or import existing one.

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 4 Posters 8.7k Views 1 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.
  • Q Offline
    Q Offline
    qxoz
    wrote on last edited by
    #1

    hi everybody!
    I have a project that include many different dialog forms, but all of them has 40% similar code.
    So how i can copy existing forms in same project of course with different names, or i can create dialog in another project then include copies into my project with different names.

    1 Reply Last reply
    0
    • BilbonSacquetB Offline
      BilbonSacquetB Offline
      BilbonSacquet
      wrote on last edited by
      #2

      Could give us more explanation regarding this 40% of similar code?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Well its mostly bodies of slots and some parts of algorithms that has similar structure for different forms.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Do you try to use derived ui files? Is that what is your idea?

          AFAIK there were templates in designer, perhaps those also work in creator...
          But I don't remember, how you could create those templates...

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            And you could create an implementation for that template and derive your dialogs from that base instead of QDialog.

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              Where i can find information about creating ui templates?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                [quote author="Gerolf" date="1321865941"]And you could create an implementation for that template and derive your dialogs from that base instead of QDialog.[/quote]
                Quite true, however, also considder if encapsulation is an alternative for you. You might be able to encapsulate the shared 40% in a class of its own, and just give each of your dialogs an instance of that class.

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qxoz
                  wrote on last edited by
                  #8

                  But can i derive user form?
                  there are few buttons and table view, of course i can add those by hand but however is it possible?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #9

                    If you use google search, you would find, e.g.

                    "Adding New Custom Wizards":http://doc.qt.nokia.com/qtcreator-2.3/creator-project-wizards.html

                    "Extending Qt Creator Manual":http://doc.qt.nokia.com/qtcreator-extending/index.html

                    "File templates in Qt Creator":http://www.qtcentre.org/threads/28909-File-templates-in-Qt-Creator

                    just to mention the first three hits :-)

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply
                    0
                    • Q Offline
                      Q Offline
                      qxoz
                      wrote on last edited by
                      #10

                      bq. If you use google search, you would find, e.g.
                      Adding New Custom Wizards [doc.qt.nokia.com]
                      Extending Qt Creator Manual [doc.qt.nokia.com]
                      File templates in Qt Creator [qtcentre.org]
                      just to mention the first three hits :-)

                      Thanks a lot!
                      That was helpfull.

                      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