Qt-interest Archive, March 2002
disconnect siganls in qlistview header
Message 1 in thread
I want to disconnect all clicked signals coming from a Qheader and do
this:
QObject::disconnect(my_qlistview->header(), SIGNAL (clicked(int)), 0, 0
);
QObject::disconnect(my_qlistview->header(), SIGNAL (pressed(int)), 0, 0
);
QObject::disconnect(my_qlistview->header(), SIGNAL (released(int)), 0, 0
);
but when I press on a header, my list is still sorted, and that's
precisely what I want to forbid.
I know I can use setSorting(-1), but I don't want to do this because I
want to do the setSorting(...)
by myself in a PopupMenu.
Do I forgot something?
--
[ signature omitted ]
Message 2 in thread
try
void QHeader::setClickEnabled( bool, int logIdx = -1 );
this will disable the click action. hope this help
ben
-----Original Message-----
From: Stéphane Colson [mailto:scolson@arkoon.net]
Sent: Thursday, March 14, 2002 9:03 AM
To: Qt List
Subject: disconnect siganls in qlistview header
I want to disconnect all clicked signals coming from a Qheader and do
this:
QObject::disconnect(my_qlistview->header(), SIGNAL (clicked(int)), 0, 0
);
QObject::disconnect(my_qlistview->header(), SIGNAL (pressed(int)), 0, 0
);
QObject::disconnect(my_qlistview->header(), SIGNAL (released(int)), 0, 0
);
but when I press on a header, my list is still sorted, and that's
precisely what I want to forbid.
I know I can use setSorting(-1), but I don't want to do this because I
want to do the setSorting(...)
by myself in a PopupMenu.
Do I forgot something?
--
[ signature omitted ]
Message 3 in thread
No, I want to (re)connect the click to open a PopupMenu.
Ben Hui a écrit :
> try
>
> void QHeader::setClickEnabled( bool, int logIdx = -1 );
>
> this will disable the click action. hope this help
> ben
>
> -----Original Message-----
> From: Stéphane Colson [mailto:scolson@arkoon.net]
> Sent: Thursday, March 14, 2002 9:03 AM
> To: Qt List
> Subject: disconnect siganls in qlistview header
>
> I want to disconnect all clicked signals coming from a Qheader and do
> this:
>
> QObject::disconnect(my_qlistview->header(), SIGNAL (clicked(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (pressed(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (released(int)), 0, 0
> );
>
> but when I press on a header, my list is still sorted, and that's
> precisely what I want to forbid.
> I know I can use setSorting(-1), but I don't want to do this because I
> want to do the setSorting(...)
> by myself in a PopupMenu.
>
> Do I forgot something?
> --
> Stephane Colson
>
> --
> List archive and information: http://qt-interest.trolltech.com
>
> --
> List archive and information: http://qt-interest.trolltech.com
--
[ signature omitted ]
Message 4 in thread
scolson@arkoon.net wrote:
> I want to disconnect all clicked signals coming from a Qheader and do
> this:
>
> QObject::disconnect(my_qlistview->header(), SIGNAL (clicked(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (pressed(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (released(int)), 0, 0
> );
>
> but when I press on a header, my list is still sorted, and that's
> precisely what I want to forbid.
> I know I can use setSorting(-1), but I don't want to do this because I
> want to do the setSorting(...)
> by myself in a PopupMenu.
>
> Do I forgot something?
You probably want something like
my_qlistview->header()->setClickEnabled( false );
Kalle Dalheimer
--
[ signature omitted ]
Message 5 in thread
I was really close to the correct answer. I use Qt2.3.2 and the right signal
to
disconnect is sectionClicked(int) which is supposed to be "obsolete" (see
Qt2.3.2 doc)
but which is used by a click on the header() of a QListView.
So many time lost for...
Stéphane Colson a écrit :
> I want to disconnect all clicked signals coming from a Qheader and do
> this:
>
> QObject::disconnect(my_qlistview->header(), SIGNAL (clicked(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (pressed(int)), 0, 0
> );
> QObject::disconnect(my_qlistview->header(), SIGNAL (released(int)), 0, 0
> );
>
> but when I press on a header, my list is still sorted, and that's
> precisely what I want to forbid.
> I know I can use setSorting(-1), but I don't want to do this because I
> want to do the setSorting(...)
> by myself in a PopupMenu.
>
> Do I forgot something?
> --
> Stephane Colson
>
> --
> List archive and information: http://qt-interest.trolltech.com
--
[ signature omitted ]