Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to insert image in QLineEdit with Qt android C++
Forum Updated to NodeBB v4.3 + New Features

How to insert image in QLineEdit with Qt android C++

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 436 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.
  • S Offline
    S Offline
    Sakhana99
    wrote on last edited by
    #1

    Hello everyone, I want to insert image into QLineEdit for login purpose with my Android Application. I found QLineEdit::addAction(const QIcon &icon, QLineEdit::ActionPosition position). Is it the best way to do that ? I remind you that my version is 5.12.
    Image2.PNG
    This Image attached below would exlpain what i want exactly.
    Please help me.

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

      Hi,

      If you want it to be integrated to the line edit, yes.

      Otherwise you can use a QHBoxLayout with 0 spacing/margins so the image is right against the line edit.

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

      S 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        If you want it to be integrated to the line edit, yes.

        Otherwise you can use a QHBoxLayout with 0 spacing/margins so the image is right against the line edit.

        S Offline
        S Offline
        Sakhana99
        wrote on last edited by
        #3

        @SGaist That's not what I want exactly.
        I want the image where ID CHASSIS and PASSWORD become writable. I mean when i run the application i can write on it.
        the background of the QLineEdit is white and sot suitable for my background. So I need a solution for it.

        JonBJ 1 Reply Last reply
        0
        • S Sakhana99

          @SGaist That's not what I want exactly.
          I want the image where ID CHASSIS and PASSWORD become writable. I mean when i run the application i can write on it.
          the background of the QLineEdit is white and sot suitable for my background. So I need a solution for it.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Sakhana99
          Either change the background to a different color, or if you want an image what about doing it via stylesheet background: url(...), like https://stackoverflow.com/a/14038720 ?

          1 Reply Last reply
          1

          • Login

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