Issues during deploying with windeployqt
-
Hi and welcome to devnet,
That's a bit too light on details.
So, shot in the dark, you are using SVG for the board and the plugin is missing.
If it's not that, then please give more details about what you use to show that game board.
-
Hi and welcome to devnet,
That's a bit too light on details.
So, shot in the dark, you are using SVG for the board and the plugin is missing.
If it's not that, then please give more details about what you use to show that game board.
@SGaist Hi, thanks for teh fast reply, I'm using QT with c++. The app works well when launching it with cmake. When trying to deploy it using windeployqt, it does not work, only the first window shows.Here is the .h of my main function.```
code_text// Created by utcpret on 13/12/2023. // #ifndef QTGAME_H #define QTGAME_H #include <QWidget> #include "Controller.h" #include "QTJeton.h" #include "QTCards.h" #include "QTJoueur.h" class QTGame : public QWidget { Q_OBJECT private: Controller* controller; PlateView* plateView; QTPyramid* pyramid; QTRangeePioches* pioches; QTBoardRoyal* boardRoyal; PrivilegeCounter* privilegeCounter; QVBoxLayout* mainlayout; QScreen* screen; QSize* size; PlayerQT* player1; PlayerQT* player2; unsigned int width; unsigned int height; std::string status; public: void quit() { this->close(); } void paintEvent(QPaintEvent* event) override; QTGame(QWidget* parent = nullptr); void handleTokenSelection(std::vector<const Token*> tokens); void fillBoard(); void takePrivilege(Player& player); void bookCard(GameTable& gametable); void usePriviledge(); void placePrivilege(unsigned int nb); void applyOptionalAction(OptionalActions action); void play(); void playOptionalActions(); void handleGameStatus(); void playCompulsoryActions(); void applyCompulsoryAction(CompulsoryActions action); void checkEndTurn(); void applyCardSkills(Game&game, Player&cardOwner, Player&opponent, JewelryCard&card); void buyJewelryCard(GameTable& gametable); void buyNobleCard(); void applyRoyalCardSkills(Game&game, Player&cardOwner, Player&opponent, RoyalCard&card); void generateNewGame(); public slots: void handleBuyingJewelryCard(Carte* cardclicked); void handleBookingJewelryCardFromPyramid(Carte* clickedCard); void handleBookingJewelryCardFromPioche(QTPioche* piocheclicked); void handleBuyingRoyalCard(QTCardRoyal* cardclicked); }; class QTStartingMenu : public QDialog { Q_OBJECT public: QTStartingMenu(QWidget *parent = nullptr); QString getPlayerName1() {return playerName1;} QString getPlayerName2() {return playerName2;} private: QString playerName1; QString playerName2; public slots: void startNewGame() { // Obtenir les noms des joueurs playerName1 = QInputDialog::getText(this, "Nouvelle partie", "Nom du joueur 1 :"); playerName2 = QInputDialog::getText(this, "Nouvelle partie", "Nom du joueur 2 :"); accept(); qDebug() << "Nouvelle partie avec les joueurs : " << playerName1 << " et " << playerName2; } void loadGame() { // Logique pour charger une partie sauvegardée qDebug() << "Charger une partie sauvegardée"; } void quitGame() { std::exit(0); } }; QString MBox(const std::vector<QString>& buttonLabels = {"OK"}, const QString& title = "Message", const QString& text = "Message"); int MBox(const std::vector<OptionalActions>& buttonLabels , const QString& title = "Message", const QString& text = "Message"); int MBox(const std::vector<CompulsoryActions>& buttonLabels , const QString& title = "Message", const QString& text = "Message"); void showWarningMessage(const QString &title, const QString &content); void showVictoryDialog(const QString &playerName, QTGame *gameInstance); int getNumberBetween(int x, int y, const QString &message, QWidget *parent = nullptr); void clearWidgetAndSetNewLayout(QWidget* parentWidget, QLayout* newLayout); void clearLayout(QLayout* layout); #endif //QTGAME_H
Here is the constructor, in the .cpp of my main function (the constructor make first a window, that is the only window showing up when trying to use windeploy)
QTGame::QTGame(QWidget* parent) : QWidget(parent) { QTStartingMenu* startingmenu = new QTStartingMenu(nullptr); startingmenu->exec(); controller = new Controller("New", startingmenu->getPlayerName1().toStdString(), startingmenu->getPlayerName2().toStdString(), Type::Humain, Type::Humain); screen = QGuiApplication::primaryScreen(); size = new QSize(screen->size()/2); width = size->width(); height = size->height(); mainlayout = new QVBoxLayout(this); QHBoxLayout* PyramidPioche = new QHBoxLayout(); QVBoxLayout* centre = new QVBoxLayout(); QHBoxLayout* total = new QHBoxLayout(); QHBoxLayout* CartesRoyalesPrivilegesPlateau= new QHBoxLayout(); plateView = new PlateView(nullptr, height-100,width/2); pyramid = new QTPyramid(); pioches = new QTRangeePioches(nullptr); boardRoyal = new QTBoardRoyal(nullptr); privilegeCounter = new PrivilegeCounter(nullptr); player1 = new PlayerQT(controller->getcurrentPlayer(), nullptr); player2 = new PlayerQT(controller->getopposingPlayer(), nullptr); PyramidPioche->addWidget(pioches); PyramidPioche->addWidget(pyramid); CartesRoyalesPrivilegesPlateau->addWidget(boardRoyal); boardRoyal->setMaximumWidth(400); pioches->setMaximumWidth(200); CartesRoyalesPrivilegesPlateau->addWidget(privilegeCounter); CartesRoyalesPrivilegesPlateau->addWidget(plateView); centre->addLayout(PyramidPioche); centre->addLayout(CartesRoyalesPrivilegesPlateau); total -> addWidget(player1); total -> addLayout(centre); total -> addWidget(player2); mainlayout->addLayout(total); //mainlayout->addLayout(first); //mainlayout->addLayout(second); int h = plateView->size().height() + pyramid->size().height()/2 + boardRoyal->size().height()/2; setFixedSize(size->width()*2,size->height()*1.75); setLayout(mainlayout); connect(plateView, &PlateView::tokensValidated, this, &QTGame::handleTokenSelection); connect(plateView, &PlateView::privilegeUsed, this, &QTGame::placePrivilege); connect(plateView, &PlateView::endOfTurn, this, &QTGame::handleGameStatus); connect(pyramid, &QTPyramid::acheterCarteClicked, this, &QTGame::handleBuyingJewelryCard); connect(pyramid, &QTPyramid::reserverCarteClicked, this, &QTGame::handleBookingJewelryCardFromPyramid); connect(pioches, &QTRangeePioches::reserverCarteClicked, this, &QTGame::handleBookingJewelryCardFromPioche); connect(boardRoyal, &QTBoardRoyal::acheterCarteClicked, this, &QTGame::handleBuyingRoyalCard); status = "start"; //handleBuyingJewelryCard(); //handleBookingJewelryCard(); handleGameStatus(); }
Here is also what packages the other .h called use:
#include <QtWidgets>
#include <QColor>
#include <utility>
#include <QDialog>
#include <QPushButton>
#include <QVBoxLayout>
#include <QLabel>
#include <vector>
#include <QtWidgets>
#include "Controller.h"
#include <QLCDNumber>
#include "QTCards.h"#include <QGraphicsView>
#include <QGraphicsLineItem>
#include <QString>
#include <QGridLayout>
#include <QLabel>
// Inclure cstddef pour utiliser std::byte de manière explicite
#include <cstddef>
#include "Jeton.h"
#include "Cards.h" -
@SGaist Hi, thanks for teh fast reply, I'm using QT with c++. The app works well when launching it with cmake. When trying to deploy it using windeployqt, it does not work, only the first window shows.Here is the .h of my main function.```
code_text// Created by utcpret on 13/12/2023. // #ifndef QTGAME_H #define QTGAME_H #include <QWidget> #include "Controller.h" #include "QTJeton.h" #include "QTCards.h" #include "QTJoueur.h" class QTGame : public QWidget { Q_OBJECT private: Controller* controller; PlateView* plateView; QTPyramid* pyramid; QTRangeePioches* pioches; QTBoardRoyal* boardRoyal; PrivilegeCounter* privilegeCounter; QVBoxLayout* mainlayout; QScreen* screen; QSize* size; PlayerQT* player1; PlayerQT* player2; unsigned int width; unsigned int height; std::string status; public: void quit() { this->close(); } void paintEvent(QPaintEvent* event) override; QTGame(QWidget* parent = nullptr); void handleTokenSelection(std::vector<const Token*> tokens); void fillBoard(); void takePrivilege(Player& player); void bookCard(GameTable& gametable); void usePriviledge(); void placePrivilege(unsigned int nb); void applyOptionalAction(OptionalActions action); void play(); void playOptionalActions(); void handleGameStatus(); void playCompulsoryActions(); void applyCompulsoryAction(CompulsoryActions action); void checkEndTurn(); void applyCardSkills(Game&game, Player&cardOwner, Player&opponent, JewelryCard&card); void buyJewelryCard(GameTable& gametable); void buyNobleCard(); void applyRoyalCardSkills(Game&game, Player&cardOwner, Player&opponent, RoyalCard&card); void generateNewGame(); public slots: void handleBuyingJewelryCard(Carte* cardclicked); void handleBookingJewelryCardFromPyramid(Carte* clickedCard); void handleBookingJewelryCardFromPioche(QTPioche* piocheclicked); void handleBuyingRoyalCard(QTCardRoyal* cardclicked); }; class QTStartingMenu : public QDialog { Q_OBJECT public: QTStartingMenu(QWidget *parent = nullptr); QString getPlayerName1() {return playerName1;} QString getPlayerName2() {return playerName2;} private: QString playerName1; QString playerName2; public slots: void startNewGame() { // Obtenir les noms des joueurs playerName1 = QInputDialog::getText(this, "Nouvelle partie", "Nom du joueur 1 :"); playerName2 = QInputDialog::getText(this, "Nouvelle partie", "Nom du joueur 2 :"); accept(); qDebug() << "Nouvelle partie avec les joueurs : " << playerName1 << " et " << playerName2; } void loadGame() { // Logique pour charger une partie sauvegardée qDebug() << "Charger une partie sauvegardée"; } void quitGame() { std::exit(0); } }; QString MBox(const std::vector<QString>& buttonLabels = {"OK"}, const QString& title = "Message", const QString& text = "Message"); int MBox(const std::vector<OptionalActions>& buttonLabels , const QString& title = "Message", const QString& text = "Message"); int MBox(const std::vector<CompulsoryActions>& buttonLabels , const QString& title = "Message", const QString& text = "Message"); void showWarningMessage(const QString &title, const QString &content); void showVictoryDialog(const QString &playerName, QTGame *gameInstance); int getNumberBetween(int x, int y, const QString &message, QWidget *parent = nullptr); void clearWidgetAndSetNewLayout(QWidget* parentWidget, QLayout* newLayout); void clearLayout(QLayout* layout); #endif //QTGAME_H
Here is the constructor, in the .cpp of my main function (the constructor make first a window, that is the only window showing up when trying to use windeploy)
QTGame::QTGame(QWidget* parent) : QWidget(parent) { QTStartingMenu* startingmenu = new QTStartingMenu(nullptr); startingmenu->exec(); controller = new Controller("New", startingmenu->getPlayerName1().toStdString(), startingmenu->getPlayerName2().toStdString(), Type::Humain, Type::Humain); screen = QGuiApplication::primaryScreen(); size = new QSize(screen->size()/2); width = size->width(); height = size->height(); mainlayout = new QVBoxLayout(this); QHBoxLayout* PyramidPioche = new QHBoxLayout(); QVBoxLayout* centre = new QVBoxLayout(); QHBoxLayout* total = new QHBoxLayout(); QHBoxLayout* CartesRoyalesPrivilegesPlateau= new QHBoxLayout(); plateView = new PlateView(nullptr, height-100,width/2); pyramid = new QTPyramid(); pioches = new QTRangeePioches(nullptr); boardRoyal = new QTBoardRoyal(nullptr); privilegeCounter = new PrivilegeCounter(nullptr); player1 = new PlayerQT(controller->getcurrentPlayer(), nullptr); player2 = new PlayerQT(controller->getopposingPlayer(), nullptr); PyramidPioche->addWidget(pioches); PyramidPioche->addWidget(pyramid); CartesRoyalesPrivilegesPlateau->addWidget(boardRoyal); boardRoyal->setMaximumWidth(400); pioches->setMaximumWidth(200); CartesRoyalesPrivilegesPlateau->addWidget(privilegeCounter); CartesRoyalesPrivilegesPlateau->addWidget(plateView); centre->addLayout(PyramidPioche); centre->addLayout(CartesRoyalesPrivilegesPlateau); total -> addWidget(player1); total -> addLayout(centre); total -> addWidget(player2); mainlayout->addLayout(total); //mainlayout->addLayout(first); //mainlayout->addLayout(second); int h = plateView->size().height() + pyramid->size().height()/2 + boardRoyal->size().height()/2; setFixedSize(size->width()*2,size->height()*1.75); setLayout(mainlayout); connect(plateView, &PlateView::tokensValidated, this, &QTGame::handleTokenSelection); connect(plateView, &PlateView::privilegeUsed, this, &QTGame::placePrivilege); connect(plateView, &PlateView::endOfTurn, this, &QTGame::handleGameStatus); connect(pyramid, &QTPyramid::acheterCarteClicked, this, &QTGame::handleBuyingJewelryCard); connect(pyramid, &QTPyramid::reserverCarteClicked, this, &QTGame::handleBookingJewelryCardFromPyramid); connect(pioches, &QTRangeePioches::reserverCarteClicked, this, &QTGame::handleBookingJewelryCardFromPioche); connect(boardRoyal, &QTBoardRoyal::acheterCarteClicked, this, &QTGame::handleBuyingRoyalCard); status = "start"; //handleBuyingJewelryCard(); //handleBookingJewelryCard(); handleGameStatus(); }
Here is also what packages the other .h called use:
#include <QtWidgets>
#include <QColor>
#include <utility>
#include <QDialog>
#include <QPushButton>
#include <QVBoxLayout>
#include <QLabel>
#include <vector>
#include <QtWidgets>
#include "Controller.h"
#include <QLCDNumber>
#include "QTCards.h"#include <QGraphicsView>
#include <QGraphicsLineItem>
#include <QString>
#include <QGridLayout>
#include <QLabel>
// Inclure cstddef pour utiliser std::byte de manière explicite
#include <cstddef>
#include "Jeton.h"
#include "Cards.h"@RAPHCVR Start from a terminal to see whether there are any errors.
Also set QT_DEBUG_PLUGINS before starting the app in a terminal and check the output (see https://doc.qt.io/qt-6/debug.html for details).