Commit 1fc151a6 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Add support for QToolBar plugin.

Adding ability to provide QToolBar subclasses via plugins. Updated
GUIToolBar example to use this new mechanism to add toolbars to ParaView
UI. This provides an alternative to adding toolbar via QActionGroups.
parent 113854a7
......@@ -421,7 +421,7 @@ anymore.")
ENDMACRO()
#------------------------------------------------------------------------
# create implementation for a custom menu or toolbar
# create implementation for a custom menu or a toolbar from an QActionGroup.
# ADD_PARAVIEW_ACTION_GROUP(
# OUTIFACES
# OUTSRCS
......@@ -451,6 +451,31 @@ MACRO(ADD_PARAVIEW_ACTION_GROUP OUTIFACES OUTSRCS)
)
ENDMACRO()
# Add a custom toolbar to the application.
# ADD_PARAVIEW_TOOLBAR(
# OUTIFACES
# OUTSRCS
# CLASS_NAME classname)
#
# CLASS_NAME QToolBar subclass that corresponds to the custom toolbar.
function(ADD_PARAVIEW_TOOLBAR OUTIFACES OUTSRCS)
pv_plugin_parse_arguments(ARG "CLASS_NAME;GROUP_NAME" "" ${ARGN} )
set(${OUTIFACES} ${ARG_CLASS_NAME} PARENT_SCOPE)
configure_file(${ParaView_CMAKE_DIR}/pqToolBarImplementation.h.in
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h @ONLY)
configure_file(${ParaView_CMAKE_DIR}/pqToolBarImplementation.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.cxx @ONLY)
set(ACTION_MOC_SRCS)
qt5_wrap_cpp(ACTION_MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h)
set(${OUTSRCS}
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.cxx
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h
${ACTION_MOC_SRCS}
PARENT_SCOPE
)
endfunction()
# create implementation for a custom view frame action interface
# ADD_PARAVIEW_VIEW_FRAME_ACTION_GROUP(
# OUTIFACES
......
// Generated file. Do not edit.
/*=========================================================================
Program: ParaView
Module: pqToolBarImplementation.cxx.in
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "@ARG_CLASS_NAME@.h"
#include "@ARG_CLASS_NAME@Implementation.h"
@ARG_CLASS_NAME@Implementation::@ARG_CLASS_NAME@Implementation(QObject* p)
: QObject(p)
{
}
@ARG_CLASS_NAME@Implementation::~@ARG_CLASS_NAME@Implementation()
{
}
QToolBar* @ARG_CLASS_NAME@Implementation::toolBar(QWidget* parentWdg)
{
return new @ARG_CLASS_NAME@(parentWdg);
}
// Generated file. Do not edit.
/*=========================================================================
Program: ParaView
Module: pqToolBarImplementation.h.
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _@ARG_CLASS_NAME@Implementation_h
#define _@ARG_CLASS_NAME@Implementation_h
#include "pqToolBarInterface.h"
#include <QObject>
/// interface class for plugins that create QActionGroups
/// for adding actions to menus and toolbars
class @ARG_CLASS_NAME@Implementation : public QObject, public pqToolBarInterface
{
Q_OBJECT
Q_INTERFACES(pqToolBarInterface)
public:
@ARG_CLASS_NAME@Implementation(QObject* p);
~@ARG_CLASS_NAME@Implementation() override;
QToolBar* toolBar(QWidget* parent) override;
private:
Q_DISABLE_COPY(@ARG_CLASS_NAME@Implementation);
};
#endif
# Adding QToolBar via plugins
ParaView now supports add a QToolBar subclass via the plugin mechanism. In the past, one had to add
actions to a toolbar via a QActionGroup. Now, directly adding a QToolBar is a supported by using
`add_paraview_toolbar` CMake function.
......@@ -16,14 +16,23 @@ if(NOT DEFINED CMAKE_MACOSX_RPATH)
endif()
IF(PARAVIEW_BUILD_QT_GUI)
QT5_WRAP_CPP(MOC_SRCS MyToolBarActions.h)
QT5_WRAP_CPP(MOC_SRCS MyToolBarActions.h MyToolBar.h)
# we implement a pqConePanel.h for the ConeSource
ADD_PARAVIEW_ACTION_GROUP(IFACES IFACE_SRCS CLASS_NAME MyToolBarActions
GROUP_NAME "ToolBar/MyActions")
# another way of adding a toolbar is to simpy add a new QToolBar subclass.
ADD_PARAVIEW_TOOLBAR(IFACES_2 IFACE_SRCS_2 CLASS_NAME MyToolBar)
# create a plugin for this panel
ADD_PARAVIEW_PLUGIN(GUIMyToolBar "1.0"
GUI_INTERFACES ${IFACES}
SOURCES MyToolBarActions.cxx ${MOC_SRCS} ${IFACE_SRCS})
ADD_PARAVIEW_PLUGIN(
GUIMyToolBar "1.0"
GUI_INTERFACES ${IFACES} ${IFACES_2}
SOURCES MyToolBarActions.cxx
MyToolBar.cxx
${MOC_SRCS} ${IFACE_SRCS} ${IFACE_SRCS_2}
)
ENDIF()
#include "MyToolBar.h"
#include <QApplication>
#include <QLabel>
#include <QMessageBox>
#include <QStyle>
MyToolBar::MyToolBar(const QString& title, QWidget* parentW)
: Superclass(title, parentW)
{
this->constructor();
}
MyToolBar::MyToolBar(QWidget* parentW)
: Superclass(parentW)
{
this->setWindowTitle("My Toolbar (Examples)");
this->constructor();
}
MyToolBar::~MyToolBar()
{
}
void MyToolBar::constructor()
{
this->addWidget(new QLabel("Custom Toolbar", this));
this->addAction(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation), "My Action",
[]() { QMessageBox::information(NULL, "MyAction", "MyAction was invoked\n"); });
}
#include <QToolBar>
class MyToolBar : public QToolBar
{
Q_OBJECT;
using Superclass = QToolBar;
public:
MyToolBar(const QString& title, QWidget* parent = nullptr);
MyToolBar(QWidget* parent = nullptr);
~MyToolBar() override;
private:
Q_DISABLE_COPY(MyToolBar);
void constructor();
};
......@@ -10,7 +10,6 @@ MyToolBarActions::MyToolBarActions(QObject* p)
: QActionGroup(p)
{
QIcon icon = qApp->style()->standardIcon(QStyle::SP_MessageBoxCritical);
QAction* a = this->addAction(new QAction(icon, "MyAction", this));
QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(onAction()));
}
......
......@@ -228,6 +228,8 @@ set (Module_SRCS
pqPluginDockWidgetsBehavior.h
pqPluginSettingsBehavior.cxx
pqPluginSettingsBehavior.h
pqPluginToolBarBehavior.cxx
pqPluginToolBarBehavior.h
pqPointPickingHelper.cxx
pqPointPickingHelper.h
pqPreviewMenuManager.cxx
......@@ -427,6 +429,7 @@ set (Module_MOC_HDRS
pqPluginActionGroupBehavior.h
pqPluginDockWidgetsBehavior.h
pqPluginSettingsBehavior.h
pqPluginToolBarBehavior.h
pqPointPickingHelper.h
pqPreviewMenuManager.h
pqPropertyGroupButton.h
......
......@@ -51,6 +51,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqPluginActionGroupBehavior.h"
#include "pqPluginDockWidgetsBehavior.h"
#include "pqPluginSettingsBehavior.h"
#include "pqPluginToolBarBehavior.h"
#include "pqPropertiesPanel.h"
#include "pqServerManagerModel.h"
#include "pqSpreadSheetVisibilityBehavior.h"
......@@ -86,6 +87,7 @@ PQ_BEHAVIOR_DEFINE_FLAG(AutoLoadPluginXMLBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PluginDockWidgetsBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(VerifyRequiredPluginBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PluginActionGroupBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PluginToolBarBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(CommandLineOptionsBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PersistentMainWindowStateBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(CollaborationBehavior, true);
......@@ -177,6 +179,10 @@ pqParaViewBehaviors::pqParaViewBehaviors(QMainWindow* mainWindow, QObject* paren
{
new pqPluginActionGroupBehavior(mainWindow);
}
if (PQ_IS_BEHAVIOR_ENABLED(PluginToolBarBehavior))
{
new pqPluginToolBarBehavior(mainWindow);
}
if (PQ_IS_BEHAVIOR_ENABLED(CommandLineOptionsBehavior))
{
new pqCommandLineOptionsBehavior(this);
......
......@@ -96,6 +96,7 @@ public:
PQ_BEHAVIOR_DEFINE_METHODS(PluginDockWidgetsBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(VerifyRequiredPluginBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(PluginActionGroupBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(PluginToolBarBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(CommandLineOptionsBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(PersistentMainWindowStateBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(CollaborationBehavior);
......@@ -127,6 +128,7 @@ private:
PQ_BEHAVIOR_DECLARE_FLAG(PluginDockWidgetsBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(VerifyRequiredPluginBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(PluginActionGroupBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(PluginToolBarBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(CommandLineOptionsBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(PersistentMainWindowStateBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(CollaborationBehavior);
......
/*=========================================================================
Program: ParaView
Module: pqPluginToolBarBehavior.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include "pqPluginToolBarBehavior.h"
#include "pqApplicationCore.h"
#include "pqInterfaceTracker.h"
#include "pqToolBarInterface.h"
#include <QMainWindow>
#include <QToolBar>
//-----------------------------------------------------------------------------
pqPluginToolBarBehavior::pqPluginToolBarBehavior(QMainWindow* parentObject)
: Superclass(parentObject)
{
pqInterfaceTracker* tracker = pqApplicationCore::instance()->interfaceTracker();
this->connect(tracker, SIGNAL(interfaceRegistered(QObject*)), SLOT(addPluginInterface(QObject*)));
// handle any already loaded plugins.
foreach (QObject* iface, tracker->interfaces())
{
this->addPluginInterface(iface);
}
}
//-----------------------------------------------------------------------------
pqPluginToolBarBehavior::~pqPluginToolBarBehavior()
{
}
//-----------------------------------------------------------------------------
void pqPluginToolBarBehavior::addPluginInterface(QObject* iface)
{
if (pqToolBarInterface* tbi = qobject_cast<pqToolBarInterface*>(iface))
{
QMainWindow* mainWindow = qobject_cast<QMainWindow*>(this->parent());
if (!mainWindow)
{
qWarning("Could not find MainWindow. Cannot load actions from the plugin.");
}
else if (QToolBar* tb = tbi->toolBar(mainWindow))
{
mainWindow->addToolBar(tb);
}
}
}
/*=========================================================================
Program: ParaView
Module: pqPluginToolBarBehavior.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#ifndef pqPluginToolBarBehavior_h
#define pqPluginToolBarBehavior_h
#include "pqApplicationComponentsModule.h"
#include <QObject>
/**
* @class pqPluginToolBarBehavior
* @ingroup Behaviors
* @brief Behavior that monitors loaded plugins to handle any implementations of
* pqToolBarInterface.
*
* pqPluginToolBarBehavior monitors loaded plugins to handle implementations of
* pqToolBarInterface. If any found, this will execute the appropriate calls to
* create and add the toolbar to the UI.
*
* Plugins that add toolbars generally use `add_paraview_toolbar` macro in their
* CMake code.
*/
class QMainWindow;
class PQAPPLICATIONCOMPONENTS_EXPORT pqPluginToolBarBehavior : public QObject
{
Q_OBJECT
typedef QObject Superclass;
public:
pqPluginToolBarBehavior(QMainWindow* parent = nullptr);
virtual ~pqPluginToolBarBehavior();
public slots:
void addPluginInterface(QObject* iface);
private:
Q_DISABLE_COPY(pqPluginToolBarBehavior)
};
#endif
......@@ -288,6 +288,8 @@ set (Module_SRCS
pqTextureSelectorPropertyWidget.h
pqTimerLogDisplay.cxx
pqTimerLogDisplay.h
pqToolBarInterface.cxx
pqToolBarInterface.h
pqToolTipTrapper.cxx
pqToolTipTrapper.h
pqTransferFunctionWidget.cxx
......@@ -439,6 +441,7 @@ set (Module_MOC_HDRS
pqTextureComboBox.h
pqTextureSelectorPropertyWidget.h
pqTimerLogDisplay.h
pqToolBarInterface.h
pqToolTipTrapper.h
pqTransferFunctionWidget.h
pqTriggerOnIdleHelper.h
......
/*=========================================================================
Program: ParaView
Module: pqToolBarInterface.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include "pqToolBarInterface.h"
//-----------------------------------------------------------------------------
pqToolBarInterface::pqToolBarInterface()
{
}
//-----------------------------------------------------------------------------
pqToolBarInterface::~pqToolBarInterface()
{
}
/*=========================================================================
Program: ParaView
Module: pqToolBarInterface.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#ifndef pqToolBarInterface_h
#define pqToolBarInterface_h
#include "pqComponentsModule.h"
#include <QObject>
/**
* @class pqToolBarInterface
* @brief Interface class for plugins that add a QToolBar to the main window.
*
* pqToolBarInterface is the interface which plugins adding a QToolBar to the
* main window should implement. One would typically use `add_paraview_toolbar`
* CMake macro for the same.
*/
class QToolBar;
class PQCOMPONENTS_EXPORT pqToolBarInterface
{
public:
pqToolBarInterface();
virtual ~pqToolBarInterface();
virtual QToolBar* toolBar(QWidget* parentWidget) = 0;
private:
Q_DISABLE_COPY(pqToolBarInterface)
};
Q_DECLARE_INTERFACE(pqToolBarInterface, "com.kitware/paraview/toolbar")
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment