修正大量demo
This commit is contained in:
18
screenwidget/frmscreenwidget.cpp
Normal file
18
screenwidget/frmscreenwidget.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "frmscreenwidget.h"
|
||||
#include "ui_frmscreenwidget.h"
|
||||
#include "screenwidget.h"
|
||||
|
||||
frmScreenWidget::frmScreenWidget(QWidget *parent) : QWidget(parent), ui(new Ui::frmScreenWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
frmScreenWidget::~frmScreenWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void frmScreenWidget::on_pushButton_clicked()
|
||||
{
|
||||
ScreenWidget::Instance()->showFullScreen();
|
||||
}
|
||||
25
screenwidget/frmscreenwidget.h
Normal file
25
screenwidget/frmscreenwidget.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef FRMSCREENWIDGET_H
|
||||
#define FRMSCREENWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class frmScreenWidget;
|
||||
}
|
||||
|
||||
class frmScreenWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit frmScreenWidget(QWidget *parent = 0);
|
||||
~frmScreenWidget();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::frmScreenWidget *ui;
|
||||
};
|
||||
|
||||
#endif // FRMSCREENWIDGET_H
|
||||
32
screenwidget/frmscreenwidget.ui
Normal file
32
screenwidget/frmscreenwidget.ui
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>frmScreenWidget</class>
|
||||
<widget class="QWidget" name="frmScreenWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>92</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>弹出</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,9 +1,8 @@
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
#include "screenwidget.h"
|
||||
#include "frmscreenwidget.h"
|
||||
#include <QApplication>
|
||||
#include <QTextCodec>
|
||||
#include <QIcon>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -24,7 +23,9 @@ int main(int argc, char *argv[])
|
||||
QTextCodec::setCodecForLocale(codec);
|
||||
#endif
|
||||
|
||||
ScreenWidget::Instance()->showFullScreen();
|
||||
frmScreenWidget w;
|
||||
w.setWindowTitle("屏幕截图");
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
void showEvent(QShowEvent *);
|
||||
|
||||
private slots:
|
||||
void saveScreen();
|
||||
private slots:
|
||||
void saveScreen();
|
||||
void saveFullScreen();
|
||||
void saveScreenOther();
|
||||
void saveFullOther();
|
||||
|
||||
@@ -14,5 +14,10 @@ DESTDIR = $$PWD/../bin
|
||||
CONFIG += warn_off
|
||||
|
||||
SOURCES += main.cpp
|
||||
SOURCES += frmscreenwidget.cpp
|
||||
SOURCES += screenwidget.cpp
|
||||
|
||||
HEADERS += screenwidget.h
|
||||
HEADERS += frmscreenwidget.h
|
||||
|
||||
FORMS += frmscreenwidget.ui
|
||||
|
||||
Reference in New Issue
Block a user