Add extended RDTableView to expose viewOptions()

This commit is contained in:
baldurk
2016-11-28 17:45:49 +01:00
parent 08bd19a990
commit 060a1caa8f
5 changed files with 82 additions and 2 deletions
@@ -0,0 +1,30 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2016 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#include "RDTableView.h"
#include <QMouseEvent>
RDTableView::RDTableView(QWidget *parent) : QTableView(parent)
{
}
+36
View File
@@ -0,0 +1,36 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2016 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#pragma once
#include <QTableView>
class RDTableView : public QTableView
{
Q_OBJECT
public:
explicit RDTableView(QWidget *parent = 0);
QStyleOptionViewItem viewOptions() const override { return QTableView::viewOptions(); }
};
+4 -2
View File
@@ -125,7 +125,8 @@ SOURCES += 3rdparty/toolwindowmanager/ToolWindowManager.cpp \
Windows/ConstantBufferPreviewer.cpp \
Widgets/BufferFormatSpecifier.cpp \
Code/FormatElement.cpp \
Windows/BufferViewer.cpp
Windows/BufferViewer.cpp \
Widgets/Extended/RDTableView.cpp
HEADERS += 3rdparty/toolwindowmanager/ToolWindowManager.h \
3rdparty/toolwindowmanager/ToolWindowManagerArea.h \
@@ -163,7 +164,8 @@ HEADERS += 3rdparty/toolwindowmanager/ToolWindowManager.h \
Widgets/Extended/RDTreeWidget.h \
Windows/ConstantBufferPreviewer.h \
Widgets/BufferFormatSpecifier.h \
Windows/BufferViewer.h
Windows/BufferViewer.h \
Widgets/Extended/RDTableView.h
FORMS += Windows/Dialogs/AboutDialog.ui \
Windows/MainWindow.ui \
+3
View File
@@ -306,6 +306,7 @@
<ClCompile Include="generated\moc_MainWindow.cpp" />
<ClCompile Include="generated\moc_RDListView.cpp" />
<ClCompile Include="generated\moc_RDListWidget.cpp" />
<ClCompile Include="generated\moc_RDTableView.cpp" />
<ClCompile Include="generated\moc_RDTreeWidget.cpp" />
<ClCompile Include="generated\moc_ResourcePreview.cpp" />
<ClCompile Include="generated\moc_TextureGoto.cpp" />
@@ -319,6 +320,7 @@
<ClCompile Include="generated\qrc_resources.cpp" />
<ClCompile Include="Widgets\BufferFormatSpecifier.cpp" />
<ClCompile Include="Widgets\Extended\RDListWidget.cpp" />
<ClCompile Include="Widgets\Extended\RDTableView.cpp" />
<ClCompile Include="Widgets\Extended\RDTreeWidget.cpp" />
<ClCompile Include="Widgets\RangeHistogram.cpp" />
<ClCompile Include="Widgets\Extended\RDDoubleSpinBox.cpp" />
@@ -386,6 +388,7 @@
<ClInclude Include="Resources\resource.h" />
<ClInclude Include="Widgets\BufferFormatSpecifier.h" />
<ClInclude Include="Widgets\Extended\RDListWidget.h" />
<ClInclude Include="Widgets\Extended\RDTableView.h" />
<ClInclude Include="Widgets\Extended\RDTreeWidget.h" />
<ClInclude Include="Widgets\RangeHistogram.h" />
<ClInclude Include="Widgets\Extended\RDDoubleSpinBox.h" />
@@ -259,6 +259,12 @@
<ClCompile Include="Windows\BufferViewer.cpp">
<Filter>Windows</Filter>
</ClCompile>
<ClCompile Include="Widgets\Extended\RDTableView.cpp">
<Filter>Widgets\Extended</Filter>
</ClCompile>
<ClCompile Include="generated\moc_RDTableView.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="3rdparty\flowlayout\FlowLayout.h">
@@ -417,6 +423,9 @@
<ClInclude Include="Windows\BufferViewer.h">
<Filter>Windows</Filter>
</ClInclude>
<ClInclude Include="Widgets\Extended\RDTableView.h">
<Filter>Widgets\Extended</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="resources.qrc">