2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef TABBAR_H
|
|
|
|
#define TABBAR_H
|
|
|
|
|
|
|
|
#include "tcommon.h"
|
|
|
|
#include <QTabBar>
|
|
|
|
|
|
|
|
#undef DVAPI
|
|
|
|
#undef DVVAR
|
|
|
|
#ifdef TOONZQT_EXPORTS
|
|
|
|
#define DVAPI DV_EXPORT_API
|
|
|
|
#define DVVAR DV_EXPORT_VAR
|
|
|
|
#else
|
|
|
|
#define DVAPI DV_IMPORT_API
|
|
|
|
#define DVVAR DV_IMPORT_VAR
|
|
|
|
#endif
|
|
|
|
|
2017-05-09 00:13:29 +12:00
|
|
|
#ifdef _MSC_VER
|
2016-03-19 06:57:51 +13:00
|
|
|
#pragma warning(disable : 4251)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
namespace DVGui {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*! \brief The TabBar class allows to show a tabar with icon in tab.
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
Inherits \b QTabar.
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
This object, more than \b QTabBar, allows to show icon in tab
|
|
|
|
using \b addIconTab(),
|
|
|
|
it's anyhow possible add text tab using \b addSimpleTab().
|
2016-03-19 06:57:51 +13:00
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
class DVAPI TabBar final : public QTabBar {
|
2016-06-15 18:43:10 +12:00
|
|
|
Q_OBJECT
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
std::vector<QPixmap> m_pixmaps;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TabBar(QWidget *parent = 0);
|
|
|
|
~TabBar();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void addIconTab(const char *iconPrefixName, const QString &tooltip);
|
|
|
|
void addSimpleTab(const QString &text);
|
|
|
|
void clearTabBar();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
void paintEvent(QPaintEvent *event);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2016-06-15 18:43:10 +12:00
|
|
|
} // namespace DVGui
|
2016-03-19 06:57:51 +13:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
#endif // TABBAR_H
|