mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 07:21:32 +08:00
Use QT_VERSION_CHECK macro for better compatibility.
This commit is contained in:
parent
14a80f1753
commit
fffc84374a
@ -6,7 +6,7 @@
|
||||
|
||||
#include "ads/API.h"
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
#else
|
||||
#include "ads/SectionContent.h"
|
||||
#endif
|
||||
|
@ -99,7 +99,7 @@ SectionWidget* ContainerWidget::addSectionContent(const SectionContent::RefPtr&
|
||||
data.titleWidget = new SectionTitleWidget(sc, NULL);
|
||||
data.contentWidget = new SectionContentWidget(sc, NULL);
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(data.titleWidget, &SectionTitleWidget::activeTabChanged, this, &ContainerWidget::onActiveTabChanged);
|
||||
#else
|
||||
QObject::connect(data.titleWidget, SIGNAL(activeTabChanged()), this, SLOT(onActiveTabChanged()));
|
||||
@ -308,7 +308,7 @@ QMenu* ContainerWidget::createContextMenu() const
|
||||
a->setProperty("type", "section");
|
||||
a->setCheckable(true);
|
||||
a->setChecked(true);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(a, &QAction::toggled, this, &ContainerWidget::onActionToggleSectionContentVisibility);
|
||||
#else
|
||||
QObject::connect(a, SIGNAL(toggled(bool)), this, SLOT(onActionToggleSectionContentVisibility(bool)));
|
||||
@ -330,7 +330,7 @@ QMenu* ContainerWidget::createContextMenu() const
|
||||
a->setProperty("type", "section");
|
||||
a->setCheckable(true);
|
||||
a->setChecked(false);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(a, &QAction::toggled, this, &ContainerWidget::onActionToggleSectionContentVisibility);
|
||||
#else
|
||||
QObject::connect(a, SIGNAL(toggled(bool)), this, SLOT(onActionToggleSectionContentVisibility(bool)));
|
||||
@ -350,7 +350,7 @@ QMenu* ContainerWidget::createContextMenu() const
|
||||
a->setProperty("type", "floating");
|
||||
a->setCheckable(true);
|
||||
a->setChecked(fw->isVisible());
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(a, &QAction::toggled, this, &ContainerWidget::onActionToggleSectionContentVisibility);
|
||||
#else
|
||||
QObject::connect(a, SIGNAL(toggled(bool)), this, SLOT(onActionToggleSectionContentVisibility(bool)));
|
||||
|
@ -286,7 +286,7 @@ void hideDropOverlay()
|
||||
{
|
||||
MyOverlay->hide();
|
||||
delete MyOverlay;
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
MyOverlayParent.clear();
|
||||
#else
|
||||
MyOverlayParent = 0;
|
||||
|
@ -90,7 +90,7 @@ void SectionTitleWidget::mouseReleaseEvent(QMouseEvent* ev)
|
||||
InternalContentData data;
|
||||
_fw->takeContent(data);
|
||||
_fw->deleteLater();
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
_fw.clear();
|
||||
#else
|
||||
_fw = 0;
|
||||
@ -140,7 +140,7 @@ void SectionTitleWidget::mouseReleaseEvent(QMouseEvent* ev)
|
||||
InternalContentData data;
|
||||
_fw->takeContent(data);
|
||||
_fw->deleteLater();
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
_fw.clear();
|
||||
#else
|
||||
_fw = 0;
|
||||
|
@ -55,7 +55,7 @@ SectionWidget::SectionWidget(ContainerWidget* parent) :
|
||||
closeButton->setToolTip(tr("Close"));
|
||||
closeButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
_tabsLayout->addWidget(closeButton);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(closeButton, &QPushButton::clicked, this, &SectionWidget::onCloseButtonClicked);
|
||||
#else
|
||||
QObject::connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(onCloseButtonClicked()));
|
||||
@ -119,7 +119,7 @@ void SectionWidget::addContent(const SectionContent::RefPtr& c)
|
||||
SectionTitleWidget* title = new SectionTitleWidget(c, NULL);
|
||||
_sectionTitles.append(title);
|
||||
_tabsLayout->insertWidget(_tabsLayout->count() - 2, title);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(title, &SectionTitleWidget::clicked, this, &SectionWidget::onSectionTitleClicked);
|
||||
#else
|
||||
QObject::connect(title, SIGNAL(clicked()), this, SLOT(onSectionTitleClicked()));
|
||||
@ -146,7 +146,7 @@ void SectionWidget::addContent(const InternalContentData& data, bool autoActivat
|
||||
_sectionTitles.append(data.titleWidget);
|
||||
_tabsLayout->insertWidget(_tabsLayout->count() - 2, data.titleWidget);
|
||||
data.titleWidget->setVisible(true);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(data.titleWidget, &SectionTitleWidget::clicked, this, &SectionWidget::onSectionTitleClicked);
|
||||
#else
|
||||
QObject::connect(data.titleWidget, SIGNAL(clicked()), this, SLOT(onSectionTitleClicked()));
|
||||
@ -257,7 +257,7 @@ void SectionWidget::moveContent(int from, int to)
|
||||
QLayoutItem* liFrom = NULL;
|
||||
|
||||
liFrom = _tabsLayout->takeAt(from);
|
||||
#if QT_VERSION >= 0x050000
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
_tabsLayout->insertItem(to, liFrom);
|
||||
#else
|
||||
_tabsLayout->insertWidget(to, liFrom->widget());
|
||||
|
Loading…
Reference in New Issue
Block a user