Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyQT5 - align left
#1
Hi, I am stuck on very stupid thing.
I need align items left and width must be according text length and for line_edit fixed length.
Thank for any advice.

IMAGE


 self.label = QLabel("Low-pass (Hz): ", self)
        self.label.setFont(QFont('Arial', 10))
        self.label.setAlignment(Qt.AlignLeft)

        self.line_edit = QLineEdit("10", self)
        self.line_edit.setFont(QFont('Arial', 10))
        self.line_edit.setAlignment(Qt.AlignLeft)
        self.line_edit.setFixedWidth(120)
   
        self.label1 = QLabel("High-pass (Hz): ", self)
        self.label1.setFont(QFont('Arial', 10))
        self.label1.setAlignment(Qt.AlignLeft)
   
        self.line_edit1 = QLineEdit("10", self)
        self.line_edit1.setFont(QFont('Arial', 10))
        self.line_edit1.setAlignment(Qt.AlignLeft)
        self.line_edit1.setFixedWidth(120)
   
 
        self.combo_box = QComboBox(self)
        self.combo_box.setFont(QFont('Arial', 10))
         
        geek_list = ["Hanning", "Hamming", "Flat", "None"]
        self.combo_box.setEditable(False)
        self.combo_box.addItems(geek_list)
        self.combo_box.setFixedWidth(120)
        
        
        buttonbox3.addWidget(self.label)
        buttonbox3.addWidget(self.line_edit)
        buttonbox3.addWidget(self.label1)
        buttonbox3.addWidget(self.line_edit1)
        buttonbox3.addWidget(self.combo_box)
Reply


Messages In This Thread
PyQT5 - align left - by frohr - May-07-2022, 04:55 PM
RE: PyQT5 - align left - by menator01 - May-07-2022, 05:27 PM
RE: PyQT5 - align left - by frohr - May-07-2022, 05:39 PM
RE: PyQT5 - align left - by deanhystad - May-07-2022, 05:40 PM
RE: PyQT5 - align left - by menator01 - May-07-2022, 06:01 PM
RE: PyQT5 - align left - by frohr - May-07-2022, 06:16 PM
RE: PyQT5 - align left - by Axel_Erfurt - May-07-2022, 07:18 PM
RE: PyQT5 - align left - by deanhystad - May-07-2022, 09:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to auto align x-axis label SamLiu 2 916 Jan-27-2023, 11:10 PM
Last Post: SamLiu
  How did one column get left-justified? Mark17 6 1,999 Feb-26-2022, 11:55 PM
Last Post: deanhystad
  "ModuleNotFoundError: No module named 'PyQt5.QtWidgets'; 'PyQt5' is not a package" chipx 3 7,584 Dec-09-2021, 07:05 AM
Last Post: chipx
  Explanation of the left side of this statement please rascalsailor 3 2,559 Sep-09-2020, 02:02 PM
Last Post: rascalsailor
  Center align Kristenl2784 1 1,992 Aug-03-2020, 04:25 PM
Last Post: bowlofred
  How to left align logging messages Mekala 3 6,922 Jun-28-2020, 04:04 PM
Last Post: bowlofred
  How to left align the columns SriRajesh 6 3,998 Dec-28-2019, 04:04 PM
Last Post: SriRajesh
  Why is left mouse click not working? yeto 3 6,275 Jul-15-2019, 05:23 AM
Last Post: Yoriz
  str.format rounding to the left of the decimal ClassicalSoul 2 2,523 Mar-27-2019, 11:12 AM
Last Post: perfringo
  Move a character left or right in a file. DreamingInsanity 4 4,905 Mar-21-2019, 07:52 PM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020