QT设计师如何制作实际尺寸?
我对界面进行建模,并在编辑器窗口中大大且方便。但是,当我在Pycharm中运行结果程序时,我的程序和整个接口的窗口要小几倍。如何使这些尺寸重合? 我还可以指出,编辑器中的元素显然大于其像素尺寸。 我有Windows 10和4K显示器。 Windows界面在设置中超大。这是一个问题吗?
这是我的UI代码:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1074</width>
<height>562</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="img_1">
<property name="geometry">
<rect>
<x>20</x>
<y>0</y>
<width>512</width>
<height>512</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>../../Buty_frames/Leonardo_DiCaprio_1/GG0000_0.jpg</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>512</width>
<height>512</height>
</size>
</property>
</widget>
<widget class="QPushButton" name="img_2">
<property name="geometry">
<rect>
<x>550</x>
<y>0</y>
<width>512</width>
<height>512</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>../../Buty_frames/Leonardo_DiCaprio_2/GG0042_0.jpg</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>512</width>
<height>512</height>
</size>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1074</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuAdd_hoto">
<property name="title">
<string>Add photo</string>
</property>
</widget>
<addaction name="menuAdd_hoto"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
I model the interface and make the elements in the editor window large and convenient. But when I run the resulting program already in pycharm, the window of my program and the whole interface are several times smaller. How can I make these sizes coincide?
I can also note that the elements in the editor are clearly larger than their pixel size.
I have windows 10 and 4k monitor. The windows interface is oversized in the settings. Can this be a problem?
This is my Ui code:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1074</width>
<height>562</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="img_1">
<property name="geometry">
<rect>
<x>20</x>
<y>0</y>
<width>512</width>
<height>512</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>../../Buty_frames/Leonardo_DiCaprio_1/GG0000_0.jpg</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>512</width>
<height>512</height>
</size>
</property>
</widget>
<widget class="QPushButton" name="img_2">
<property name="geometry">
<rect>
<x>550</x>
<y>0</y>
<width>512</width>
<height>512</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>../../Buty_frames/Leonardo_DiCaprio_2/GG0042_0.jpg</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>512</width>
<height>512</height>
</size>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1074</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuAdd_hoto">
<property name="title">
<string>Add photo</string>
</property>
</widget>
<addaction name="menuAdd_hoto"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论