QtBase: examples/widgets/layouts coding style
Change-Id: I4340c1fcbb467bf3c2ace3b4bd4b042fe9521c35 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
parent
9b49c0561e
commit
78c374865e
@ -116,10 +116,10 @@ void Dialog::createGridGroupBox()
|
|||||||
|
|
||||||
//! [9]
|
//! [9]
|
||||||
for (int i = 0; i < NumGridRows; ++i) {
|
for (int i = 0; i < NumGridRows; ++i) {
|
||||||
labels[i] = new QLabel(tr("Line %1:").arg(i + 1));
|
labels[i] = new QLabel(tr("Line %1:").arg(i + 1));
|
||||||
lineEdits[i] = new QLineEdit;
|
lineEdits[i] = new QLineEdit;
|
||||||
layout->addWidget(labels[i], i + 1, 0);
|
layout->addWidget(labels[i], i + 1, 0);
|
||||||
layout->addWidget(lineEdits[i], i + 1, 1);
|
layout->addWidget(lineEdits[i], i + 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! [9] //! [10]
|
//! [9] //! [10]
|
||||||
|
@ -87,4 +87,4 @@ private:
|
|||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
#endif
|
#endif // DIALOG_H
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QtWidgets>
|
|
||||||
|
|
||||||
#include "borderlayout.h"
|
#include "borderlayout.h"
|
||||||
|
|
||||||
BorderLayout::BorderLayout(QWidget *parent, int margin, int spacing)
|
BorderLayout::BorderLayout(QWidget *parent, int margin, int spacing)
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
|
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QWidgetItem>
|
|
||||||
|
|
||||||
class BorderLayout : public QLayout
|
class BorderLayout : public QLayout
|
||||||
{
|
{
|
||||||
@ -85,4 +84,4 @@ private:
|
|||||||
QList<ItemWrapper *> list;
|
QList<ItemWrapper *> list;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // BORDERLAYOUT_H
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QtWidgets>
|
|
||||||
|
|
||||||
#include "borderlayout.h"
|
#include "borderlayout.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
#include <QTextBrowser>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
Window::Window()
|
Window::Window()
|
||||||
{
|
{
|
||||||
|
@ -58,4 +58,4 @@ private:
|
|||||||
QLabel *createLabel(const QString &text);
|
QLabel *createLabel(const QString &text);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // WINDOW_H
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#ifndef DIALOG_H
|
#ifndef DIALOG_H
|
||||||
#define DIALOG_H
|
#define DIALOG_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
|
|
||||||
@ -88,4 +87,4 @@ private:
|
|||||||
QGridLayout *optionsLayout;
|
QGridLayout *optionsLayout;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // DIALOG_H
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QWidgetItem>
|
#include <QStyle>
|
||||||
//! [0]
|
//! [0]
|
||||||
class FlowLayout : public QLayout
|
class FlowLayout : public QLayout
|
||||||
{
|
{
|
||||||
@ -75,4 +75,4 @@ private:
|
|||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
#endif
|
#endif // FLOWLAYOUT_H
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QtWidgets>
|
#include <QPushButton>
|
||||||
|
|
||||||
#include "flowlayout.h"
|
#include "flowlayout.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
@ -56,4 +56,4 @@ public:
|
|||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
#endif
|
#endif // WINDOW_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user