Forum
Sign Up

setting group to invisible does not always work

9 years 3 months ago - 9 years 3 months ago #1 by Matthias Zangl
Hello,

we just found out that setVisible(false) only works for a group if no group before it is visible. Otherwise it stays visible.

thanks,
Matthias
Last edit: 9 years 3 months ago by Matthias Zangl.

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

More
9 years 2 months ago #2 by Matthias Zangl
Hi again,

also this problem is still not fully solved in version 2.3. But we found an interesting detail. The width of the first group seems to matter. If you don't create a 4th button, or make the texts smaller the 2nd group will become invisible.

Plese see our test code below.

thanks for your answer,
Matthias
  Qtitan::RibbonPage* pPage = ribbonBar()->addPage( "test" );
  if( pPage )
  {
    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" };
		QAction* pAct = new QAction( QPixmap( s[0] ), s[0], ribbonBar()->getQuickAccessBar() );
          pGr->addAction( pAct, Qt::ToolButtonTextUnderIcon );
		  m_pOpenAction = pAct;
		  pAct = new QAction( QPixmap( s[1] ), s[1], ribbonBar()->getQuickAccessBar() );
          pGr->addAction( pAct, Qt::ToolButtonTextUnderIcon );
		  pAct = new QAction( QPixmap( s[2] ), s[2], ribbonBar()->getQuickAccessBar() );
          pGr->addAction( pAct, Qt::ToolButtonTextUnderIcon );
		  //toggling this makes it work or not 
		  pAct = new QAction( QPixmap( s[3] ), s[3], ribbonBar()->getQuickAccessBar() );
          pGr->addAction( pAct, Qt::ToolButtonTextUnderIcon );
		  
    }
    // 
    pGr = pPage->addGroup( "example2" );
    if( pGr )
    {
      pGr->setVisible(false); // this doesn't work (
		 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;
        }
		
    }
  }

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

More
9 years 2 months ago #3 by Developer Machines
Thanks for the info. The bug has been fixed.

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