Divider: one pixel heigth, cleaned up the demo removing the underline of the textfields and removing the padding/spacing of the layout (and a stretch)
This commit is contained in:
parent
403addec6d
commit
16c112d16d
|
@ -3,12 +3,14 @@
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <qtmaterialdivider.h>
|
#include <qtmaterialdivider.h>
|
||||||
#include <qtmaterialtextfield.h>
|
|
||||||
|
|
||||||
DividerSettingsEditor::DividerSettingsEditor(QWidget *parent)
|
DividerSettingsEditor::DividerSettingsEditor(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
ui(new Ui::DividerSettingsForm),
|
ui(new Ui::DividerSettingsForm),
|
||||||
m_divider(new QtMaterialDivider)
|
m_divider1(new QtMaterialDivider),
|
||||||
|
m_divider2(new QtMaterialDivider),
|
||||||
|
m_textfield1(new QtMaterialTextField),
|
||||||
|
m_textfield2(new QtMaterialTextField)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
@ -21,30 +23,24 @@ DividerSettingsEditor::DividerSettingsEditor(QWidget *parent)
|
||||||
layout->addWidget(canvas);
|
layout->addWidget(canvas);
|
||||||
|
|
||||||
ui->setupUi(widget);
|
ui->setupUi(widget);
|
||||||
// layout->setContentsMargins(20, 20, 20, 20);
|
layout->setContentsMargins(20, 20, 20, 20);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
// layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
QLabel *lbl = new QLabel;
|
m_textfield1->setLabel( "First Name" );
|
||||||
lbl->setText( "1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 " );
|
m_textfield1->setPlaceholderText( "Placeholder" );
|
||||||
|
m_textfield1->setShowUnderline( false );
|
||||||
|
|
||||||
QtMaterialTextField *txt1 = new QtMaterialTextField;
|
m_textfield2->setLabel( "Middle Name" );
|
||||||
txt1->setLabel( "First Name" );
|
m_textfield2->setShowUnderline( false );
|
||||||
txt1->setPlaceholderText( "Placeholder" );
|
|
||||||
|
|
||||||
QtMaterialTextField *txt2 = new QtMaterialTextField;
|
|
||||||
txt2->setLabel( "Middle Name" );
|
|
||||||
|
|
||||||
QtMaterialDivider *div2 = new QtMaterialDivider;
|
|
||||||
div2->setInsetSize( 40 );
|
|
||||||
|
|
||||||
layout = new QVBoxLayout;
|
layout = new QVBoxLayout;
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
canvas->setLayout(layout);
|
canvas->setLayout(layout);
|
||||||
layout->addWidget(txt1);
|
layout->addWidget(m_textfield1);
|
||||||
layout->addWidget(m_divider);
|
layout->addWidget(m_divider1);
|
||||||
layout->addWidget(txt2);
|
layout->addWidget(m_textfield2);
|
||||||
layout->addWidget(div2);
|
layout->addWidget(m_divider2);
|
||||||
layout->addWidget(lbl);
|
layout->addStretch();
|
||||||
|
|
||||||
setupForm();
|
setupForm();
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "ui_dividersettingsform.h"
|
#include "ui_dividersettingsform.h"
|
||||||
|
#include <qtmaterialtextfield.h>
|
||||||
|
|
||||||
class QtMaterialDivider;
|
class QtMaterialDivider;
|
||||||
|
|
||||||
|
@ -20,7 +21,10 @@ protected slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DividerSettingsForm *const ui;
|
Ui::DividerSettingsForm *const ui;
|
||||||
QtMaterialDivider *const m_divider;
|
QtMaterialDivider *const m_divider1;
|
||||||
|
QtMaterialDivider *const m_divider2;
|
||||||
|
QtMaterialTextField *const m_textfield1;
|
||||||
|
QtMaterialTextField *const m_textfield2;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIVIDERSETTINGSEDITOR_H
|
#endif // DIVIDERSETTINGSEDITOR_H
|
||||||
|
|
Loading…
Reference in New Issue