Gui: remove all leftovers of iisTaskPanel
This commit is contained in:
@@ -4,7 +4,7 @@ add_subdirectory(PreferencePacks)
|
||||
add_subdirectory(PreferencePackTemplates)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DFCGui -DQIIS_MAKEDLL -DQSINT_MAKEDLL -DOVR_OS_WIN32 -DQUARTER_INTERNAL -DQUARTER_MAKE_DLL -DCOIN_DLL)
|
||||
add_definitions(-DFCGui -DQSINT_MAKEDLL -DOVR_OS_WIN32 -DQUARTER_INTERNAL -DQUARTER_MAKE_DLL -DCOIN_DLL)
|
||||
endif(WIN32)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE)
|
||||
@@ -1181,7 +1181,6 @@ SET(FreeCADGui_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
${FreeCADGui_CPP_SRCS}
|
||||
${FreeCADGui_XML_SRCS}
|
||||
${iis_MOC_SRCS}
|
||||
${qsint_MOC_SRCS}
|
||||
${Gui_QRC_SRCS}
|
||||
${Gui_UIC_HDRS}
|
||||
@@ -1196,7 +1195,6 @@ SET(FreeCADGui_SRCS
|
||||
${Language_SRCS}
|
||||
${Propertyeditor_SRCS}
|
||||
${Task_View_SRCS}
|
||||
${iisTaskPanel_SRCS}
|
||||
${qsintActionPanel_SRCS}
|
||||
${Resource_SRCS}
|
||||
${Quarter_SRCS}
|
||||
|
||||
@@ -42,11 +42,9 @@
|
||||
#include "TaskDialog.h"
|
||||
#include "TaskEditControl.h"
|
||||
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
#include <Gui/QSint/actionpanel/taskgroup_p.h>
|
||||
#include <Gui/QSint/actionpanel/taskheader_p.h>
|
||||
#include <Gui/QSint/actionpanel/freecadscheme.h>
|
||||
#endif
|
||||
|
||||
|
||||
using namespace Gui::TaskView;
|
||||
@@ -73,69 +71,6 @@ TaskWidget::~TaskWidget()
|
||||
// TaskGroup
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
TaskGroup::TaskGroup(QWidget *parent)
|
||||
: iisTaskGroup(parent, false)
|
||||
{
|
||||
setScheme(iisFreeCADTaskPanelScheme::defaultScheme());
|
||||
}
|
||||
|
||||
TaskGroup::~TaskGroup()
|
||||
{
|
||||
}
|
||||
|
||||
namespace Gui { namespace TaskView {
|
||||
class TaskIconLabel : public iisIconLabel {
|
||||
public:
|
||||
TaskIconLabel(const QIcon &icon,
|
||||
const QString &title,
|
||||
QWidget *parent = 0)
|
||||
: iisIconLabel(icon, title, parent) {
|
||||
// do not allow to get the focus because when hiding the task box
|
||||
// it could cause to activate another MDI view.
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
}
|
||||
void setTitle(const QString &text) {
|
||||
myText = text;
|
||||
update();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void TaskGroup::actionEvent (QActionEvent* e)
|
||||
{
|
||||
QAction *action = e->action();
|
||||
switch (e->type()) {
|
||||
case QEvent::ActionAdded:
|
||||
{
|
||||
TaskIconLabel *label = new TaskIconLabel(
|
||||
action->icon(), action->text(), this);
|
||||
this->addIconLabel(label);
|
||||
connect(label,SIGNAL(clicked()),action,SIGNAL(triggered()),Qt::QueuedConnection);
|
||||
break;
|
||||
}
|
||||
case QEvent::ActionChanged:
|
||||
{
|
||||
// update label when action changes
|
||||
QBoxLayout* bl = this->groupLayout();
|
||||
int index = this->actions().indexOf(action);
|
||||
if (index < 0) break;
|
||||
QWidgetItem* item = static_cast<QWidgetItem*>(bl->itemAt(index));
|
||||
TaskIconLabel* label = static_cast<TaskIconLabel*>(item->widget());
|
||||
label->setTitle(action->text());
|
||||
break;
|
||||
}
|
||||
case QEvent::ActionRemoved:
|
||||
{
|
||||
// cannot change anything
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
TaskGroup::TaskGroup(QWidget *parent)
|
||||
: QSint::ActionBox(parent)
|
||||
{
|
||||
@@ -177,19 +112,12 @@ void TaskGroup::actionEvent (QActionEvent* e)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// TaskBox
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
TaskBox::TaskBox(const QPixmap &icon, const QString &title, bool expandable, QWidget *parent)
|
||||
: iisTaskBox(icon, title, expandable, parent), wasShown(false)
|
||||
{
|
||||
setScheme(iisFreeCADTaskPanelScheme::defaultScheme());
|
||||
}
|
||||
#else
|
||||
TaskBox::TaskBox(QWidget *parent)
|
||||
: QSint::ActionGroup(parent), wasShown(false)
|
||||
{
|
||||
@@ -228,7 +156,6 @@ QSize TaskBox::minimumSizeHint() const
|
||||
QSize s2 = QWidget::minimumSizeHint();
|
||||
return QSize(qMax(s1.width(), s2.width()), qMax(s1.height(), s2.height()));
|
||||
}
|
||||
#endif
|
||||
|
||||
TaskBox::~TaskBox()
|
||||
{
|
||||
@@ -292,28 +219,12 @@ void TaskBox::actionEvent (QActionEvent* e)
|
||||
switch (e->type()) {
|
||||
case QEvent::ActionAdded:
|
||||
{
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
TaskIconLabel *label = new TaskIconLabel(
|
||||
action->icon(), action->text(), this);
|
||||
this->addIconLabel(label);
|
||||
connect(label,SIGNAL(clicked()),action,SIGNAL(triggered()));
|
||||
#else
|
||||
QSint::ActionLabel *label = new QSint::ActionLabel(action, this);
|
||||
this->addActionLabel(label, true, false);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case QEvent::ActionChanged:
|
||||
{
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
// update label when action changes
|
||||
QBoxLayout* bl = myGroup->groupLayout();
|
||||
int index = this->actions().indexOf(action);
|
||||
if (index < 0) break;
|
||||
QWidgetItem* item = static_cast<QWidgetItem*>(bl->itemAt(index));
|
||||
TaskIconLabel* label = static_cast<TaskIconLabel*>(item->widget());
|
||||
label->setTitle(action->text());
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case QEvent::ActionRemoved:
|
||||
@@ -331,7 +242,6 @@ void TaskBox::actionEvent (QActionEvent* e)
|
||||
// TaskPanel
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
TaskPanel::TaskPanel(QWidget *parent)
|
||||
: QSint::ActionPanel(parent)
|
||||
{
|
||||
@@ -355,7 +265,7 @@ QSize TaskPanel::minimumSizeHint() const
|
||||
QSize s2 = QWidget::minimumSizeHint();
|
||||
return QSize(qMax(s1.width(), s2.width()), qMax(s1.height(), s2.height()));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
@@ -368,10 +278,6 @@ TaskView::TaskView(QWidget *parent)
|
||||
//addWidget(new TaskEditControl(this));
|
||||
//addWidget(new TaskAppearance(this));
|
||||
//addStretch();
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
taskPanel = new iisTaskPanel(this);
|
||||
taskPanel->setScheme(iisFreeCADTaskPanelScheme::defaultScheme());
|
||||
#else
|
||||
taskPanel = new TaskPanel(this);
|
||||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
sizePolicy.setHorizontalStretch(0);
|
||||
@@ -379,7 +285,7 @@ TaskView::TaskView(QWidget *parent)
|
||||
sizePolicy.setHeightForWidth(taskPanel->sizePolicy().hasHeightForWidth());
|
||||
taskPanel->setSizePolicy(sizePolicy);
|
||||
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||
#endif
|
||||
|
||||
this->setWidget(taskPanel);
|
||||
setWidgetResizable(true);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@@ -604,9 +510,7 @@ void TaskView::showDialog(TaskDialog *dlg)
|
||||
taskPanel->addWidget(ActiveCtrl);
|
||||
}
|
||||
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||
#endif
|
||||
|
||||
if (!dlg->needsFullSpace())
|
||||
taskPanel->addStretch();
|
||||
@@ -726,7 +630,6 @@ void TaskView::addTaskWatcher(void)
|
||||
taskPanel->addStretch();
|
||||
updateWatcher();
|
||||
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
||||
// Workaround to avoid a crash in Qt. See also
|
||||
// https://forum.freecadweb.org/viewtopic.php?f=8&t=39187
|
||||
@@ -741,7 +644,6 @@ void TaskView::addTaskWatcher(void)
|
||||
#endif
|
||||
|
||||
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||
#endif
|
||||
}
|
||||
|
||||
void TaskView::removeTaskWatcher(void)
|
||||
@@ -819,18 +721,14 @@ void TaskView::clicked (QAbstractButton * button)
|
||||
|
||||
void TaskView::clearActionStyle()
|
||||
{
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
static_cast<QSint::FreeCADPanelScheme*>(QSint::FreeCADPanelScheme::defaultScheme())->clearActionStyle();
|
||||
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||
#endif
|
||||
}
|
||||
|
||||
void TaskView::restoreActionStyle()
|
||||
{
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
static_cast<QSint::FreeCADPanelScheme*>(QSint::FreeCADPanelScheme::defaultScheme())->restoreActionStyle();
|
||||
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,16 +24,10 @@
|
||||
#ifndef GUI_TASKVIEW_TASKVIEW_H
|
||||
#define GUI_TASKVIEW_TASKVIEW_H
|
||||
|
||||
#define QSINT_ACTIONPANEL
|
||||
|
||||
#include <vector>
|
||||
#include <QScrollArea>
|
||||
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
#include <Gui/iisTaskPanel/include/iisTaskPanel>
|
||||
#else
|
||||
#include <Gui/QSint/include/QSint>
|
||||
#endif
|
||||
#include <Gui/Selection.h>
|
||||
#include "TaskWatcher.h"
|
||||
|
||||
@@ -62,19 +56,6 @@ public:
|
||||
//~TaskContent();
|
||||
};
|
||||
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
class GuiExport TaskGroup : public iisTaskGroup, public TaskContent
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskGroup(QWidget *parent = 0);
|
||||
~TaskGroup();
|
||||
|
||||
protected:
|
||||
void actionEvent (QActionEvent*);
|
||||
};
|
||||
#else
|
||||
class GuiExport TaskGroup : public QSint::ActionBox, public TaskContent
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -88,21 +69,13 @@ public:
|
||||
protected:
|
||||
void actionEvent (QActionEvent*);
|
||||
};
|
||||
#endif
|
||||
|
||||
/// Father class of content with header and Icon
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
class GuiExport TaskBox : public iisTaskBox, public TaskContent
|
||||
#else
|
||||
class GuiExport TaskBox : public QSint::ActionGroup, public TaskContent
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
TaskBox(const QPixmap &icon, const QString &title, bool expandable, QWidget *parent);
|
||||
#else
|
||||
/** Constructor. Creates TaskBox without header.
|
||||
*/
|
||||
explicit TaskBox(QWidget *parent = 0);
|
||||
@@ -126,7 +99,7 @@ public:
|
||||
bool expandable = true,
|
||||
QWidget *parent = 0);
|
||||
virtual QSize minimumSizeHint() const;
|
||||
#endif
|
||||
|
||||
~TaskBox();
|
||||
void hideGroupBox();
|
||||
bool isGroupVisible() const;
|
||||
@@ -139,7 +112,6 @@ private:
|
||||
bool wasShown;
|
||||
};
|
||||
|
||||
#if defined (QSINT_ACTIONPANEL)
|
||||
class GuiExport TaskPanel : public QSint::ActionPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -149,7 +121,6 @@ public:
|
||||
virtual ~TaskPanel();
|
||||
virtual QSize minimumSizeHint() const;
|
||||
};
|
||||
#endif
|
||||
|
||||
/// Father class of content of a Free widget (without header and Icon), shut be an exception!
|
||||
class GuiExport TaskWidget : public QWidget, public TaskContent
|
||||
@@ -213,11 +184,7 @@ protected:
|
||||
|
||||
std::vector<TaskWatcher*> ActiveWatcher;
|
||||
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
iisTaskPanel* taskPanel;
|
||||
#else
|
||||
QSint::ActionPanel* taskPanel;
|
||||
#endif
|
||||
TaskDialog *ActiveDialog;
|
||||
TaskEditControl *ActiveCtrl;
|
||||
|
||||
|
||||
@@ -150,11 +150,7 @@ TaskSmoothing::TaskSmoothing()
|
||||
selection = new Selection();
|
||||
selection->setObjects(Gui::Selection().getSelectionEx(nullptr, Mesh::Feature::getClassTypeId()));
|
||||
Gui::Selection().clearSelection();
|
||||
#if !defined (QSINT_ACTIONPANEL)
|
||||
Gui::TaskView::TaskGroup* tasksel = new Gui::TaskView::TaskGroup();
|
||||
#else
|
||||
Gui::TaskView::TaskBox* tasksel = new Gui::TaskView::TaskBox();
|
||||
#endif
|
||||
tasksel->groupLayout()->addWidget(selection);
|
||||
tasksel->hide();
|
||||
Content.push_back(tasksel);
|
||||
|
||||
Reference in New Issue
Block a user