Пример #1
0
def main():
    from calibre.gui2 import Application
    from qt.core import QMainWindow, QStatusBar, QTimer
    app = Application([])
    w = QMainWindow()
    s = QStatusBar(w)
    w.setStatusBar(s)
    s.showMessage('Testing ProceedQuestion')
    w.show()
    p = ProceedQuestion(w)

    def doit():
        p.dummy_question()
        p.dummy_question(
            action_label='A very long button for testing relayout (indeed)')
        p(lambda p: None,
          None,
          'ass2',
          'ass2',
          'testing2',
          'testing2',
          det_msg=
          'details shown first, with a long line to test wrapping of text and width layout',
          show_det=True,
          show_ok=True)

    QTimer.singleShot(10, doit)
    app.exec_()
Пример #2
0
 def __init__(self, parent=None):
     QStatusBar.__init__(self, parent)
     self.version = get_version()
     self.base_msg = f'{get_appname_for_display()} {self.version}'
     self.device_string = ''
     self.update_label = UpdateLabel('')
     self.total = self.current = self.selected = self.library_total = 0
     self.addPermanentWidget(self.update_label)
     self.update_label.setVisible(False)
     self.defmsg = VersionLabel(self)
     self.addWidget(self.defmsg)
     self.set_label()