📄 light_mainform.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'light_mainform.ui'**** Created by: The User Interface Compiler ($Id: qt/main.cpp 3.3.8 edited Jan 11 14:47 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "light_mainform.h"#include <qvariant.h>#include <qlabel.h>#include <qspinbox.h>#include <qslider.h>#include <qpushbutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include <stdlib.h>#include <qsettings.h>/* * Constructs a light_MainForm as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */light_MainForm::light_MainForm( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "light_MainForm" ); setAcceptDrops( FALSE ); light_TextLabel = new QLabel( this, "light_TextLabel" ); light_TextLabel->setGeometry( QRect( 20, 30, 67, 20 ) ); light_Spinbox = new QSpinBox( this, "light_Spinbox" ); light_Spinbox->setEnabled( FALSE ); light_Spinbox->setGeometry( QRect( 80, 70, 50, 22 ) ); light_Spinbox->setMaxValue( 100 ); light_Spinbox->setMinValue( 10 ); *light_Spinbox.value=readsettings(); light_Slider = new QSlider( this, "light_Slider" ); light_Slider->setGeometry( QRect( 80, 30, 200, 24 ) ); light_Slider->setAcceptDrops( FALSE ); light_Slider->setMinValue( 10 ); light_Slider->setMaxValue( 100 ); light_Slider->setOrientation( QSlider::Horizontal ); *light_Slider.value= readsettings(); ok_Button = new QPushButton( this, "ok_Button" ); ok_Button->setGeometry( QRect( 80, 160, 70, 30 ) ); cancel_Button = new QPushButton( this, "cancel_Button" ); cancel_Button->setGeometry( QRect( 210, 160, 70, 30 ) ); languageChange(); resize( QSize(331, 250).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( light_Slider, SIGNAL( valueChanged(int) ), light_Spinbox, SLOT( setValue(int) ) ); connect( cancel_Button, SIGNAL( clicked() ), this, SLOT( closeEvent() ) ); connect( light_Spinbox, SIGNAL( valueChanged(int) ), light_Slider, SLOT( setValue(int) ) ); connect( light_Slider, SIGNAL( valueChanged(int) ), this, SLOT( changeLight() ) ); connect( ok_Button, SIGNAL( clicked() ), this, SLOT( writeValue() ) );}/* * Destroys the object and frees any allocated resources */light_MainForm::~light_MainForm(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void light_MainForm::languageChange(){ setCaption( tr( "lightChanger" ) ); light_TextLabel->setText( tr( "light" ) ); ok_Button->setText( tr( "OK" ) ); cancel_Button->setText( tr( "cancel" ) );}void light_MainForm::writeValue(){ //qWarning( "light_MainForm::writeValue(): Not implemented yet" );}void light_MainForm::changeLight(){ system("echo yes >>test"); // qWarning( "light_MainForm::changeLight(): Not implemented yet" );}void light_MainForm::closeEvent(){ writesettings(); light_MainForm ->reject(); // qWarning( "light_MainForm::closeEvent(): Not implemented yet" );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -