37 #include <QPushButton> 39 #include <QFileDialog> 40 #include <QVBoxLayout> 54 QVBoxLayout* layout =
new QVBoxLayout(
this);
55 layout->setAlignment(Qt::AlignTop);
58 QLabel* page_title =
new QLabel(
this);
59 page_title->setText(title.c_str());
60 QFont page_title_font(QFont().defaultFamily(), 18, QFont::Bold);
61 page_title->setFont(page_title_font);
62 page_title->setWordWrap(
true);
63 layout->addWidget(page_title);
64 layout->setAlignment(page_title, Qt::AlignTop);
67 QLabel* page_instructions =
new QLabel(
this);
68 page_instructions->setText(instructions.c_str());
69 page_instructions->setWordWrap(
true);
71 page_instructions->setMinimumWidth(1);
72 layout->addWidget(page_instructions);
73 layout->setAlignment(page_instructions, Qt::AlignTop);
76 layout->setContentsMargins(0, 0, 0, 0);
78 this->setLayout(layout);
93 : QFrame(parent), dir_only_(dir_only), load_only_(load_only)
96 setFrameShape(QFrame::StyledPanel);
97 setFrameShadow(QFrame::Raised);
102 QVBoxLayout* layout =
new QVBoxLayout(
this);
105 QHBoxLayout* hlayout =
new QHBoxLayout();
108 QLabel* widget_title =
new QLabel(
this);
109 widget_title->setText(title);
110 QFont widget_title_font(QFont().defaultFamily(), 12, QFont::Bold);
111 widget_title->setFont(widget_title_font);
112 layout->addWidget(widget_title);
113 layout->setAlignment(widget_title, Qt::AlignTop);
116 QLabel* widget_instructions =
new QLabel(
this);
117 widget_instructions->setText(instructions);
118 widget_instructions->setWordWrap(
true);
119 widget_instructions->setTextFormat(Qt::RichText);
120 layout->addWidget(widget_instructions);
121 layout->setAlignment(widget_instructions, Qt::AlignTop);
130 QPushButton* browse_button =
new QPushButton(
this);
131 browse_button->setText(
"Browse");
132 connect(browse_button, SIGNAL(clicked()),
this, SLOT(
btn_file_dialog()));
133 hlayout->addWidget(browse_button);
136 layout->addLayout(hlayout);
149 path = QFileDialog::getExistingDirectory(
this,
"Open Package Directory",
path_box_->text(),
150 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
160 path = QFileDialog::getOpenFileName(
this,
"Open File", start_path,
"");
164 path = QFileDialog::getSaveFileName(
this,
"Create/Load File", start_path,
"");
202 path_box_->setText(QString(path.c_str()));
206 const QString& arg_instructions, QWidget* parent,
const bool dir_only,
207 const bool load_only)
208 :
LoadPathWidget(title, instructions, parent, dir_only, load_only)
212 args_ =
new QLineEdit(
this);
215 layout()->addWidget(
args_);
220 return args_->text();
225 args_->setText(args);
230 args_->setEnabled(enabled);