Results 1 to 2 of 2

Thread: How to display an icon or image in a Windows Form using Qt Designer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2020
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default How to display an icon or image in a Windows Form using Qt Designer?

    Hello:

    I'm creating a Windows Form in Qt Designer, and I would wish to add a check mark icon (or red cross icon) to validate an entry in an edit field. What control can I use to display this icon or image?

    Thanks
    Gus

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to display an icon or image in a Windows Form using Qt Designer?

    Use a QLabel with a QPixmap and place it in a layout next to the line edit. You can set the pixmap to be a check mark, an X, or nothing depending on how you want to display the status of the edit field's contents.

    You could also think about using a QValidator or a QCompleter on the line edit if that is feasible to prevent the user from entering the wrong thing in the first place.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Qt Designer Windows Form in PyQt5 differs from the Preview in Qt Designer
    By gussabina in forum Qt Tools
    Replies: 1
    Last Post: 1st September 2020, 17:34
  2. Unable to display image in windows
    By ankireddy in forum Newbie
    Replies: 1
    Last Post: 7th January 2012, 04:58
  3. systray: icon does not display in windows server 2003
    By lovelypp in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2008, 11:47
  4. MDI child form icon
    By tebessum in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2008, 10:33
  5. Replies: 7
    Last Post: 13th November 2006, 16:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.