当前位置:网站首页>QT designer cannot modify the window size, and cannot change the size by dragging the window with the mouse

QT designer cannot modify the window size, and cannot change the size by dragging the window with the mouse

2022-06-23 06:58:00 Shu Yang

Problem description :

performance 1: Here's the picture , stay QT Designer interface , stay geometry Properties , After a certain point, the width and height are the original values , Cannot modify window size .

       

performance 2: Drag the window with the mouse , I can't drag it , Still can't change the window size .

       

       
       

       

resolvent :

1、 Right click ui file ——> choice “ use … open ”——> choice “ Normal text editor ”

2、 Take yours. ui File on the window size of this code , Amend to read as follows , Save it , Right click again ui file ——> choice “ use … open ”——> choice “ Interface editor ” Open your ui file , You can get back to normal .

 <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1024</width>
    <height>1024</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="minimumSize">
   <size>
    <width>0</width>
    <height>0</height>
   </size>
  </property>
  <property name="maximumSize">
   <size>
    <width>5000</width>
    <height>3000</height>
   </size>
  </property>

       

       

The normal code for resizing windows is as follows , Yes, there is 4 Part of the , The data of these four parts can be modified according to your own needs .

 Insert picture description here

I can not change the size of the window corresponding to ui The content of the file is as follows , You can see that a part of the code is missing .

原网站

版权声明
本文为[Shu Yang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230556565302.html