[Qt-creator] single click to open files

Coda Highland coda at bobandgeorge.com
Wed Oct 7 16:42:26 CEST 2009


It seems to me that it would be preferable to make it use edit
triggers, and therefore connect to the edit(QModelIndex) signal, so
that making it configurable in the preferences is just a matter of
m_view->setEditTriggers().

On Wed, Oct 7, 2009 at 9:12 AM, Will Stokes <wstokes at gmail.com> wrote:
> I dug through the source code and it appears changing the project tree
> to open a file by single instead of double clicking is pretty easy.
> Line 157 of projecttreewidget.cpp connects the view's activated signal
> to the openItem slot. Instead of using activated used clicked (or
> double clicked depending on a user preference), aka:
>
> connect(m_view, SIGNAL(clicked(const QModelIndex&)),
>             this, SLOT(openItem(const QModelIndex&)));
>
> instead of:
>
> connect(m_view, SIGNAL(activated(const QModelIndex&)),
>             this, SLOT(openItem(const QModelIndex&)));
>
> I haven't tested this change myself since I don't have Qt4.6 on my
> system at this time.
>
> -Will
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>




More information about the Qt-creator-old mailing list