Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. heightForWidth in designer?
Qt 6.12 LTS is out! See what's new in the release blog

heightForWidth in designer?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.6k Views 2 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.
  • H Offline
    H Offline
    haggi
    wrote on last edited by
    #1

    Hi,
    in my UI I have one widget which should always keep it's aspect of 1.78:1. If I understand the procedure korrectly than I have to create a subclass, add the hasHeightforWidth() method and the heightForWidth() method itself. My question is: Is there any way to do this in designer? Or do I really have to do it in my c++ code?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      AFAIK, no, you have to re-implement that method yourself.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        Just a note.
        Since you use the Designer. You can use the promotion feature to
        still use visual design and have heightForWidth()
        http://doc.qt.io/qt-5/designer-using-custom-widgets.html

        1 Reply Last reply
        0
        • H Offline
          H Offline
          haggi
          wrote on last edited by
          #4

          Thanks, this helps a lot.

          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
          • Unsolved