Merge pull request #2087 from Cacodemon345/newqt
qt: Dialog improvements
This commit is contained in:
@@ -31,6 +31,7 @@ FileField::FileField(QWidget *parent) :
|
||||
fileName_ = ui->label->text();
|
||||
emit fileSelected(ui->label->text());
|
||||
});
|
||||
this->setFixedWidth(this->sizeHint().width() + ui->pushButton->sizeHint().width());
|
||||
}
|
||||
|
||||
FileField::~FileField()
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@@ -16,6 +16,9 @@
|
||||
*/
|
||||
#include "qt_styleoverride.hpp"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QAbstractItemView>
|
||||
|
||||
int StyleOverride::styleHint(
|
||||
StyleHint hint,
|
||||
const QStyleOption *option,
|
||||
@@ -44,4 +47,9 @@ void StyleOverride::polish(QWidget* widget)
|
||||
}
|
||||
widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
}
|
||||
|
||||
if (qobject_cast<QComboBox*>(widget)) {
|
||||
widget->setMinimumWidth(widget->minimumSizeHint().width());
|
||||
qobject_cast<QComboBox*>(widget)->view()->setMinimumWidth(widget->minimumSizeHint().width());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user