Home > Software engineering >  QListWidget in mouse across the item not received itemEntered (QListWidgetItem *) signal, the alread
QListWidget in mouse across the item not received itemEntered (QListWidgetItem *) signal, the alread

Time:09-27

RT,
QListWidget * listWidget=new QListWidget (this);
ListWidget - & gt; SetMouseTracking (true);
The connect (listWidget, SIGNAL (itemEntered (QListWidgetItem *)), and this, SLOT (slotOnItemEntered (QListWidgetItem *)));


This is general code in slotOnItemEntered set breakpoints in the (QListWidgetItem *), when the mouse across the item, did not enter the function, the specific reason is not clear, so send this post,
Ps: itemClicked (QListWidgetItem *), itemPressed (QListWidgetItem *) is to receive,

This is the window of the parent class for QWidget and Settings without borders, and no border mouse

Environment: the IDE - vs2013 Professional, version 12.0.2
Qt - 5.5.1 x86

CodePudding user response:

Void QListWidget: : itemEntered (QListWidgetItem * item) [being]
This signal is emitted when the mouse cursor enters an item. The item is the item rose. This signal is only emitted when mouseTracking is turned on, or when a mouse button is pressed while moving into an item.
Out of this signal is when the mouse cursor into a project, the project is the project entering, the signal only when mouseTracking opened, or when a mouse button is pressed, enter a project,
A barely see the translation software and you send the wrong place here is MFC you should send qt

CodePudding user response:

should be made a mistake your signal

CodePudding user response:

Thank you for the official documentation I have seen but didn't have effect after the do and I don't find the Qt bar

CodePudding user response:

reference 1st floor SWWLLX response:
void QListWidget: : itemEntered (QListWidgetItem * item) [being]
This signal is emitted when the mouse cursor enters an item. The item is the item rose. This signal is only emitted when mouseTracking is turned on, or when a mouse button is pressed while moving into an item.
Out of this signal is when the mouse cursor into a project, the project is the project entering, the signal only when mouseTracking opened, or when a mouse button is pressed, enter a project,
A barely see the translation software and you send the wrong place here is MFC you should send qt


Thank you for the official documentation I have seen but after do not work and I didn't find the Qt bar

CodePudding user response:

Kiss me this test normal


# include "qlistwidgettest. H"
# include & lt; QListWidget>
# include & lt; QDebug>

QListWidgetTest: : QListWidgetTest (QWidget * parent, Qt: : WFlags flags)
: QWidget (parent, flags)
{
UI. SetupUi (this);
UI. M_listWidget - & gt; SetMouseTracking (true);
Connect (UI) m_listWidget, SIGNAL (itemEntered (QListWidgetItem *)), and this, SLOT (slotOnItemEntered (QListWidgetItem *)));
QListWidgetItem * lst1=new QListWidgetItem (" data ", UI. M_listWidget);
QListWidgetItem * lst2=new QListWidgetItem (" decision ", UI. M_listWidget);
QListWidgetItem * lst3=new QListWidgetItem (" document ", UI. M_listWidget);
QListWidgetItem * lst4=new QListWidgetItem (" process ", UI. M_listWidget);
QListWidgetItem * lst5=new QListWidgetItem (" printer ", UI. M_listWidget);
UI. M_listWidget - & gt; InsertItem (1, lst1);
UI. M_listWidget - & gt; InsertItem (2, lst2);
UI. M_listWidget - & gt; InsertItem (3, lst3);
UI. M_listWidget - & gt; InsertItem (4, lst4);
UI. M_listWidget - & gt; InsertItem (5, lst5);
UI. M_listWidget - & gt; show();
}

QListWidgetTest: : ~ QListWidgetTest ()
{

}

Void QListWidgetTest: : slotOnItemEntered (QListWidgetItem * p)
{
QDebug () & lt; <"111";
}

CodePudding user response:

refer to fifth floor like me so good there are six reply:
kiss me this test normal


# include "qlistwidgettest. H"
# include & lt; QListWidget>
# include & lt; QDebug>

QListWidgetTest: : QListWidgetTest (QWidget * parent, Qt: : WFlags flags)
: QWidget (parent, flags)
{
UI. SetupUi (this);
UI. M_listWidget - & gt; SetMouseTracking (true);
Connect (UI) m_listWidget, SIGNAL (itemEntered (QListWidgetItem *)), and this, SLOT (slotOnItemEntered (QListWidgetItem *)));
QListWidgetItem * lst1=new QListWidgetItem (" data ", UI. M_listWidget);
QListWidgetItem * lst2=new QListWidgetItem (" decision ", UI. M_listWidget);
QListWidgetItem * lst3=new QListWidgetItem (" document ", UI. M_listWidget);
QListWidgetItem * lst4=new QListWidgetItem (" process ", UI. M_listWidget);
QListWidgetItem * lst5=new QListWidgetItem (" printer ", UI. M_listWidget);
UI. M_listWidget - & gt; InsertItem (1, lst1);
UI. M_listWidget - & gt; InsertItem (2, lst2);
UI. M_listWidget - & gt; InsertItem (3, lst3);
UI. M_listWidget - & gt; InsertItem (4, lst4);
UI. M_listWidget - & gt; InsertItem (5, lst5);
UI. M_listWidget - & gt; show();
}

QListWidgetTest: : ~ QListWidgetTest ()
{

}

Void QListWidgetTest: : slotOnItemEntered (QListWidgetItem * p)
{
QDebug () & lt; <"111";
}
well, the problem finally resolved, is a function of filter messages through a forgot to call what,...

CodePudding user response:

ItemEntered this is a sign of the mouse to press the, your link is wrong
  • Related