Exemple #1
0
    def __init__(self):
        super(VistaListaPrenotazioni, self).__init__()
        grid_layout = QGridLayout()
        self.controller = ControlloreListaPrenotazioni()
        self.list_view = QListView()

        self.calendar = QCalendarWidget(self)
        self.calendar.move(20, 20)
        self.calendar.setGridVisible(True)
        self.calendar.setMinimumDate(QDate(currentYear, currentMonth - 1, 1))
        self.calendar.setMaximumDate(
            QDate(currentYear, currentMonth + 1,
                  calendar.monthrange(currentYear, currentMonth)[1]))
        self.calendar.setSelectedDate(QDate(currentYear, currentMonth, 1))
        self.calendar.clicked.connect(self.printInfo)

        buttons_layout = QVBoxLayout()
        add_button = QPushButton("Aggiungi prenotazione")
        add_button.clicked.connect(self.aggiungi_prenotazione)
        buttons_layout.addWidget(add_button)

        delete_button = QPushButton("Elimina prenotazione")
        delete_button.clicked.connect(self.elimina_prenotazione)
        buttons_layout.addWidget(delete_button)

        grid_layout.addWidget(self.calendar, 0, 0)
        grid_layout.addLayout(buttons_layout, 0, 1)
        grid_layout.addWidget(self.list_view, 1, 0)

        self.resize(600, 400)
        self.setWindowTitle('Lista Prenotazioni')
        self.setLayout(grid_layout)
Exemple #2
0
    def __init__(self, parent):
        super().__init__()

        self.parent = parent
        self.select_date = None

        self.setWindowTitle("Выбор даты начала ведения дневника")

        self.layout = QVBoxLayout()

        self.calendar = QCalendarWidget()
        self.layout.addWidget(self.calendar)

        self.btn_layout = QHBoxLayout()
        self.layout.addLayout(self.btn_layout)

        self.btn_cancel = QPushButton("Отмена")
        self.btn_cancel.clicked.connect(self.action_cancel)
        self.btn_layout.addWidget(self.btn_cancel)

        self.btn_save = QPushButton("Сохранить")
        self.btn_save.clicked.connect(self.action_save)
        self.btn_layout.addWidget(self.btn_save)

        self.setLayout(self.layout)
Exemple #3
0
 def __init__(self):
     super().__init__()
     self.analyzer = DataAnalyzer()
     self.cleaned_data = pd.DataFrame()
     self.min_date_selector = QCalendarWidget(self)
     self.max_date_selector = QCalendarWidget(self)
     self.target_line = QLineEdit(self)
     self.account_number_line = QLineEdit(self)
     self.message_line = QLineEdit(self)
     self.min_value_line = QLineEdit(self)
     self.max_value_line = QLineEdit(self)
     self.analyze_button = QPushButton('Analyze data')
     self.load_button = QPushButton('Load data')
     self.analyze_button.setDisabled(True)
     self._set_layout()
     self._set_connections()
Exemple #4
0
    def __init__(self):
        super(Demo, self).__init__()
        self.calendar = QCalendarWidget(self)
        self.calendar.setMinimumDate(
            QDate(1946, 2, 14))                        # 2
        self.calendar.setMaximumDate(
            QDate(2099, 6, 6))                         # 3
        # self.calendar.setDateRange(QDate(1946, 2, 14), QDate(6666, 6, 6))
        # self.calendar.setFirstDayOfWeek(
        #     Qt.Monday)                            # 4
        # self.calendar.setSelectedDate(QDate(1946, 2, 14))                     # 5
        self.calendar.setGridVisible(
            True)                                      # 6
        self.calendar.clicked.connect(
            self.show_emotion_func)                   # 6

        # 7
        print(self.calendar.minimumDate())
        print(self.calendar.maximumDate())
        print(self.calendar.selectedDate())

        # 8
        self.label = QLabel(self)
        self.label.setAlignment(Qt.AlignCenter)

        weekday = self.calendar.selectedDate().toString('ddd')                  # 9
        self.label.setText(EMOTION[weekday])

        self.v_layout = QVBoxLayout()
        self.v_layout.addWidget(self.calendar)
        self.v_layout.addWidget(self.label)

        self.setLayout(self.v_layout)
        self.setWindowTitle('QCalendarWidget')
Exemple #5
0
    def UiComponents(self):
        # creating a QCalendarWidget object
        global calendar
        calendar = QCalendarWidget(self)

        # setting geometry to the calendar
        calendar.setGeometry(0, 0, 400, 250)
    def get_calendar_widget(self):
        calendar = QCalendarWidget()
        calendar.setEnabled(True)
        calendar.setFirstDayOfWeek(Qt.Monday)
        calendar.setDateEditEnabled(True)

        return calendar
Exemple #7
0
    def initUI(self):
        vbox = QVBoxLayout(self)
        # 创建一个横向布局
        cal = QCalendarWidget(self)
        # 创建一个QCalendarWidget
        cal.setGridVisible(True)
        # 设置网格可见
        # 从窗口组件中选定一个日期,会发射一个QCore.QDate信号
        cal.clicked[QDate].connect(
            self.showDate)  # clicked[QDate]说明点击信号发出,会带有一个QDate参数, 就要求槽函数也要有形参
        # 选择一个日期时, QDate的点击信号就触发了,
        # 把这个信号和我们自己定义的showDate()方法关联起来
        # 并且传入一个QDate类型的参数(即当前选中的日期)
        vbox.addWidget(cal)

        # 自动在底部标签栏显示当前日期的信息
        self.lbl = QLabel(self)
        # 设置日历的最小日期
        # self.cal.setMinimumDate(QDate(1980,1,1))
        # cal.setSelectedDate(QDate(1980,1,1)) 设置选取的日期
        date = cal.selectedDate()
        # 使用selectedDate()方法获取选中的日期, 默认当前日期
        self.lbl.setText(date.toString())
        # 然后把日期对象转成字符串, 在标签栏里面显示出来

        vbox.addWidget(self.lbl)
        # 布局中加入标签控件
        self.setLayout(vbox)
        # 设置布局
        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('Calendar')
        self.show()
Exemple #8
0
	def __init__(self):
		super().__init__()
		self.calendar = QCalendarWidget(self)
		# self.calendar.setGridVisible(True)
		self.calendar.setContentsMargins(0,0,0,0)
		self.calendar.setSelectedDate(QDate(datetime.now().year, datetime.now().month, 1))
		self.calendar.clicked.connect(self.printDateInfo)
    def show_calendar(self, date_initial: 'QDate'):
        """
        Calendar widget to select date from
        :return: None
        """
        self.cal_widget = QWidget()
        self.cal_widget.setWindowModality(Qt.ApplicationModal)
        self.cal_widget.main_layout = QGridLayout(self.cal_widget)
        self.cal_widget.setWindowTitle('Calendar')
        self.cal_widget.setLayout(self.cal_widget.main_layout)

        cal = QCalendarWidget(self.cal_widget)
        cal.setGridVisible(True)
        cal.setSelectedDate(date_initial)
        self.cal_widget.main_layout.addWidget(cal, 0, 0)
        cal.clicked[QtCore.QDate].connect(self.showDate)

        button_set = QPushButton(
            QApplication.style().standardIcon(
                QtWidgets.QStyle.SP_DialogOkButton), " Set", self.cal_widget)
        button_set.clicked.connect(partial(self.set_date, cal))
        self.cal_widget.main_layout.addWidget(button_set, 1, 1)

        self.cal_widget.lbl = QLabel(self.cal_widget)
        self.cal_widget.main_layout.addWidget(self.cal_widget.lbl, 1, 0)

        self.showDate(cal.selectedDate())
        self.cal_widget.show()
    def __init__(self, parent=None):
        super(VistaListaPrenotazioni, self).__init__(parent)

        self.g_layout = QGridLayout()

        self.label_prenotazioni_by_data = QLabel("\nSeleziona una data, poi premi  'Vai'  per vedere gli arrivi alla data selezionata: \n")
        self.label_prenotazioni_by_data.setStyleSheet("font: 200 14pt \"Papyrus\";\n""color: rgb(0, 0, 0);\n"
                                                    "background-color: rgb(178, 225, 255);\n"
                                                    "selection-color: rgb(170, 255, 0);")
        self.g_layout.addWidget(self.label_prenotazioni_by_data, 0, 0)

        self.calendario = QCalendarWidget()
        self.calendario.setGridVisible(True)
        self.calendario.setVerticalHeaderFormat(QCalendarWidget.NoVerticalHeader)
        self.calendario.setMinimumDate(QDate(2021, 6, 1))
        self.calendario.setMaximumDate(QDate(2021, 9, 15))

        self.g_layout.addWidget(self.calendario, 1, 0)

        self.h_layout = QHBoxLayout()

        self.create_button("Mostra tutte", self.go_lista_prenotazioni, "background-color:#FFD800;")
        self.create_button("Vai", self.go_lista_prenotazioni_by_data, "background-color:#00FF00;")

        self.g_layout.addLayout(self.h_layout, 2, 0)

        self.setLayout(self.g_layout)
        self.resize(700, 600)
        self.setWindowTitle("Lista Prenotazioni")
Exemple #11
0
    def initUI(self):
        self.setWindowTitle('进度条示例')
        self.setWindowIcon(QIcon('./res/apaki.ico'))
        self.setGeometry(400, 300, 400, 300)

        self.pbar = QProgressBar(self)
        self.btn = QPushButton("开始下载", self)
        self.btn.clicked.connect(self.doAction)

        self.timer = QBasicTimer()
        self.step = 0

        # -------------------------------------------------
        cal = QCalendarWidget(self)
        cal.clicked[QDate].connect(self.showData)

        date = cal.selectedDate()
        self.label = QLabel(self)
        self.label.setText(date.toString())

        grid = QGridLayout(self)
        grid.addWidget(self.pbar, 0, 1)
        grid.addWidget(self.btn, 0, 0)
        grid.addWidget(self.label, 2, 0, 1, 2)
        grid.addWidget(cal, 3, 0, 1, 2)
        self.setLayout(grid)
Exemple #12
0
    def initUI(self):

        vbox = QVBoxLayout(self)

        cal = QCalendarWidget(self)
        cal.setGridVisible(True)
        cal.clicked[QDate].connect(self.showDate)

        vbox.addWidget(cal)

        self.lbl = QLabel(self)
        date = cal.selectedDate()
        self.lbl.setText(date.toString())
        #lbl contains the date of the selected day
        vbox.addWidget(self.lbl)

        self.setLayout(vbox)
        reminderbutton = QPushButton("Check For Reminder", self)
        reminderbutton.move(120, 990)
        reminderbutton.resize(175, 25)
        addbutton = QPushButton("Add Reminder", self)
        addbutton.move(300, 990)
        addbutton.resize(175, 25)
        temporary = LabelAndButtonWork()
        self.lbls = self.lbl.text()
        reminderbutton.clicked.connect(lambda: temporary.CheckForReminder(
            temporary.GetWordsForLabel(self.lbls)))
        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('Calendar')
        self.show()
Exemple #13
0
 def __init__(self, parent, filter_widget):
     super().__init__(parent=parent)
     self.parent=parent
     self.filter_widget=filter_widget
     self.global_layout=QHBoxLayout()
     self.setLayout(self.global_layout)
     self.item1=QComboBox()
     for column in Filter.columns:
         self.item1.addItem(column)
     self.global_layout.addWidget(self.item1)
     self.item2=QComboBox()
     for operation in ['<','<=','=','>','>=']:
         self.item2.addItem(operation)
     self.global_layout.addWidget(self.item2)
     self.item3=QLineEdit()
     self.global_layout.addWidget(self.item3)
     self.calendar=QCalendarWidget()
     self.global_layout.addWidget(self.calendar)
     self.calendar.hide()
     self.remove_button=QToolButton()
     folder=os.path.split(inspect.getfile(Curve))[0]
     self.remove_button.setIcon(QtGui.QIcon(os.path.join(folder,'minus.png')))
     self.global_layout.addWidget(self.remove_button)
     self.remove_button.clicked.connect(self.remove)
     self.activate_box = QCheckBox('activate')
     
     self.global_layout.addWidget(self.activate_box)
     self.item1.currentTextChanged.connect(self.columnchanged)
Exemple #14
0
    def __init__(self):
        super().__init__()
        # 윈도우 설정
        self.setGeometry(300, 100, 1200, 800)  # x, y, w, h
        self.setWindowTitle('Canlendar Widget')

        # CalendarWidget 위젯 화면에 표시
        self.cal = QCalendarWidget(self)
        self.cal.setGeometry(120, 50, 970, 300)
        self.cal.setGridVisible(True)
        self.cal.selectionChanged.connect(self.calendar_change)

        # min max 기간 설정
        #self.cal.setMinimumDate(QDate(2020, 8, 25))
        #self.cal.setMaximumDate(QDate(2020, 8, 27))

        # Calendar 에서 선택한 값 표시할 QLabel
        self.calendar_label = QLabel(self)
        self.calendar_label.setGeometry(120, 370, 970, 30)
        self.calendar_label.setStyleSheet('background-color:#D3D3D3')

        self.b = QPlainTextEdit(self)
        self.b.insertPlainText("일기를 작성해요주세용.\n")
        self.b.setGeometry(120, 420, 970, 200)

        self.setupUI()
Exemple #15
0
    def home(self):
        """
        Home page of the App. 
        """

        # Create and display calendar object.
        calendar = QCalendarWidget(self)
        calendar.setGridVisible(True)
        calendar.move(20, 50)
        calendar.resize(320, 200)
        calendar.setMinimumDate(QtCore.QDate(1995, 6, 16))
        calendar.setMaximumDate(QtCore.QDate.currentDate())
        calendar.clicked[QtCore.QDate].connect(self.get_apod_date)

        # Get date selected by calendar object and change date to desired
        # format. (YYMMDD)
        date = calendar.selectedDate()
        a_date = [int(str(date.year())[2:]), date.month(), date.day()]
        self.astro_date = ''.join(list(map(str, a_date)))

        # Create "See Picture" button. Connect it to get_picture function.
        see_button = QPushButton("See Picture", self)
        see_button.move(20, 280)
        see_button.clicked.connect(self.get_picture)

        # Display all objects in the window.
        self.show()
Exemple #16
0
 def initUI(self):
     self.calendar_label = QLabel('Seleziona la data', self)
     self.calendar = QCalendarWidget(self)
     self.stringa_data = time.strftime(
         '%d/%m/%Y'
     )  # per far si che ci sia un valore all'avvio, da inserire con strftime
     self.stringa_data_per_nome_file = time.strftime('%d%m%y')
     #Creo i bottoni
     self.btn_download = QPushButton('Scarica Bolle', self)
     self.btn_upload = QPushButton('Carica Vendite', self)
     #Creo widget testo per output
     self.mio_testo = QTextEdit(self)
     self.mio_testo.setReadOnly(True)
     self.mio_testo.setMaximumHeight(50)
     #Creo layout
     self.vbox = QVBoxLayout()
     self.hbox = QHBoxLayout()
     self.hbox.addWidget(self.btn_download)
     self.hbox.addWidget(self.btn_upload)
     self.vbox.addWidget(self.calendar_label)
     self.vbox.addWidget(self.calendar)
     self.vbox.addLayout(self.hbox)
     self.vbox.addWidget(self.mio_testo)
     self.setLayout(self.vbox)
     self.calendar.clicked[QDate].connect(self.set_date)
     #self.btn_download.clicked.connect(lambda: self.test_funct('ciccio')) #uso lambda per passare ulteriori argomenti al segnale
     self.btn_download.clicked.connect(self.download_bolle)
     self.btn_upload.clicked.connect(self.upload_vendite)
     self.setWindowTitle('Occupy Artoni')
     self.show()
Exemple #17
0
    def initUI(self):
        self.cal = QCalendarWidget()
        self.cal.setGridVisible(True)  # 격자표시 설정
        self.cal.setDateRange(QDate(2020, 1, 1), QDate.currentDate())
        self.cal.clicked[QDate].connect(self.PastDate)

        self.label1 = QLabel(self)
        self.date = self.cal.selectedDate()
        self.label1.setText(self.date.toString())

        self.label2 = QLabel(self)
        previousBtn = QPushButton('이전 달')
        previousBtn.clicked.connect(self.preMonth)
        nextBtn = QPushButton('다음 달')
        nextBtn.clicked.connect(self.nextMonth)

        vbox = QVBoxLayout()
        vbox.addWidget(self.cal)
        vbox.addWidget(self.label1)
        vbox.addWidget(self.label2)
        vbox.addWidget(previousBtn)
        vbox.addWidget(nextBtn)

        self.setLayout(vbox)

        self.setWindowTitle('QCalendarWidget')
        self.setGeometry(300, 300, 500, 400)
        self.show()
Exemple #18
0
def calendar(tela, x, y, largura, altura):
    calendar_ = QCalendarWidget(tela)
    calendar_.setVerticalHeaderFormat(QCalendarWidget.NoVerticalHeader)
    calendar_.setGridVisible(True)
    calendar_.setGeometry(QRect(x, y, largura, altura))

    return calendar_
Exemple #19
0
    def initUI(self):
        cal = QCalendarWidget(self)
        cal.setGridVisible(True)
        cal.clicked[QDate].connect(self.showDate)
        # QCalenderWidget의 객체(cal)를 하나 만듭니다.
        # setGridVisible(True)로 설정하면, 날짜 사이에 그리드가 표시됩니다.
        # 날짜를 클릭했을 때 showDate 메서드가 호출되도록 연결해줍니다.

        self.lbl = QLabel(self)
        date = cal.selectedDate()
        # selectedDate는 현재 선택된 날짜 정보를 갖고 있습니다. (디폴트는 현재 날짜)
        #
        # 현재 날짜 정보를 라벨에 표시되도록 해줍니다.
        self.lbl.setText(date.toString())

        vbox = QVBoxLayout()
        vbox.addWidget(cal)
        vbox.addWidget(self.lbl)
        # 수직 박스 레이아웃을 이용해서, 달력과 라벨을 수직으로 배치해줍니다.

        self.setLayout(vbox)

        self.setWindowTitle('QCalendarWidget')
        self.setGeometry(300, 300, 400, 300)
        self.show()
Exemple #20
0
    def initUI(self):
        """初始化UI界面"""
        # 创建 box layout
        vbox = QVBoxLayout(self)

        cal = QCalendarWidget(self)
        cal.setGridVisible(True)
        cal.clicked[QDate].connect(self.showDate)

        vbox.addWidget(cal)

        self.label = QLabel(self)

        date = cal.selectedDate()

        self.label.setText(date.toString())

        vbox.addWidget(self.label)

        self.setLayout(vbox)

        # window settings
        self.setGeometry(500, 500, 500, 360)
        self.setWindowTitle("Calendar")

        self.show()
Exemple #21
0
    def init_ui(self):
        global cal
        cal = QCalendarWidget(self)
        cal.setGridVisible(True)
        cal.clicked[QDate].connect(self.tasks_show)

        tools = QMainWindow()
        exit_action = QAction(QIcon('pictures\exit.png'), 'Exit', tools)
        exit_action.setShortcut('Ctrl+Q')
        exit_action.triggered.connect(qApp.quit)
        add_action = QAction(QIcon('pictures\plus.png'), 'Add notification', tools)
        add_action.triggered.connect(self.add)
        list_action = QAction(QIcon("pictures\list.png"), "Notifications list", tools)
        list_action.triggered.connect(self.all_notifications)
        clear_action = QAction(QIcon("pictures\_basket.bmp"), "Clear all tasks", tools)
        clear_action.triggered.connect(self.clear_all)

        tools.toolbar = tools.addToolBar('Exit')
        tools.toolbar.addAction(add_action)
        tools.toolbar.addAction(list_action)
        tools.toolbar.addAction(clear_action)
        tools.toolbar.addAction(exit_action)

        vbox = QVBoxLayout()
        vbox.addWidget(tools)
        vbox.addWidget(cal)
        vbox.addStretch(1)


        self.setLayout(vbox)
        self.setGeometry(500, 400, 600, 600)
        self.setWindowTitle('Task reminder by Saf & CHu Calculated')
        self.setWindowIcon(QIcon('pictures\cal'))
        self.show()
        self.tasks_show()
Exemple #22
0
    def open_calendar(self):
        self.calendarwindow = QWidget()
        self.cal = QCalendarWidget(self)
        self.cal.setGridVisible(True)
        self.cal.clicked[QDate].connect(self.show_date)

        self.cal_label = QLabel(self)
        self.date = self.cal.selectedDate()
        self.cal_label.setText(self.date.toPyDate().strftime("%d.%m.%Y"))

        choose_btn = QPushButton("Valitse")
        choose_btn.clicked.connect(self.set_date)
        cancel_btn = QPushButton("Peruuta")
        cancel_btn.clicked.connect(self.calendarwindow.close)

        # Ikkunan asettelu
        hbox = QHBoxLayout()
        hbox.addWidget(self.cal_label)
        hbox.addStretch()
        hbox.addWidget(choose_btn)
        hbox.addWidget(cancel_btn)

        vbox = QVBoxLayout()
        vbox.addStretch()
        vbox.addWidget(self.cal)
        vbox.addLayout(hbox)

        self.calendarwindow.setLayout(vbox)
        self.calendarwindow.setGeometry(600, 300, 300, 200)
        self.calendarwindow.setWindowTitle("Valitse päivämäärä")
        self.calendarwindow.setWindowIcon(QIcon(f"{mainpath}icon.ico"))
        self.calendarwindow.show()
Exemple #23
0
    def initUI(self):
        VBox = QVBoxLayout()
        calendar = QCalendarWidget(self)
        calendar.setGridVisible(True)
        # calendar.move(20, 20)
        calendar.clicked[QDate].connect(self.showDate)

        label = QLabel(self)
        date = calendar.selectedDate()
        label.setText(self.getDate(date))
        # label.move(130, 260)
        label.setAlignment(Qt.AlignCenter)
        self.label = label

        self.calendar = calendar

        Hbox = QHBoxLayout()

        VBox.addWidget(calendar, 5)
        VBox.addWidget(label, 1)

        self.setLayout(VBox)

        buttons = QDialogButtonBox(QDialogButtonBox.Ok
                                   | QDialogButtonBox.Cancel)  # 窗口中建立确认和取消按钮

        VBox.addWidget(buttons)

        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        self.resize(350, 300)
        self.center()
        self.setWindowTitle('日历控件')
        self.show()
Exemple #24
0
    def InitUI(self):
        self.setWindowTitle("მონაცემთა შეტანა")
        self.setWindowIcon(QtGui.QIcon("icon/outcome.svg"))
        self.setFixedSize(1300, 900)
        vbox = QVBoxLayout()
        hbox = QHBoxLayout()
        vbox.setContentsMargins(2, 2, 2, 2)
############################## Calendar ###############################
        self.calendar = QCalendarWidget()
        self.calendar.setGridVisible(True)
        self.calendar.setFirstDayOfWeek(Qt.Monday)
############################### Table #################################
        self.table = QTableWidget()
        self.table.setRowCount(1)
        self.table.setColumnCount(len(self._header))
        self.table.setHorizontalHeaderLabels(self._header)
        self.table.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
        self.table.resizeRowsToContents()
        self.table.setSortingEnabled(False)
        self.table.setWordWrap(True)
        self.rowNumb = self.table.rowCount()-1
############################## add Row ################################
        self.addRowButton = QPushButton('დამატება')
        self.addRowButton.setMaximumWidth(100)
        self.addRowButton.setIcon(QIcon('icon/addRow.svg'))
        self.addRowButton.clicked.connect(self.addRow)
############################## del Row ################################
        self.delRowButton = QPushButton('წაშლა')
        self.delRowButton.setMaximumWidth(100)
        self.delRowButton.setIcon(QIcon('icon/DelRow.svg'))
        self.delRowButton.clicked.connect(self.delRow)
############################### test ##################################
        sumHboxLayout = QHBoxLayout()
        self.sumMoney = QLineEdit()
        self.equivalentSumMoney = QLineEdit()
        sumHboxLayout.addWidget(self.sumMoney)
        sumHboxLayout.addWidget(self.equivalentSumMoney)
        self.testButton = QPushButton('ტესტი')
        self.testButton.setIcon(QIcon('icon/test.png'))
        self.testButton.clicked.connect(self.test)
############################## Accept #################################
        self.acceptButton = QPushButton('დადასტურება', self)
        self.acceptButton.clicked.connect(self.acceptDialog)
############################## Reject #################################
        self.rejectButton = QPushButton('გაუქმება', self)
        self.rejectButton.clicked.connect(self.rejectDialog)
###################### Add widgets on layouts #########################
        hbox.addWidget(self.addRowButton)
        hbox.addWidget(self.delRowButton)

        vbox.addWidget(self.calendar,5)
        vbox.addWidget(self.table,90)
        vbox.addLayout(hbox)
        vbox.addLayout(sumHboxLayout)
        vbox.addWidget(self.testButton,5)
        hboxAcceptReject = QHBoxLayout()
        hboxAcceptReject.addWidget(self.acceptButton)
        hboxAcceptReject.addWidget(self.rejectButton)
        vbox.addLayout(hboxAcceptReject)
        self.setLayout(vbox)
    def __init__(self, lesson: Lesson, on_change=lambda: None):
        super().__init__(flags=QtCore.Qt.WindowStaysOnTopHint)
        self.lesson = lesson
        self.l = QVBoxLayout()
        self.on_change = on_change

        self.calendar = QCalendarWidget()
        # self.calendar.setSelectedDate(QDate=QDate(date.year, date.month, date.day))
        self.l.addWidget(self.calendar)

        self.lesson_selector_layout = QHBoxLayout()
        self.l.addLayout(self.lesson_selector_layout)
        self.lesson_selector_layout.addWidget(QLabel("Выберете время занятия"))

        self.lesson_selector = QComboBox()
        self.lesson_selector.addItems([
            "1. 9:00", "2. 10:45", "3. 13:00", "4. 14:45", "5. 16:30",
            "6. 18:15"
        ])

        self.lesson_selector_layout.addWidget(self.lesson_selector)

        self.button = QPushButton("Подтвердить")
        self.button.clicked.connect(self.accept)
        self.button.setStyleSheet(
            "background-color: #ff8000; color: #ffffff; font-weight: bold;")
        self.l.addWidget(self.button)

        self.setLayout(self.l)
Exemple #26
0
    def initUI(self):

        vbox = QVBoxLayout(self)

        cal = QCalendarWidget(self)
        cal.setGridVisible(True)
        # what is the difference between setting true and false???
        cal.clicked[QDate].connect(self.showData)
        # If we select a date from the widget, a clicked[QDate] signal
        # is emitted.
        # We connect this signal to the user defined showDate() method.

        vbox.addWidget(cal)

        self.lbl = QLabel(self)
        date = cal.selectedDate()  # the default date is today
        self.lbl.setText(date.toString())

        vbox.addWidget(self.lbl)

        self.setLayout(vbox)

        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle("Calendar")
        self.show()
Exemple #27
0
 def __init__(self):
     super(MainWindow, self).__init__()
     # interface e splitter
     uiFile = QtCore.QFile(":/Ui_MainWindow.ui")
     uiFile.open(QtCore.QFile.ReadOnly)
     uic.loadUi(uiFile, self)
     uiFile.close()
     self.loadSplitter()
     self.setWindowTitle("Todopad")
     self.setWindowIcon(QIcon(':/app.ico'))
     # connects
     self.connects()
     # current path do app
     self.path = QDir.currentPath()
     # desativando html no text edit
     self.textEdit.setAcceptRichText(False)
     # font size do text edit
     self.textEdit.setFontPointSize(10)
     # ativando drag and drop interno da lista
     self.listWidget.setDragDropMode(QAbstractItemView.InternalMove)
     # inicializando objeto do calendario
     self.calendar = QCalendarWidget()
     self.calendar.setWindowTitle('Calendar')
     self.calendar.setWindowIcon(QIcon(':/app.ico'))
     self.calendar.setGridVisible(True)
     # controle de versao da aplicacao para escrita no json
     self.version = "1.1"
Exemple #28
0
    def __init__(self):
        super(window, self).__init__()
        self.setGeometry(50, 50, 800, 500)
        self.setWindowTitle('pyqt5 Tut')
        # self.setWindowIcon(QIcon('pic.png'))

        extractAction = QAction('&Get to the choppah', self)
        extractAction.setShortcut('Ctrl+Q')
        extractAction.setStatusTip('leave the app')
        extractAction.triggered.connect(self.close_application)

        self.statusBar()

        mainMenu = self.menuBar()
        fileMenu = mainMenu.addMenu('&File')
        fileMenu.addAction(extractAction)

        extractAction = QAction(QIcon('pic.png'), 'flee the scene', self)
        extractAction.triggered.connect(self.close_application)
        self.toolBar = self.addToolBar('extraction')
        self.toolBar.addAction(extractAction)

        fontChoice = QAction('Font', self)
        fontChoice.triggered.connect(self.font_choice)
        # self.toolBar = self.addToolBar('Font')
        self.toolBar.addAction(fontChoice)

        cal = QCalendarWidget(self)
        cal.move(500, 200)
        cal.resize(200, 200)

        self.home()
    def __init__(
        self, projectconfigwindow_classobject
    ):  #Multiple inheritance, see documentation on super().__init__()
        super(CalendarDialog, self).__init__()
        self.start_calendar = projectconfigwindow_classobject.start_date_calendar
        self.end_calendar = projectconfigwindow_classobject.end_date_calendar
        self.date_picked = ''
        self.setWindowTitle('Date Picker')
        self.setFixedSize(400, 300)
        mainlayout = QVBoxLayout()
        exitlayout = QHBoxLayout()

        self.my_calendar = QCalendarWidget(self)
        self.my_calendar.setGridVisible(True)
        if self.end_calendar == True:
            self.my_calendar.setMinimumDate(
                QDate(projectconfigwindow_classobject.minimumdate[2],
                      projectconfigwindow_classobject.minimumdate[0],
                      projectconfigwindow_classobject.minimumdate[1]))
        self.my_calendar.clicked[QDate].connect(self.show_date)

        self.date_label = QLabel(self)
        date = self.my_calendar.selectedDate()
        self.date_label.setText(date.toString())
        confirmbutt = QPushButton('Confirm Date')
        confirmbutt.clicked.connect(self.on_confirm_button_clicked)

        exitlayout.addWidget(self.date_label)
        exitlayout.addWidget(confirmbutt)

        mainlayout.addWidget(self.my_calendar)
        mainlayout.addLayout(exitlayout)
        self.setLayout(mainlayout)
    def home(self):
        btn = QPushButton('quit', self)
        btn.clicked.connect(self.close_application)
        # btn.resize(btn.sizeHint()) # auto size for btn
        btn.resize(btn.minimumSizeHint())
        btn.move(0, 100)

        extractAction = QAction(QIcon('icon-smoker.jpg'), 'Flee the scene',
                                self)
        extractAction.triggered.connect(self.close_application)
        self.toolBar = self.addToolBar('Extraction')
        self.toolBar.addAction(extractAction)

        bsAction = QAction(QIcon('icon-me.jpg'), 'bullshit time', self)
        bsAction.triggered.connect(self.bullshit)
        self.toolBar.addAction(bsAction)

        fontChoice = QAction('font', self)
        fontChoice.triggered.connect(self.font_choice)
        self.toolBar.addAction(fontChoice)

        color = QColor(0, 0, 0)
        fontColor = QAction('Font bg Color', self)
        fontColor.triggered.connect(self.color_picker)
        self.toolBar.addAction(fontColor)

        cal = QCalendarWidget(self)
        cal.move(500, 200)
        cal.resize(200, 200)

        checkBox = QCheckBox('window size', self)
        checkBox.move(300, 25)
        # checkBox.toggle()
        checkBox.stateChanged.connect(self.enlargeWindow)

        self.progress = QProgressBar(self)
        self.progress.setGeometry(200, 80, 250, 20)

        self.btn = QPushButton('download', self)
        self.btn.move(200, 120)
        self.btn.clicked.connect(self.download)

        # print(self.style().objectName())
        self.styleChoice = QLabel('Windows', self)

        comboBox = QComboBox(self)
        # comboBox.addItem('motif')
        # comboBox.addItem('Windows')
        # comboBox.addItem('cde')
        # comboBox.addItem('Plastique')
        # comboBox.addItem('Cleanlooks')
        # comboBox.addItem('windowsvista')
        comboBox.addItems(QStyleFactory.keys())

        comboBox.move(25, 250)
        self.styleChoice.move(50, 150)
        comboBox.activated[str].connect(self.style_choice)

        self.show()