MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / TOPPASBase

Method TOPPASBase

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp:88–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 qreal TOPPASBase::z_value_ = 42.0;
87
88 TOPPASBase::TOPPASBase(QWidget* parent) :
89 QMainWindow(parent),
90 DefaultParamHandler("TOPPASBase"),
91 clipboard_scene_(nullptr)
92 {
93
94 setWindowTitle("TOPPAS");
95 setWindowIcon(QIcon(":/TOPPAS.png"));
96
97 //prevents errors caused by too small width,height values
98 setMinimumSize(400, 400);
99
100 // center main window
101 setGeometry(
102 (int)(0.1 * QApplication::desktop()->width()),
103 (int)(0.1 * QApplication::desktop()->height()),
104 (int)(0.8 * QApplication::desktop()->width()),
105 (int)(0.8 * QApplication::desktop()->height())
106 );
107
108 // create dummy widget (to be able to have a layout), Tab bar and workspace
109 QWidget* dummy = new QWidget(this);
110 setCentralWidget(dummy);
111 QVBoxLayout* box_layout = new QVBoxLayout(dummy);
112 tab_bar_ = new EnhancedTabBar(dummy);
113 tab_bar_->setWhatsThis("Tab bar<BR><BR>Close tabs through the context menu or by double-clicking them.");
114 tab_bar_->addTab("dummy", 1336);
115 tab_bar_->setMinimumSize(tab_bar_->sizeHint());
116 tab_bar_->removeId(1336);
117 //connect slots and signals for selecting spectra
118 connect(tab_bar_, &EnhancedTabBar::currentIdChanged, this, &TOPPASBase::focusByTab);
119 connect(tab_bar_, &EnhancedTabBar::closeRequested, this, &TOPPASBase::closeByTab);
120
121 box_layout->addWidget(tab_bar_);
122 ws_ = new EnhancedWorkspace(dummy);
123 connect(ws_, &EnhancedWorkspace::subWindowActivated, this, &TOPPASBase::updateTabBar);
124 connect(ws_, &EnhancedWorkspace::subWindowActivated, this, &TOPPASBase::updateMenu);
125
126 box_layout->addWidget(ws_);
127
128 //################## MENUS #################
129 // File menu
130 QMenu* file = new QMenu("&File", this);
131 menuBar()->addMenu(file);
132 file->addAction("&New", this, SLOT(newPipeline()), Qt::CTRL + Qt::Key_N);
133 file->addAction("&Open", this, SLOT(openFilesByDialog()), Qt::CTRL + Qt::Key_O);
134 file->addAction("Open &example file", this, SLOT(openExampleDialog()), Qt::CTRL + Qt::Key_E);
135 file->addAction("&Include", this, SLOT(includePipeline()), Qt::CTRL + Qt::Key_I);
136 //file->addAction("Online &Repository", this, SLOT(openOnlinePipelineRepository()), Qt::CTRL + Qt::Key_R);
137 file->addAction("&Save", this, SLOT(savePipeline()), Qt::CTRL + Qt::Key_S);
138 file->addAction("Save &As", this, SLOT(saveCurrentPipelineAs()), Qt::CTRL + Qt::SHIFT + Qt::Key_S);
139 file->addAction("E&xport as image", this, SLOT(exportAsImage()));
140 file->addAction("Refresh &parameters", this, SLOT(refreshParameters()), Qt::CTRL + Qt::SHIFT + Qt::Key_P);
141 file->addAction("&Close pipeline", this, SLOT(closeFile()), Qt::CTRL + Qt::Key_W);
142
143 file->addSeparator();
144 // Recent files
145 file->addMenu(recent_files_menu_.getMenu()); // updates automatically via RecentFilesMenu class, since this is just a pointer

Callers

nothing calls this directly

Calls 15

widthMethod · 0.80
heightMethod · 0.80
addTabMethod · 0.80
sizeHintMethod · 0.80
removeIdMethod · 0.80
getMenuMethod · 0.80
setValidStringsMethod · 0.80
emplace_backMethod · 0.80
setMaxLengthMethod · 0.80
setTextMethod · 0.80
absolutePathMethod · 0.80
StringClass · 0.50

Tested by

no test coverage detected