
Originally Posted by
Philip_Anselmo
but doesn't close the form1... <=the first question is.. how do I close or better yet.. just hide.. the form1?
Try this:
void Form1::muestraform2()
{
static Form2 *form2 = new Form2( this );
hide();
form2->show();
form2->setActiveWindow();
form2->raise();
}
void Form1::muestraform2()
{
static Form2 *form2 = new Form2( this );
hide();
form2->show();
form2->setActiveWindow();
form2->raise();
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
Philip_Anselmo
the other problem is that I made an object of the class form1 on form2 ( Form1 *form1 = new Form1(); ), the I tryied to fill the TL2 with this:
...
It doesn't gives me any errors at all, but the text is empty
It looks like you create a new object of the Form1 class instead of using the existing one.

Originally Posted by
Philip_Anselmo
QString texto = LE1->text(); (it's declared and filled inside a slot wich I use to pass the text from LE1 to TL1)
...
It should be like: form1->texto right?
Again, it looks like you are using a local variable instead another one --- in this case you should use a member variable.

Originally Posted by
Philip_Anselmo
after that I want to pass that QString to form2 to fill the TL2
You can either create a method that returns that string and just invoke it from that second form in the Right Time(tm) or you can use signals and slots mechanism to update that string after every change.
Bookmarks