⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui_new.h

📁 在linux系统下
💻 H
字号:
/********************************************************************************
** Form generated from reading ui file 'new.ui'
**
** Created: Fri Aug 3 08:49:54 2007
**      by: Qt User Interface Compiler version 4.2.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/

#ifndef UI_NEW_H
#define UI_NEW_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QComboBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QGroupBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QSlider>
#include <QtGui/QWidget>
#include <QFileDialog>
#include "view.h"

class Ui_Dialog : public QDialog
{
	Q_OBJECT
public:
    QGroupBox *groupBox_ajust;
    QWidget *layoutWidget_2;
    QGridLayout *gridLayout;
    QLabel *label_brightness;
    QLabel *label_hue;
    QSlider *horizontalSlider_contrast;
    QSlider *horizontalSlider_brightness;
    QSlider *horizontalSlider_hue;
    QLabel *label_contrast;
    QPushButton *pushButton_reset;
    QGroupBox *groupBox_Option;
    QPushButton *pushButton_ChangeDirection;
    QComboBox *comboBox;
    QLabel *label_format;
    QLabel *label_Dir;
    QLabel *label_currentdirecty;
    QWidget *horizontalLayout;
    QHBoxLayout *hboxLayout;
    QPushButton *pushButton_OK;
    QPushButton *pushButton_cancel;
    QPushButton *pushButton_quit;
public:
    Ui_Dialog()
    {
    this->setObjectName(QString::fromUtf8("Dialog"));
    groupBox_ajust = new QGroupBox(this);
    groupBox_ajust->setObjectName(QString::fromUtf8("groupBox_ajust"));
    groupBox_ajust->setGeometry(QRect(40, 20, 411, 181));
    layoutWidget_2 = new QWidget(groupBox_ajust);
    layoutWidget_2->setObjectName(QString::fromUtf8("layoutWidget_2"));
    layoutWidget_2->setGeometry(QRect(10, 30, 391, 111));
    gridLayout = new QGridLayout(layoutWidget_2);
    gridLayout->setSpacing(6);
    gridLayout->setMargin(0);
    gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
    label_brightness = new QLabel(layoutWidget_2);
    label_brightness->setObjectName(QString::fromUtf8("label_brightness"));

    gridLayout->addWidget(label_brightness, 1, 0, 1, 1);

    label_hue = new QLabel(layoutWidget_2);
    label_hue->setObjectName(QString::fromUtf8("label_hue"));

    gridLayout->addWidget(label_hue, 2, 0, 1, 1);

    horizontalSlider_contrast = new QSlider(layoutWidget_2);
    horizontalSlider_contrast->setObjectName(QString::fromUtf8("horizontalSlider_contrast"));
    horizontalSlider_contrast->setOrientation(Qt::Horizontal);

    gridLayout->addWidget(horizontalSlider_contrast, 0, 1, 1, 1);

    horizontalSlider_brightness = new QSlider(layoutWidget_2);
    horizontalSlider_brightness->setObjectName(QString::fromUtf8("horizontalSlider_brightness"));
    horizontalSlider_brightness->setOrientation(Qt::Horizontal);

    gridLayout->addWidget(horizontalSlider_brightness, 1, 1, 1, 1);

    horizontalSlider_hue = new QSlider(layoutWidget_2);
    horizontalSlider_hue->setObjectName(QString::fromUtf8("horizontalSlider_hue"));
    horizontalSlider_hue->setOrientation(Qt::Horizontal);

    gridLayout->addWidget(horizontalSlider_hue, 2, 1, 1, 1);

    label_contrast = new QLabel(layoutWidget_2);
    label_contrast->setObjectName(QString::fromUtf8("label_contrast"));

    gridLayout->addWidget(label_contrast, 0, 0, 1, 1);

    pushButton_reset = new QPushButton(groupBox_ajust);
    pushButton_reset->setObjectName(QString::fromUtf8("pushButton_reset"));
    pushButton_reset->setGeometry(QRect(327, 150, 75, 23));
    groupBox_Option = new QGroupBox(this);
    groupBox_Option->setObjectName(QString::fromUtf8("groupBox_Option"));
    groupBox_Option->setGeometry(QRect(40, 220, 421, 111));
    pushButton_ChangeDirection = new QPushButton(groupBox_Option);
    pushButton_ChangeDirection->setObjectName(QString::fromUtf8("pushButton_ChangeDirection"));
    pushButton_ChangeDirection->setGeometry(QRect(312, 26, 101, 23));
    comboBox = new QComboBox(groupBox_Option);
    comboBox->setObjectName(QString::fromUtf8("comboBox"));
    comboBox->setGeometry(QRect(256, 60, 151, 22));
    label_format = new QLabel(groupBox_Option);
    label_format->setObjectName(QString::fromUtf8("label_format"));
    label_format->setGeometry(QRect(10, 60, 54, 13));
    label_Dir = new QLabel(groupBox_Option);
    label_Dir->setObjectName(QString::fromUtf8("label_Dir"));
    label_Dir->setGeometry(QRect(140, 26, 180, 21));
    label_currentdirecty = new QLabel(groupBox_Option);
    label_currentdirecty->setObjectName(QString::fromUtf8("label_currentdirecty"));
    label_currentdirecty->setGeometry(QRect(10, 26, 101, 21));
    horizontalLayout = new QWidget(this);
    horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
    horizontalLayout->setGeometry(QRect(300, 350, 162, 31));
    hboxLayout = new QHBoxLayout(horizontalLayout);
    hboxLayout->setSpacing(6);
    hboxLayout->setMargin(0);
    hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
    pushButton_OK = new QPushButton(horizontalLayout);
    pushButton_OK->setObjectName(QString::fromUtf8("pushButton"));

    hboxLayout->addWidget(pushButton_OK);

    

    pushButton_cancel = new QPushButton(horizontalLayout);
    pushButton_cancel->setObjectName(QString::fromUtf8("pushButton_cancel"));

    hboxLayout->addWidget(pushButton_cancel);

    pushButton_quit = new QPushButton(horizontalLayout);
    pushButton_quit->setObjectName(QString::fromUtf8("pushButton_quit"));

    hboxLayout->addWidget(pushButton_quit);

    retranslateUi(this);

    QSize size(483, 403);
    size = size.expandedTo(this->minimumSizeHint());
    this->resize(size);

    setFixedSize(size);

    QMetaObject::connectSlotsByName(this);
    } // setupUi

    void retranslateUi(QDialog *Dialog)
    {
    Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0, QApplication::UnicodeUTF8));
    groupBox_ajust->setTitle(QApplication::translate("Dialog", "Ajust", 0, QApplication::UnicodeUTF8));
    label_brightness->setText(QApplication::translate("Dialog", " Brightness:", 0, QApplication::UnicodeUTF8));
    label_hue->setText(QApplication::translate("Dialog", "   Hue:", 0, QApplication::UnicodeUTF8));
    label_contrast->setText(QApplication::translate("Dialog", " Contrast:", 0, QApplication::UnicodeUTF8));
    pushButton_reset->setText(QApplication::translate("Dialog", "Reset", 0, QApplication::UnicodeUTF8));
    groupBox_Option->setTitle(QApplication::translate("Dialog", "Option", 0, QApplication::UnicodeUTF8));
    pushButton_ChangeDirection->setText(QApplication::translate("Dialog", "ChangeDirection", 0, QApplication::UnicodeUTF8));
    comboBox->clear();
    comboBox->addItem(QApplication::translate("Dialog", "BMP", 0, QApplication::UnicodeUTF8));
    comboBox->addItem(QApplication::translate("Dialog", "PNG", 0, QApplication::UnicodeUTF8));
    comboBox->addItem(QApplication::translate("Dialog", "JPG", 0, QApplication::UnicodeUTF8));
    label_format->setText(QApplication::translate("Dialog", "Format:", 0, QApplication::UnicodeUTF8));
    label_currentdirecty->setText(QApplication::translate("Dialog", "Current Directy:", 0, QApplication::UnicodeUTF8));
    pushButton_OK->setText(QApplication::translate("Dialog", "OK", 0, QApplication::UnicodeUTF8));
    pushButton_quit->setText(QApplication::translate("Dialog", "Quit", 0, QApplication::UnicodeUTF8));
    pushButton_cancel->setText(QApplication::translate("Dialog", "Cancel", 0, QApplication::UnicodeUTF8));
    Q_UNUSED(Dialog);
    } // retranslateUi

};

namespace Ui {
    class ImageSetting: public Ui_Dialog 
	{
		Q_OBJECT
	public:
		ImageSetting(Highlight::view *parent)
		{
			pview = parent;
			format = "";
			currentDir = pview->getDirection();
			Init();
		}
		enum ColorFormat
		{
			FMT_BMP	=0,
			FMT_JPG	=1,
			FMT_PNG	=2,
			FMT_DEFAULT =100
		};
		enum Definition
		{
			DEF_HIGH	= 0,
			DEF_NORMAL	= 1,
			DEF_DEFAULT = 100
		};
	public slots:
		void Definition_Clicked(int ID)
		{
			switch(ID)
			{
			case DEF_HIGH:
				definition = DEF_HIGH;
				break;
			case DEF_NORMAL:
				definition = DEF_NORMAL;
				break;
			default:
				definition = DEF_DEFAULT;
				break;
			}
		}
		void ColorFormat_Clicked(int ID)
		{
			switch(ID)
			{
			case FMT_BMP:
				format = "bmp";
				break;
			case FMT_JPG:
				format = "png";
				break;
			case FMT_PNG:
				format = "jpg";
				break;
			default:
				format = "";
				break;
			}
		}
		void ChangeDirection()
		{
			QString oldDir;
			oldDir = currentDir;
			currentDir = QFileDialog::getExistingDirectory(this,tr("Open Directory"),
				currentDir,QFileDialog::ShowDirsOnly|QFileDialog::DontResolveSymlinks);
			if (currentDir.isEmpty())
			{
				currentDir = oldDir;
			}
			updateDir();
			
		}
		void OnOK()
		{
			ColorFormat_Clicked(comboBox->currentIndex());
			if(!format.isEmpty())
			{
				pview->setFormat( format);
			}
			if( currentDir != pview->getDirection())
			{
				pview->setDirection( currentDir);
			}
			
			this->accept();
		}
		void OnCanCle()
		{
			this->reject();
		}
		void OnQuit()
		{
			pview->close();
			this->reject();
		}
		void change_Brightness(int value)
		{
			pview->setBrightness(value);
		}
		void change_Contrast(int value)
		{
			pview->setContrast( value);
		}
		void change_Hue(int value)
		{
			pview->setHue( value);
		}
		void OnReset()
		{
			horizontalSlider_brightness->setValue(oldBrightness);
			horizontalSlider_contrast->setValue(oldContrast);
			horizontalSlider_hue->setValue(oldHue);
		}
		public:
		void Init()
		{
			InitSetting();
			connect();
			updateDir();
		}
		void updateDir()
		{
			label_Dir->setText(currentDir);
		}
	
		void connect()
		{

			QObject::connect(pushButton_ChangeDirection,SIGNAL(clicked()),this,SLOT(ChangeDirection()));
			QObject::connect(pushButton_OK,SIGNAL(clicked()),this,SLOT(OnOK()));
			QObject::connect(pushButton_quit,SIGNAL(clicked()),this,SLOT(OnQuit()));
			QObject::connect(pushButton_cancel,SIGNAL(clicked()),this,SLOT(OnCanCle()));
			QObject::connect(pushButton_reset,SIGNAL(clicked()),this,SLOT(OnReset()));

			QObject::connect(horizontalSlider_brightness,SIGNAL(valueChanged(int)),this,SLOT(change_Brightness(int)));
			QObject::connect(horizontalSlider_contrast,SIGNAL(valueChanged(int)),this,SLOT(change_Contrast(int)));
			QObject::connect(horizontalSlider_hue,SIGNAL(valueChanged(int)),this,SLOT(change_Hue(int)));
			
		}
		void InitSetting()
		{
			horizontalSlider_contrast->setMaximum(65535);
			horizontalSlider_brightness->setMaximum(65535);
			horizontalSlider_hue->setMaximum(65535);

			horizontalSlider_brightness->setValue(pview->getDevice().getBrightness());
			horizontalSlider_contrast->setValue(pview->getDevice().getContrast());
			horizontalSlider_hue->setValue(pview->getDevice().getHue());
			oldBrightness = pview->getDevice().getBrightness();
			oldContrast   = pview->getDevice().getContrast();
			oldHue	      = pview->getDevice().getHue();
		}
	private:
		QString format;
		QString currentDir;
		Definition definition;
		Highlight::view *pview;
		int oldContrast;
		int oldBrightness;
		int oldHue;
	};
} 

#endif // UI_NEW_H

⌨️ 快捷键说明

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