Compare commits

..

No commits in common. "a28e484cb22c07e851d999aafdcdcdc504d74378" and "56f64f00f0c6b30ba9d367438ac437a33c139948" have entirely different histories.

5 changed files with 20 additions and 95 deletions

View File

@ -104,7 +104,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ElementPoolWidget.cpp" />
<ClCompile Include="src\CaptionButton.cpp" />
<ClCompile Include="src\Editor\EditorWidget.cpp" />
<ClCompile Include="src\Editor\ElementManager.cpp" />
@ -188,7 +187,6 @@
<QtMoc Include="src\MainWindow.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="src\Editor\ElementManager.h" />
<QtMoc Include="src\Editor\ElementPoolWidget.h" />
<ClInclude Include="src\Editor\GraphicElement.h" />
<ClInclude Include="src\Editor\LayerManager.h" />
<ClInclude Include="src\Editor\LayerStyle.h" />

View File

@ -207,9 +207,6 @@
<ClCompile Include="src\Editor\PixelPath.cpp">
<Filter>Source Files\Editor</Filter>
</ClCompile>
<ClCompile Include="ElementPoolWidget.cpp">
<Filter>Source Files\Editor</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="src\Renderer\RendererGLWidget.h">
@ -245,9 +242,6 @@
<QtMoc Include="src\Editor\RightBar\InfoDisplayWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="src\Editor\ElementPoolWidget.h">
<Filter>Header Files\Editor</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<None Include="..\data.json" />

View File

@ -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();
}

View File

@ -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);
};

View File

@ -1,12 +1,11 @@
#include "CppUnitTest.h"
//#include "MainWindow.h"
#include "MainWindow.h"
#include <QGuiApplication>
#include <QtWidgets/QApplication>
#include <FramelessHelper/Core/private/framelessconfig_p.h>
#include <util/SvgFileLoader.h>
#include "Renderer/Painting/CubicBezier.h"
#include <Renderer/Painting/StraightLine.h>
#include <ElementPoolWidget.h>
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
@ -44,24 +43,24 @@ namespace UnitTest
TEST_CLASS(UnitTest)
{
public:
//TEST_METHOD(TestMethod1)
//{
// FRAMELESSHELPER_USE_NAMESPACE
// FramelessHelper::Core::initialize();
// //QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
// char arg[] = "";
// char* argv[] = { arg };
// int argc = 1;
// QApplication a(argc, argv);
// FramelessHelper::Core::setApplicationOSThemeAware();
// FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
// FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
// MainWindow w;
// w.show();
// a.exec();
//}
TEST_METHOD(TestMethod1)
{
FRAMELESSHELPER_USE_NAMESPACE
FramelessHelper::Core::initialize();
//QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
char arg[] = "";
char* argv[] = { arg };
int argc = 1;
QApplication a(argc, argv);
FramelessHelper::Core::setApplicationOSThemeAware();
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
MainWindow w;
w.show();
a.exec();
}
};
TEST_CLASS(SvgLoaderTest)
@ -95,13 +94,5 @@ namespace UnitTest
}
};
TEST_CLASS(ElementPoolTest)
{
public:
TEST_METHOD(ElementPool) {
qInstallMessageHandler(messageHandler);
ElementPoolWidget wi;
wi.show();
}
};
}