QtBase: examples/widgets/layouts coding style

Change-Id: I4340c1fcbb467bf3c2ace3b4bd4b042fe9521c35
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
David Schulz 2012-11-21 14:14:38 +01:00 committed by The Qt Project
parent 9b49c0561e
commit 78c374865e
10 changed files with 14 additions and 18 deletions

View File

@ -116,10 +116,10 @@ void Dialog::createGridGroupBox()
//! [9]
for (int i = 0; i < NumGridRows; ++i) {
labels[i] = new QLabel(tr("Line %1:").arg(i + 1));
lineEdits[i] = new QLineEdit;
layout->addWidget(labels[i], i + 1, 0);
layout->addWidget(lineEdits[i], i + 1, 1);
labels[i] = new QLabel(tr("Line %1:").arg(i + 1));
lineEdits[i] = new QLineEdit;
layout->addWidget(labels[i], i + 1, 0);
layout->addWidget(lineEdits[i], i + 1, 1);
}
//! [9] //! [10]

View File

@ -87,4 +87,4 @@ private:
};
//! [0]
#endif
#endif // DIALOG_H

View File

@ -38,8 +38,6 @@
**
****************************************************************************/
#include <QtWidgets>
#include "borderlayout.h"
BorderLayout::BorderLayout(QWidget *parent, int margin, int spacing)

View File

@ -43,7 +43,6 @@
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
class BorderLayout : public QLayout
{
@ -85,4 +84,4 @@ private:
QList<ItemWrapper *> list;
};
#endif
#endif // BORDERLAYOUT_H

View File

@ -38,10 +38,10 @@
**
****************************************************************************/
#include <QtWidgets>
#include "borderlayout.h"
#include "window.h"
#include <QTextBrowser>
#include <QLabel>
Window::Window()
{

View File

@ -58,4 +58,4 @@ private:
QLabel *createLabel(const QString &text);
};
#endif
#endif // WINDOW_H

View File

@ -41,7 +41,6 @@
#ifndef DIALOG_H
#define DIALOG_H
#include <QMainWindow>
#include <QDialog>
#include <QQueue>
@ -88,4 +87,4 @@ private:
QGridLayout *optionsLayout;
};
#endif
#endif // DIALOG_H

View File

@ -43,7 +43,7 @@
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
#include <QStyle>
//! [0]
class FlowLayout : public QLayout
{
@ -75,4 +75,4 @@ private:
};
//! [0]
#endif
#endif // FLOWLAYOUT_H

View File

@ -38,7 +38,7 @@
**
****************************************************************************/
#include <QtWidgets>
#include <QPushButton>
#include "flowlayout.h"
#include "window.h"

View File

@ -56,4 +56,4 @@ public:
};
//! [0]
#endif
#endif // WINDOW_H