Message: Re: Adding icon/logo/image to GUI Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Adding icon/logo/image to GUI 

Forum: (Graphical) User Interfaces
Re: Question Adding icon/logo/image to GUI (Leonardo Ghizoni)
Re: None Re: Adding icon/logo/image to GUI (John Allison)
Re: Question Re: Adding icon/logo/image to GUI (Leonardo Ghizoni)
Date: 20 Jul, 2016
From: Garnier Laurent <Garnier Laurent>

Hi,

There is no quick or easy way to do that (no G4 command). But as you have you own GUI you could customize it :

        // Only available with Qt !
#ifdef G4UI_USE_QT

      // Get the UIQt manager
      G4UIQt* UIQt = static_cast<G4UIQt*> (UImanager->GetG4UIWindow());
      if ( UIQt) {

        // Create a new toolbar
        QToolBar* myToolbar = new QToolBar();
        myToolbar->setIconSize (QSize(20,20));

        // align right
        QWidget* spacer = new QWidget();
        spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        myToolbar->addWidget(spacer);

        // add my logo
        myToolbar->addWidget(new QLabel("My logo"));

        // add to the main window
        UIQt->GetMainWindow()->addToolBar(Qt::TopToolBarArea, myToolbar);
      }
#endif

Of course, you have to change the QLabel("My logo") by a icon ;) Cheers,

Laurent

 Add Message Add Message
to: "Re: Adding icon/logo/image to GUI"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]