Un-default the "OK" button so that we can press enter on the URL field.

This commit is contained in:
Andrzej Kapolka 2014-05-06 11:47:35 -07:00
parent 9421af9f10
commit 082ff760d6
2 changed files with 13 additions and 0 deletions

View file

@ -50,10 +50,20 @@ AttachmentsDialog::AttachmentsDialog() :
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), SLOT(deleteLater()));
_ok = buttons->button(QDialogButtonBox::Ok);
setMinimumSize(600, 600);
}
void AttachmentsDialog::setVisible(bool visible) {
QDialog::setVisible(visible);
// un-default the OK button
if (visible) {
_ok->setDefault(false);
}
}
void AttachmentsDialog::updateAttachmentData() {
QVector<AttachmentData> data;
for (int i = 0; i < _attachments->count() - 1; i++) {

View file

@ -30,6 +30,8 @@ public:
AttachmentsDialog();
virtual void setVisible(bool visible);
public slots:
void updateAttachmentData();
@ -41,6 +43,7 @@ private slots:
private:
QVBoxLayout* _attachments;
QPushButton* _ok;
};
/// A panel controlling a single attachment.