Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QTabWidget Class Reference

#include <G4UIQt.hh>

+ Inheritance diagram for G4QTabWidget:

Public Member Functions

 G4QTabWidget ()
 
 G4QTabWidget (QWidget *aParent, G4int sizeX, G4int sizeY)
 
void paintEvent (QPaintEvent *event)
 
void setTabSelected (G4bool a)
 
void setLastTabCreated (G4int a)
 
bool isTabSelected ()
 
void setPreferredSize (QSize s)
 
QSize sizeHint () const
 

Public Attributes

G4bool fTabSelected
 
G4int fLastCreated
 
G4int fPreferedSizeX
 
G4int fPreferedSizeY
 

Detailed Description

Definition at line 85 of file G4UIQt.hh.

Constructor & Destructor Documentation

◆ G4QTabWidget() [1/2]

G4QTabWidget::G4QTabWidget ( )

Definition at line 5118 of file G4UIQt.cc.

5119 :QTabWidget()
5120 ,fTabSelected(false)
5121 ,fLastCreated(-1)
5124{
5125}
G4int fLastCreated
Definition: G4UIQt.hh:94
G4int fPreferedSizeX
Definition: G4UIQt.hh:95
G4int fPreferedSizeY
Definition: G4UIQt.hh:96
G4bool fTabSelected
Definition: G4UIQt.hh:93

◆ G4QTabWidget() [2/2]

G4QTabWidget::G4QTabWidget ( QWidget *  aParent,
G4int  sizeX,
G4int  sizeY 
)

Definition at line 5103 of file G4UIQt.cc.

5107 :QTabWidget(aParent)
5108 ,fTabSelected(false)
5109 ,fLastCreated(-1)
5110,fPreferedSizeX(sizeX+6) // margin left+right
5111,fPreferedSizeY(sizeY+58) // tab label height + margin left+right
5112{
5113 setMinimumSize(100,100);
5114 QSizePolicy policy = QSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
5115 setSizePolicy(policy);
5116}

Member Function Documentation

◆ isTabSelected()

bool G4QTabWidget::isTabSelected ( )
inline

Definition at line 92 of file G4UIQt.hh.

92{ return fTabSelected; };

◆ paintEvent()

void G4QTabWidget::paintEvent ( QPaintEvent *  event)

Definition at line 5190 of file G4UIQt.cc.

5193{
5194
5195 if (currentWidget()) {
5196
5197 if ( isTabSelected()) {
5198
5199 // QCoreApplication::sendPostedEvents () ;
5200
5201 QString text = tabText (currentIndex());
5202
5203 if (fLastCreated == -1) {
5204 QTextEdit* edit = dynamic_cast<QTextEdit*>(currentWidget());
5205 if (!edit){
5206 QString paramSelect = QString("/vis/viewer/select ")+text;
5208 if(UI != NULL) {
5209 UI->ApplyCommand(paramSelect.toStdString().c_str());
5210 }
5211 }
5212 } else {
5213 fLastCreated = -1;
5214 }
5215 setTabSelected(false);
5216 }
5217 }
5218}
void setTabSelected(G4bool a)
Definition: G4UIQt.hh:90
bool isTabSelected()
Definition: G4UIQt.hh:92
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:495
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

◆ setLastTabCreated()

void G4QTabWidget::setLastTabCreated ( G4int  a)
inline

Definition at line 91 of file G4UIQt.hh.

91{ fLastCreated = a; };

Referenced by G4UIQt::AddTabWidget().

◆ setPreferredSize()

void G4QTabWidget::setPreferredSize ( QSize  s)
inline

Definition at line 97 of file G4UIQt.hh.

97 {
98 fPreferedSizeX = s.width() + 6; // tab label height + margin left+right
99 fPreferedSizeY = s.height() + 58; // margin left+right
100 }

◆ setTabSelected()

void G4QTabWidget::setTabSelected ( G4bool  a)
inline

Definition at line 90 of file G4UIQt.hh.

90{ fTabSelected = a; };

◆ sizeHint()

QSize G4QTabWidget::sizeHint ( ) const
inline

Definition at line 101 of file G4UIQt.hh.

101 {
102 return QSize(fPreferedSizeX, fPreferedSizeY);
103 }

Member Data Documentation

◆ fLastCreated

G4int G4QTabWidget::fLastCreated

Definition at line 94 of file G4UIQt.hh.

Referenced by setLastTabCreated().

◆ fPreferedSizeX

G4int G4QTabWidget::fPreferedSizeX

Definition at line 95 of file G4UIQt.hh.

Referenced by setPreferredSize(), and sizeHint().

◆ fPreferedSizeY

G4int G4QTabWidget::fPreferedSizeY

Definition at line 96 of file G4UIQt.hh.

Referenced by setPreferredSize(), and sizeHint().

◆ fTabSelected

G4bool G4QTabWidget::fTabSelected

Definition at line 93 of file G4UIQt.hh.

Referenced by isTabSelected(), and setTabSelected().


The documentation for this class was generated from the following files: