QtCanpool 3.3.0
载入中...
搜索中...
未找到
qxnavigationbar.h
浏览该文件的文档.
1
5#ifndef QXNAVIGATIONBAR_H
6#define QXNAVIGATIONBAR_H
7
8#include "qxapp_global.h"
9
10#include <QtCore/QSize>
11#include <QtGui/QIcon>
12#include <QtWidgets/QWidget>
13
14QT_BEGIN_NAMESPACE
15class QButtonGroup;
16class QToolButton;
17class QVBoxLayout;
18QT_END_NAMESPACE
19
21
22class QxNavigationBarPrivate;
23
36class QX_APP_EXPORT QxNavigationBar : public QWidget
37{
38 Q_OBJECT
39 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
40 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
41public:
42 explicit QxNavigationBar(QWidget *parent = Q_NULLPTR);
43 ~QxNavigationBar() override;
44
46 int addItem(const QIcon &icon, const QString &text);
48 void insertItem(int index, const QIcon &icon, const QString &text);
50 void removeItem(int index);
52 void clear();
53
55 int count() const;
57 int currentIndex() const;
58 QString itemText(int index) const;
59 QIcon itemIcon(int index) const;
60 bool isItemEnabled(int index) const;
61
63 QSize iconSize() const;
64
69 QToolButton *button(int index) const;
70
71public Q_SLOTS:
73 void setCurrentIndex(int index);
74 void setItemText(int index, const QString &text);
75 void setItemIcon(int index, const QIcon &icon);
76 void setItemEnabled(int index, bool enabled);
77 void setItemToolTip(int index, const QString &toolTip);
78 void setIconSize(const QSize &size);
79
80Q_SIGNALS:
87 void currentChanged(int index);
88private:
89 Q_DISABLE_COPY(QxNavigationBar)
91};
92
94
95#endif // QXNAVIGATIONBAR_H
A vertical rail of exclusive, checkable entries.
void currentChanged(int index)
Emitted when the selection moves: on a click, on an explicit setCurrentIndex(), and also when an entr...
#define QX_APP_END_NAMESPACE
#define QX_APP_EXPORT
#define QX_DECLARE_PRIVATE(Class)
#define Q_NULLPTR
Copyleft (C) 2025 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
#define QX_APP_BEGIN_NAMESPACE
bool enabled
Definition qxlogger.cpp:27
QColor text
QColor button