ensured parenting of qwidgets

This commit is contained in:
itsmattkc
2019-01-30 17:36:54 +11:00
parent 54180e5e0d
commit 6f3a826da7
32 changed files with 350 additions and 357 deletions
+4 -5
View File
@@ -7,13 +7,12 @@
#include <QFileDialog>
EmbeddedFileChooser::EmbeddedFileChooser(QWidget* parent) : QWidget(parent) {
QHBoxLayout* layout = new QHBoxLayout();
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
setLayout(layout);
file_label = new QLabel();
file_label = new QLabel(this);
update_label();
layout->addWidget(file_label);
QPushButton* browse_button = new QPushButton("...");
QPushButton* browse_button = new QPushButton("...", this);
browse_button->setFixedWidth(25);
layout->addWidget(browse_button);
connect(browse_button, SIGNAL(clicked(bool)), this, SLOT(browse()));
@@ -35,7 +34,7 @@ void EmbeddedFileChooser::setFilename(const QString &s) {
}
void EmbeddedFileChooser::update_label() {
QString l = "<html>" + tr("File:") + " ";
QString l = "<html>" + tr("File:") + " ";
if (filename.isEmpty()) {
l += "(none)";
} else {