Compare commits
No commits in common. "a28e484cb22c07e851d999aafdcdcdc504d74378" and "56f64f00f0c6b30ba9d367438ac437a33c139948" have entirely different histories.
a28e484cb2
...
56f64f00f0
|
@ -104,7 +104,6 @@
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="ElementPoolWidget.cpp" />
|
|
||||||
<ClCompile Include="src\CaptionButton.cpp" />
|
<ClCompile Include="src\CaptionButton.cpp" />
|
||||||
<ClCompile Include="src\Editor\EditorWidget.cpp" />
|
<ClCompile Include="src\Editor\EditorWidget.cpp" />
|
||||||
<ClCompile Include="src\Editor\ElementManager.cpp" />
|
<ClCompile Include="src\Editor\ElementManager.cpp" />
|
||||||
|
@ -188,7 +187,6 @@
|
||||||
<QtMoc Include="src\MainWindow.h" />
|
<QtMoc Include="src\MainWindow.h" />
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="src\Editor\ElementManager.h" />
|
<ClInclude Include="src\Editor\ElementManager.h" />
|
||||||
<QtMoc Include="src\Editor\ElementPoolWidget.h" />
|
|
||||||
<ClInclude Include="src\Editor\GraphicElement.h" />
|
<ClInclude Include="src\Editor\GraphicElement.h" />
|
||||||
<ClInclude Include="src\Editor\LayerManager.h" />
|
<ClInclude Include="src\Editor\LayerManager.h" />
|
||||||
<ClInclude Include="src\Editor\LayerStyle.h" />
|
<ClInclude Include="src\Editor\LayerStyle.h" />
|
||||||
|
|
|
@ -207,9 +207,6 @@
|
||||||
<ClCompile Include="src\Editor\PixelPath.cpp">
|
<ClCompile Include="src\Editor\PixelPath.cpp">
|
||||||
<Filter>Source Files\Editor</Filter>
|
<Filter>Source Files\Editor</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="ElementPoolWidget.cpp">
|
|
||||||
<Filter>Source Files\Editor</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="src\Renderer\RendererGLWidget.h">
|
<QtMoc Include="src\Renderer\RendererGLWidget.h">
|
||||||
|
@ -245,9 +242,6 @@
|
||||||
<QtMoc Include="src\Editor\RightBar\InfoDisplayWidget.h">
|
<QtMoc Include="src\Editor\RightBar\InfoDisplayWidget.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</QtMoc>
|
||||||
<QtMoc Include="src\Editor\ElementPoolWidget.h">
|
|
||||||
<Filter>Header Files\Editor</Filter>
|
|
||||||
</QtMoc>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\data.json" />
|
<None Include="..\data.json" />
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
#include "ElementPoolWidget.h"
|
|
||||||
|
|
||||||
ElementPoolWidget::ElementPoolWidget(QWidget* parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
iconWidth = 30, iconHeight = 40;
|
|
||||||
pictureList = new QListWidget(this);
|
|
||||||
pictureList->setIconSize(QSize(iconWidth, iconHeight));
|
|
||||||
pictureList->setResizeMode(QListView::Adjust);
|
|
||||||
pictureList->setViewMode(QListView::IconMode);
|
|
||||||
pictureList->setMovement(QListView::Static);
|
|
||||||
pictureList->setSpacing(10);
|
|
||||||
|
|
||||||
setVisible(true);
|
|
||||||
|
|
||||||
connect(pictureList, SIGNAL(vitemClicked(QListWidgetItem*)), this, SLOT(pictureItemClicked(QListWidgetItem*)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ElementPoolWidget::setElementList(std::vector<GraphicElement*> elements) {
|
|
||||||
pictureList->clear();
|
|
||||||
for (int index = 0; index < elements.size(); index++) {
|
|
||||||
QString strPath = QString("D:\\BigC\\Project\\ArchitectureColoredPainting\\svg\\test.svg");
|
|
||||||
QPixmap itemPixmap(strPath);
|
|
||||||
QListWidgetItem* pItem = new QListWidgetItem(
|
|
||||||
itemPixmap.scaled(QSize(iconWidth, iconHeight)),
|
|
||||||
elements[index]->name);
|
|
||||||
pItem->setSizeHint(QSize(iconWidth, iconHeight));
|
|
||||||
pictureList->insertItem(index, pItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ElementPoolWidget::~ElementPoolWidget() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int ElementPoolWidget::pictureItemClicked(QListWidgetItem* item) {
|
|
||||||
return pictureList->currentRow();
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <QWidget>
|
|
||||||
#include <vector>
|
|
||||||
#include <GraphicElement.h>
|
|
||||||
#include <QListWidget>
|
|
||||||
class ElementPoolWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
private:
|
|
||||||
//std::vector<GraphicElement*> elements;
|
|
||||||
QListWidget* pictureList;
|
|
||||||
int iconWidth, iconHeight;
|
|
||||||
public:
|
|
||||||
ElementPoolWidget(QWidget* parent = NULL);
|
|
||||||
void setElementList(std::vector<GraphicElement*> elementList);
|
|
||||||
~ElementPoolWidget();
|
|
||||||
public slots:
|
|
||||||
int pictureItemClicked(QListWidgetItem* item);
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
//#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
||||||
#include <util/SvgFileLoader.h>
|
#include <util/SvgFileLoader.h>
|
||||||
#include "Renderer/Painting/CubicBezier.h"
|
#include "Renderer/Painting/CubicBezier.h"
|
||||||
#include <Renderer/Painting/StraightLine.h>
|
#include <Renderer/Painting/StraightLine.h>
|
||||||
#include <ElementPoolWidget.h>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
@ -44,24 +43,24 @@ namespace UnitTest
|
||||||
TEST_CLASS(UnitTest)
|
TEST_CLASS(UnitTest)
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//TEST_METHOD(TestMethod1)
|
TEST_METHOD(TestMethod1)
|
||||||
//{
|
{
|
||||||
// FRAMELESSHELPER_USE_NAMESPACE
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
// FramelessHelper::Core::initialize();
|
FramelessHelper::Core::initialize();
|
||||||
// //QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
//QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
// QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
// char arg[] = "";
|
char arg[] = "";
|
||||||
// char* argv[] = { arg };
|
char* argv[] = { arg };
|
||||||
// int argc = 1;
|
int argc = 1;
|
||||||
// QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
// FramelessHelper::Core::setApplicationOSThemeAware();
|
FramelessHelper::Core::setApplicationOSThemeAware();
|
||||||
// FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
||||||
// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||||
// FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||||
// MainWindow w;
|
MainWindow w;
|
||||||
// w.show();
|
w.show();
|
||||||
// a.exec();
|
a.exec();
|
||||||
//}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_CLASS(SvgLoaderTest)
|
TEST_CLASS(SvgLoaderTest)
|
||||||
|
@ -95,13 +94,5 @@ namespace UnitTest
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
TEST_CLASS(ElementPoolTest)
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TEST_METHOD(ElementPool) {
|
|
||||||
qInstallMessageHandler(messageHandler);
|
|
||||||
ElementPoolWidget wi;
|
|
||||||
wi.show();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue