Skip to content

Commit

Permalink
feature: 修复ui样式解决在linux上combox显示不方便好看
Browse files Browse the repository at this point in the history
  • Loading branch information
QQxiaoming committed Jun 16, 2020
1 parent 4e9295a commit 2664137
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/UI_YUVviewer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'UI_YUVviewer.ui'
# Form implementation generated from reading ui file './src/UI_YUVviewer.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!

Expand All @@ -11,13 +11,13 @@
class Ui_YUVviewer(object):
def setupUi(self, YUVviewer):
YUVviewer.setObjectName("YUVviewer")
YUVviewer.resize(470, 155)
YUVviewer.resize(550, 155)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(YUVviewer.sizePolicy().hasHeightForWidth())
YUVviewer.setSizePolicy(sizePolicy)
YUVviewer.setMinimumSize(QtCore.QSize(470, 155))
YUVviewer.setMinimumSize(QtCore.QSize(550, 155))
YUVviewer.setMaximumSize(QtCore.QSize(16777215, 155))
self.centralwidget = QtWidgets.QWidget(YUVviewer)
self.centralwidget.setObjectName("centralwidget")
Expand Down Expand Up @@ -217,3 +217,4 @@ def retranslateUi(self, YUVviewer):
self.openFolder_PushButton.setText(_translate("YUVviewer", "Open folder"))
self.about_PushButton.setText(_translate("YUVviewer", "About"))
self.help_PushButton.setText(_translate("YUVviewer", "Help"))

4 changes: 2 additions & 2 deletions src/UI_YUVviewer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>470</width>
<width>550</width>
<height>155</height>
</rect>
</property>
Expand All @@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>470</width>
<width>550</width>
<height>155</height>
</size>
</property>
Expand Down
3 changes: 3 additions & 0 deletions src/YUVviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ YUVviewer::YUVviewer(QWidget *parent) :
ui->frameSizeType_ComboBox->insertItem(ui->frameSizeType_ComboBox->count(),config_it->first);
config_it++;
}
ui->frameSizeType_ComboBox->setStyleSheet("combobox-popup: 0;");
ui->YUVFormat_ComboBox->setStyleSheet("combobox-popup: 0;");
ui->frameRate_ComboBox->setStyleSheet("combobox-popup: 0;");

YUVviewerConfigFile = new ConfigFile(QCoreApplication::applicationDirPath()+"/YUVViewer.ini");
if(YUVviewerConfigFile->config_dict.frameSizeType == "Other")
Expand Down
4 changes: 4 additions & 0 deletions src/YUVviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def __init__(self):
size = self.geometry()
self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)

self.ui.frameSizeType_ComboBox.setStyleSheet("combobox-popup: 0;")
self.ui.YUVFormat_ComboBox.setStyleSheet("combobox-popup: 0;")
self.ui.frameRate_ComboBox.setStyleSheet("combobox-popup: 0;")

for key,value in self.frameSizeTypeDict.items():
self.ui.frameSizeType_ComboBox.insertItem(self.ui.frameSizeType_ComboBox.count(), key)

Expand Down

0 comments on commit 2664137

Please sign in to comment.