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

Qt-interest Archive, July 2007
Hooking up to actions generated by qt-designer in eclipse


Message 1 in thread

Hi,

I am using the eclipse plugin RC1 and have a MainWindow with some
menus. Designer generates a ui_*.h file which contains the setupUi
method that populates the menu. These are created by actions. Where do
I connect the action.triggered() signal to the slot that I have
defined? Or must this be done somewhere in the text editor of eclipse?

-- 
 [ signature omitted ] 

Message 2 in thread

On 14.07.07 03:18:07, Svenn Are Bjerkem wrote:
> Hi,
> 
> I am using the eclipse plugin RC1 and have a MainWindow with some
> menus. Designer generates a ui_*.h file which contains the setupUi
> method that populates the menu. These are created by actions. Where do
> I connect the action.triggered() signal to the slot that I have
> defined? Or must this be done somewhere in the text editor of eclipse?

You normally do that in the constructor of your class.

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

On 7/14/07, Andreas Pakulat <apaku@xxxxxx> wrote:
> On 14.07.07 03:18:07, Svenn Are Bjerkem wrote:
> > Hi,
> >
> > I am using the eclipse plugin RC1 and have a MainWindow with some
> > menus. Designer generates a ui_*.h file which contains the setupUi
> > method that populates the menu. These are created by actions. Where do
> > I connect the action.triggered() signal to the slot that I have
> > defined? Or must this be done somewhere in the text editor of eclipse?
>
> You normally do that in the constructor of your class.

Thanks, I guess that the current version of the eclipse plugin does
not provide this feature as the AddressBook example also do this by
the text editor. I was just moving one step further than the
AddressBook example and with menus I promptly faced the problem how to
connect toolbar buttons and menu items to trigger the same dialog
posting. In the Blanchette/Summerfield book on qt4 this is easy to
understand for a texteditor-only development with Qt4, but so far I
have't found how to do this with the qt plugin for Eclipse. The
generation of the actions happen in the ui_*.h files, and these are
not visible in the Eclipse project tree. I have to do a search for the
actions and then I get a text view of the ui_*.h file I want to
inspect, or I have to enter the back door through the file system.
(The names of the generated actions are also visible from the
properties view when the respective menu item is selected in the
Designer view.

Maybe somebody from Trolltech could elaborate on this as I think
handling of actions is a hot topic for the next version of the Eclipse
plugin. (Unless I have misunderstood something totally.)

-- 
 [ signature omitted ] 

Message 4 in thread

On 14.07.07 13:20:08, Svenn Are Bjerkem wrote:
> On 7/14/07, Andreas Pakulat <apaku@xxxxxx> wrote:
> >On 14.07.07 03:18:07, Svenn Are Bjerkem wrote:
> >> Hi,
> >>
> >> I am using the eclipse plugin RC1 and have a MainWindow with some
> >> menus. Designer generates a ui_*.h file which contains the setupUi
> >> method that populates the menu. These are created by actions. Where do
> >> I connect the action.triggered() signal to the slot that I have
> >> defined? Or must this be done somewhere in the text editor of eclipse?
> >
> >You normally do that in the constructor of your class.
> 
> Thanks, I guess that the current version of the eclipse plugin does
> not provide this feature as the AddressBook example also do this by
> the text editor. I was just moving one step further than the
> AddressBook example and with menus I promptly faced the problem how to
> connect toolbar buttons and menu items to trigger the same dialog
> posting. In the Blanchette/Summerfield book on qt4 this is easy to
> understand for a texteditor-only development with Qt4, but so far I
> have't found how to do this with the qt plugin for Eclipse. The
> generation of the actions happen in the ui_*.h files, and these are
> not visible in the Eclipse project tree. I have to do a search for the
> actions and then I get a text view of the ui_*.h file I want to
> inspect, or I have to enter the back door through the file system.
> (The names of the generated actions are also visible from the
> properties view when the respective menu item is selected in the
> Designer view.
> 
> Maybe somebody from Trolltech could elaborate on this as I think
> handling of actions is a hot topic for the next version of the Eclipse
> plugin. (Unless I have misunderstood something totally.)

I have to say I have no idea what the eclipse plugin provides, but the
usual approach when designing a GUI with the Designer is to do any
custom connections in the source files that you have (not the ui*.h but
the class you subclass from QWidget/QDialog/QMainWindow).

You don't create working GUI's with just a gui editor in Qt land. You
always have to fill in some code that does the actual work.

Andreas

-- 
 [ signature omitted ]