This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<qresource prefix="/graphics" >
|
||||
<file>cards/dealerbutton.png</file>
|
||||
<file>cards/logo1-140x100_neu.png</file>
|
||||
<file>graphics/logo-140-100.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/mycards" >
|
||||
<file>cards/mycards/0.png</file>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "newgamedialogimpl.h"
|
||||
#include "aboutpokerthimpl.h"
|
||||
#include "settingsdialogimpl.h"
|
||||
#include "startsplash.h"
|
||||
|
||||
#include "handinterface.h"
|
||||
#include "playerinterface.h"
|
||||
@@ -1380,33 +1381,33 @@ void mainWindowImpl::breakButtonClicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void mainWindowImpl::paintStartSplash() {
|
||||
|
||||
StartSplash *mySplash = new StartSplash();
|
||||
|
||||
mySplash->setGeometry(0,0,300,200);
|
||||
mySplash->setWindowFlags(Qt::SplashScreen);
|
||||
mySplash->show();
|
||||
|
||||
// QTimer *timer = new QTimer(this);
|
||||
// connect(timer, SIGNAL(timeout()), mySplash, SLOT(/*StartSp*/lash::nextAnimationFrame()));
|
||||
// timer->start(100);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||
|
||||
// cout << event->key() << endl;
|
||||
|
||||
|
||||
if (event->key() == 16777265) { switchToolBox(); }
|
||||
if (event->key() == 65) {
|
||||
|
||||
QWidget *myWidget = new QWidget(this, Qt::SplashScreen);
|
||||
myWidget->setGeometry(100,100,100,100);
|
||||
// myWidget->setMask(QRegion(3,3,40,40));
|
||||
myWidget->show();
|
||||
|
||||
// QPicture picture;
|
||||
QPainter painter(this);
|
||||
// painter.begin(this); // paint in picture
|
||||
painter.drawEllipse(10,20, 80,70); // draw an ellipse
|
||||
painter.end();
|
||||
paintStartSplash();
|
||||
|
||||
}
|
||||
if (event->key() == 66) {
|
||||
|
||||
// myWidget->hide();
|
||||
|
||||
/*QPicture picture;
|
||||
QPainter painter;
|
||||
painter.begin(this); // paint in picture
|
||||
painter.drawEllipse(10,20, 80,70); // draw an ellipse
|
||||
painter.end(); */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ public slots:
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void switchToolBox();
|
||||
|
||||
void paintStartSplash();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
StartSplash::StartSplash()
|
||||
: QWidget()
|
||||
{
|
||||
|
||||
frameNo = 0;
|
||||
|
||||
QTimer *timer = new QTimer;
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(nextAnimationFrame()));
|
||||
timer->start(40);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,4 +27,27 @@ StartSplash::~StartSplash()
|
||||
{
|
||||
}
|
||||
|
||||
void StartSplash::nextAnimationFrame() {
|
||||
|
||||
++frameNo;
|
||||
update();
|
||||
}
|
||||
|
||||
void StartSplash::paintEvent(QPaintEvent * event) {
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
if(frameNo < 51) {
|
||||
|
||||
painter.setBrush(QColor(0+frameNo,40+frameNo,6+frameNo));
|
||||
painter.drawRect(0,0,299,199);
|
||||
|
||||
}
|
||||
|
||||
if(frameNo >= 51) {
|
||||
|
||||
painter.setBrush(QColor(51,91,57));
|
||||
painter.drawRect(0,0,299,199);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,17 +12,24 @@
|
||||
#ifndef STARTSPLASH_H
|
||||
#define STARTSPLASH_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <f.thauer@web.de>
|
||||
*/
|
||||
class StartSplash : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StartSplash();
|
||||
|
||||
~StartSplash();
|
||||
|
||||
int frameNo;
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
|
||||
public slots:
|
||||
|
||||
void nextAnimationFrame();
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user