Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How add Qpushbutton in QLineEdit with PyQt6 ?
Forum Updated to NodeBB v4.3 + New Features

How add Qpushbutton in QLineEdit with PyQt6 ?

Scheduled Pinned Locked Moved Solved Qt 6
5 Posts 2 Posters 745 Views 1 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.
  • J Offline
    J Offline
    Jbone73
    wrote on last edited by
    #1

    Hi,

    Sorry for my English, I don't have a good level.

    I have a question :
    I am new to Python and I use PyQt6 to develop my first application, I would like to know if it is possible to put a QPushButton in a QLineEdit?

    I would like to make a clickable button to display a new window.

    Thank you all in advance for your help.

    jsulmJ 1 Reply Last reply
    0
    • J Jbone73

      Hi,

      Sorry for my English, I don't have a good level.

      I have a question :
      I am new to Python and I use PyQt6 to develop my first application, I would like to know if it is possible to put a QPushButton in a QLineEdit?

      I would like to make a clickable button to display a new window.

      Thank you all in advance for your help.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Jbone73 Do you want to have a button inside a line edit? If so - why? You can put the button near the line edit.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jbone73
        wrote on last edited by
        #3

        Oh ! I meant an icon and not a button, it should be on the right in the QLineEdit

        jsulmJ 1 Reply Last reply
        0
        • J Jbone73

          Oh ! I meant an icon and not a button, it should be on the right in the QLineEdit

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Jbone73 You can use a QPushButton or QToolButton with an icon on it.
          To arrange line edit and button use layouts: https://doc.qt.io/qt-5/layout.html

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jbone73
            wrote on last edited by
            #5

            @jsulm said in How add Qpushbutton in QLineEdit with PyQt6 ?:

            QPushButton

            Thank you very much jsulm, I looked at the doc and that's exactly it

            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