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. Using individual ui files

Using individual ui files

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.1k 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.
  • G Offline
    G Offline
    gabor53
    wrote on last edited by
    #1

    Hi,
    I created a ui file using Qt Creator. I would like to use it to display labels. How can I use it from an existing class? I checked the examples available online but unfortunately none of the worked.
    Thank you.

    K 1 Reply Last reply
    0
    • G gabor53

      Hi,
      I created a ui file using Qt Creator. I would like to use it to display labels. How can I use it from an existing class? I checked the examples available online but unfortunately none of the worked.
      Thank you.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @gabor53

      Depends on your intensions. Possibly this is helping

      Vote the answer(s) that helped you to solve your issue(s)

      G 1 Reply Last reply
      3
      • K koahnig

        @gabor53

        Depends on your intensions. Possibly this is helping

        G Offline
        G Offline
        gabor53
        wrote on last edited by
        #3

        @koahnig
        Unfortunately this didn't help as it is about custom widgets.

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

          Created a ui named display.ui using File ->New File in Creator.
          The pro file section looks like this:

          FORMS    += \
              additem.ui \
              review.ui \
              mainwindow.ui \
              imagedisplay.ui \
              display.ui
          

          and the header of the file mainwindow.cpp where I want to use the form looks like this:

          #include "mainwindow.h"
          #include "ui_mainwindow.h"
          #include "ui_display.h"
          #include <imagedisplay.h>
          

          When I try to use display.ui from mainwindow.h I use:

          ui::
          

          but in the dropdown display.ui is not listed. What am I missing? Thank you.

          1 Reply Last reply
          0
          • m.sueM Offline
            m.sueM Offline
            m.sue
            wrote on last edited by m.sue
            #5

            Hi,
            I usually use one ui-file with one cpp-file and one header-file, like:
            display.ui
            display.h there use ui::DisplayClass or what the name is
            display.cpp
            and
            mainwindow.ui
            mainwindow.h there use ui::MainWindowClass or what the name is
            mainwindow.cpp
            I would not try to mix-up the two classes Display and MainWindow.
            -Michael.

            G 1 Reply Last reply
            1
            • m.sueM m.sue

              Hi,
              I usually use one ui-file with one cpp-file and one header-file, like:
              display.ui
              display.h there use ui::DisplayClass or what the name is
              display.cpp
              and
              mainwindow.ui
              mainwindow.h there use ui::MainWindowClass or what the name is
              mainwindow.cpp
              I would not try to mix-up the two classes Display and MainWindow.
              -Michael.

              G Offline
              G Offline
              gabor53
              wrote on last edited by
              #6

              @m.sue
              Thank you.

              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