Forum
Sign Up

SetVisible for ribbon button does not work

8 years 9 months ago #1 by Matthias Zangl
Hello,

setVisible(false) for a ribbon-button only disables it and draws other buttons over it. So the hidden one shines trough.

I can also provide a screenshot if needed.

thanks,
Matthias

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

More
8 years 9 months ago #2 by Developer Machines
To better understand the problem please attach a screenshot, along with sample code.

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

More
8 years 9 months ago - 8 years 9 months ago #3 by Matthias Zangl
Hi,

this is the source code.

In the constructor some buttons are created.
	Qtitan::RibbonGroup* pGr = pPage->addGroup( "example" );
    if( pGr )
    {
      static const QString s [] = {
        ":/RibbonTest2/Resources/file-openimage.png",
        ":/RibbonTest2/Resources/QA-undo.png",
        ":/RibbonTest2/Resources/QA-redo.png",
        ":/RibbonTest2/Resources/QA-save.png" };
        size_t n = sizeof( s ) / sizeof( s[0] );
        for( size_t i = 0; i < n; ++i )
        {
          QAction* pAct = new QAction( QPixmap( s[i] ), s[i], ribbonBar()->getQuickAccessBar());
          pGr->addAction( pAct, Qt::ToolButtonTextUnderIcon );
          if( 0 == i )
            m_pOpenAction = pAct;
        }
		

This code does the toggle.
void RibbonTest2::onShowHideOpenAction( bool bHide )
{
  if( m_pOpenAction )
    m_pOpenAction->setVisible( bHide );
}

The result is the following:




Thanks for helping,
Matthias
Attachments:
Last edit: 8 years 9 months ago by Matthias Zangl.

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

More
8 years 9 months ago #4 by Developer Machines
Bug was fixed. Bugfix is available in the current release.
The following user(s) said Thank You: Matthias Zangl

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 MachinesEduard
Time to create page: 0.135 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 )