Skip to content

Commit

Permalink
Sheet: Make ViewProviderSpreadsheet.h self-contained
Browse files Browse the repository at this point in the history
and fix a few minor issues
  • Loading branch information
wwmayer committed May 22, 2024
1 parent 5808387 commit ab171f0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include "DlgSettingsImp.h"
#include "SheetTableViewAccessibleInterface.h"
#include "SpreadsheetView.h"
#include "ViewProviderSpreadsheet.h"
#include "Workbench.h"

Expand Down
33 changes: 23 additions & 10 deletions src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <Gui/View3DInventor.h>
#include <Mod/Spreadsheet/App/Sheet.h>

#include "SpreadsheetView.h"
#include "ViewProviderSpreadsheet.h"
#include "ViewProviderSpreadsheetPy.h"

Expand All @@ -50,15 +49,12 @@ using namespace Spreadsheet;

PROPERTY_SOURCE(SpreadsheetGui::ViewProviderSheet, Gui::ViewProviderDocumentObject)

ViewProviderSheet::ViewProviderSheet()
: Gui::ViewProviderDocumentObject()
{}
ViewProviderSheet::ViewProviderSheet() = default;

ViewProviderSheet::~ViewProviderSheet()
{
if (!view.isNull()) {
Gui::getMainWindow()->removeWindow(view);
// delete view;
}
}

Expand All @@ -76,14 +72,31 @@ std::vector<std::string> ViewProviderSheet::getDisplayModes() const

QIcon ViewProviderSheet::getIcon() const
{
// clang-format off
static const char* const Points_Feature_xpm[] = {
"16 16 3 1", " c None", ". c #000000", "+ c #FFFFFF",
" ", " ", "................", ".++++.++++.++++.",
".++++.++++.++++.", "................", ".++++.++++.++++.", ".++++.++++.++++.",
"................", ".++++.++++.++++.", ".++++.++++.++++.", "................",
".++++.++++.++++.", ".++++.++++.++++.", "................", " "};
"16 16 3 1",
" c None",
". c #000000",
"+ c #FFFFFF",
" ",
" ",
"................",
".++++.++++.++++.",
".++++.++++.++++.",
"................",
".++++.++++.++++.",
".++++.++++.++++.",
"................",
".++++.++++.++++.",
".++++.++++.++++.",
"................",
".++++.++++.++++.",
".++++.++++.++++.",
"................",
" "};
QPixmap px(Points_Feature_xpm);
return px;
// clang-format on
}

bool ViewProviderSheet::setEdit(int ModNum)
Expand Down
8 changes: 1 addition & 7 deletions src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@
#include <Gui/ViewProviderDocumentObject.h>
#include <Gui/ViewProviderPythonFeature.h>
#include <Mod/Spreadsheet/SpreadsheetGlobal.h>
#include <Mod/Spreadsheet/Gui/SpreadsheetView.h>


namespace Spreadsheet
{
class Sheet;
}

namespace SpreadsheetGui
{

class SheetView;

class SpreadsheetGuiExport ViewProviderSheet: public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER_WITH_OVERRIDE(SpreadsheetGui::ViewProviderSheet);
Expand Down
2 changes: 0 additions & 2 deletions src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheetPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "PreCompiled.h"

// clang-format off
#include "SpreadsheetView.h"
#include "ViewProviderSpreadsheetPy.h"
#include "ViewProviderSpreadsheetPy.cpp"
// clang-format on
Expand Down Expand Up @@ -56,7 +55,6 @@ PyObject* ViewProviderSpreadsheetPy::getCustomAttributes(const char* /*attr*/) c
return nullptr;
}


int ViewProviderSpreadsheetPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
Expand Down

0 comments on commit ab171f0

Please sign in to comment.