textinput page added
This commit is contained in:
parent
8eda6ad35e
commit
8abbae3661
@ -5,6 +5,11 @@
|
||||
|
||||
#include "Page.h"
|
||||
|
||||
Page::Page( QQuickItem* parent )
|
||||
: Page( Qt::Vertical )
|
||||
{
|
||||
}
|
||||
|
||||
Page::Page( Qt::Orientation orientation, QQuickItem* parent )
|
||||
: QskLinearBox( orientation, parent )
|
||||
{
|
||||
|
@ -10,5 +10,6 @@
|
||||
class Page : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
Page( QQuickItem* parent = nullptr );
|
||||
Page( Qt::Orientation, QQuickItem* parent = nullptr );
|
||||
};
|
||||
|
@ -24,6 +24,12 @@ HEADERS += \
|
||||
SOURCES += \
|
||||
button/ButtonPage.cpp \
|
||||
|
||||
HEADERS += \
|
||||
textinput/TextInputPage.h
|
||||
|
||||
SOURCES += \
|
||||
textinput/TextInputPage.cpp \
|
||||
|
||||
HEADERS += \
|
||||
Page.h
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "progressbar/ProgressBarPage.h"
|
||||
#include "slider/SliderPage.h"
|
||||
#include "button/ButtonPage.h"
|
||||
#include "textinput/TextInputPage.h"
|
||||
|
||||
#include <SkinnyShortcut.h>
|
||||
#include <SkinnyShapeProvider.h>
|
||||
@ -20,6 +21,7 @@
|
||||
#include <QskPushButton.h>
|
||||
#include <QskMenu.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskDialog.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
@ -132,6 +134,7 @@ namespace
|
||||
tabView->addTab( "Buttons", new ButtonPage() );
|
||||
tabView->addTab( "Sliders", new SliderPage() );
|
||||
tabView->addTab( "Progress\nBars", new ProgressBarPage() );
|
||||
tabView->addTab( "Text\nInputs", new TextInputPage() );
|
||||
|
||||
connect( header, &Header::enabledToggled,
|
||||
tabView, &TabView::setTabsEnabled );
|
||||
@ -147,6 +150,9 @@ int main( int argc, char* argv[] )
|
||||
|
||||
Qsk::addGraphicProvider( "shapes", new SkinnyShapeProvider() );
|
||||
|
||||
// dialogs in faked windows -> QskSubWindow
|
||||
QskDialog::instance()->setPolicy( QskDialog::EmbeddedBox );
|
||||
|
||||
QGuiApplication app( argc, argv );
|
||||
|
||||
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
|
||||
|
41
examples/gallery/textinput/TextInputPage.cpp
Normal file
41
examples/gallery/textinput/TextInputPage.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "TextInputPage.h"
|
||||
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskTextInput.h>
|
||||
|
||||
TextInputPage::TextInputPage( QQuickItem* parent )
|
||||
: Page( parent )
|
||||
{
|
||||
setSpacing( 40 );
|
||||
populate();
|
||||
}
|
||||
|
||||
void TextInputPage::populate()
|
||||
{
|
||||
auto box = new QskLinearBox( Qt::Horizontal, 2, this );
|
||||
box->setExtraSpacingAt( Qt::BottomEdge );
|
||||
|
||||
{
|
||||
new QskTextInput( "Edit Me", box );
|
||||
}
|
||||
|
||||
{
|
||||
auto input = new QskTextInput( "Only Read Me", box );
|
||||
input->setReadOnly( true );
|
||||
}
|
||||
|
||||
{
|
||||
auto input = new QskTextInput( "12345", box );
|
||||
input->setMaxLength( 5 );
|
||||
input->setEchoMode( QskTextInput::PasswordEchoOnEdit );
|
||||
}
|
||||
|
||||
{
|
||||
// once we have QskTextEdit it will be here too.
|
||||
}
|
||||
}
|
17
examples/gallery/textinput/TextInputPage.h
Normal file
17
examples/gallery/textinput/TextInputPage.h
Normal file
@ -0,0 +1,17 @@
|
||||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Page.h"
|
||||
|
||||
class TextInputPage : public Page
|
||||
{
|
||||
public:
|
||||
TextInputPage( QQuickItem* = nullptr );
|
||||
|
||||
private:
|
||||
void populate();
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user