Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Mar 13, 2019
1 parent aa3ded2 commit 6227a82
Show file tree
Hide file tree
Showing 21 changed files with 832 additions and 0 deletions.
46 changes: 46 additions & 0 deletions StringsPlugin/PluginMainWindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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 "PluginMainWindow.h"
#include "ui_PluginMainWindow.h"

#include "pluginmain.h"

PluginMainWindow::PluginMainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::PluginMainWindow)
{
ui->setupUi(this);
}

PluginMainWindow::~PluginMainWindow()
{
delete ui;
}

void PluginMainWindow::on_pushButtonScan_clicked()
{

}

void PluginMainWindow::on_pushButtonInfo_clicked()
{
DialogInfo di(this);

di.exec();
}
49 changes: 49 additions & 0 deletions StringsPlugin/PluginMainWindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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.
//
#ifndef PLUGINMAINWINDOW_H
#define PLUGINMAINWINDOW_H

#include <QMainWindow>

#include "dialoginfo.h"

namespace Ui
{
class PluginMainWindow;
}

class PluginMainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit PluginMainWindow(QWidget* parent = nullptr);
~PluginMainWindow();

private slots:
void on_pushButtonScan_clicked();
void on_pushButtonInfo_clicked();

private:
Ui::PluginMainWindow* ui;
};

#endif // PLUGINMAINWINDOW_H
112 changes: 112 additions & 0 deletions StringsPlugin/PluginMainWindow.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PluginMainWindow</class>
<widget class="QMainWindow" name="PluginMainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>QtPlugin</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>:/icons/images/icon.png</normaloff>:/icons/images/icon.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButtonScan">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Scan</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxScanOverlay">
<property name="text">
<string>Scan overlay</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDeepScan">
<property name="text">
<string>Deep scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButtonInfo">
<property name="text">
<string>Info</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="FormResult" name="widgetResult" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<action name="actionClearText">
<property name="text">
<string>&amp;Clear Text</string>
</property>
<property name="toolTip">
<string>Clear Text</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>FormResult</class>
<extends>QWidget</extends>
<header>formresult.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>
42 changes: 42 additions & 0 deletions StringsPlugin/PluginTabWidget.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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 "PluginTabWidget.h"


PluginTabWidget::PluginTabWidget(QWidget* parent) :
QWidget(parent)
{
mPluginMainWindow = new PluginMainWindow(parent);
mPluginMainWindow->setAutoFillBackground(true);
QVBoxLayout* layout = new QVBoxLayout(parent);
layout->addWidget(mPluginMainWindow);
layout->setMargin(0);
setLayout(layout);
// setWindowTitle(mPluginMainWindow->windowTitle());
setWindowTitle(tr("Strings"));
setWindowIcon(mPluginMainWindow->windowIcon());
}

void PluginTabWidget::closeEvent(QCloseEvent* event)
{
Q_UNUSED(event);
mPluginMainWindow->close();
}
44 changes: 44 additions & 0 deletions StringsPlugin/PluginTabWidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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.
//
#ifndef PLUGINTABWIDGET_H
#define PLUGINTABWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QMessageBox>

#include "PluginMainWindow.h"
#include "pluginmain.h"

class PluginTabWidget : public QWidget
{
Q_OBJECT
public:
explicit PluginTabWidget(QWidget* parent = 0);

protected:
void closeEvent(QCloseEvent* event);

private:
PluginMainWindow* mPluginMainWindow;
};

#endif // PLUGINTABWIDGET_H
53 changes: 53 additions & 0 deletions StringsPlugin/QtPlugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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 "QtPlugin.h"

//#include "pluginmain.h"
#include "PluginTabWidget.h"

static PluginTabWidget* pluginTabWidget;

static QWidget* getParent()
{
return QWidget::find((WId)Plugin::hwndDlg);
}

void QtPlugin::Init()
{
}

void QtPlugin::Setup()
{
QWidget* parent = getParent();
pluginTabWidget = new PluginTabWidget(parent);
GuiAddQWidgetTab(pluginTabWidget);
}

void QtPlugin::Stop()
{
GuiCloseQWidgetTab(pluginTabWidget);
delete pluginTabWidget;
}

void QtPlugin::ShowTab()
{
GuiShowQWidgetTab(pluginTabWidget);
}
35 changes: 35 additions & 0 deletions StringsPlugin/QtPlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) 2019 hors<horsicq@gmail.com>
//
// 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.
//
#ifndef QTPLUGIN_H
#define QTPLUGIN_H

//#include "PluginTabWidget.h"
//#include "PluginMainWindow.h"

namespace QtPlugin
{
void Init();
void Setup();
void Stop();
void ShowTab();
} //QtPlugin

#endif // QTPLUGIN_H
Loading

0 comments on commit 6227a82

Please sign in to comment.