Skip to content

Commit

Permalink
7.30提交
Browse files Browse the repository at this point in the history
  • Loading branch information
hu571648983 committed Jul 30, 2018
1 parent 3fcf6b8 commit 1bb164b
Show file tree
Hide file tree
Showing 94 changed files with 13,937 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QT_Dialog/QT_Dialog.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2018-07-25T20:49:07. -->
<!-- Written by QtCreator 3.1.2, 2018-07-27T17:15:21. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand Down
22 changes: 22 additions & 0 deletions QT_Event/QT_Event.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-07-27T18:43:45
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QT_Event
TEMPLATE = app


SOURCES += main.cpp\
mywidget.cpp \
mylabel.cpp

HEADERS += mywidget.h \
mylabel.h

FORMS += mywidget.ui
251 changes: 251 additions & 0 deletions QT_Event/QT_Event.pro.user

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions QT_Event/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "mywidget.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyWidget w;
w.show();

return a.exec();
}
22 changes: 22 additions & 0 deletions QT_Event/mylabel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "mylabel.h"

MyLabel::MyLabel(QWidget *parent) :
QLabel(parent)
{
}

void MyLabel::mousePressEvent(QMouseEvent *ev)
{
int i= ev->x();
int j = ev->y();

QString text = QString("<center><h1></h1></center>");
}
void MyLabel::mouseReleaseEvent(QMouseEvent *ev)
{

}
void MyLabel::mouseMoveEvent(QMouseEvent *ev)
{

}
23 changes: 23 additions & 0 deletions QT_Event/mylabel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef MYLABEL_H
#define MYLABEL_H

#include <QLabel>

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

protected:
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);

signals:

public slots:

};

#endif // MYLABEL_H
14 changes: 14 additions & 0 deletions QT_Event/mywidget.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "mywidget.h"
#include "ui_mywidget.h"

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

MyWidget::~MyWidget()
{
delete ui;
}
22 changes: 22 additions & 0 deletions QT_Event/mywidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef MYWIDGET_H
#define MYWIDGET_H

#include <QWidget>

namespace Ui {
class MyWidget;
}

class MyWidget : public QWidget
{
Q_OBJECT

public:
explicit MyWidget(QWidget *parent = 0);
~MyWidget();

private:
Ui::MyWidget *ui;
};

#endif // MYWIDGET_H
29 changes: 29 additions & 0 deletions QT_Event/mywidget.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MyWidget</class>
<widget class="QWidget" name="MyWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>567</height>
</rect>
</property>
<property name="windowTitle">
<string>MyWidget</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
24 changes: 24 additions & 0 deletions QT_Parts/QT_Parts.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-07-27T16:39:08
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QT_Parts
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui

RESOURCES += \
image.qrc \
images.qrc
251 changes: 251 additions & 0 deletions QT_Parts/QT_Parts.pro.user

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions QT_Parts/image.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<RCC/>
1 change: 1 addition & 0 deletions QT_Parts/images.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<RCC/>
11 changes: 11 additions & 0 deletions QT_Parts/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}
27 changes: 27 additions & 0 deletions QT_Parts/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->myButton->setText("123");
connect(ui->myButton, &QPushButton::clicked, this, &MainWindow::close);

QString str = ui->lineEdit->text();
qDebug() << str;

ui->lineEdit->setText("xxxxxsss");

ui->labelText->setText("xxxxeeee");
// ui->labelImage->setPixmap(QPixmap("OnePiece.png"));
}

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


25 changes: 25 additions & 0 deletions QT_Parts/mainwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private slots:
void on_myButton_clicked();

private:
Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
96 changes: 96 additions & 0 deletions QT_Parts/mainwindow.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>923</width>
<height>626</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="myButton">
<property name="geometry">
<rect>
<x>30</x>
<y>30</y>
<width>93</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>myButton</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>150</x>
<y>30</y>
<width>113</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>12345</string>
</property>
</widget>
<widget class="QLabel" name="labelText">
<property name="geometry">
<rect>
<x>40</x>
<y>70</y>
<width>72</width>
<height>15</height>
</rect>
</property>
<property name="text">
<string>labelText</string>
</property>
</widget>
<widget class="QLabel" name="labelImage">
<property name="geometry">
<rect>
<x>400</x>
<y>50</y>
<width>481</width>
<height>381</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../../../notes/电商项目总结/README.assets/1532138582676.png</pixmap>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>923</width>
<height>26</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
20 changes: 20 additions & 0 deletions QT_Qlabel/QT_Qlabel.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-07-27T10:22:09
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QT_Qlabel
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui
Loading

0 comments on commit 1bb164b

Please sign in to comment.