forked from gochao/QT-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fcf6b8
commit 1bb164b
Showing
94 changed files
with
13,937 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<RCC/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<RCC/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.