annotate ui/helpdialog.cpp @ 214:aab742690bee

Fix check for selected items and wait for bytes written. According to the documentation closing the write channel should suffice. But in testing it did not sent over everything.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 26 Mar 2014 17:17:19 +0100
parents 103daf2d39c0
children 17e1c8f37d72
rev   line source
190
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 #include "helpdialog.h"
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2 #include <QDebug>
192
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
3 #include <QVBoxLayout>
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
4 #include <QTextEdit>
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
5 #include <QPushButton>
190
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 HelpDialog::HelpDialog(QMainWindow *parent) :
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 QDialog(parent)
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 {
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 setupGUI();
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 }
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 void HelpDialog::setupGUI()
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 {
192
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
15 QVBoxLayout *mainLayout = new QVBoxLayout(this);
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
16 QTextEdit *helpText = new QTextEdit;
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
17 helpText->setReadOnly(true);
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
18 helpText->setPlainText(tr("This dialog contains some text to help the user."));
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
19
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
20 QHBoxLayout *buttonLayout = new QHBoxLayout;
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
21 QPushButton *closeButton = new QPushButton(tr("Close"));
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
22 connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
23 buttonLayout->insertStretch(0, 10);
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
24 buttonLayout->addWidget(closeButton);
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
25
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
26 mainLayout->addWidget(helpText);
103daf2d39c0 Added some content and a close button to the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 190
diff changeset
27 mainLayout->addLayout(buttonLayout);
190
1a66a15d0df8 Added stub for help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 }

http://wald.intevation.org/projects/trustbridge/