From 060a1caa8f56b3bcae066ba240b682719bc69a6d Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 28 Nov 2016 17:45:49 +0100 Subject: [PATCH] Add extended RDTableView to expose viewOptions() --- qrenderdoc/Widgets/Extended/RDTableView.cpp | 30 +++++++++++++++++ qrenderdoc/Widgets/Extended/RDTableView.h | 36 +++++++++++++++++++++ qrenderdoc/qrenderdoc.pro | 6 ++-- qrenderdoc/qrenderdoc_local.vcxproj | 3 ++ qrenderdoc/qrenderdoc_local.vcxproj.filters | 9 ++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 qrenderdoc/Widgets/Extended/RDTableView.cpp create mode 100644 qrenderdoc/Widgets/Extended/RDTableView.h diff --git a/qrenderdoc/Widgets/Extended/RDTableView.cpp b/qrenderdoc/Widgets/Extended/RDTableView.cpp new file mode 100644 index 000000000..ce2e399fc --- /dev/null +++ b/qrenderdoc/Widgets/Extended/RDTableView.cpp @@ -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 + +RDTableView::RDTableView(QWidget *parent) : QTableView(parent) +{ +} diff --git a/qrenderdoc/Widgets/Extended/RDTableView.h b/qrenderdoc/Widgets/Extended/RDTableView.h new file mode 100644 index 000000000..c2f4969a9 --- /dev/null +++ b/qrenderdoc/Widgets/Extended/RDTableView.h @@ -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 + +class RDTableView : public QTableView +{ + Q_OBJECT +public: + explicit RDTableView(QWidget *parent = 0); + + QStyleOptionViewItem viewOptions() const override { return QTableView::viewOptions(); } +}; diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index 691efac97..5c68fcdf1 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -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 \ diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index 62c77a530..4787d6847 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -306,6 +306,7 @@ + @@ -319,6 +320,7 @@ + @@ -386,6 +388,7 @@ + diff --git a/qrenderdoc/qrenderdoc_local.vcxproj.filters b/qrenderdoc/qrenderdoc_local.vcxproj.filters index 77c03e0ba..6cc08b631 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj.filters +++ b/qrenderdoc/qrenderdoc_local.vcxproj.filters @@ -259,6 +259,12 @@ Windows + + Widgets\Extended + + + Generated Files + @@ -417,6 +423,9 @@ Windows + + Widgets\Extended +