Access the UI, from multiple windows.
-
You wrote the method twice: once in the header and a second time in the implementation file. That's what the compilers is complaining about. You can have only one implementation.
-
You wrote the method twice: once in the header and a second time in the implementation file. That's what the compilers is complaining about. You can have only one implementation.
-
wrote on 5 Feb 2018, 00:48 last edited by
For the love of God, this stuff is not working, i lost my patience.
-
wrote on 5 Feb 2018, 04:17 last edited by
Can someone create just any working example?? I want it to compile it, and see if it's gonna work.
-
Can someone create just any working example?? I want it to compile it, and see if it's gonna work.
@Loc888 Come on it's simple. Just remove the method definition from the header file:
// Header : explicit Window1(Settings_Window *TheTrueOne = 0, QWidget *parent = 0); // Source: Window1::Window1(Settings_Window *TheTrueOne,QWidget *parent) : QWidget(parent),ui(new Ui::Window1), GivenToMe(TheTrueOne) { ui->setupUi(this); }
Some reading about C++ would help.
-
@Loc888 Come on it's simple. Just remove the method definition from the header file:
// Header : explicit Window1(Settings_Window *TheTrueOne = 0, QWidget *parent = 0); // Source: Window1::Window1(Settings_Window *TheTrueOne,QWidget *parent) : QWidget(parent),ui(new Ui::Window1), GivenToMe(TheTrueOne) { ui->setupUi(this); }
Some reading about C++ would help.
wrote on 5 Feb 2018, 18:27 last edited by Loc888 2 May 2018, 18:28@jsulm I fixed that issue.. I mean, when i change the checkBox in the other window, nothing change, and i try like 50 times and more, and same stuff, doesn't work,and i can't understand why.
My compiler is giving me around 50 warnings, when i create non-static data member, it is normal?
-
@jsulm I fixed that issue.. I mean, when i change the checkBox in the other window, nothing change, and i try like 50 times and more, and same stuff, doesn't work,and i can't understand why.
My compiler is giving me around 50 warnings, when i create non-static data member, it is normal?
@Loc888
Hi
Nope 50 warning is not normal.
What does warnings say ?Also, if nothing happens. Are you sure u are not creating a second copy/instance ?
-
@Loc888
Hi
Nope 50 warning is not normal.
What does warnings say ?Also, if nothing happens. Are you sure u are not creating a second copy/instance ?
wrote on 5 Feb 2018, 19:07 last edited bymainwindow.h:41: Warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
Settings_Window* Settings_Widget = new Settings_Window;
^Men, i don't know about that instance.....I send you a simple project, and if you want., you can take a look, i am really tired.
-
mainwindow.h:41: Warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
Settings_Window* Settings_Widget = new Settings_Window;
^Men, i don't know about that instance.....I send you a simple project, and if you want., you can take a look, i am really tired.
@Loc888
Hi
It gives that warning if you doclass xxx : whatever {
int var =0;
}
and not using c++ 11Do you have
Settings_Window* Settings_Widget = new Settings_Window;
in a. h file ?Yes, please. zip project. upload to somewhere and send me link.
-
@Loc888
Hi
It gives that warning if you doclass xxx : whatever {
int var =0;
}
and not using c++ 11Do you have
Settings_Window* Settings_Widget = new Settings_Window;
in a. h file ?Yes, please. zip project. upload to somewhere and send me link.
wrote on 5 Feb 2018, 19:32 last edited byhttp://www.mediafire.com/file/n9e0d3q02soc3z5/Test_3.rar
Yes, it's in .h file. Correct this stuff if you can, and try to compile, because i do a lot of tries, and i don't really know how it's looks like right now.
-
http://www.mediafire.com/file/n9e0d3q02soc3z5/Test_3.rar
Yes, it's in .h file. Correct this stuff if you can, and try to compile, because i do a lot of tries, and i don't really know how it's looks like right now.
@Loc888
Hi
Im not getting those warning.
While i look in project, you can try adding
CONFIG +=c++11
in the .pro file.
Delete all in build folder
and rebuild all -
Hi
You do create a brand new mainwindow. so
that is why you dont see the checked checkbox as that is in first copyvoid Window1::on_Check_Button_clicked() { MainWindow* W1 = new MainWindow; // not the first one, u open settings in.. ui->lineEdit->setText("Is not checked.");
-
Hi
Here is working project.
Main issue was you created a NEW mainwindow so
the setting_Widget was NOT the same as one where u checked checkbox..https://www.dropbox.com/s/nhrr9qpv76d1r07/Test_3B.zip?dl=0
I fixed it to give window1 as parameter and use it that way.
(as described higher up)
41/53