Ok, well, the code that's giving errors isn't too big, so I'll post it here. Note that these are just the header files, the .cpp's are included in the attached zip file.
PokerInfoTable.h
#include <Qt stuff here (multiple lines)>
#include <string>
#include <vector>
class PokerTableInfo
: public QWidget{
Q_OBJECT
public:
PokerTableInfo
(QWidget *parent
= 0);
~PokerTableInfo();
void setTableName(std::string *tableName);
std::string *getTableName();
void setFolded();
void newRound();
void setNumPlayers(int numPlayers);
void setProfit(double *dProfit);
void setHandFlavorText(std::string *sFlavor);
void addHandCard(char rank, char suit);
void addBoardCard(char rank, char suit);
private:
bool folded;
std::vector<char> handCardsRank;
std::vector<char> handCardsSuit;
std::vector<char> boardCardsRank;
std::vector<char> boardCardsSuit;
std::string *tableName;
void setupUi();
void resetHandCards();
void resetBoardCards();
void setHandText();
void setBoardText();
static bool isLegalRank(char rank);
static bool isLegalSuit(char suit);
static void getCardText
(std
::vector<char>
*rank, std
::vector<char>
*suit,
QString *cardText
);
};
#include <Qt stuff here (multiple lines)>
#include <string>
#include <vector>
class PokerTableInfo : public QWidget
{
Q_OBJECT
public:
PokerTableInfo(QWidget *parent = 0);
~PokerTableInfo();
void setTableName(std::string *tableName);
std::string *getTableName();
void setFolded();
void newRound();
void setNumPlayers(int numPlayers);
void setProfit(double *dProfit);
void setHandFlavorText(std::string *sFlavor);
void addHandCard(char rank, char suit);
void addBoardCard(char rank, char suit);
private:
QGroupBox *boxTable;
QWidget *layoutWidget;
QGridLayout *gridLayout;
QLabel *lblPlayers;
QLabel *txtPlayers;
QLabel *lblHand;
QLabel *txtHand;
QLabel *lblBoard;
QLabel *txtBoard;
QLabel *lblProfit;
QLabel *txtProfit;
bool folded;
std::vector<char> handCardsRank;
std::vector<char> handCardsSuit;
QString *handFlavorText;
std::vector<char> boardCardsRank;
std::vector<char> boardCardsSuit;
std::string *tableName;
void setupUi();
void resetHandCards();
void resetBoardCards();
void setHandText();
void setBoardText();
static bool isLegalRank(char rank);
static bool isLegalSuit(char suit);
static void getCardText(std::vector<char> *rank, std::vector<char> *suit, QString *cardText);
};
To copy to clipboard, switch view to plain text mode
MainWindow.h
#include <QtGui/QWidget>
#include <vector>
#include "PokerTableInfo.h"
{
Q_OBJECT
public:
~MainWindow();
std::vector<PokerTableInfo*> getPokerTables();
void addPokerTable();
void removePokerTable(int tableNr);
private:
std::vector<PokerTableInfo*> pokerTables;
void autoResize(int numPokerTables);
void autoRearange();
void setNewSize(int width, int height);
void setupUi();
PokerTableInfo *pokerTableInfo;
};
#include <QtGui/QWidget>
#include <vector>
#include "PokerTableInfo.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
std::vector<PokerTableInfo*> getPokerTables();
void addPokerTable();
void removePokerTable(int tableNr);
private:
std::vector<PokerTableInfo*> pokerTables;
void autoResize(int numPokerTables);
void autoRearange();
void setNewSize(int width, int height);
void setupUi();
QWidget *centralwidget;
QWidget *gridLayoutContainer;
QGridLayout *gridLayout;
PokerTableInfo *pokerTableInfo;
QLabel *lblStatusBar;
QLabel *lblEmpty;
};
To copy to clipboard, switch view to plain text mode
The error says gridLayout is already defined in MainWindow.h (4th line from the bottom) and it's being redefined in PokerInfoTable.h (3rd line after private declarations start).
In case you want to see for yourself, I made a minimalist project that still gives exactly the same error, just run compile.bat in the attached zip file.
Bookmarks