解决Linux下后于messageDialog初始化的兄弟控件触发messageDialog显示时的层级bug

This commit is contained in:
duanshengchao 2025-06-10 16:50:10 +08:00
parent faf4f63c7f
commit 695c85536d
3 changed files with 37 additions and 22 deletions

View File

@ -131,7 +131,13 @@ void MainWindow::showMessageDialog(MessageDialogType type,const QString& strTitl
} }
m_pMessageDialog->move(nX, nY); m_pMessageDialog->move(nX, nY);
m_pMessageDialog->exec(); if(QSysInfo::kernelType() == "linux")
{
m_pMessageDialog->show();
m_pMessageDialog->raise();
}
else
m_pMessageDialog->exec();
} }
void MainWindow::hideMessageDialog() void MainWindow::hideMessageDialog()
{ {

View File

@ -25,16 +25,16 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>1</number> <number>2</number>
</property> </property>
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">

View File

@ -22,16 +22,16 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>1</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>1</number> <number>2</number>
</property> </property>
<item> <item>
<widget class="QWidget" name="centralWidget" native="true"> <widget class="QWidget" name="centralWidget" native="true">
@ -96,20 +96,21 @@
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton <string notr="true">QPushButton
{ {
color: rgb(250, 250, 250); color: rgb(240, 240, 240);
font: 10pt ; font: 10pt;
border:0px; border:0px;
border-radius:2px; border-radius:5px;
background-color:rgb(67,160,249); background-color: rgb(49, 91, 125);
} }
QPushButton:hover QPushButton:hover
{ {
background-color:rgb(55,131,204); background-color: rgb(65, 122, 166);
} }
QPushButton:pressed QPushButton:pressed
{ {
background-color:rgb(67,160,249); background-color: rgb(49, 91, 125);
}</string> }
</string>
</property> </property>
<property name="text"> <property name="text">
<string>确认</string> <string>确认</string>
@ -132,20 +133,21 @@ background-color:rgb(67,160,249);
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton <string notr="true">QPushButton
{ {
color: rgb(250, 250, 250); color: rgb(240, 240, 240);
font: 10pt; font: 10pt;
border:0px; border:0px;
border-radius:5px; border-radius:5px;
background-color:rgb(67,160,249); background-color: rgb(49, 91, 125);
} }
QPushButton:hover QPushButton:hover
{ {
background-color:rgb(55,131,204); background-color: rgb(65, 122, 166);
} }
QPushButton:pressed QPushButton:pressed
{ {
background-color:rgb(67,160,249); background-color: rgb(49, 91, 125);
}</string> }
</string>
</property> </property>
<property name="text"> <property name="text">
<string>是</string> <string>是</string>
@ -164,7 +166,14 @@ background-color:rgb(67,160,249);
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QPushButton
{
color: rgb(240, 240, 240);
font: 10pt;
border-radius:5px;
background-color: transparent;
}
</string>
</property> </property>
<property name="text"> <property name="text">
<string>否</string> <string>否</string>