Add TabWidet
This commit is contained in:
parent
91362b4af3
commit
16acde949f
|
|
@ -5,10 +5,16 @@ TEMPLATE = lib
|
||||||
include(link_components.pri)
|
include(link_components.pri)
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
plugin/qtmaterialplugins.cpp
|
plugin/qtmaterialplugins.cpp \
|
||||||
|
plugin/qtmaterialtabwidgetcontainerextension.cpp \
|
||||||
|
plugin/qtmaterialtabwidgetextensionfactory.cpp \
|
||||||
|
plugin/qtmaterialtabwidgetplugin.cpp
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
plugin/plugintemplate.h \
|
plugin/plugintemplate.h \
|
||||||
plugin/qtmaterialplugins.h
|
plugin/qtmaterialplugins.h \
|
||||||
|
plugin/qtmaterialtabwidgetcontainerextension.h \
|
||||||
|
plugin/qtmaterialtabwidgetextensionfactory.h \
|
||||||
|
plugin/qtmaterialtabwidgetplugin.h
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(qt-material-widget)
|
TARGET = $$qtLibraryTarget(qt-material-widget)
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ SOURCES += \
|
||||||
$$COMP_PATH/qtmaterialmenu.cpp \
|
$$COMP_PATH/qtmaterialmenu.cpp \
|
||||||
$$COMP_PATH/qtmaterialmenu_internal.cpp \
|
$$COMP_PATH/qtmaterialmenu_internal.cpp \
|
||||||
$$COMP_PATH/qtmateriallist.cpp \
|
$$COMP_PATH/qtmateriallist.cpp \
|
||||||
$$COMP_PATH/qtmateriallistitem.cpp
|
$$COMP_PATH/qtmateriallistitem.cpp \
|
||||||
|
$$PWD/qtmaterialtabwidget.cpp
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$COMP_PATH/qtmaterialavatar_p.h \
|
$$COMP_PATH/qtmaterialavatar_p.h \
|
||||||
$$COMP_PATH/qtmaterialavatar.h \
|
$$COMP_PATH/qtmaterialavatar.h \
|
||||||
|
|
@ -129,7 +130,8 @@ HEADERS += \
|
||||||
$$COMP_PATH/qtmateriallist_p.h \
|
$$COMP_PATH/qtmateriallist_p.h \
|
||||||
$$COMP_PATH/qtmateriallistitem.h \
|
$$COMP_PATH/qtmateriallistitem.h \
|
||||||
$$COMP_PATH/qtmateriallistitem_p.h \
|
$$COMP_PATH/qtmateriallistitem_p.h \
|
||||||
$$PWD/lib/qtmaterialconst.h
|
$$PWD/lib/qtmaterialconst.h \
|
||||||
|
$$PWD/qtmaterialtabwidget.h
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
$$COMP_PATH/material_res.qrc
|
$$COMP_PATH/material_res.qrc
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include "qtmaterialplugins.h"
|
#include "qtmaterialplugins.h"
|
||||||
|
#include "qtmaterialtabwidgetplugin.h"
|
||||||
QtMaterialPlugins::QtMaterialPlugins(QObject *parent) : QObject(parent)
|
QtMaterialPlugins::QtMaterialPlugins(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_plugins << new MaterialAppBarPlugin(this)
|
m_plugins << new MaterialAppBarPlugin(this)
|
||||||
|
|
@ -27,6 +27,7 @@ QtMaterialPlugins::QtMaterialPlugins(QObject *parent) : QObject(parent)
|
||||||
<< new MaterialTabsPlugin(this)
|
<< new MaterialTabsPlugin(this)
|
||||||
<< new MaterialTextFieldPlugin(this)
|
<< new MaterialTextFieldPlugin(this)
|
||||||
<< new MaterialTogglePlugin(this)
|
<< new MaterialTogglePlugin(this)
|
||||||
|
<< new QtMaterialTabWidgetPlugin(this)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
#include "qtmaterialtabwidgetcontainerextension.h"
|
||||||
|
#include "qtmaterialtabwidget.h"
|
||||||
|
|
||||||
|
QtMaterialTabWidgetContainerExtension::QtMaterialTabWidgetContainerExtension(QtMaterialTabWidget *widget,
|
||||||
|
QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
, myWidget(widget)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidgetContainerExtension::addWidget(QWidget *widget)
|
||||||
|
{
|
||||||
|
myWidget->addPage(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
int QtMaterialTabWidgetContainerExtension::count() const
|
||||||
|
{
|
||||||
|
return myWidget->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int QtMaterialTabWidgetContainerExtension::currentIndex() const
|
||||||
|
{
|
||||||
|
return myWidget->currentIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidgetContainerExtension::insertWidget(int index, QWidget *widget)
|
||||||
|
{
|
||||||
|
myWidget->insertPage(index, widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidgetContainerExtension::remove(int index)
|
||||||
|
{
|
||||||
|
myWidget->removePage(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidgetContainerExtension::setCurrentIndex(int index)
|
||||||
|
{
|
||||||
|
myWidget->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* QtMaterialTabWidgetContainerExtension::widget(int index) const
|
||||||
|
{
|
||||||
|
return myWidget->widget(index);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
#ifndef QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||||
|
#define QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||||
|
|
||||||
|
#include <QtDesigner/QDesignerContainerExtension>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QExtensionManager;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
class QtMaterialTabWidget;
|
||||||
|
|
||||||
|
class QtMaterialTabWidgetContainerExtension: public QObject,
|
||||||
|
public QDesignerContainerExtension
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(QDesignerContainerExtension)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QtMaterialTabWidgetContainerExtension(QtMaterialTabWidget *widget, QObject *parent);
|
||||||
|
|
||||||
|
void addWidget(QWidget *widget) override;
|
||||||
|
int count() const override;
|
||||||
|
int currentIndex() const override;
|
||||||
|
void insertWidget(int index, QWidget *widget) override;
|
||||||
|
void remove(int index) override;
|
||||||
|
void setCurrentIndex(int index) override;
|
||||||
|
QWidget *widget(int index) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QtMaterialTabWidget *myWidget;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALTABWIDGETCONTAINEREXTENSION_H
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include "qtmaterialtabwidgetextensionfactory.h"
|
||||||
|
#include "qtmaterialtabwidgetcontainerextension.h"
|
||||||
|
#include "qtmaterialtabwidget.h"
|
||||||
|
|
||||||
|
QtMaterialTabWidgetExtensionFactory::QtMaterialTabWidgetExtensionFactory(QExtensionManager *parent)
|
||||||
|
: QExtensionFactory(parent)
|
||||||
|
{}
|
||||||
|
//! [0]
|
||||||
|
|
||||||
|
//! [1]
|
||||||
|
QObject *QtMaterialTabWidgetExtensionFactory::createExtension(QObject *object,
|
||||||
|
const QString &iid,
|
||||||
|
QObject *parent) const
|
||||||
|
{
|
||||||
|
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(object);
|
||||||
|
|
||||||
|
if (widget && (iid == Q_TYPEID(QDesignerContainerExtension)))
|
||||||
|
return new QtMaterialTabWidgetContainerExtension(widget, parent);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||||
|
#define QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||||
|
|
||||||
|
#include <QtDesigner/QExtensionFactory>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QExtensionManager;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class QtMaterialTabWidgetExtensionFactory: public QExtensionFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QtMaterialTabWidgetExtensionFactory(QExtensionManager *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALTABWIDGETEXTENSIONFACTORY_H
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
#include <QtDesigner/QExtensionFactory>
|
||||||
|
#include <QtDesigner/QExtensionManager>
|
||||||
|
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||||
|
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||||
|
#include <QtDesigner/QDesignerContainerExtension>
|
||||||
|
#include <QtDesigner/QDesignerPropertySheetExtension>
|
||||||
|
|
||||||
|
#include "qtmaterialtabwidgetplugin.h"
|
||||||
|
#include "qtmaterialtabwidget.h"
|
||||||
|
#include "qtmaterialtabwidgetextensionfactory.h"
|
||||||
|
|
||||||
|
QtMaterialTabWidgetPlugin::QtMaterialTabWidgetPlugin(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidgetPlugin::name() const
|
||||||
|
{
|
||||||
|
return QLatin1String("QtMaterialTabWidget");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidgetPlugin::group() const
|
||||||
|
{
|
||||||
|
return QLatin1String("Qt Material Widgets");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidgetPlugin::toolTip() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidgetPlugin::whatsThis() const
|
||||||
|
{
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidgetPlugin::includeFile() const
|
||||||
|
{
|
||||||
|
return QLatin1String("qtmaterialtabwidget.h");
|
||||||
|
}
|
||||||
|
|
||||||
|
QIcon QtMaterialTabWidgetPlugin::icon() const
|
||||||
|
{
|
||||||
|
return QIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [0] //! [1]
|
||||||
|
bool QtMaterialTabWidgetPlugin::isContainer() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [1] //! [2]
|
||||||
|
QWidget *QtMaterialTabWidgetPlugin::createWidget(QWidget *parent)
|
||||||
|
{
|
||||||
|
QtMaterialTabWidget *widget = new QtMaterialTabWidget(parent);
|
||||||
|
connect(widget, &QtMaterialTabWidget::currentIndexChanged,
|
||||||
|
this, &QtMaterialTabWidgetPlugin::currentIndexChanged);
|
||||||
|
connect(widget, &QtMaterialTabWidget::pageTitleChanged,
|
||||||
|
this, &QtMaterialTabWidgetPlugin::pageTitleChanged);
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [2] //! [3]
|
||||||
|
bool QtMaterialTabWidgetPlugin::isInitialized() const
|
||||||
|
{
|
||||||
|
return initialized;
|
||||||
|
}
|
||||||
|
//! [3]
|
||||||
|
|
||||||
|
//! [4]
|
||||||
|
void QtMaterialTabWidgetPlugin::initialize(QDesignerFormEditorInterface *formEditor)
|
||||||
|
{
|
||||||
|
if (initialized)
|
||||||
|
return;
|
||||||
|
//! [4]
|
||||||
|
|
||||||
|
//! [5]
|
||||||
|
QExtensionManager *manager = formEditor->extensionManager();
|
||||||
|
//! [5] //! [6]
|
||||||
|
QExtensionFactory *factory = new QtMaterialTabWidgetExtensionFactory(manager);
|
||||||
|
|
||||||
|
Q_ASSERT(manager != 0);
|
||||||
|
manager->registerExtensions(factory, Q_TYPEID(QDesignerContainerExtension));
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
//! [6]
|
||||||
|
|
||||||
|
//! [7]
|
||||||
|
QString QtMaterialTabWidgetPlugin::domXml() const
|
||||||
|
{
|
||||||
|
return QLatin1String("\
|
||||||
|
<ui language=\"c++\">\
|
||||||
|
<widget class=\"QtMaterialTabWidget\" name=\"tabwidget\">\
|
||||||
|
<widget class=\"QWidget\" name=\"page\" />\
|
||||||
|
</widget>\
|
||||||
|
<customwidgets>\
|
||||||
|
<customwidget>\
|
||||||
|
<class>QtMaterialTabWidget</class>\
|
||||||
|
<extends>QWidget</extends>\
|
||||||
|
<addpagemethod>addPage</addpagemethod>\
|
||||||
|
</customwidget>\
|
||||||
|
</customwidgets>\
|
||||||
|
</ui>");
|
||||||
|
}
|
||||||
|
//! [7]
|
||||||
|
|
||||||
|
//! [8]
|
||||||
|
void QtMaterialTabWidgetPlugin::currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
Q_UNUSED(index);
|
||||||
|
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(sender());
|
||||||
|
//! [8] //! [9]
|
||||||
|
if (widget) {
|
||||||
|
QDesignerFormWindowInterface *form = QDesignerFormWindowInterface::findFormWindow(widget);
|
||||||
|
if (form)
|
||||||
|
form->emitSelectionChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [9]
|
||||||
|
|
||||||
|
//! [10]
|
||||||
|
void QtMaterialTabWidgetPlugin::pageTitleChanged(const QString &title)
|
||||||
|
{
|
||||||
|
Q_UNUSED(title);
|
||||||
|
QtMaterialTabWidget *widget = qobject_cast<QtMaterialTabWidget*>(sender());
|
||||||
|
//! [10] //! [11]
|
||||||
|
if (widget) {
|
||||||
|
QWidget *page = widget->widget(widget->currentIndex());
|
||||||
|
QDesignerFormWindowInterface *form;
|
||||||
|
form = QDesignerFormWindowInterface::findFormWindow(widget);
|
||||||
|
//! [11]
|
||||||
|
if (form) {
|
||||||
|
//! [12]
|
||||||
|
QDesignerFormEditorInterface *editor = form->core();
|
||||||
|
QExtensionManager *manager = editor->extensionManager();
|
||||||
|
//! [12] //! [13]
|
||||||
|
QDesignerPropertySheetExtension *sheet;
|
||||||
|
sheet = qt_extension<QDesignerPropertySheetExtension*>(manager, page);
|
||||||
|
const int propertyIndex = sheet->indexOf(QLatin1String("windowTitle"));
|
||||||
|
sheet->setChanged(propertyIndex, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
#ifndef QTMATERIALTABWIDGETPLUGIN_H
|
||||||
|
#define QTMATERIALTABWIDGETPLUGIN_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||||
|
|
||||||
|
class QtMaterialTabWidgetPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QtMaterialTabWidgetPlugin(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
QString name() const override;
|
||||||
|
QString group() const override;
|
||||||
|
QString toolTip() const override;
|
||||||
|
QString whatsThis() const override;
|
||||||
|
QString includeFile() const override;
|
||||||
|
QIcon icon() const override;
|
||||||
|
bool isContainer() const override;
|
||||||
|
QWidget *createWidget(QWidget *parent) override;
|
||||||
|
bool isInitialized() const override;
|
||||||
|
void initialize(QDesignerFormEditorInterface *formEditor) override;
|
||||||
|
QString domXml() const override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void currentIndexChanged(int index);
|
||||||
|
void pageTitleChanged(const QString &title);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool initialized = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALTABWIDGETPLUGIN_H
|
||||||
|
|
@ -29,7 +29,7 @@ void QtMaterialSliderPrivate::init()
|
||||||
stateMachine = new QtMaterialSliderStateMachine(q, thumb, track);
|
stateMachine = new QtMaterialSliderStateMachine(q, thumb, track);
|
||||||
stepTo = 0;
|
stepTo = 0;
|
||||||
oldValue = q->value();
|
oldValue = q->value();
|
||||||
trackWidth = 2;
|
trackWidth = 4;
|
||||||
hoverTrack = false;
|
hoverTrack = false;
|
||||||
hoverThumb = false;
|
hoverThumb = false;
|
||||||
hover = false;
|
hover = false;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QtUiPlugin/QDesignerExportWidget>
|
#include <QtUiPlugin/QDesignerExportWidget>
|
||||||
|
|
||||||
#define QT_MATERIAL_SLIDER_MARGIN 30
|
#define QT_MATERIAL_SLIDER_MARGIN 10
|
||||||
|
|
||||||
class QtMaterialSliderPrivate;
|
class QtMaterialSliderPrivate;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine(
|
||||||
m_pulseOutState->assignProperty(thumb, "haloSize", 35);
|
m_pulseOutState->assignProperty(thumb, "haloSize", 35);
|
||||||
m_pulseInState->assignProperty(thumb, "haloSize", 28);
|
m_pulseInState->assignProperty(thumb, "haloSize", 28);
|
||||||
|
|
||||||
m_inactiveState->assignProperty(thumb, "diameter", 11);
|
m_inactiveState->assignProperty(thumb, "diameter", 15);
|
||||||
m_focusState->assignProperty(thumb, "diameter", 11);
|
m_focusState->assignProperty(thumb, "diameter", 15);
|
||||||
m_slidingState->assignProperty(thumb, "diameter", 17);
|
m_slidingState->assignProperty(thumb, "diameter", 20);
|
||||||
|
|
||||||
QAbstractTransition *transition;
|
QAbstractTransition *transition;
|
||||||
QtMaterialStateTransition *customTransition;
|
QtMaterialStateTransition *customTransition;
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,42 @@ void QtMaterialTabs::setCurrentTab(int index)
|
||||||
emit currentChanged(index);
|
emit currentChanged(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabs::setTabText(int index, const QString &text)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialTabs);
|
||||||
|
|
||||||
|
if (index > -1) {
|
||||||
|
QtMaterialTab *tab = static_cast<QtMaterialTab *>(d->tabLayout->itemAt(index)->widget());
|
||||||
|
if (tab) {
|
||||||
|
tab->setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabs::insertTab(int index, const QString &text, const QIcon &icon)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialTabs);
|
||||||
|
|
||||||
|
QtMaterialTab *tab = new QtMaterialTab(this);
|
||||||
|
tab->setText(text);
|
||||||
|
tab->setHaloVisible(isHaloVisible());
|
||||||
|
tab->setRippleStyle(rippleStyle());
|
||||||
|
|
||||||
|
if (!icon.isNull()) {
|
||||||
|
tab->setIcon(icon);
|
||||||
|
tab->setIconSize(QSize(22, 22));
|
||||||
|
}
|
||||||
|
|
||||||
|
d->tabLayout->insertWidget(index, tab);
|
||||||
|
|
||||||
|
if (-1 == d->tab) {
|
||||||
|
d->tab = 0;
|
||||||
|
d->inkBar->refreshGeometry();
|
||||||
|
d->inkBar->raise();
|
||||||
|
tab->setActive(true);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
void QtMaterialTabs::addTab(const QString &text, const QIcon &icon)
|
void QtMaterialTabs::addTab(const QString &text, const QIcon &icon)
|
||||||
{
|
{
|
||||||
Q_D(QtMaterialTabs);
|
Q_D(QtMaterialTabs);
|
||||||
|
|
@ -204,6 +240,27 @@ void QtMaterialTabs::addTab(const QString &text, const QIcon &icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabs::removeTab(int index)
|
||||||
|
{
|
||||||
|
Q_D(QtMaterialTabs);
|
||||||
|
|
||||||
|
if (index > -1) {
|
||||||
|
QtMaterialTab *tab = static_cast<QtMaterialTab *>(d->tabLayout->itemAt(index)->widget());
|
||||||
|
if (tab) {
|
||||||
|
d->tabLayout->removeWidget(tab);
|
||||||
|
delete tab;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCurrentTab(index - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int QtMaterialTabs::count() const
|
||||||
|
{
|
||||||
|
Q_D(const QtMaterialTabs);
|
||||||
|
return d->tabLayout->count();
|
||||||
|
}
|
||||||
|
|
||||||
int QtMaterialTabs::currentIndex() const
|
int QtMaterialTabs::currentIndex() const
|
||||||
{
|
{
|
||||||
Q_D(const QtMaterialTabs);
|
Q_D(const QtMaterialTabs);
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,18 @@ public:
|
||||||
void setTextColor(const QColor &color);
|
void setTextColor(const QColor &color);
|
||||||
QColor textColor() const;
|
QColor textColor() const;
|
||||||
|
|
||||||
|
void insertTab(int index, const QString &text, const QIcon &icon = QIcon());
|
||||||
void addTab(const QString &text, const QIcon &icon = QIcon());
|
void addTab(const QString &text, const QIcon &icon = QIcon());
|
||||||
|
void removeTab(int index);
|
||||||
|
int count() const;
|
||||||
|
|
||||||
void setCurrentTab(QtMaterialTab *tab);
|
void setCurrentTab(QtMaterialTab *tab);
|
||||||
void setCurrentTab(int index);
|
void setCurrentTab(int index);
|
||||||
|
void setTabText(int index, const QString &text);
|
||||||
|
|
||||||
int currentIndex() const;
|
int currentIndex() const;
|
||||||
|
|
||||||
signals:
|
Q_SIGNALS:
|
||||||
void currentChanged(int);
|
void currentChanged(int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ void QtMaterialTabsInkBar::refreshGeometry()
|
||||||
const qreal s = 1-m_tween;
|
const qreal s = 1-m_tween;
|
||||||
|
|
||||||
if (QAbstractAnimation::Running != m_animation->state()) {
|
if (QAbstractAnimation::Running != m_animation->state()) {
|
||||||
m_geometry = QRect(r.left(), r.bottom()-1, r.width(), 2);
|
m_geometry = QRect(r.left(), r.bottom()-1, r.width(), 4);
|
||||||
} else {
|
} else {
|
||||||
const qreal left = m_previousGeometry.left()*s + r.left()*m_tween;
|
const qreal left = m_previousGeometry.left()*s + r.left()*m_tween;
|
||||||
const qreal width = m_previousGeometry.width()*s + r.width()*m_tween;
|
const qreal width = m_previousGeometry.width()*s + r.width()*m_tween;
|
||||||
m_geometry = QRect(left, r.bottom()-1, width, 2);
|
m_geometry = QRect(left, r.bottom()-1, width, 4);
|
||||||
}
|
}
|
||||||
m_tabs->update();
|
m_tabs->update();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
#include "qtmaterialtabwidget.h"
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <qtmaterialtabs.h>
|
||||||
|
|
||||||
|
QtMaterialTabWidget::QtMaterialTabWidget(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
|
, tabBar(new QtMaterialTabs)
|
||||||
|
, stackWidget(new QStackedWidget)
|
||||||
|
{
|
||||||
|
tabBar->setObjectName(QStringLiteral("__qt__passive_tabBar"));
|
||||||
|
|
||||||
|
connect(tabBar, QOverload<int>::of(&QtMaterialTabs::currentChanged),
|
||||||
|
this, &QtMaterialTabWidget::setCurrentIndex);
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||||
|
layout->addWidget(tabBar);
|
||||||
|
layout->addWidget(stackWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize QtMaterialTabWidget::sizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(300, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::addPage(QWidget *page)
|
||||||
|
{
|
||||||
|
insertPage(count(), page);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::removePage(int index)
|
||||||
|
{
|
||||||
|
QWidget *widget = stackWidget->widget(index);
|
||||||
|
stackWidget->removeWidget(widget);
|
||||||
|
|
||||||
|
tabBar->removeTab(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
int QtMaterialTabWidget::count() const
|
||||||
|
{
|
||||||
|
return stackWidget->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int QtMaterialTabWidget::currentIndex() const
|
||||||
|
{
|
||||||
|
return stackWidget->currentIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::insertPage(int index, QWidget *page)
|
||||||
|
{
|
||||||
|
page->setParent(stackWidget);
|
||||||
|
|
||||||
|
stackWidget->insertWidget(index, page);
|
||||||
|
|
||||||
|
QString title = page->windowTitle();
|
||||||
|
if (title.isEmpty()) {
|
||||||
|
title = tr("Tab %1").arg(tabBar->count() + 1);
|
||||||
|
page->setWindowTitle(title);
|
||||||
|
}
|
||||||
|
connect(page, &QWidget::windowTitleChanged,
|
||||||
|
this, &QtMaterialTabWidget::pageWindowTitleChanged);
|
||||||
|
tabBar->insertTab(index, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::setCurrentIndex(int index)
|
||||||
|
{
|
||||||
|
if (index != currentIndex()) {
|
||||||
|
stackWidget->setCurrentIndex(index);
|
||||||
|
tabBar->setCurrentTab(index);
|
||||||
|
emit currentIndexChanged(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::pageWindowTitleChanged()
|
||||||
|
{
|
||||||
|
QWidget *page = qobject_cast<QWidget *>(sender());
|
||||||
|
const int index = stackWidget->indexOf(page);
|
||||||
|
tabBar->setTabText(index, page->windowTitle());
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* QtMaterialTabWidget::widget(int index)
|
||||||
|
{
|
||||||
|
return stackWidget->widget(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtMaterialTabWidget::pageTitle() const
|
||||||
|
{
|
||||||
|
if (const QWidget *currentWidget = stackWidget->currentWidget())
|
||||||
|
return currentWidget->windowTitle();
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMaterialTabWidget::setPageTitle(QString const &newTitle)
|
||||||
|
{
|
||||||
|
if (QWidget *currentWidget = stackWidget->currentWidget())
|
||||||
|
currentWidget->setWindowTitle(newTitle);
|
||||||
|
emit pageTitleChanged(newTitle);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef QTMATERIALTABWIDGET_H
|
||||||
|
#define QTMATERIALTABWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QtUiPlugin/QDesignerExportWidget>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QStackedWidget;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
class QtMaterialTabs;
|
||||||
|
|
||||||
|
class QDESIGNER_WIDGET_EXPORT QtMaterialTabWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
|
||||||
|
Q_PROPERTY(QString pageTitle READ pageTitle WRITE setPageTitle STORED false)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QtMaterialTabWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
|
|
||||||
|
int count() const;
|
||||||
|
int currentIndex() const;
|
||||||
|
QWidget *widget(int index);
|
||||||
|
QString pageTitle() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void addPage(QWidget *page);
|
||||||
|
void insertPage(int index, QWidget *page);
|
||||||
|
void removePage(int index);
|
||||||
|
void setPageTitle(QString const &newTitle);
|
||||||
|
void setCurrentIndex(int index);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void pageWindowTitleChanged();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void currentIndexChanged(int index);
|
||||||
|
void pageTitleChanged(const QString &title);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QtMaterialTabs *tabBar;
|
||||||
|
QStackedWidget *stackWidget;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTMATERIALTABWIDGET_H
|
||||||
|
|
@ -67,11 +67,11 @@ FORMS += \
|
||||||
radiobuttonsettingsform.ui \
|
radiobuttonsettingsform.ui \
|
||||||
togglesettingsform.ui \
|
togglesettingsform.ui \
|
||||||
textfieldsettingsform.ui \
|
textfieldsettingsform.ui \
|
||||||
tabssettingsform.ui \
|
|
||||||
dialogsettingsform.ui \
|
dialogsettingsform.ui \
|
||||||
drawersettingsform.ui \
|
drawersettingsform.ui \
|
||||||
scrollbarsettingsform.ui \
|
scrollbarsettingsform.ui \
|
||||||
appbarsettingsform.ui
|
appbarsettingsform.ui \
|
||||||
|
tabssettingsform.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
../components/material_res.qrc \
|
../components/material_res.qrc \
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ PluginDemoForm::PluginDemoForm(QWidget *parent) :
|
||||||
dialogLayout->addWidget(dialogWidget);
|
dialogLayout->addWidget(dialogWidget);
|
||||||
|
|
||||||
connect(closeButton, SIGNAL(pressed()), m_dialog, SLOT(hideDialog()));
|
connect(closeButton, SIGNAL(pressed()), m_dialog, SLOT(hideDialog()));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginDemoForm::~PluginDemoForm()
|
PluginDemoForm::~PluginDemoForm()
|
||||||
|
|
@ -43,3 +45,7 @@ void PluginDemoForm::on_qtmaterialflatbutton_3_clicked()
|
||||||
{
|
{
|
||||||
m_dialog->showDialog();
|
m_dialog->showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginDemoForm::tabIndexChanged(int index)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ public:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_qtmaterialflatbutton_3_clicked();
|
void on_qtmaterialflatbutton_3_clicked();
|
||||||
|
void tabIndexChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PluginDemoForm *ui;
|
Ui::PluginDemoForm *ui;
|
||||||
|
|
|
||||||
|
|
@ -7,81 +7,44 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>907</width>
|
<width>907</width>
|
||||||
<height>849</height>
|
<height>908</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
<item row="15" column="1">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QtMaterialToggle" name="qtmaterialtoggle"/>
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="3">
|
<item row="7" column="1" colspan="4">
|
||||||
<widget class="QtMaterialCheckBox" name="qtmaterialcheckbox">
|
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>150</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>CheckBox</string>
|
<string>FlatButton</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="icon">
|
||||||
</item>
|
<iconset resource="../components/material_res.qrc">
|
||||||
<item row="5" column="0">
|
<normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</iconset>
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="iconSize">
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>FloatActionButton</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" colspan="3">
|
|
||||||
<widget class="QtMaterialAutoComplete" name="qtmaterialautocomplete">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>20</width>
|
||||||
<height>16777215</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="dataSource">
|
<property name="overlayStyle">
|
||||||
<stringlist>
|
<enum>MaterialConst::TintedOverlay</enum>
|
||||||
<string>HELLO</string>
|
|
||||||
<string>WORLD</string>
|
|
||||||
<string>MATERIAL</string>
|
|
||||||
</stringlist>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="12" column="0">
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -94,11 +57,11 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>IconButton</string>
|
<string>RaiseButton</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QtMaterialFloatingActionButton" name="qtmaterialfloatingactionbutton">
|
<widget class="QtMaterialFloatingActionButton" name="qtmaterialfloatingactionbutton">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../components/material_res.qrc">
|
<iconset resource="../components/material_res.qrc">
|
||||||
|
|
@ -109,71 +72,32 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="1" colspan="3">
|
<item row="4" column="0">
|
||||||
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton">
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>CirculaProgress</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1" colspan="4">
|
||||||
|
<widget class="QtMaterialProgress" name="qtmaterialprogress">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>200</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string>RadioButton 1</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="12" column="0">
|
|
||||||
<widget class="QLabel" name="label_11">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Slider</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="label_8">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Progress</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Avatar & Badge</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
|
|
@ -218,57 +142,34 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1" colspan="3">
|
<item row="2" column="1" colspan="4">
|
||||||
<widget class="QtMaterialProgress" name="qtmaterialprogress">
|
<widget class="QtMaterialCheckBox" name="qtmaterialcheckbox">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>200</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="13" column="1" colspan="3">
|
|
||||||
<widget class="QtMaterialTextField" name="qtmaterialtextfield">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="label">
|
|
||||||
<string>Input Text</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1" colspan="3">
|
|
||||||
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>150</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FlatButton</string>
|
<string>CheckBox</string>
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../components/material_res.qrc">
|
|
||||||
<normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</normaloff>:/icons/icons/maps/svg/production/ic_local_see_24px.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="overlayStyle">
|
|
||||||
<enum>MaterialConst::TintedOverlay</enum>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="4" column="1">
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QtMaterialCircularProgress" name="qtmaterialcircularprogress">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>60</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="size">
|
||||||
|
<double>40.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -281,11 +182,61 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>RaiseButton</string>
|
<string>FloatActionButton</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>AutoComplete</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QtMaterialIconButton" name="qtmaterialiconbutton">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../components/material_res.qrc">
|
||||||
|
<normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_14">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
|
@ -303,10 +254,42 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="14" column="1">
|
<item row="0" column="1" colspan="4">
|
||||||
<widget class="QtMaterialToggle" name="qtmaterialtoggle"/>
|
<widget class="QtMaterialAutoComplete" name="qtmaterialautocomplete">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="dataSource">
|
||||||
|
<stringlist>
|
||||||
|
<string>HELLO</string>
|
||||||
|
<string>WORLD</string>
|
||||||
|
<string>MATERIAL</string>
|
||||||
|
</stringlist>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0">
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="0">
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
|
@ -324,6 +307,31 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="15" column="2">
|
||||||
|
<widget class="QtMaterialToggle" name="qtmaterialtoggle_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QtMaterialAvatar" name="qtmaterialavatar">
|
<widget class="QtMaterialAvatar" name="qtmaterialavatar">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
|
@ -362,40 +370,43 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1" colspan="3">
|
<item row="9" column="0">
|
||||||
<widget class="QtMaterialSlider" name="qtmaterialslider">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="maximumSize">
|
<property name="sizePolicy">
|
||||||
<size>
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<width>200</width>
|
<horstretch>0</horstretch>
|
||||||
<height>16777215</height>
|
<verstretch>0</verstretch>
|
||||||
</size>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="font">
|
||||||
<number>50</number>
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Progress</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="1" column="0">
|
||||||
<widget class="QtMaterialCircularProgress" name="qtmaterialcircularprogress">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="maximumSize">
|
<property name="sizePolicy">
|
||||||
<size>
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<width>60</width>
|
<horstretch>0</horstretch>
|
||||||
<height>60</height>
|
<verstretch>0</verstretch>
|
||||||
</size>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="size">
|
<property name="font">
|
||||||
<double>40.000000000000000</double>
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Avatar & Badge</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="14" column="2">
|
<item row="12" column="1" colspan="4">
|
||||||
<widget class="QtMaterialToggle" name="qtmaterialtoggle_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="11" column="1" colspan="3">
|
|
||||||
<widget class="QtMaterialRaisedButton" name="qtmaterialraisedbutton">
|
<widget class="QtMaterialRaisedButton" name="qtmaterialraisedbutton">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
|
|
@ -411,22 +422,34 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="QtMaterialIconButton" name="qtmaterialiconbutton">
|
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton_2">
|
||||||
<property name="icon">
|
<property name="maximumSize">
|
||||||
<iconset resource="../components/material_res.qrc">
|
|
||||||
<normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</normaloff>:/icons/icons/content/svg/production/ic_mail_24px.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>200</width>
|
||||||
<height>40</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton 2</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="13" column="1" colspan="4">
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QtMaterialSlider" name="qtmaterialslider">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -439,12 +462,12 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Dialog</string>
|
<string>IconButton</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="13" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -457,11 +480,55 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>CirculaProgress</string>
|
<string>Slider</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="15" column="0">
|
||||||
|
<widget class="QLabel" name="label_13">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Roboto</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Toggle</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1" colspan="4">
|
||||||
|
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton 1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="1" colspan="4">
|
||||||
|
<widget class="QtMaterialTextField" name="qtmaterialtextfield">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="label">
|
||||||
|
<string>Input Text</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton_3">
|
<widget class="QtMaterialFlatButton" name="qtmaterialflatbutton_3">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
|
|
@ -493,8 +560,28 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="1" column="3">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QtMaterialTabWidget" name="tabwidget">
|
||||||
|
<widget class="QWidget" name="page">
|
||||||
|
<widget class="QtMaterialCircularProgress" name="qtmaterialcircularprogress_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>130</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>78</width>
|
||||||
|
<height>78</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>86</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -507,12 +594,20 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>RadioButton</string>
|
<string>Tab 1 content</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</widget>
|
||||||
<item row="14" column="0">
|
<widget class="QWidget" name="page_2">
|
||||||
<widget class="QLabel" name="label_13">
|
<widget class="QLabel" name="label_16">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>40</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>86</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
@ -525,39 +620,20 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Toggle</string>
|
<string>Tab 2 content</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QtMaterialProgress" name="qtmaterialprogress_2">
|
||||||
<item row="0" column="0">
|
<property name="geometry">
|
||||||
<widget class="QLabel" name="label">
|
<rect>
|
||||||
<property name="sizePolicy">
|
<x>210</x>
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<y>30</y>
|
||||||
<horstretch>0</horstretch>
|
<width>112</width>
|
||||||
<verstretch>0</verstretch>
|
<height>24</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Roboto</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>AutoComplete</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</widget>
|
||||||
<item row="10" column="1">
|
|
||||||
<widget class="QtMaterialRadioButton" name="qtmaterialradiobutton_2">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>RadioButton 2</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -647,9 +723,17 @@
|
||||||
<header>qtmaterialtoggle.h</header>
|
<header>qtmaterialtoggle.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>QtMaterialTabWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>qtmaterialtabwidget.h</header>
|
||||||
|
<addpagemethod>addPage</addpagemethod>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../components/material_res.qrc"/>
|
<include location="../components/material_res.qrc"/>
|
||||||
|
<include location="../components/material_res.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue