mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-22 03:04:09 -04:00
add parameterisation to the theme name.
This commit is contained in:
parent
2ce04c051c
commit
2aaf094f96
3 changed files with 19 additions and 21 deletions
|
@ -1,12 +1,10 @@
|
||||||
/* A file to test imorting C modules for handling arrays to Python */
|
|
||||||
|
|
||||||
#include "kcardgame.hpp"
|
#include "kcardgame.hpp"
|
||||||
MyKCardDeck::MyKCardDeck()
|
MyKCardDeck::MyKCardDeck(QString theme_name)
|
||||||
{
|
{
|
||||||
int argc = 1;
|
int argc = 1;
|
||||||
char *argv[2] = {"pysol", NULL};
|
char *argv[2] = {"pysol", NULL};
|
||||||
app = new QGuiApplication(argc, argv);
|
app = new QGuiApplication(argc, argv);
|
||||||
d = new KCardDeck( KCardTheme("svg-ancient-egyptians"), nullptr);
|
d = new KCardDeck(KCardTheme(theme_name), nullptr);
|
||||||
unsigned int number = 0;
|
unsigned int number = 0;
|
||||||
QList<quint32> ids;
|
QList<quint32> ids;
|
||||||
for (int i = 0; i < 1; ++i)
|
for (int i = 0; i < 1; ++i)
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Q_DECL_EXPORT MyKCardDeck: public QObject
|
||||||
public:
|
public:
|
||||||
QGuiApplication *app;
|
QGuiApplication *app;
|
||||||
KCardDeck *d;
|
KCardDeck *d;
|
||||||
explicit MyKCardDeck();
|
explicit MyKCardDeck(QString);
|
||||||
public slots:
|
public slots:
|
||||||
Q_DECL_EXPORT QPixmap *get_card_pixmap(int i);
|
Q_DECL_EXPORT QPixmap *get_card_pixmap(int i);
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ class SVGManager:
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
# self.svg = Rsvg.Handle().new_from_file(filename)
|
# self.svg = Rsvg.Handle().new_from_file(filename)
|
||||||
self.d = MyKCardDeck()
|
self.d = MyKCardDeck("svg-jolly-royal")
|
||||||
|
|
||||||
# Taken from https://stackoverflow.com/questions/44471795
|
# Taken from https://stackoverflow.com/questions/44471795
|
||||||
# Under MIT License - thanks.
|
# Under MIT License - thanks.
|
||||||
|
|
Loading…
Add table
Reference in a new issue