Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, May 2008
Newbie Trying to Learn QStackedWidget

Pages: Prev | 1 | 2 | Next

Message 1 in thread

Hi,

I am new to C++ and Qt and am trying to learn the basics of a
QStackedWidget.  All I'm trying to do at this stage is add a couple of
basic forms to the QStackedWidget and then display each form when a
menu item is chosen.

To do this I have copied and adapted the following code from books and examples:
/*********
 * Form1.h
 *********/
#include <QtGui>
#include "ui_Form1.h"

class Form1 : public QWidget,
			  public Ui::Form1
{

	Q_OBJECT

	public:
		Form1(QWidget* parent = 0);
		~Form1();

};

/***********
 * Form1.cpp
 ***********/
#include <QWidget>
#include "Form1.h"

Form1::Form1(QWidget* parent)
{
	setupUi(this);
}

Form1::~Form1()
{

}

/*********
 * Form2.h
 *********/
#include <QtGui>
#include "ui_Form2.h"

class Form2 : public QWidget,
			  public Ui::Form2
{

	Q_OBJECT

	public:
		Form2(QWidget* parent = 0);
		~Form2();

};

/***********
 * Form2.cpp
 ***********/
#include <QWidget>
#include "Form2.h"

Form2::Form2(QWidget* parent)
{
	setupUi(this);
}

Form2::~Form2()
{

}

/**************
 * mainwindow.h
 **************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "ui_Stacked.h"

class MainWindow : public QMainWindow,
                   public Ui::MainWindow
{
  Q_OBJECT
  public:
    MainWindow(QWidget* parent = 0);
    ~MainWindow();

  protected:
    void setupActions();
  protected slots:
    void showForm1();
    void showForm2();
};
#endif // MAINWINDOW_H

/****************
 * mainwindow.cpp
 ****************/
#include <QtGui>
#include "mainwindow.h"
#include "Form1.h"
#include "Form2.h"

// Constructor
MainWindow::MainWindow(QWidget* parent)
 : QMainWindow(parent)
{
  setupUi(this);
  setupActions();

}

// Destructor
MainWindow::~MainWindow()
{

}

void MainWindow::setupActions()
{
  connect(actionShow_Form_1, SIGNAL(triggered(bool)),
          qApp, SLOT(showForm1()));
  connect(actionShow_Form_2, SIGNAL(triggered(bool)),
          qApp, SLOT(showForm2()));

}

void MainWindow::showForm1()
{
	stackedWidget->setCurrentIndex(0);
}

void MainWindow::showForm2()
{
	stackedWidget->setCurrentIndex(1);
}

/**********
 * main.cpp
 **********/
#include <QApplication>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow mainWindow;
    mainWindow.show();

    return a.exec();
}

Could someone please tell me where I add each Form to the
QStackedWidget?  I have tried various things as part of the MainWindow
constructor but get errors with whatever I try.

Many thanks,

Peter.

--
 [ signature omitted ] 

Message 2 in thread

Inyour MainWindow cosntructor... Create 2 forms, and the stacked
widget...

Ie
form1 = new Form1;
form2 = new Form2;

stackedWidget = new QStackedWidget( this );
stackedWidget->addWidget( form1 );
stackedWidget->addWidget( form2 );


Scott



> -----Original Message-----
> From: Peter E Dennis [mailto:peter.edwin.dennis@xxxxxxxxx]
> Sent: Thursday, May 29, 2008 12:18 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Newbie Trying to Learn QStackedWidget
> 
> Hi,
> 
> I am new to C++ and Qt and am trying to learn the basics of a
> QStackedWidget.  All I'm trying to do at this stage is add a couple of
> basic forms to the QStackedWidget and then display each form when a
> menu item is chosen.
> 
> To do this I have copied and adapted the following code from books and
> examples:
> /*********
>  * Form1.h
>  *********/
> #include <QtGui>
> #include "ui_Form1.h"
> 
> class Form1 : public QWidget,
> 			  public Ui::Form1
> {
> 
> 	Q_OBJECT
> 
> 	public:
> 		Form1(QWidget* parent = 0);
> 		~Form1();
> 
> };
> 
> /***********
>  * Form1.cpp
>  ***********/
> #include <QWidget>
> #include "Form1.h"
> 
> Form1::Form1(QWidget* parent)
> {
> 	setupUi(this);
> }
> 
> Form1::~Form1()
> {
> 
> }
> 
> /*********
>  * Form2.h
>  *********/
> #include <QtGui>
> #include "ui_Form2.h"
> 
> class Form2 : public QWidget,
> 			  public Ui::Form2
> {
> 
> 	Q_OBJECT
> 
> 	public:
> 		Form2(QWidget* parent = 0);
> 		~Form2();
> 
> };
> 
> /***********
>  * Form2.cpp
>  ***********/
> #include <QWidget>
> #include "Form2.h"
> 
> Form2::Form2(QWidget* parent)
> {
> 	setupUi(this);
> }
> 
> Form2::~Form2()
> {
> 
> }
> 
> /**************
>  * mainwindow.h
>  **************/
> #ifndef MAINWINDOW_H
> #define MAINWINDOW_H
> 
> #include <QMainWindow>
> #include "ui_Stacked.h"
> 
> class MainWindow : public QMainWindow,
>                    public Ui::MainWindow
> {
>   Q_OBJECT
>   public:
>     MainWindow(QWidget* parent = 0);
>     ~MainWindow();
> 
>   protected:
>     void setupActions();
>   protected slots:
>     void showForm1();
>     void showForm2();
> };
> #endif // MAINWINDOW_H
> 
> /****************
>  * mainwindow.cpp
>  ****************/
> #include <QtGui>
> #include "mainwindow.h"
> #include "Form1.h"
> #include "Form2.h"
> 
> // Constructor
> MainWindow::MainWindow(QWidget* parent)
>  : QMainWindow(parent)
> {
>   setupUi(this);
>   setupActions();
> 
> }
> 
> // Destructor
> MainWindow::~MainWindow()
> {
> 
> }
> 
> void MainWindow::setupActions()
> {
>   connect(actionShow_Form_1, SIGNAL(triggered(bool)),
>           qApp, SLOT(showForm1()));
>   connect(actionShow_Form_2, SIGNAL(triggered(bool)),
>           qApp, SLOT(showForm2()));
> 
> }
> 
> void MainWindow::showForm1()
> {
> 	stackedWidget->setCurrentIndex(0);
> }
> 
> void MainWindow::showForm2()
> {
> 	stackedWidget->setCurrentIndex(1);
> }
> 
> /**********
>  * main.cpp
>  **********/
> #include <QApplication>
> #include "mainwindow.h"
> 
> int main(int argc, char *argv[])
> {
>     QApplication a(argc, argv);
> 
>     MainWindow mainWindow;
>     mainWindow.show();
> 
>     return a.exec();
> }
> 
> Could someone please tell me where I add each Form to the
> QStackedWidget?  I have tried various things as part of the MainWindow
> constructor but get errors with whatever I try.
> 
> Many thanks,
> 
> Peter.
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 3 in thread

Hi Scott,

Thanks for your reply.

I have tried a couple of ways to do this, when I add your suggestion
and try to 'make' it again:

mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:16: error: `form1' undeclared (first use this function)
mainwindow.cpp:16: error: (Each undeclared identifier is reported only once for
each function it appears in.)
mainwindow.cpp:17: error: `form2' undeclared (first use this function)
mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
mingw32-make: *** [release] Error 2

if I then put:

 Form1 form1 = new Form1;
 Form2 form2 = new Form2;

 stackedWidget = new QStackedWidget( this );
 stackedWidget->addWidget( form1 );
 stackedWidget->addWidget( form2 );

I get the following errors:

C:\Qt\4.4.0\projects\Stacked>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.4.0/projects/Stacked'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS
_QMAIN -I"..\..\include\QtCore" -I"..\..\include\QtCore" -I"..\..\include\QtGui"
 -I"..\..\include\QtGui" -I"..\..\include" -I"." -I"c:\Qt\4.4.0\include\ActiveQt
" -I"tmp\moc\release_shared" -I"." -I"..\..\mkspecs\win32-g++" -o tmp\obj\releas
e_shared\mainwindow.o mainwindow.cpp
../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor `Form1::
Form1(const Form1&)':
../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error: `QWidget::QWidget
(const QWidget&)' is private
mainwindow.cpp:16: error: within this context
mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:16: error:   initializing temporary from result of `Form1::Form1(
QWidget*)'
../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor `Form2::
Form2(const Form2&)':
../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error: `QWidget::QWidget
(const QWidget&)' is private
mainwindow.cpp:17: error: within this context
mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:17: error:   initializing temporary from result of `Form2::Form2(
QWidget*)'
mainwindow.cpp:20: error: no matching function for call to `QStackedWidget::addW
idget(Form1&)'
../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note: candidates
are: int QStackedWidget::addWidget(QWidget*)
mainwindow.cpp:21: error: no matching function for call to `QStackedWidget::addW
idget(Form2&)'
../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note: candidates
are: int QStackedWidget::addWidget(QWidget*)
mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
mingw32-make: *** [release] Error 2

C:\Qt\4.4.0\projects\Stacked>

Thanks again,

Peter.

2008/5/29 Scott Aron Bloom <Scott.Bloom@xxxxxxxxxxxx>:
> Inyour MainWindow cosntructor... Create 2 forms, and the stacked
> widget...
>
> Ie
> form1 = new Form1;
> form2 = new Form2;
>
> stackedWidget = new QStackedWidget( this );
> stackedWidget->addWidget( form1 );
> stackedWidget->addWidget( form2 );
>
>
> Scott
>
>
>
>> -----Original Message-----
>> From: Peter E Dennis [mailto:peter.edwin.dennis@xxxxxxxxx]
>> Sent: Thursday, May 29, 2008 12:18 AM
>> To: qt-interest@xxxxxxxxxxxxx
>> Subject: Newbie Trying to Learn QStackedWidget
>>
>> Hi,
>>
>> I am new to C++ and Qt and am trying to learn the basics of a
>> QStackedWidget.  All I'm trying to do at this stage is add a couple of
>> basic forms to the QStackedWidget and then display each form when a
>> menu item is chosen.
>>
>> To do this I have copied and adapted the following code from books and
>> examples:
>> /*********
>>  * Form1.h
>>  *********/
>> #include <QtGui>
>> #include "ui_Form1.h"
>>
>> class Form1 : public QWidget,
>>                         public Ui::Form1
>> {
>>
>>       Q_OBJECT
>>
>>       public:
>>               Form1(QWidget* parent = 0);
>>               ~Form1();
>>
>> };
>>
>> /***********
>>  * Form1.cpp
>>  ***********/
>> #include <QWidget>
>> #include "Form1.h"
>>
>> Form1::Form1(QWidget* parent)
>> {
>>       setupUi(this);
>> }
>>
>> Form1::~Form1()
>> {
>>
>> }
>>
>> /*********
>>  * Form2.h
>>  *********/
>> #include <QtGui>
>> #include "ui_Form2.h"
>>
>> class Form2 : public QWidget,
>>                         public Ui::Form2
>> {
>>
>>       Q_OBJECT
>>
>>       public:
>>               Form2(QWidget* parent = 0);
>>               ~Form2();
>>
>> };
>>
>> /***********
>>  * Form2.cpp
>>  ***********/
>> #include <QWidget>
>> #include "Form2.h"
>>
>> Form2::Form2(QWidget* parent)
>> {
>>       setupUi(this);
>> }
>>
>> Form2::~Form2()
>> {
>>
>> }
>>
>> /**************
>>  * mainwindow.h
>>  **************/
>> #ifndef MAINWINDOW_H
>> #define MAINWINDOW_H
>>
>> #include <QMainWindow>
>> #include "ui_Stacked.h"
>>
>> class MainWindow : public QMainWindow,
>>                    public Ui::MainWindow
>> {
>>   Q_OBJECT
>>   public:
>>     MainWindow(QWidget* parent = 0);
>>     ~MainWindow();
>>
>>   protected:
>>     void setupActions();
>>   protected slots:
>>     void showForm1();
>>     void showForm2();
>> };
>> #endif // MAINWINDOW_H
>>
>> /****************
>>  * mainwindow.cpp
>>  ****************/
>> #include <QtGui>
>> #include "mainwindow.h"
>> #include "Form1.h"
>> #include "Form2.h"
>>
>> // Constructor
>> MainWindow::MainWindow(QWidget* parent)
>>  : QMainWindow(parent)
>> {
>>   setupUi(this);
>>   setupActions();
>>
>> }
>>
>> // Destructor
>> MainWindow::~MainWindow()
>> {
>>
>> }
>>
>> void MainWindow::setupActions()
>> {
>>   connect(actionShow_Form_1, SIGNAL(triggered(bool)),
>>           qApp, SLOT(showForm1()));
>>   connect(actionShow_Form_2, SIGNAL(triggered(bool)),
>>           qApp, SLOT(showForm2()));
>>
>> }
>>
>> void MainWindow::showForm1()
>> {
>>       stackedWidget->setCurrentIndex(0);
>> }
>>
>> void MainWindow::showForm2()
>> {
>>       stackedWidget->setCurrentIndex(1);
>> }
>>
>> /**********
>>  * main.cpp
>>  **********/
>> #include <QApplication>
>> #include "mainwindow.h"
>>
>> int main(int argc, char *argv[])
>> {
>>     QApplication a(argc, argv);
>>
>>     MainWindow mainWindow;
>>     mainWindow.show();
>>
>>     return a.exec();
>> }
>>
>> Could someone please tell me where I add each Form to the
>> QStackedWidget?  I have tried various things as part of the MainWindow
>> constructor but get errors with whatever I try.
>>
>> Many thanks,
>>
>> Peter.
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 4 in thread

You must write:
Form1* form1 = new Form1;
Form2* form2 = new Form2;

On Thu, 29 May 2008 12:17:30 +0400, Peter E Dennis  
<peter.edwin.dennis@xxxxxxxxx> wrote:
> Hi Scott,
>
> Thanks for your reply.
>
> I have tried a couple of ways to do this, when I add your suggestion
> and try to 'make' it again:
>
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:16: error: `form1' undeclared (first use this function)
> mainwindow.cpp:16: error: (Each undeclared identifier is reported only  
> once for
> each function it appears in.)
> mainwindow.cpp:17: error: `form2' undeclared (first use this function)
> mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
> mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
> mingw32-make: *** [release] Error 2
>
> if I then put:
>
>  Form1 form1 = new Form1;
>  Form2 form2 = new Form2;
>
>  stackedWidget = new QStackedWidget( this );
>  stackedWidget->addWidget( form1 );
>  stackedWidget->addWidget( form2 );
>
> I get the following errors:
>
> C:\Qt\4.4.0\projects\Stacked>make
> mingw32-make -f Makefile.Release
> mingw32-make[1]: Entering directory `C:/Qt/4.4.0/projects/Stacked'
> g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE  
> -DQT_LARGEFILE_SUPPORT
> -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT  
> -DQT_NEEDS
> _QMAIN -I"..\..\include\QtCore" -I"..\..\include\QtCore"  
> -I"..\..\include\QtGui"
>  -I"..\..\include\QtGui" -I"..\..\include" -I"."  
> -I"c:\Qt\4.4.0\include\ActiveQt
> " -I"tmp\moc\release_shared" -I"." -I"..\..\mkspecs\win32-g++" -o  
> tmp\obj\releas
> e_shared\mainwindow.o mainwindow.cpp
> ../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor  
> `Form1::
> Form1(const Form1&)':
> ../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error:  
> `QWidget::QWidget
> (const QWidget&)' is private
> mainwindow.cpp:16: error: within this context
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:16: error:   initializing temporary from result of  
> `Form1::Form1(
> QWidget*)'
> ../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor  
> `Form2::
> Form2(const Form2&)':
> ../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error:  
> `QWidget::QWidget
> (const QWidget&)' is private
> mainwindow.cpp:17: error: within this context
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:17: error:   initializing temporary from result of  
> `Form2::Form2(
> QWidget*)'
> mainwindow.cpp:20: error: no matching function for call to  
> `QStackedWidget::addW
> idget(Form1&)'
> ../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note:  
> candidates
> are: int QStackedWidget::addWidget(QWidget*)
> mainwindow.cpp:21: error: no matching function for call to  
> `QStackedWidget::addW
> idget(Form2&)'
> ../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note:  
> candidates
> are: int QStackedWidget::addWidget(QWidget*)
> mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
> mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
> mingw32-make: *** [release] Error 2
>
> C:\Qt\4.4.0\projects\Stacked>
>
> Thanks again,
>
> Peter.
>
> 2008/5/29 Scott Aron Bloom <Scott.Bloom@xxxxxxxxxxxx>:
>> Inyour MainWindow cosntructor... Create 2 forms, and the stacked
>> widget...
>>
>> Ie
>> form1 = new Form1;
>> form2 = new Form2;
>>
>> stackedWidget = new QStackedWidget( this );
>> stackedWidget->addWidget( form1 );
>> stackedWidget->addWidget( form2 );
>>
>> Scott
>>
>>> -----Original Message-----
>>> From: Peter E Dennis [mailto:peter.edwin.dennis@xxxxxxxxx]
>>> Sent: Thursday, May 29, 2008 12:18 AM
>>> To: qt-interest@xxxxxxxxxxxxx
>>> Subject: Newbie Trying to Learn QStackedWidget
>>>
>>> Hi,
>>>
>>> I am new to C++ and Qt and am trying to learn the basics of a
>>> QStackedWidget.  All I'm trying to do at this stage is add a couple of
>>> basic forms to the QStackedWidget and then display each form when a
>>> menu item is chosen.
>>>
>>> To do this I have copied and adapted the following code from books and
>>> examples:
>>> /*********
>>>  * Form1.h
>>>  *********/
>>> #include <QtGui>
>>> #include "ui_Form1.h"
>>>
>>> class Form1 : public QWidget,
>>>                         public Ui::Form1
>>> {
>>>
>>>       Q_OBJECT
>>>
>>>       public:
>>>               Form1(QWidget* parent = 0);
>>>               ~Form1();
>>>
>>> };
>>>
>>> /***********
>>>  * Form1.cpp
>>>  ***********/
>>> #include <QWidget>
>>> #include "Form1.h"
>>>
>>> Form1::Form1(QWidget* parent)
>>> {
>>>       setupUi(this);
>>> }
>>>
>>> Form1::~Form1()
>>> {
>>>
>>> }
>>>
>>> /*********
>>>  * Form2.h
>>>  *********/
>>> #include <QtGui>
>>> #include "ui_Form2.h"
>>>
>>> class Form2 : public QWidget,
>>>                         public Ui::Form2
>>> {
>>>
>>>       Q_OBJECT
>>>
>>>       public:
>>>               Form2(QWidget* parent = 0);
>>>               ~Form2();
>>>
>>> };
>>>
>>> /***********
>>>  * Form2.cpp
>>>  ***********/
>>> #include <QWidget>
>>> #include "Form2.h"
>>>
>>> Form2::Form2(QWidget* parent)
>>> {
>>>       setupUi(this);
>>> }
>>>
>>> Form2::~Form2()
>>> {
>>>
>>> }
>>>
>>> /**************
>>>  * mainwindow.h
>>>  **************/
>>> #ifndef MAINWINDOW_H
>>> #define MAINWINDOW_H
>>>
>>> #include <QMainWindow>
>>> #include "ui_Stacked.h"
>>>
>>> class MainWindow : public QMainWindow,
>>>                    public Ui::MainWindow
>>> {
>>>   Q_OBJECT
>>>   public:
>>>     MainWindow(QWidget* parent = 0);
>>>     ~MainWindow();
>>>
>>>   protected:
>>>     void setupActions();
>>>   protected slots:
>>>     void showForm1();
>>>     void showForm2();
>>> };
>>> #endif // MAINWINDOW_H
>>>
>>> /****************
>>>  * mainwindow.cpp
>>>  ****************/
>>> #include <QtGui>
>>> #include "mainwindow.h"
>>> #include "Form1.h"
>>> #include "Form2.h"
>>>
>>> // Constructor
>>> MainWindow::MainWindow(QWidget* parent)
>>>  : QMainWindow(parent)
>>> {
>>>   setupUi(this);
>>>   setupActions();
>>>
>>> }
>>>
>>> // Destructor
>>> MainWindow::~MainWindow()
>>> {
>>>
>>> }
>>>
>>> void MainWindow::setupActions()
>>> {
>>>   connect(actionShow_Form_1, SIGNAL(triggered(bool)),
>>>           qApp, SLOT(showForm1()));
>>>   connect(actionShow_Form_2, SIGNAL(triggered(bool)),
>>>           qApp, SLOT(showForm2()));
>>>
>>> }
>>>
>>> void MainWindow::showForm1()
>>> {
>>>       stackedWidget->setCurrentIndex(0);
>>> }
>>>
>>> void MainWindow::showForm2()
>>> {
>>>       stackedWidget->setCurrentIndex(1);
>>> }
>>>
>>> /**********
>>>  * main.cpp
>>>  **********/
>>> #include <QApplication>
>>> #include "mainwindow.h"
>>>
>>> int main(int argc, char *argv[])
>>> {
>>>     QApplication a(argc, argv);
>>>
>>>     MainWindow mainWindow;
>>>     mainWindow.show();
>>>
>>>     return a.exec();
>>> }
>>>
>>> Could someone please tell me where I add each Form to the
>>> QStackedWidget?  I have tried various things as part of the MainWindow
>>> constructor but get errors with whatever I try.
>>>
>>> Many thanks,
>>>
>>> Peter.
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>> "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 5 in thread


"Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in message 
news:op.ubwptu1rp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> You must write:
> Form1* form1 = new Form1;
> Form2* form2 = new Form2;

Problem is, this will result in a memory leak. You should clean up after 
yourself. Since (AFAIK) the stacked widget does not take ownership of the 
widgets you add, you should set the ownership yourself, so they get deleted 
when your window is deleted.

Form1* form1 = new Form1(this);
Form2* form2 = new Form2(this);

André
 

--
 [ signature omitted ] 

Message 6 in thread

I meant he didn't declare form1 and form2 as pointers, what's incorrect  
when they are created using "new" operator. :)

On Thu, 29 May 2008 13:17:32 +0400, André Somers <andre@xxxxxxxxxxxxxxxx>  
wrote:
> "Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in  
> message news:op.ubwptu1rp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> You must write:
>> Form1* form1 = new Form1;
>> Form2* form2 = new Form2;
>
> Problem is, this will result in a memory leak. You should clean up after  
> yourself. Since (AFAIK) the stacked widget does not take ownership of  
> the widgets you add, you should set the ownership yourself, so they get  
> deleted when your window is deleted.
>
> Form1* form1 = new Form1(this);
> Form2* form2 = new Form2(this);
>
> André
>  --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 7 in thread


"Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in message 
news:op.ubwso1gfp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I meant he didn't declare form1 and form2 as pointers, what's incorrect 
> when they are created using "new" operator. :)

I know :-)
It was not meant as a correction, but as a supplement to your suggestion :-)

André
 

--
 [ signature omitted ] 

Message 8 in thread

thanks everyone for the input.  Those little stars sure are useful aren't they?

I tried running the program but none of the menus work.  It looks as
though the submenu is stuck behind the main menu on the main menu bar.
 My menu is:
Form 1
- Show Form 1

Form 2
- Show Form 2

But it appears as:
Form 1  Form 2  with "Show Form 1" in the background.  I have attached
a screenshot but not sure if the list accepts them.

I tried running the program on windows but there are no errors showing
in the cmd box.  I am now in Linux (Ubuntu) and when I run the program
and try to access the menus I get:

$ ./Stacked
Object::connect: No such slot QApplication::showForm1()
Object::connect:  (sender name:   'actionShow_Form_1')
Object::connect:  (receiver name: 'Stacked')
Object::connect: No such slot QApplication::showForm2()
Object::connect:  (sender name:   'actionShow_Form_2')
Object::connect:  (receiver name: 'Stacked')

but when I look in my *.ui files the action's are there:
$ grep actionShow_Form_1 *
mainwindow.cpp:  connect(actionShow_Form_1, SIGNAL(triggered(bool)),
Binary file mainwindow.o matches
Binary file moc_mainwindow.o matches
Binary file Stacked matches
Stacked.ui:    <addaction name="actionShow_Form_1" />
Stacked.ui:  <action name="actionShow_Form_1" >
ui_Stacked.h:    QAction *actionShow_Form_1;
ui_Stacked.h:    actionShow_Form_1 = new QAction(MainWindow);
ui_Stacked.h:
actionShow_Form_1->setObjectName(QString::fromUtf8("actionShow_Form_1"));
ui_Stacked.h:    menuForm1->addAction(actionShow_Form_1);
ui_Stacked.h:
actionShow_Form_1->setText(QApplication::translate("MainWindow", "Show
Form 1", 0, QApplication::UnicodeUTF8));


Can someone please tell me what may be causing this?

Many thanks,

Peter.



2008/5/29 André Somers <andre@xxxxxxxxxxxxxxxx>:
>
>
> "Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:op.ubwso1gfp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> I meant he didn't declare form1 and form2 as pointers, what's incorrect
>> when they are created using "new" operator. :)
>
> I know :-)
> It was not meant as a correction, but as a supplement to your suggestion :-)
>
> André
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

Attachment:

Attachment: StackedMenus.png
Description: PNG image


Message 9 in thread

Actually what appears in the screenshot, behind the main menus: "This
is Form 1" is a label I have placed in the center of Form1, I have
attached the *.ui files here in case they help.

2008/5/29 Peter E Dennis <peter.edwin.dennis@xxxxxxxxx>:
> thanks everyone for the input.  Those little stars sure are useful aren't they?
>
> I tried running the program but none of the menus work.  It looks as
> though the submenu is stuck behind the main menu on the main menu bar.
>  My menu is:
> Form 1
> - Show Form 1
>
> Form 2
> - Show Form 2
>
> But it appears as:
> Form 1  Form 2  with "Show Form 1" in the background.  I have attached
> a screenshot but not sure if the list accepts them.
>
> I tried running the program on windows but there are no errors showing
> in the cmd box.  I am now in Linux (Ubuntu) and when I run the program
> and try to access the menus I get:
>
> $ ./Stacked
> Object::connect: No such slot QApplication::showForm1()
> Object::connect:  (sender name:   'actionShow_Form_1')
> Object::connect:  (receiver name: 'Stacked')
> Object::connect: No such slot QApplication::showForm2()
> Object::connect:  (sender name:   'actionShow_Form_2')
> Object::connect:  (receiver name: 'Stacked')
>
> but when I look in my *.ui files the action's are there:
> $ grep actionShow_Form_1 *
> mainwindow.cpp:  connect(actionShow_Form_1, SIGNAL(triggered(bool)),
> Binary file mainwindow.o matches
> Binary file moc_mainwindow.o matches
> Binary file Stacked matches
> Stacked.ui:    <addaction name="actionShow_Form_1" />
> Stacked.ui:  <action name="actionShow_Form_1" >
> ui_Stacked.h:    QAction *actionShow_Form_1;
> ui_Stacked.h:    actionShow_Form_1 = new QAction(MainWindow);
> ui_Stacked.h:
> actionShow_Form_1->setObjectName(QString::fromUtf8("actionShow_Form_1"));
> ui_Stacked.h:    menuForm1->addAction(actionShow_Form_1);
> ui_Stacked.h:
> actionShow_Form_1->setText(QApplication::translate("MainWindow", "Show
> Form 1", 0, QApplication::UnicodeUTF8));
>
>
> Can someone please tell me what may be causing this?
>
> Many thanks,
>
> Peter.
>
>
>
> 2008/5/29 André Somers <andre@xxxxxxxxxxxxxxxx>:
>>
>>
>> "Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:op.ubwso1gfp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>
>>> I meant he didn't declare form1 and form2 as pointers, what's incorrect
>>> when they are created using "new" operator. :)
>>
>> I know :-)
>> It was not meant as a correction, but as a supplement to your suggestion :-)
>>
>> André
>>
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>

Attachment:

Attachment: Form1.ui
Description: application/designer

Attachment: Form2.ui
Description: application/designer

Attachment: Stacked.ui
Description: application/designer


Message 10 in thread

Well I've fixed the problem with the menu.  I already have a
QStackedWidget as the widget between my menu and my status bar.  So
rather than creating another one i removed the following line from
mainwindow.cpp:

//stackedWidget = new QStackedWidget( this );

but I'm still getting the no such slot errors.

Does anyone know why this is?

Thanks again for all the help.

Peter.


2008/5/29 Peter E Dennis <peter.edwin.dennis@xxxxxxxxx>:
> Actually what appears in the screenshot, behind the main menus: "This
> is Form 1" is a label I have placed in the center of Form1, I have
> attached the *.ui files here in case they help.
>
> 2008/5/29 Peter E Dennis <peter.edwin.dennis@xxxxxxxxx>:
>> thanks everyone for the input.  Those little stars sure are useful aren't they?
>>
>> I tried running the program but none of the menus work.  It looks as
>> though the submenu is stuck behind the main menu on the main menu bar.
>>  My menu is:
>> Form 1
>> - Show Form 1
>>
>> Form 2
>> - Show Form 2
>>
>> But it appears as:
>> Form 1  Form 2  with "Show Form 1" in the background.  I have attached
>> a screenshot but not sure if the list accepts them.
>>
>> I tried running the program on windows but there are no errors showing
>> in the cmd box.  I am now in Linux (Ubuntu) and when I run the program
>> and try to access the menus I get:
>>
>> $ ./Stacked
>> Object::connect: No such slot QApplication::showForm1()
>> Object::connect:  (sender name:   'actionShow_Form_1')
>> Object::connect:  (receiver name: 'Stacked')
>> Object::connect: No such slot QApplication::showForm2()
>> Object::connect:  (sender name:   'actionShow_Form_2')
>> Object::connect:  (receiver name: 'Stacked')
>>
>> but when I look in my *.ui files the action's are there:
>> $ grep actionShow_Form_1 *
>> mainwindow.cpp:  connect(actionShow_Form_1, SIGNAL(triggered(bool)),
>> Binary file mainwindow.o matches
>> Binary file moc_mainwindow.o matches
>> Binary file Stacked matches
>> Stacked.ui:    <addaction name="actionShow_Form_1" />
>> Stacked.ui:  <action name="actionShow_Form_1" >
>> ui_Stacked.h:    QAction *actionShow_Form_1;
>> ui_Stacked.h:    actionShow_Form_1 = new QAction(MainWindow);
>> ui_Stacked.h:
>> actionShow_Form_1->setObjectName(QString::fromUtf8("actionShow_Form_1"));
>> ui_Stacked.h:    menuForm1->addAction(actionShow_Form_1);
>> ui_Stacked.h:
>> actionShow_Form_1->setText(QApplication::translate("MainWindow", "Show
>> Form 1", 0, QApplication::UnicodeUTF8));
>>
>>
>> Can someone please tell me what may be causing this?
>>
>> Many thanks,
>>
>> Peter.
>>
>>
>>
>> 2008/5/29 André Somers <andre@xxxxxxxxxxxxxxxx>:
>>>
>>>
>>> "Constantin Makshin" <dinosaur-rus@xxxxxxxxxxxxxxxxxxxxx> wrote in message
>>> news:op.ubwso1gfp27x8p@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>
>>>> I meant he didn't declare form1 and form2 as pointers, what's incorrect
>>>> when they are created using "new" operator. :)
>>>
>>> I know :-)
>>> It was not meant as a correction, but as a supplement to your suggestion :-)
>>>
>>> André
>>>
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>> "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt-interest/
>>>
>>>
>>
>

--
 [ signature omitted ] 

Message 11 in thread

On Thu, May 29, 2008 at 09:39:48PM +1000, Peter E Dennis wrote:
> Well I've fixed the problem with the menu.  I already have a
> QStackedWidget as the widget between my menu and my status bar.  So
> rather than creating another one i removed the following line from
> mainwindow.cpp:
> 
> //stackedWidget = new QStackedWidget( this );
> 
> but I'm still getting the no such slot errors.
> 
> Does anyone know why this is?

look at your connect statements and replace "qApp" with "this" ;-)

Andre

--
 [ signature omitted ] 

Message 12 in thread

Thank you very much Andre!

Almost there.  The only thing left is that when I click on each sub
menu, nothing appears in the MainWindow.  I placed a single label as
the only widget for each form saying "This is Form 1" and "This is
Form 2" respectively.  But the MainWindow remains blank only
displaying the menu bar and the status bar with nothing in between.

Can someone please tell me why this is?

Again thank you for all the help.

Sorry for spamming the list with my questions.

2008/5/29 Andre Haupt <andre@xxxxxxxxxxxxxxx>:
> On Thu, May 29, 2008 at 09:39:48PM +1000, Peter E Dennis wrote:
>> Well I've fixed the problem with the menu.  I already have a
>> QStackedWidget as the widget between my menu and my status bar.  So
>> rather than creating another one i removed the following line from
>> mainwindow.cpp:
>>
>> //stackedWidget = new QStackedWidget( this );
>>
>> but I'm still getting the no such slot errors.
>>
>> Does anyone know why this is?
>
> look at your connect statements and replace "qApp" with "this" ;-)
>
> Andre
>

--
 [ signature omitted ] 

Message 13 in thread

> Problem is, this will result in a memory leak. You should 
> clean up after 
> yourself. Since (AFAIK) the stacked widget does not take 
> ownership of the 
> widgets you add, you should set the ownership yourself

That's not correct! stackedWidget->addWidget() does indeed transfer ownership (i.e. sets the parent).

This should be clarified in the docs though - there is no word about this in there, when other classes specify this behaviour.

Guess i'll report this to qt-bugs.

Cheers,
Peter

--
 [ signature omitted ] 

Message 14 in thread


"Peter Prade" <prade@xxxxxxxxxxx> wrote in message 
news:1C5B9B48EC79514FB4F4A7884ACFCB9F3CB9F4@xxxxxxxxxxxxxxxxxxxxxxx
>> Problem is, this will result in a memory leak. You should
>> clean up after
>> yourself. Since (AFAIK) the stacked widget does not take
>> ownership of the
>> widgets you add, you should set the ownership yourself
>
> That's not correct! stackedWidget->addWidget() does indeed transfer 
> ownership (i.e. sets the parent).
>
> This should be clarified in the docs though - there is no word about this 
> in there, when other classes specify this behaviour.
>
> Guess i'll report this to qt-bugs.

Thank you for the correction. I do think this is documentation bug as you 
said, because something like that should be documented in the stackedWidget 
docs.

André
 

--
 [ signature omitted ] 

Message 15 in thread

On Thursday 29 May 2008 08.17:30 Peter E Dennis wrote:
> Hi Scott,
>
> Thanks for your reply.
>
> I have tried a couple of ways to do this, when I add your suggestion
> and try to 'make' it again:
>
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:16: error: `form1' undeclared (first use this function)
> mainwindow.cpp:16: error: (Each undeclared identifier is reported only once
> for each function it appears in.)
> mainwindow.cpp:17: error: `form2' undeclared (first use this function)
> mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
> mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
> mingw32-make: *** [release] Error 2
>
> if I then put:
>
>  Form1 form1 = new Form1;
>  Form2 form2 = new Form2;
>
>  stackedWidget = new QStackedWidget( this );
>  stackedWidget->addWidget( form1 );
>  stackedWidget->addWidget( form2 );
>
> I get the following errors:
>
> C:\Qt\4.4.0\projects\Stacked>make
> mingw32-make -f Makefile.Release
> mingw32-make[1]: Entering directory `C:/Qt/4.4.0/projects/Stacked'
> g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
> -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
> -DQT_THREAD_SUPPORT -DQT_NEEDS _QMAIN -I"..\..\include\QtCore"
> -I"..\..\include\QtCore" -I"..\..\include\QtGui" -I"..\..\include\QtGui"
> -I"..\..\include" -I"." -I"c:\Qt\4.4.0\include\ActiveQt "
> -I"tmp\moc\release_shared" -I"." -I"..\..\mkspecs\win32-g++" -o
> tmp\obj\releas e_shared\mainwindow.o mainwindow.cpp
> ../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor
> `Form1:: Form1(const Form1&)':
> ../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error:
> `QWidget::QWidget (const QWidget&)' is private
> mainwindow.cpp:16: error: within this context
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:16: error:   initializing temporary from result of
> `Form1::Form1( QWidget*)'
> ../../include/QtGui/../../src/gui/kernel/qwidget.h: In copy constructor
> `Form2:: Form2(const Form2&)':
> ../../include/QtGui/../../src/gui/kernel/qwidget.h:750: error:
> `QWidget::QWidget (const QWidget&)' is private
> mainwindow.cpp:17: error: within this context
> mainwindow.cpp: In constructor `MainWindow::MainWindow(QWidget*)':
> mainwindow.cpp:17: error:   initializing temporary from result of
> `Form2::Form2( QWidget*)'
> mainwindow.cpp:20: error: no matching function for call to
> `QStackedWidget::addW idget(Form1&)'
> ../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note:
> candidates are: int QStackedWidget::addWidget(QWidget*)
> mainwindow.cpp:21: error: no matching function for call to
> `QStackedWidget::addW idget(Form2&)'
> ../../include/QtGui/../../src/gui/widgets/qstackedwidget.h:69: note:
> candidates are: int QStackedWidget::addWidget(QWidget*)
> mingw32-make[1]: *** [tmp/obj/release_shared/mainwindow.o] Error 1
> mingw32-make[1]: Leaving directory `C:/Qt/4.4.0/projects/Stacked'
> mingw32-make: *** [release] Error 2
>
> C:\Qt\4.4.0\projects\Stacked>
>
> Thanks again,
>
> Peter.
>
> 2008/5/29 Scott Aron Bloom <Scott.Bloom@xxxxxxxxxxxx>:
> > Inyour MainWindow cosntructor... Create 2 forms, and the stacked
> > widget...
> >
> > Ie
> > form1 = new Form1;
> > form2 = new Form2;
> >
> > stackedWidget = new QStackedWidget( this );
> > stackedWidget->addWidget( form1 );
> > stackedWidget->addWidget( form2 );
> >
> >
> > Scott
> >
> >> -----Original Message-----
> >> From: Peter E Dennis [mailto:peter.edwin.dennis@xxxxxxxxx]
> >> Sent: Thursday, May 29, 2008 12:18 AM
> >> To: qt-interest@xxxxxxxxxxxxx
> >> Subject: Newbie Trying to Learn QStackedWidget
> >>
> >> Hi,
> >>
> >> I am new to C++ and Qt and am trying to learn the basics of a
> >> QStackedWidget.  All I'm trying to do at this stage is add a couple of
> >> basic forms to the QStackedWidget and then display each form when a
> >> menu item is chosen.
> >>
> >> To do this I have copied and adapted the following code from books and
> >> examples:
> >> /*********
> >>  * Form1.h
> >>  *********/
> >> #include <QtGui>
> >> #include "ui_Form1.h"
> >>
> >> class Form1 : public QWidget,
> >>                         public Ui::Form1
> >> {
> >>
> >>       Q_OBJECT
> >>
> >>       public:
> >>               Form1(QWidget* parent = 0);
> >>               ~Form1();
> >>
> >> };
> >>
> >> /***********
> >>  * Form1.cpp
> >>  ***********/
> >> #include <QWidget>
> >> #include "Form1.h"
> >>
> >> Form1::Form1(QWidget* parent)
> >> {
> >>       setupUi(this);
> >> }
> >>
> >> Form1::~Form1()
> >> {
> >>
> >> }
> >>
> >> /*********
> >>  * Form2.h
> >>  *********/
> >> #include <QtGui>
> >> #include "ui_Form2.h"
> >>
> >> class Form2 : public QWidget,
> >>                         public Ui::Form2
> >> {
> >>
> >>       Q_OBJECT
> >>
> >>       public:
> >>               Form2(QWidget* parent = 0);
> >>               ~Form2();
> >>
> >> };
> >>
> >> /***********
> >>  * Form2.cpp
> >>  ***********/
> >> #include <QWidget>
> >> #include "Form2.h"
> >>
> >> Form2::Form2(QWidget* parent)
> >> {
> >>       setupUi(this);
> >> }
> >>
> >> Form2::~Form2()
> >> {
> >>
> >> }
> >>
> >> /**************
> >>  * mainwindow.h
> >>  **************/
> >> #ifndef MAINWINDOW_H
> >> #define MAINWINDOW_H
> >>
> >> #include <QMainWindow>
> >> #include "ui_Stacked.h"
> >>
> >> class MainWindow : public QMainWindow,
> >>                    public Ui::MainWindow
> >> {
> >>   Q_OBJECT
> >>   public:
> >>     MainWindow(QWidget* parent = 0);
> >>     ~MainWindow();
> >>
> >>   protected:
> >>     void setupActions();
> >>   protected slots:
> >>     void showForm1();
> >>     void showForm2();
> >> };
> >> #endif // MAINWINDOW_H
> >>
> >> /****************
> >>  * mainwindow.cpp
> >>  ****************/
> >> #include <QtGui>
> >> #include "mainwindow.h"
> >> #include "Form1.h"
> >> #include "Form2.h"
> >>
> >> // Constructor
> >> MainWindow::MainWindow(QWidget* parent)
> >>
> >>  : QMainWindow(parent)
> >>
> >> {
> >>   setupUi(this);
> >>   setupActions();
> >>
> >> }
> >>
> >> // Destructor
> >> MainWindow::~MainWindow()
> >> {
> >>
> >> }
> >>
> >> void MainWindow::setupActions()
> >> {
> >>   connect(actionShow_Form_1, SIGNAL(triggered(bool)),
> >>           qApp, SLOT(showForm1()));
> >>   connect(actionShow_Form_2, SIGNAL(triggered(bool)),
> >>           qApp, SLOT(showForm2()));
> >>
> >> }
> >>
> >> void MainWindow::showForm1()
> >> {
> >>       stackedWidget->setCurrentIndex(0);
> >> }
> >>
> >> void MainWindow::showForm2()
> >> {
> >>       stackedWidget->setCurrentIndex(1);
> >> }
> >>
> >> /**********
> >>  * main.cpp
> >>  **********/
> >> #include <QApplication>
> >> #include "mainwindow.h"
> >>
> >> int main(int argc, char *argv[])
> >> {
> >>     QApplication a(argc, argv);
> >>
> >>     MainWindow mainWindow;
> >>     mainWindow.show();
> >>
> >>     return a.exec();
> >> }
> >>
> >> Could someone please tell me where I add each Form to the
> >> QStackedWidget?  I have tried various things as part of the MainWindow
> >> constructor but get errors with whatever I try.
> >>
> >> Many thanks,
> >>
> >> Peter.
> >>
> >> --
> >> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> >> "unsubscribe" in the subject or the body.
> >> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/

Hi,

i think there is a little stars missing in the code :

 Form1 *form1 = new Form1;
 Form2 *form2 = new Form2;

Then the rest should be good.

Cheers
Samuel

--
 [ signature omitted ] 

Pages: Prev | 1 | 2 | Next