-
Notifications
You must be signed in to change notification settings - Fork 26
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
db220b7
commit 28d9b96
Showing
352 changed files
with
6,322 additions
and
2,732 deletions.
There are no files selected for viewing
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
Empty file.
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,115 @@ | ||
#include "factory.h" | ||
//静态变量的初始化应该放在cpp文件中,放在头文件中会被重复包含导致重定义 | ||
QString Factory::DefaultStyleSheet="color:white;background-color:black"; | ||
QFont Factory::DefaultFont=QFont("Microsoft YaHei" ,12, 30); | ||
QLabel* Factory::CreateQLabel(QWidget*pos, int x, int y, int w, int h, | ||
QString Text,QString StyleSheet,QFont Font,Qt::Alignment s) | ||
{ | ||
QLabel* p=new QLabel(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
p->setAlignment(s); | ||
return p; | ||
} | ||
QLabel* Factory::CreateQLabel(QMainWindow*pos, int x, int y, int w, int h, | ||
QString Text,QString StyleSheet,QFont Font,Qt::Alignment s) | ||
{ | ||
QLabel* p=new QLabel(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
p->setAlignment(s); | ||
return p; | ||
} | ||
QLabel* Factory::CreateQLabel(QWidget *pos, QString Text, QString StyleSheet, QFont Font) | ||
{ | ||
QLabel* p=new QLabel(pos); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
return p; | ||
} | ||
|
||
QPushButton* Factory::CreateQPushButton(QWidget*pos,int x, int y, int w, int h, | ||
QString Text,QString StyleSheet,QFont Font) | ||
{ | ||
QPushButton* p=new QPushButton(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
return p; | ||
} | ||
QPushButton* Factory::CreateQPushButton(QMainWindow*pos,int x, int y, int w, int h, | ||
QString Text,QString StyleSheet,QFont Font) | ||
{ | ||
QPushButton* p=new QPushButton(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
return p; | ||
} | ||
|
||
QPushButton* Factory::CreateQPushButton(QWidget* pos,QString Text,QString StyleSheet) | ||
{ | ||
QPushButton* p=new QPushButton(pos); | ||
p->setText(Text); | ||
p->setStyleSheet(StyleSheet); | ||
return p; | ||
} | ||
|
||
QProgressBar* Factory::CreateQProgressBar(QWidget*pos,int x, int y, int w, int h,bool TextVisible) | ||
{ | ||
QProgressBar* p=new QProgressBar(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setStyle(QStyleFactory::create("fusion")); | ||
p->setTextVisible(TextVisible); | ||
return p; | ||
} | ||
QMediaPlayer* Factory::CreateQMediaPlayer(QWidget*pos, QUrl url, int v) | ||
{ | ||
QMediaPlayer* p=new QMediaPlayer(pos); | ||
p->setMedia(url);//相对路径 | ||
p->setVolume(v); | ||
return p; | ||
} | ||
QMediaPlaylist* Factory::CreateQMediaPlaylist(QWidget* pos) | ||
{ | ||
QMediaPlaylist* p=new QMediaPlaylist(pos);//游戏音效 | ||
p->addMedia(QUrl("qrc:/music/music/coin.mp3"));//硬币音效 | ||
p->addMedia(QUrl("qrc:/music/music/powerup.mp3"));//升级音效 | ||
p->addMedia(QUrl("qrc:/music/music/flagpole.wav"));//碰到旗子音效 | ||
p->addMedia(QUrl("qrc:/music/music/stomp.mp3"));//捡到钥匙音效 | ||
p->addMedia(QUrl("qrc:/music/music/count_down.mp3"));//战斗计算音效 | ||
p->addMedia(QUrl("qrc:/music/music/one_up.mp3"));//吃到蘑菇音效 | ||
p->addMedia(QUrl("qrc:/music/music/pipe.mp3"));//开门音效 | ||
return p; | ||
} | ||
|
||
QSpinBox* Factory::CreateQSpinBox(QWidget*pos,QString StyleSheet) | ||
{ | ||
QSpinBox* p=new QSpinBox(pos); | ||
p->setStyleSheet(StyleSheet); | ||
return p; | ||
} | ||
QComboBox* Factory::CreateQComboBox(QWidget* pos,int index) | ||
{ | ||
QComboBox* p=new QComboBox(pos); | ||
p->addItem(QObject::tr("魔法少女"));//项目编号从0开始 | ||
p->addItem(QObject::tr("火影忍者")); | ||
p->addItem(QObject::tr("超级玛丽")); | ||
p->setCurrentIndex(index); | ||
return p; | ||
} | ||
QLineEdit* Factory::CreateQLineEdit(QMainWindow*pos,int x, int y, int w,int h,QString StyleSheet,QFont Font) | ||
{ | ||
QLineEdit* p=new QLineEdit(pos); | ||
p->setGeometry(x,y,w,h); | ||
p->setStyleSheet(StyleSheet); | ||
p->setFont(Font); | ||
return p; | ||
} |
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,39 @@ | ||
#ifndef FACTORY_H | ||
#define FACTORY_H | ||
#include <QWidget> | ||
#include <QMainWindow> | ||
#include <QLabel> | ||
#include <QPushButton> | ||
#include <QLineEdit> | ||
#include <QProgressBar> | ||
#include <QSpinBox> | ||
#include <QComboBox> | ||
#include <QMediaPlayer> | ||
#include <QMediaPlaylist> | ||
#include <QTimer> | ||
#include <QStyleFactory> | ||
#include <QString> | ||
class Factory | ||
{ | ||
public: | ||
QLabel* CreateQLabel(QWidget *pos, int x, int y, int w, int h, | ||
QString Text="", QString StyleSheet=DefaultStyleSheet, QFont Font=DefaultFont, Qt::Alignment s=Qt::AlignCenter); | ||
QLabel* CreateQLabel(QMainWindow*pos,int x, int y, int w, int h, | ||
QString Text="",QString StyleSheet=DefaultStyleSheet,QFont Font=DefaultFont,Qt::Alignment s=Qt::AlignCenter); | ||
QLabel* CreateQLabel(QWidget* pos,QString Text="",QString StyleSheet=DefaultStyleSheet,QFont Font=DefaultFont); | ||
QPushButton* CreateQPushButton(QWidget*pos,int x, int y, int w, int h, | ||
QString Text="",QString StyleSheet=DefaultStyleSheet,QFont Font=DefaultFont); | ||
QPushButton* CreateQPushButton(QMainWindow*pos,int x, int y, int w, int h, | ||
QString Text="",QString StyleSheet=DefaultStyleSheet,QFont Font=DefaultFont); | ||
QPushButton* CreateQPushButton(QWidget* pos,QString Text="",QString StyleSheet=DefaultStyleSheet); | ||
QProgressBar* CreateQProgressBar(QWidget*pos,int x, int y, int w, int h,bool TextVisible); | ||
QMediaPlayer *CreateQMediaPlayer(QWidget*pos,QUrl url,int v); | ||
QMediaPlaylist* CreateQMediaPlaylist(QWidget* pos); | ||
QSpinBox* CreateQSpinBox(QWidget*pos,QString StyleSheet); | ||
QComboBox* CreateQComboBox(QWidget* pos,int index); | ||
QLineEdit* CreateQLineEdit(QMainWindow*pos,int x, int y, int w,int h,QString StyleSheet,QFont Font); | ||
private: | ||
static QString DefaultStyleSheet; | ||
static QFont DefaultFont; | ||
}; | ||
#endif // FACTORY_H |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
0
image/DungeonNew/Mario/up00.png → image/DungeonNew/37.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/down00.png → image/DungeonNew/38.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/left00.png → image/DungeonNew/39/390.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/left01.png → image/DungeonNew/39/391.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/left02.png → image/DungeonNew/39/392.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/left03.png → image/DungeonNew/39/393.png
100644 → 100755
File renamed without changes
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
0
image/DungeonNew/Mario/right00.png → image/DungeonNew/40/400.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/right01.png → image/DungeonNew/40/401.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/right02.png → image/DungeonNew/40/402.png
100644 → 100755
File renamed without changes
0
image/DungeonNew/Mario/right03.png → image/DungeonNew/40/403.png
100644 → 100755
File renamed without changes
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.