Include a dialog twice
-
Hi,
Please show the real code.
Your example here does not even relate to the error.
-
Hi @SGaist, here's my .h file:
#ifndef KEYCOLOR_H #define KEYCOLOR_H #include "keymapping.h" //here #include <QDialog> #include <QColorDialog> #include <QDebug> namespace Ui { class keyColor; } class keyColor : public QDialog { Q_OBJECT public: explicit keyColor(QWidget *parent = nullptr); ~keyColor(); void getMapping(); QString getFirstCol() {return firstCol;} QString getFirstBor() {return firstBor;} QString getFirstTog() {return firstTog;} QString getSecondCol() {return secondCol;} QString getSecondBor() {return secondBor;} QString getSecondTog() {return secondTog;} QString getThirdCol() {return thirdCol;} QString getThirdBor() {return thirdBor;} QString getThirdTog() {return thirdTog;} QString getFourthCol() {return fourthCol;} QString getFourthBor() {return fourthBor;} QString getFourthTog() {return fourthTog;} QString getFifthCol() {return fifthCol;} QString getFifthBor() {return fifthBor;} QString getFifthTog() {return fifthTog;} private slots: void on_toolButton_Col1_clicked(); void on_toolButton_Bor1_clicked(); void on_toolButton_Tog1_clicked(); void on_toolButton_Col2_clicked(); void on_toolButton_Bor2_clicked(); void on_toolButton_Tog2_clicked(); void on_toolButton_Col3_clicked(); void on_toolButton_Bor3_clicked(); void on_toolButton_Tog3_clicked(); void on_toolButton_Col4_clicked(); void on_toolButton_Bor4_clicked(); void on_toolButton_Tog4_clicked(); void on_toolButton_Col5_clicked(); void on_toolButton_Bor5_clicked(); void on_toolButton_Tog5_clicked(); void on_pushButton_Toggled_toggled(bool checked); private: Ui::keyColor *ui; keyMappingsColor map; //here QString firstCol = "200, 15, 20"; QString firstBor; QString firstTog; QString secondCol; QString secondBor; QString secondTog; QString thirdCol; QString thirdBor; QString thirdTog; QString fourthCol; QString fourthBor; QString fourthTog; QString fifthCol; QString fifthBor; QString fifthTog; }; #endif // KEYCOLOR_HThe parts where //here is, are the including commands.
-
What is keyMappingsColor ?
-
That I understood.
My question was rather: how did you implement it ?
Is it really located in "keymapping.h" ?
Is it in a namespace ? -
That I understood.
My question was rather: how did you implement it ?
Is it really located in "keymapping.h" ?
Is it in a namespace ? -
@Sucharek said in Include a dialog twice:
keyColor
Do oyu include this header file inside keymapping.h ? If so you've a circular include problem -> google for 'forward declaration' and remove the circular include with the help of this.
-
@Sucharek said in Include a dialog twice:
keyColor
Do oyu include this header file inside keymapping.h ? If so you've a circular include problem -> google for 'forward declaration' and remove the circular include with the help of this.
Hi @Christian-Ehrlicher, yes I had it included in both dialogs. When I removed it in keymapping.h, I could include the in the other class, so thanks, but I have another problem, which was actually the first one I had.
So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't. -
Hi @Christian-Ehrlicher, yes I had it included in both dialogs. When I removed it in keymapping.h, I could include the in the other class, so thanks, but I have another problem, which was actually the first one I had.
So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.@Sucharek said in Include a dialog twice:
So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.
Do you really think anyone can answer from this description?
-
@Sucharek said in Include a dialog twice:
So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.
Do you really think anyone can answer from this description?
Hi @JonB, sorry for doing a bad description. Here's a better one:
Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same. -
Hi @JonB, sorry for doing a bad description. Here's a better one:
Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same. -
Hi @JonB, sorry for doing a bad description. Here's a better one:
Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.@Sucharek said in Include a dialog twice:
Hi @JonB, sorry for doing a bad description. Here's a better one:
Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.please keep in mind, your 2 dialogs are 2 different instances, even though they share a base class, they are completely separated. That means changing stuff in the base class from inside one dialog will not ever effect stuff in the base class of the other dialog, when your program is running.
-
@Sucharek said in Include a dialog twice:
Hi @JonB, sorry for doing a bad description. Here's a better one:
Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.please keep in mind, your 2 dialogs are 2 different instances, even though they share a base class, they are completely separated. That means changing stuff in the base class from inside one dialog will not ever effect stuff in the base class of the other dialog, when your program is running.