Home python pyqt5, qt designer about layers

pyqt5, qt designer about layers

Author

Date

Category

I can’t understand the work of the layer, what and what. The question is the next, straight show how to do what I’m trying.

What do you need? I am trying to make the registration window, for example, the next. Screen:

What did I get to throw:

created several buttons, the text of the Edge merged into the layers as writes on all forums and so on.

  1. But there are two questions, what I, for example, can not change the positions of Label, to the left, right, and so
  2. After I try to make a layer for the entire window, in order to after changing the size of my window changed and widgets !!! But here’s what I get:

tried to look for less lessons – did not find anything.


Answer 1, Authority 100%

There is everything on the Internet. How to find what you need is another question.
I found great things for you that will allow you
Master the topic of interest to you. Enjoy your study.

login.ui

& lt; xml version = "1.0" encoding = "UTF-8"? & gt;
& lt; ui version = "4.0" & gt;
 & lt; Class & gt; Mainwindow & lt; / class & gt;
 & lt; widget class = "qmainwindow" name = "Mainwindow" & gt;
 & lt; Property Name = "Geometry" & gt;
  & lt; rect & gt;
  & lt; x & gt; 0 & lt; / x & gt;
  & lt; y & gt; 0 & lt; / y & gt;
  & lt; width & gt; 500 & lt; / width & gt;
  & lt; height & gt; 790 & lt; / height & gt;
  & lt; / rect & gt;
 & lt; / Property & gt;
 & lt; Property Name = "MinimumSize" & gt;
  & lt; Size & gt;
  & lt; width & gt; 500 & lt; / width & gt;
  & lt; height & gt; 700 & lt; / height & gt;
  & lt; / Size & gt;
 & lt; / Property & gt;
 & lt; Property Name = "font" & gt;
  & lt; font & gt;
  & lt; Family & GT; Segoe UI & LT; / Family & GT;
  & lt; Pointsize & gt; 10 & lt; / pointsize & gt;
  & lt; / font & gt;
 & lt; / Property & gt;
 & lt; Property Name = "Windowtitle" & gt;
  & lt; String & GT; login & lt; / String & GT;
 & lt; / Property & gt;
 & lt; Property Name = "Windowicon" & gt;
  & lt; iconset resource = "file_rc.qrc" & gt;
  & lt; Normaloff & gt;: / icon / images / icon.ico & lt; / normaloff & gt;: / icon / images / icon.ico & lt; / iconset & gt;
 & lt; / Property & gt;
 & lt; Property Name = "StyleSheet" & gt;
  & lt; String Notr = "True" & GT; Color: RGB (200, 200, 200);
Background-Color: RGB (10, 10, 10); & lt; / String & GT;
 & lt; / Property & gt;
 & lt; widget class = "qwidget" name = "centralwidget" & gt;
  & lt; layout class = "qvboxlayout" name = "verticlaysout" & gt;
  & lt; Property Name = "Spacing" & gt;
   & lt; Number & gt; 0 & lt; / Number & gt;
  & lt; / Property & gt;
  & lt; Property Name = "Leftmargin" & gt;
   & lt; Number & gt; 0 & lt; / Number & gt;
  & lt; / Property & gt;
  & lt; Property Name = "TopMargin" & gt;
   & lt; Number & gt; 0 & lt; / Number & gt;
  & lt; / Property & gt;
  & lt; Property Name = "RightMargin" & gt;
   & lt; Number & gt; 0 & lt; / Number & gt;
  & lt; / Property & gt;
  & lt; Property Name = "Bottommargin" & gt;
   & lt; Number & gt; 0 & lt; / Number & gt;
  & lt; / Property & gt;
  & lt; Item & gt;
   & lt; widget class = "qframe" name = "top_bar" & gt;
   & lt; Property Name = "MaximumSize" & gt;
    & lt; Size & gt;
    & lt; width & gt; 16777215 & lt; / width & gt;
    & lt; height & gt; 35 & lt; / height & gt;
    & lt; / Size & gt;
   & lt; / Property & gt;
   & lt; Property Name = "StyleSheet" & gt;
    & lt; String Notr = "True" / & gt;
   & lt; / Property & gt;
   & lt; Property Name = "Frameshape" & gt;
    & lt; enum & gt; qframe :: noframe & lt; / enum & gt;
   & lt; / Property & gt;
   & lt; Property Name = "FrameShadow" & gt;
    & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
   & lt; / Property & gt;
   & lt; layout class = "qhboxlayout" name = "horizontalis_2" & gt;
    & lt; Property Name = "Spacing" & gt;
    & lt; Number & gt; 0 & lt; / Number & gt;
    & lt; / Property & gt;
    & lt; Property Name = "Leftmargin" & gt;
    & lt; Number & gt; 0 & lt; / Number & gt;
    & lt; / Property & gt;
    & lt; Property Name = "TopMargin" & gt; 
& lt; Number & gt; 5 & lt; / Number & gt;
    & lt; / Property & gt;
    & lt; Property Name = "RightMargin" & gt;
    & lt; Number & gt; 0 & lt; / Number & gt;
    & lt; / Property & gt;
    & lt; Property Name = "Bottommargin" & gt;
    & lt; Number & gt; 0 & lt; / Number & gt;
    & lt; / Property & gt;
    & lt; Item & gt;
    & lt; Widget Class = "QFrame" name = "Frame_error" & gt;
     & lt; Property Name = "MaximumSize" & gt;
     & lt; Size & gt;
      & lt; width & gt; 450 & lt; / width & gt;
      & lt; Height & gt; 16777215 & lt; / height & gt;
     & lt; / Size & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
     & lt; String Notr = "True" & gt; background-color: rgb (255, 85, 127);
Border-Radius: 5px; & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Frameshape" & gt;
     & lt; enum & gt; qframe :: styledpanel & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; Property Name = "FrameShadow" & gt;
     & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; layout class = "qhboxlayout" name = "horizontalyod_3" & gt;
     & lt; Property Name = "Leftmargin" & gt;
      & lt; Number & gt; 10 & lt; / Number & gt;
     & lt; / Property & gt;
     & lt; Property Name = "TopMargin" & gt;
      & lt; Number & gt; 3 & lt; / Number & gt;
     & lt; / Property & gt;
     & lt; Property Name = "RightMargin" & gt;
      & lt; Number & gt; 10 & lt; / Number & gt;
     & lt; / Property & gt;
     & lt; Property Name = "Bottommargin" & gt;
      & lt; Number & gt; 3 & lt; / Number & gt;
     & lt; / Property & gt;
     & lt; Item & gt;
      & lt; widget class = "QLabel" name = "label_error" & gt;
      & lt; Property Name = "StyleSheet" & gt;
       & lt; String Notr = "True" & gt; Color: RGB (35, 35, 35); & lt; / String & GT;
      & lt; / Property & gt;
      & lt; Property Name = "Text" & gt;
       & lt; String & GT; Error & LT; / String & GT;
      & lt; / Property & gt;
      & lt; Property Name = "Alignment" & gt;
       & lt; set & gt; qt :: aligncenter & lt; / set & gt;
      & lt; / Property & gt;
      & lt; / widget & gt;
     & lt; / Item & gt;
     & lt; Item & gt;
      & lt; widget class = "qpushbutton" name = "pushbutton_close_pupup" & gt;
      & lt; Property Name = "MaximumSize" & gt;
       & lt; Size & gt;
       & lt; width & gt; 20 & lt; / width & gt;
       & lt; height & gt; 20 & lt; / height & gt;
       & lt; / Size & gt;
      & lt; / Property & gt;
      & lt; Property Name = "StyleSheet" & gt;
       & lt; String Notr = "True" & gt; qpushbutton {
  Border-Radius: 5px;
  Background-image: URL (: / close_image / images / cil-x.png);
  Background-Position: Center;
  background-color: rgb (60, 60, 60);
}
QPushButton: Hover {
  Background-Color: RGB (50, 50, 50);
  Color: RGB (200, 200, 200);
}
QPushButton: pressed {
  background-color: rgb (35, 35, 35);
  Color: RGB (200, 200, 200);
} & lt; / String & GT;
      & lt; / Property & gt;
      & lt; Property Name = "Text" & gt;
       & lt; String / & GT;
      & lt; / Property & gt;
      & lt; / widget & gt;
     & lt; / Item & gt;
     & lt; / layout & gt;
    & lt; / widget & gt;
    & lt; / Item & gt;
   & lt; / layout & gt;
   & lt; / widget & gt;
  & lt; / Item & gt;
  & lt; Item & gt;
   & lt; widget class = "qframe" name = "content" & gt;
   & lt; Property Name = "StyleSheet" & gt;
    & lt; String Notr = "True" / & gt;
   & lt; / Property & gt;
   & lt; Property Name = "Frameshape" & gt;
    & lt; enum & gt; qframe :: noframe & lt; / enum & gt;
   & lt; / Property & gt;
   & lt; Property Name = "FrameShadow" & gt;
    & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
   & lt; / Property & gt;
   & lt; layout class = "qhboxlayout" name = "horizontaliyout" & gt;
    & lt; Item & gt;
    & lt; widget class = "qframe" name = "login_area" & gt;
     & lt; Property Name = "MaximumSize" & gt;
     & lt; Size & gt;
      & lt; width & gt; 450 & lt; / width & gt;
      & lt; Height & gt; 550 & lt; / height & gt;
     & lt; / Size & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
     & lt; String Notr = "True" & gt; Border-Radius: 10px; & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Frameshape" & gt;
     & lt; enum & gt; qframe :: noframe & lt; / enum & gt;
     & lt; / Property & gt; 
& lt; Property Name = "FrameShadow" & gt;
     & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; widget class = "qframe" name = "logo" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & lt; x & gt; 45 & lt; / x & gt;
      & lt; y & gt; 40 & lt; / y & gt;
      & lt; width & gt; 360 & lt; / width & gt;
      & lt; height & gt; 90 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & lt; String Notr = "True" & gt; background-image: URL (: / logo / images / logo_360x90.png);
Background-Repeat: no-repeat;
Background-Position: Center; & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Frameshape" & gt;
      & lt; enum & gt; qframe :: styledpanel & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; Property Name = "FrameShadow" & gt;
      & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; / widget & gt;
     & lt; widget class = "qframe" name = "avatar" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & lt; x & gt; 165 & lt; / x & gt;
      & lt; y & gt; 150 & lt; / y & gt;
      & lt; width & gt; 120 & lt; / width & gt;
      & lt; height & gt; 120 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & lt; String Notr = "True" & gt; QFrame {
  Background-image: URL (: / Avatar / Images / avatar.png);
  Border-Radius: 60px;
  Border: 10px Solid RGB (255, 207, 0);
  Background-Position: Center;
}
QFrame: Hover {
  Border: 10px Solid RGB (255, 225, 0);
}
& lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Frameshape" & gt;
      & lt; enum & gt; qframe :: styledpanel & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; Property Name = "FrameShadow" & gt;
      & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
     & lt; / Property & gt;
     & lt; / widget & gt;
     & lt; widget class = "QLineEdit" name = "lineedit_user" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & lt; x & gt; 85 & lt; / x & gt;
      & lt; y & gt; 288 & lt; / y & gt;
      & lt; width & gt; 280 & lt; / width & gt;
      & lt; height & gt; 50 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "font" & gt;
      & lt; font & gt;
      & lt; Family & GT; Segoe UI & LT; / Family & GT;
      & lt; Pointsize & gt; 10 & lt; / pointsize & gt;
      & lt; / font & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & lt; String Notr = "True" & gt; QlineEdit {
  Border: 2px Solid RGB (45, 45, 45);
  Border-Radius: 5px;
  Padding: 15px;
  Background-Color: RGB (30, 30, 30);
  Color: RGB (100, 100, 100);
}
QLineEdit: Hover {
  Border: 2px Solid RGB (55, 55, 55);
}
QLineEdit: Focus {
  Border: 2px Solid RGB (255, 207, 0);
  Color: RGB (200, 200, 200);
} & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "MaxLength" & gt;
      & lt; Number & gt; 32 & lt; / Number & gt;
     & lt; / Property & gt;
     & lt; Property Name = "PlaceholderText" & gt;
      & lt; String & GT; User & lt; / String & GT;
     & lt; / Property & gt;
     & lt; / widget & gt;
     & lt; widget class = "QLineEdit" name = "lineedit_password" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & lt; x & gt; 85 & lt; / x & gt;
      & lt; y & gt; 340 & lt; / y & gt;
      & lt; width & gt; 280 & lt; / width & gt;
      & lt; height & gt; 50 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "font" & gt;
      & lt; font & gt;
      & lt; Family & GT; Segoe UI & LT; / Family & GT;
      & lt; Pointsize & gt; 10 & lt; / pointsize & gt;
      & lt; / font & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & lt; String Notr = "True" & gt; QlineEdit {
  Border: 2px Solid RGB (45, 45, 45);
  Border-Radius: 5px;
  Padding: 15px;
  Background-Color: RGB (30, 30, 30);
  Color: RGB (100, 100, 100);
}
QLineEdit: Hover {
  Border: 2px Solid RGB (55, 55, 55);
}
QLineEdit: Focus {
  Border: 2px Solid RGB (255, 207, 0);
  Color: RGB (200, 200, 200);
} & lt; / String & GT; 
& lt; / Property & gt;
     & Lt; property name = "maxLength" & gt;
      & Lt; number & gt; 16 & lt; / number & gt;
     & lt; / Property & gt;
     & Lt; property name = "echoMode" & gt;
      & Lt; enum & gt; QLineEdit :: Password & lt; / enum & gt;
     & lt; / Property & gt;
     & Lt; property name = "placeholderText" & gt;
      & Lt; string & gt; PASSWORD & lt; / string & gt;
     & lt; / Property & gt;
     & lt; / widget & gt;
     & Lt; widget class = "QCheckBox" name = "checkBox_save_user" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & Lt; x & gt; 85 & lt; / x & gt;
      & Lt; y & gt; 395 & lt; / y & gt;
      & Lt; width & gt; 281 & lt; / width & gt;
      & Lt; height & gt; 22 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "font" & gt;
      & lt; font & gt;
      & lt; Family & GT; Segoe UI & LT; / Family & GT;
      & lt; Pointsize & gt; 10 & lt; / pointsize & gt;
      & lt; / font & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & Lt; string notr = "true" & gt; QCheckBox :: indicator {
  border: 3px solid rgb (100, 100, 100);
  width: 15px;
  height: 15px;
  Border-Radius: 10px;
  background-color: rgb (135, 135, 135);
}
QCheckBox :: indicator: checked {
  border: 3px solid rgb (255, 205, 0);
  background-color: rgb (255, 255, 0);
} & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Text" & gt;
      & Lt; string & gt; SAVE USER & lt; / string & gt;
     & lt; / Property & gt;
     & lt; / widget & gt;
     & Lt; widget class = "QPushButton" name = "pushButton_login" & gt;
     & lt; Property Name = "Geometry" & gt;
      & lt; rect & gt;
      & Lt; x & gt; 85 & lt; / x & gt;
      & Lt; y & gt; 425 & lt; / y & gt;
      & Lt; width & gt; 280 & lt; / width & gt;
      & Lt; height & gt; 50 & lt; / height & gt;
      & lt; / rect & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
      & lt; String Notr = "True" & gt; qpushbutton {
  Background-Color: RGB (50, 50, 50);
  border: 2px solid rgb (60, 60, 60);
  Border-Radius: 5px;
}
QPushButton: Hover {
  background-color: rgb (60, 60, 60);
  border: 2px solid rgb (70, 70, 70);
}
QPushButton: pressed {
  background-color: rgb (250, 230, 0);
  border: 2px solid rgb (255, 165, 24);
  color: rgb (35, 35, 35);
} & lt; / String & GT;
     & lt; / Property & gt;
     & lt; Property Name = "Text" & gt;
      & Lt; string & gt; CONNECT TO CYBERPUNK & lt; / string & gt;
     & lt; / Property & gt;
     & lt; / widget & gt;
    & lt; / widget & gt;
    & lt; / Item & gt;
   & lt; / layout & gt;
   & lt; / widget & gt;
  & lt; / Item & gt;
  & lt; Item & gt;
   & Lt; widget class = "QFrame" name = "bottom" & gt;
   & lt; Property Name = "MaximumSize" & gt;
    & lt; Size & gt;
    & lt; width & gt; 16777215 & lt; / width & gt;
    & lt; height & gt; 35 & lt; / height & gt;
    & lt; / Size & gt;
   & lt; / Property & gt;
   & lt; Property Name = "StyleSheet" & gt;
    & Lt; string notr = "true" & gt; background-color: rgb (15, 15, 15) & lt; / string & gt;
   & lt; / Property & gt;
   & lt; Property Name = "Frameshape" & gt;
    & lt; enum & gt; qframe :: noframe & lt; / enum & gt;
   & lt; / Property & gt;
   & lt; Property Name = "FrameShadow" & gt;
    & lt; enum & gt; QFrame :: Raised & lt; / enum & gt;
   & lt; / Property & gt;
   & Lt; layout class = "QVBoxLayout" name = "verticalLayout_2" & gt;
    & lt; Item & gt;
    & Lt; widget class = "QLabel" name = "label_credits" & gt;
     & lt; Property Name = "font" & gt;
     & lt; font & gt;
      & lt; Family & GT; Segoe UI & LT; / Family & GT;
     & lt; / font & gt;
     & lt; / Property & gt;
     & lt; Property Name = "StyleSheet" & gt;
     & Lt; string notr = "true" & gt; color: rgb (75, 75, 75); & lt; / string & gt;
     & lt; / Property & gt;
     & lt; Property Name = "Text" & gt;
     & Lt; string & gt; Created by: Wanderson M. Pimenta & lt; / string & gt;
     & lt; / Property & gt;
     & lt; Property Name = "Alignment" & gt;
     & Lt; set & gt; Qt :: AlignRight | Qt :: AlignTrailing | Qt :: AlignVCenter & lt; / set & gt;
     & lt; / Property & gt;
    & lt; / widget & gt;
    & lt; / Item & gt;
   & lt; / layout & gt;
   & lt; / widget & gt;
  & lt; / Item & gt;
  & lt; / layout & gt;
 & lt; / widget & gt; 
& lt; widget class = "qmenubar" name = "Menubar" & gt;
  & lt; Property Name = "Geometry" & gt;
   & lt; rect & gt;
   & lt; x & gt; 0 & lt; / x & gt;
   & lt; y & gt; 0 & lt; / y & gt;
   & lt; width & gt; 500 & lt; / width & gt;
   & lt; height & gt; 21 & lt; / height & gt;
   & lt; / rect & gt;
  & lt; / Property & gt;
  & lt; / widget & gt;
 & lt; / widget & gt;
 & lt; Resources & gt;
  & lt; include location = "file_rc.qrc" / & gt;
 & lt; / Resources & gt;
 & lt; Connections / & gt;
& lt; / ui & gt;

More:
https://www.youtube.com/watch?v=8v0L DS7VXY & AMP; AB_Channel = Wanderson

https://github.com/wanderson-magalhaes/login_pyqt5

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions