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

Qt-interest Archive, April 2008
Do I need to derive from QDialog here or just QWidget (newbie)?


Message 1 in thread

 I am working on Fedora/Eclipse/Qt4.3.4. The question pertains to
integration of Eclipse and the Qt Designer, but is also Qt-relevant,
somewhat, so I think it belongs here.

I am doing the AddressBook sample that came with the Eclipse plugin,
following the cheat sheet provided.

When I get to the stage where I have to wire up the Add button on the main
form by using the signals/slots editor, I find that the form has no
'accept()' slot, even if I choose 'Show all signals and slots'. When I open
up the CPP file for the dialog, I see my dialog class has been derived from
QWidget, like this:

#include <QtGui/QWidget>
#include "ui_addressbook.h"

class AddressBook : public QWidget
{
Q_OBJECT

.....etc ....

So basically I think the problem is that the AddressBook should be derived
from QDialog to get that accept() slot.

Is that right?

If it is, how did I get the wrong base class ?

How can I most easily fix it? I could just edit the header but not sure of
all the other references.

BTW the app compiles and runs just fine but of course the buttons don't do
anything.

Message 2 in thread

In the .ui file there is an attribute on the top widget node... Set it
from QWidget to QDialog...

 

I have never been able to figure out how to do it in designer, or the
Dev Studio Integration.. I assume its equally hidden in the eclipse plug
in J

Scott

 

From: Eric Fowler [mailto:eric.fowler@xxxxxxxxx] 
Sent: Monday, April 14, 2008 3:48 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Do I need to derive from QDialog here or just QWidget (newbie)?

 

I am working on Fedora/Eclipse/Qt4.3.4. The question pertains to
integration of Eclipse and the Qt Designer, but is also Qt-relevant,
somewhat, so I think it belongs here. 

I am doing the AddressBook sample that came with the Eclipse plugin,
following the cheat sheet provided. 

When I get to the stage where I have to wire up the Add button on the
main form by using the signals/slots editor, I find that the form has no
'accept()' slot, even if I choose 'Show all signals and slots'. When I
open up the CPP file for the dialog, I see my dialog class has been
derived from QWidget, like this: 

#include <QtGui/QWidget>
#include "ui_addressbook.h"

class AddressBook : public QWidget
{
Q_OBJECT

.....etc .... 

So basically I think the problem is that the AddressBook should be
derived from QDialog to get that accept() slot. 

Is that right? 

If it is, how did I get the wrong base class ?

How can I most easily fix it? I could just edit the header but not sure
of all the other references. 

BTW the app compiles and runs just fine but of course the buttons don't
do anything.