15#ifndef QDESIGNER_TABWIDGET_H
16#define QDESIGNER_TABWIDGET_H
22#include <QtCore/qhash.h>
23#include <QtCore/qpointer.h>
24#include <QtGui/qicon.h>
28class QDesignerFormWindowInterface;
35 class PromotionTaskMenu;
42 explicit QTabWidgetEventFilter(QTabWidget *parent);
43 ~QTabWidgetEventFilter();
46 static void install(QTabWidget *tabWidget);
47 static QTabWidgetEventFilter *eventFilterOf(
const QTabWidget *tabWidget);
49 static QMenu *addTabWidgetContextMenuActions(
const QTabWidget *tabWidget, QMenu *popup);
52 QMenu *addContextMenuActions(QMenu *popup);
54 bool eventFilter(QObject *o, QEvent *e) override;
56 QDesignerFormWindowInterface *formWindow()
const;
59 void removeCurrentPage();
64 int pageFromPosition(
const QPoint &pos, QRect &rect)
const;
65 QTabBar *tabBar()
const;
67 QTabWidget *m_tabWidget;
68 mutable QPointer<QTabBar> m_cachedTabBar;
70 QWidget *m_dropIndicator =
nullptr;
72 QWidget *m_dragPage =
nullptr;
75 bool m_mousePressed =
false;
76 QAction *m_actionDeletePage;
77 QAction *m_actionInsertPage;
78 QAction *m_actionInsertPageAfter;
79 qdesigner_internal::PromotionTaskMenu* m_pagePromotionTaskMenu;
85 explicit QTabWidgetPropertySheet(QTabWidget *object, QObject *parent =
nullptr);
87 void setProperty(
int index,
const QVariant &value) override;
88 QVariant property(
int index)
const override;
89 bool reset(
int index) override;
90 bool isEnabled(
int index)
const override;
94 static bool checkProperty(
const QString &propertyName);
97 enum TabWidgetProperty { PropertyCurrentTabText, PropertyCurrentTabName, PropertyCurrentTabIcon,
98 PropertyCurrentTabToolTip, PropertyCurrentTabWhatsThis, PropertyTabWidgetNone };
100 static TabWidgetProperty tabWidgetPropertyFromName(
const QString &name);
101 QTabWidget *m_tabWidget;
104 qdesigner_internal::PropertySheetStringValue text;
105 qdesigner_internal::PropertySheetStringValue tooltip;
106 qdesigner_internal::PropertySheetStringValue whatsthis;
107 qdesigner_internal::PropertySheetIconValue icon;
109 QHash<QWidget *, PageData> m_pageToData;
112using QTabWidgetPropertySheetFactory = QDesignerPropertySheetFactory<QTabWidget, QTabWidgetPropertySheet>;
virtual bool dynamicPropertiesAllowed() const =0
virtual bool isDynamicProperty(int index) const =0
virtual int addDynamicProperty(const QString &propertyName, const QVariant &value)=0
virtual bool canAddDynamicProperty(const QString &propertyName) const =0
virtual bool removeDynamicProperty(int index)=0
virtual ~QDesignerDynamicPropertySheetExtension()=default
QDesignerPropertySheetFactory(QExtensionManager *parent=nullptr)
static void registerExtension(QExtensionManager *mgr)
FormEditorOptionsPage(QDesignerFormEditorInterface *core)
QString name() const override
QWidget * createPage(QWidget *parent) override
bool reset(int index) override
~LayoutPropertySheet() override
void setProperty(int index, const QVariant &value) override
static void markChangedStretchProperties(QDesignerFormEditorInterface *core, QLayout *lt, const DomLayout *domLayout)
static void stretchAttributesToDom(QDesignerFormEditorInterface *core, QLayout *lt, DomLayout *domLayout)
void setChanged(int index, bool changed) override
QVariant property(int index) const override
QString propertyGroup(int index) const override
~LinePropertySheet() override
bool isVisible(int index) const override
void setProperty(int index, const QVariant &value) override
void remove(int index) override
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void addWidget(QWidget *widget) override
int count() const override
bool canAddWidget() const override
int currentIndex() const override
bool canRemove(int) const override
void setCurrentIndex(int index) override
bool canRemove(int) const override
void addWidget(QWidget *widget) override
bool canAddWidget() const override
int count() const override
void remove(int index) override
static void positionNewMdiChild(const QWidget *area, QWidget *mdiChild)
int currentIndex() const override
QWidget * widget(int index) const override
void insertWidget(int index, QWidget *widget) override
void setCurrentIndex(int index) override
bool isChanged(int index) const override
void setProperty(int index, const QVariant &value) override
static bool checkProperty(const QString &propertyName)
bool isEnabled(int index) const override
bool reset(int index) override
QVariant property(int index) const override
int currentIndex() const override
void addWidget(QWidget *widget) override
int count() const override
QWidget * widget(int index) const override
void remove(int index) override
bool canRemove(int) const override
bool canAddWidget() const override
void insertWidget(int index, QWidget *widget) override
void setCurrentIndex(int index) override
static const char * pageIdProperty
bool reset(int index) override
bool isVisible(int index) const override
void setProperty(int index, const QVariant &value) override
~SpacerPropertySheet() override
bool dynamicPropertiesAllowed() const override
bool isVisible(int index) const override
QString name() const override
QWidget * createPage(QWidget *parent) override
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QDESIGNER_SHARED_EXPORT