Forum
Sign Up

Keeping drop down galleries open after item select

12 years 5 months ago #1 by Matthias Zangl
Hi,

in our application we have a drop down gallery to select and item and beneath some buttons to do something with the item selected (after selecting it).

By default the gallery is closed after selection of an item.

We researched the source code and found this place
void RibbonGallery::mouseReleaseEvent(QMouseEvent* event)
{
    QTN_D(RibbonGallery);
    if (d.pressed_ || (/*parentWidget()->getPosition() == BarPopup &&*/ isItemSelected()))
    {
        d.pressed_ = false;
        d.repaintItems();

        int index = hitTestItem(event->pos());
        if (index != -1)
        {
            d.repaintItems();
            emit itemSelectionChanged();
            emit itemClicked(getItem(index));

//*********************************************************************************************
// insert a new property and check here if it is set should solve the problem

            if (OfficePopupMenu* popupBar = qobject_cast<OfficePopupMenu*>(parentWidget()))
                popupBar->close();

//*********************************************************************************************
        }
    }
}


We have 2 questions regarding this:

1. Is this the right place to adopt this behaviour?

2. Does it make sense for you to offer this functionality by setting a flag?

thanks,
Matthias

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.113 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 )