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. How do I make *.ui files look like real interface of an app?

How do I make *.ui files look like real interface of an app?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt creatorc++ui file
3 Posts 3 Posters 395 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.
  • R Offline
    R Offline
    RDWTT
    wrote on 25 May 2024, 03:28 last edited by
    #1

    Hello everyone!
    I'm new to Qt and to programming. I develop an application where I apply .qss to a whole window or individually to each component by using a->setStyleSheet(styles->pushButtonDefault) (styles is .cpp file where I store qstrings with different stylesheets). But these changes aren't displayed in the .ui in Qt Creator. Adding styles directly to components in the .ui file doesn't work for me because some components are created dynamically and some styles are changed while application is running (for example if you put wrong number in the input field, the field becomes red).
    So, the question is: is it possible to show changes to UI in the Qt creator .ui files?

    I use Qt 5.15.2 and C++

    Thanks ๐Ÿ‘๐Ÿผ

    C 1 Reply Last reply 25 May 2024, 04:49
    0
    • R RDWTT
      25 May 2024, 03:28

      Hello everyone!
      I'm new to Qt and to programming. I develop an application where I apply .qss to a whole window or individually to each component by using a->setStyleSheet(styles->pushButtonDefault) (styles is .cpp file where I store qstrings with different stylesheets). But these changes aren't displayed in the .ui in Qt Creator. Adding styles directly to components in the .ui file doesn't work for me because some components are created dynamically and some styles are changed while application is running (for example if you put wrong number in the input field, the field becomes red).
      So, the question is: is it possible to show changes to UI in the Qt creator .ui files?

      I use Qt 5.15.2 and C++

      Thanks ๐Ÿ‘๐Ÿผ

      C Offline
      C Offline
      ChrisW67
      wrote on 25 May 2024, 04:49 last edited by
      #2

      @RDWTT Qt Creator (Designer) cannot display a preview of anything that is not in the .ui file.

      The .ui files are text used to generate source code before compilation. What you are asking for is indeterminate changes made at runtime, i.e. after compilation and deployment, to somehow roll back into the .ui file. I cannot see how this would be achievable (or useful).

      The way to see how the ui looks in this circumstance is to build and run your program.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Axel Spoerl
        Moderators
        wrote on 25 May 2024, 07:14 last edited by
        #3

        โ€ฆand on a side note: Qt 5.15 isnโ€™t ideal to start developing a new app! Much better to start with 6.5!

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        0

        2/3

        25 May 2024, 04:49

        • Login

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