Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
LayoutTabs.h
Go to the documentation of this file.
1#pragma once
2
3#include <QTabWidget>
5#include <misc/qt/Macros.h>
6
7namespace sf
8{
9
13class QDESIGNER_WIDGET_EXPORT LayoutTabs : public VariableWidgetBase
14{
15 Q_OBJECT
16 Q_PROPERTY(QStringList tabsConfig READ getTabsConfig WRITE setTabsConfig)
17 Q_PROPERTY(QTabWidget::TabPosition tabPosition READ getTabPosition WRITE setTabPosition)
18 Q_PROPERTY(QTabWidget::TabShape tabShape READ getTabShape WRITE setTabShape)
19 Q_PROPERTY(int currentIndex READ getCurrentIndex WRITE setCurrentIndex)
20
21 // Propagate the 'TabPosition' property.
22 SF_DECL_PROP_GS(QTabWidget::TabPosition, TabPosition)
23 SF_DECL_PROP_GS(QTabWidget::TabShape, TabShape)
24 SF_DECL_PROP_GS(int, CurrentIndex)
25
26 public:
30 explicit LayoutTabs(QWidget* parent = nullptr);
31
39 [[nodiscard]] QStringList getTabsConfig() const;
40
44 void setTabsConfig(const QStringList& sl);
45
46 protected:
50 bool isRequiredProperty(const QString& name) override;
51
55 void applyReadOnly(bool yn) override;
56
57 private:
61 class Private;
62
63 Q_DISABLE_COPY(LayoutTabs)
64};
65
66}// namespace sf
QTabWidget::TabPosition tabPosition
Definition LayoutTabs.h:17
QStringList getTabsConfig() const
Gets the tabs configuration where each string in the list configures a tab.
void setTabsConfig(const QStringList &sl)
Sets the tabs configuration where each string in the list configures a tab.
QTabWidget::TabShape tabShape
Definition LayoutTabs.h:18
int currentIndex
Definition LayoutTabs.h:19
void applyReadOnly(bool yn) override
Overridden from base class 'sf::VariableWidgetBase'.
LayoutTabs(QWidget *parent=nullptr)
Constructor.
QStringList tabsConfig
Definition LayoutTabs.h:16
bool isRequiredProperty(const QString &name) override
Overridden from base class 'sf::ObjectExtension'.
VariableWidgetBase(QWidget *parent, QObject *self)
Constructor.
#define SF_DECL_PROP_GS(Type, Name)
Declares unreferenced getter and unreferenced setter for a property.
Definition misc/qt/Macros.h:8
Definition Application.h:10