desktopclockpreferences.ui.h

来自「Linux/windows环境下Qt程序」· C头文件 代码 · 共 65 行

H
65
字号
#include "BSettings.h"#include <qcolordialog.h>#include <qfontdialog.h>#include <qlabel.h>void DesktopClockPreferences::setSettings( void * s){	BSettings * settings = (BSettings*)s;	showWMCheckBox->setChecked(settings->showWM);   	showAHCheckBox->setChecked(settings->showAH);	stayOnTopCheckBox->setChecked(settings->stayOnTop);	showDateCheckBox->setChecked(settings->showDate);	showTimeCheckBox->setChecked(settings->showTime);	showSecondsCheckBox->setChecked(settings->showSeconds);	showGlareCheckBox->setChecked(settings->showGlare);	dateStringFormat->setText(settings->dateFormat);	timeStringFormat->setText(settings->timeFormat);	fontLabel->setText(settings->fontFormat);	hourColorLabel->setPaletteBackgroundColor(QColor(settings->hourColor));	secondColorLabel->setPaletteBackgroundColor(QColor(settings->secondColor));}void DesktopClockPreferences::getSettings( void* s){	BSettings * settings = (BSettings*)s;	settings->showWM = showWMCheckBox->isChecked();	settings->showAH = showAHCheckBox->isChecked();	settings->stayOnTop = stayOnTopCheckBox->isChecked();	settings->showDate = showDateCheckBox->isChecked();	settings->showTime = showTimeCheckBox->isChecked();	settings->showSeconds = showSecondsCheckBox->isChecked();	settings->showGlare = showGlareCheckBox->isChecked();	settings->dateFormat = dateStringFormat->text();	settings->timeFormat = timeStringFormat->text();	settings->fontFormat = fontLabel->text();	settings->hourColor = hourColorLabel->paletteBackgroundColor().name();	settings->secondColor = secondColorLabel->paletteBackgroundColor().name();}void DesktopClockPreferences::selectHourColor(){	hourColorLabel->setPaletteBackgroundColor(QColorDialog::getColor(hourColorLabel->paletteBackgroundColor()));}void DesktopClockPreferences::selectSecondColor(){	secondColorLabel->setPaletteBackgroundColor(QColorDialog::getColor(secondColorLabel->paletteBackgroundColor()));}void DesktopClockPreferences::selectFont(){    bool ok;    QFont fnt = QFontDialog::getFont(&ok, font(), this);    if (ok)	    fontLabel->setText(fnt.toString());    else	    return;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?