ui_mainwindow.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:smhr 作者: andycasey 项目源码 文件源码
def __init_ui__(self):
        """
        Set up the primary user interface (not the stuff in tabs).
        """

        # Create the central widget with a vertical layout.
        cw = QtGui.QWidget(self)
        cw_vbox = QtGui.QVBoxLayout(cw)
        cw_vbox.setContentsMargins(10, 20, 10, 10)



        # Create the primary widget for all the main tabs.
        self.tabs = QtGui.QTabWidget(cw)
        self.tabs.setTabPosition(QtGui.QTabWidget.North)
        self.tabs.setUsesScrollButtons(False)

        sp = QtGui.QSizePolicy(
            QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.MinimumExpanding)
        sp.setHorizontalStretch(0)
        sp.setVerticalStretch(0)
        sp.setHeightForWidth(self.tabs.sizePolicy().hasHeightForWidth())
        self.tabs.setSizePolicy(sp)

        # Create summary tab.
        self.summary_tab = summary.SummaryTab(self)
        self.tabs.addTab(self.summary_tab, "Summary")

        # Create radial velocity tab
        self.rv_tab = rv.RVTab(self)
        self.tabs.addTab(self.rv_tab, "Radial velocity")

        # Create normalization tab.
        self.normalization_tab = normalization.NormalizationTab(self)
        self.tabs.addTab(self.normalization_tab, "Normalization")

        # Create stellar parameters tab.
        self.stellar_parameters_tab \
            = stellar_parameters.StellarParametersTab(self)
        self.tabs.addTab(self.stellar_parameters_tab, "Stellar parameters")

        # Create chemical abundances tab
        # BUT IT'S XBOX HUGE
        self.chemical_abundances_tab \
            = chemical_abundances.ChemicalAbundancesTab(self)
        self.tabs.addTab(self.chemical_abundances_tab, "Chemical abundances")

        # Disable all tabs except the first one.
        for i in range(self.tabs.count()):
            self.tabs.setTabEnabled(i, i == 0)

        cw_vbox.addWidget(self.tabs)
        self.setCentralWidget(cw)

        self.tabs.setCurrentIndex(0)
        self._update_window_title()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号