1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/colorwidgettest/mainwindow.cpp
2018-07-23 19:08:04 +08:00

25 lines
581 B
C++

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <qqtcolorwidget.h>
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
{
ui->setupUi ( this );
ui->lineEdit->setText ( "0x863356" );
ui->widget->setColor ( QRgb ( ui->lineEdit->text().toInt() ) );
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
ui->widget->setColor ( QRgb ( ui->lineEdit->text().toInt() ) );
ui->widget->setAutoFillBackground ( true );
ui->widget->update();
}