Forum
Sign Up
× DataGrid for Qt.C++

incorrect row select via mouse click

9 years 4 months ago - 9 years 4 months ago #1 by Kwangho Kim
i use qtitandatagrid 3.5 , but still i cant satisfying this component's click event process.

though i click my list's item but i cant select row. and qtitandatagrid demo project cause same situation.
i only select row via click when very slowly click row!!

i attached my record file.( i want to attach my file, but i cant!! )





Last edit: 9 years 4 months ago by Kwangho Kim.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #2 by Kwangho Kim
i found out this situation cause. i modifed qtitan code belows, then i solved my problem but i got another problem.
another problem is when mouse double click, i got twice click event( click, doub click event ) .
so, i suggest you to modify below qtitan code that before run (if (doubleclick ) return, distinguish mouse click row index based on mouse click pos.

GraphicControl::mouserPressEvent( QmouseEvent* event )
{
if( !m_rootGP )
return;

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
bool doubleClick = event->timestamp() - m_mousePressTime < doubleClickInterval /*&& button == mousePressButton*/;
m_mousePressTime = event->timestamp();
m_mousePressButton = event->button();
m_pressPos = event->globalPos();
// if( doubleClick )
// {
// return;
// }
#endif

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #3 by Developer Machines
Thank you for the video. Error was reproduced. In the near future we will fix it. If your bug-fix will Ok we will add this to the main trunk (or will be another solution).

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #4 by Developer Machines
This code was our fix for an issue in Qt. In Qt5.3 bug was fixed by this commit - qt.gitorious.org/qt/scitools-qtbase/comm...2229627f36d60168f0e2
So please add these lines to code, fix will be added to the build of QtitanDataGrid to the end of this week.
void GraphicControl::mousePressEvent(QMouseEvent *event)
 {
    if (!m_rootGP)
        return;

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
    bool doubleClick = event->flags().testFlag(Qt::MouseEventCreatedDoubleClick);
#else
    ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
    bool doubleClick = event->timestamp() - m_mousePressTime < doubleClickInterval /*&& button == mousePressButton*/;
#endif    
    m_mousePressTime = event->timestamp();
    m_mousePressButton = event->button();
    m_pressPos = event->globalPos();

    if (doubleClick)
        return;
#endif

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #5 by Kwangho Kim
Thanks for fixing codes.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.142 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )