QT Designer Doppelklick auf Item - geht das bei Euch?

Alles rund um die Programmierung mit Qt
Antworten
Aimos
Beiträge: 3
Registriert: 2. September 2006 23:01

QT Designer Doppelklick auf Item - geht das bei Euch?

Beitrag von Aimos »

Hi,

ich habe mir die QT Doku mal durchgelesen und an irgendeinem Punkt kommt die Ansage, dass durch ein Doppelklick auf einen Button (bzw. ein Element) der QT Designer im Quellcode einen Eintrag vornimmt, der dann nur noch zu füllen ist.
Invoking the "Add Address" Dialog from the Application
Once we're done designing the dialog, we need to invoke it when the user clicks the main dialog's Add button. To achieve this, we must add a slot to the AddressBook class and invoke the AddDialog from the slot.

The Qt Visual Studio Integration makes this very easy. Simply double-click the Add button; this will open the .cpp file associated to the dialog and generate a skeleton slot called on_addButton_clicked(). Type in the following code lines in the slot's body:

AddDialog dialog(this);
dialog.exec();
Forms created using Qt Designer call QMetaObject::connectSlotsByName() to establish connections between signals emitted by the form's child widgets and slots that follow the naming convention on_<sender>_<signal>().

If we wanted to connect to another signal than clicked(), we would have to manually add the slot to the AddressBook class's. This requires editing both the header file (addressbook.h) and the implementation file (addressbook.cpp).

We must also add this line to the top of addressbook.cpp:

#include "adddialog.h"
Build and run the program now. If you click the Add button, the Add Address dialog will pop up. If you click OK, the dialog will go
away.
Ich kann in dem Designer so viel Doppelklicken wie ich will. Es passiert nichts. Hat einer nen Tipp wie man das einschalten kann. Oder an was das liegen kann, dass das nicht geht.

Ich verwende QT 4.1.2 mit VS2005.
Aimos
Beiträge: 3
Registriert: 2. September 2006 23:01

Beitrag von Aimos »

*ähm* peinlich, aber ich habe per Zufall die Lösung gefunden.

Per Default Einstellung geht bei mir auch im VS2005 der QT Designer auf und von dort aus funktioniert das mit dem Doppelklick NICHT. Obwohl es in der DOkumentation steht.

Wenn man aber "Open With ..." auf dem name.ui File anwendet und dort QT Form Designer auswählt bekommt man sowas wie nen Embedded Qt Designer zu gesicht aus dem heraus das mit dem Klick funktioniert.

Vielleicht hilft das auch anderen Suchenden.
Antworten