feat: adjust window height by simple mode

This commit is contained in:
rankun 2021-05-16 13:00:26 +08:00
parent 3bbea81e12
commit 501365560b
3 changed files with 48 additions and 3 deletions

View file

@ -621,6 +621,10 @@ void Dialog::on_useSingleModeCheck_clicked()
ui->wirelessGroupBox->show();
ui->usbGroupBox->show();
}
QTimer::singleShot(0, this, [this](){
resize(width(), layout()->sizeHint().height());
});
}
void Dialog::on_serialBox_currentIndexChanged(const QString &arg1)

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>500</width>
<height>745</height>
<height>769</height>
</rect>
</property>
<property name="minimumSize">
@ -72,10 +72,22 @@
</item>
<item>
<widget class="QListWidget" name="connectedPhoneList">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
<height>100</height>
</size>
</property>
</widget>
@ -751,10 +763,22 @@
</item>
<item>
<widget class="QTextEdit" name="outEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>140</height>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="focusPolicy">
@ -768,6 +792,19 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>

View file

@ -56,6 +56,10 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QSurfaceFormat varFormat = QSurfaceFormat::defaultFormat();
varFormat.setVersion(2, 0);
varFormat.setProfile(QSurfaceFormat::NoProfile);