Exemplo n.º 1
0
/**
 * Constructor for the main window
 */
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
    ui->setupUi(this);

    //Resize the image for the Mission Execution button
    QPixmap pixmap(":/res/longButtons/Mission_Execution_Button_Type_2.png");
    QIcon ButtonIcon(pixmap);
    ui->pushButton_8->setIcon(ButtonIcon);
    ui->pushButton_8->setIconSize(pixmap.rect().size()/13);

    //Resize the image for the Mission Planning button
    QPixmap pixmap2(":/res/longButtons/Mission_Planning_Button_Type_2.png");
    QIcon ButtonIcon2(pixmap2);
    ui->pushButton_9->setIcon(ButtonIcon2);
    ui->pushButton_9->setIconSize(pixmap2.rect().size()/13);

    //Resize the image for the Mission Recap button
    QPixmap pixmap3(":/res/longButtons/Mission_Recap_Button_Type_2.png");
    QIcon ButtonIcon3(pixmap3);
    ui->pushButton_7->setIcon(ButtonIcon3);
    ui->pushButton_7->setIconSize(pixmap3.rect().size()/13);

    //Resize the image for the Tutorial button
    QPixmap pixmap4(":/res/longButtons/Tutorial_Button_Type_2.png");
    QIcon ButtonIcon4(pixmap4);
    ui->pushButton_6->setIcon(ButtonIcon4);
    ui->pushButton_6->setIconSize(pixmap4.rect().size()/13);
}
//This functions adds images to the selction button
void MainWindow::setupImageButtons()
{
    //arduino image
    QPixmap pixmap(":/images/arduino.png");
    QIcon ButtonIcon(pixmap);
    ui->arduinoButton->setIcon(ButtonIcon);
    ui->arduinoButton->setIconSize((QSize(80,80)));

    //rasb pi image
    QPixmap pixmap2(":/images/rasbpi.png");
    QIcon ButtonIcon2(pixmap2);
    ui->raspButton->setIcon(ButtonIcon2);
    ui->raspButton->setIconSize((QSize(80,80)));
}
/**
* \author Jules Gorny - ALCoV team, ISIT, UMR 6284 UdA – CNRS
**/
AskSomething::AskSomething(QString windowsTitle, QString labelText, bool pwType, bool browseNeed, QIcon icon, QWidget *parent) : QDialog(parent)
{
	this->setWindowIcon(icon);
	this->setWindowTitle(windowsTitle);

    m_answer = new QLineEdit(this);
	if( pwType )
		m_answer->setEchoMode(QLineEdit::Password);
	m_answerLbl = new QLabel(this);
	m_answerLbl->setText(labelText);
	connect(m_answer, SIGNAL(textChanged(QString)), this, SLOT(slot_textChanged(QString)));
	
    validateButton = new QPushButton(tr("Validate"));
	validateButton->setDefault( true );
	validateButton->setEnabled( false );

	QSpacerItem *Spacer1 = new QSpacerItem(10, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
	QSpacerItem *Spacer2 = new QSpacerItem(10, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
		
	QPushButton *browseButton;
	if( browseNeed )
	{
		browseButton = new QPushButton();
		browseButton->setGeometry(browseButton->x(), browseButton->y(), 40, 28);
		QPixmap pixmap2(Config::IMAGES_FOLDER + "browse.png");
		QIcon ButtonIcon2(pixmap2);	
		browseButton->setIcon(ButtonIcon2);
		browseButton->setIconSize(QSize(28,28));
		browseButton->setFlat(true);
		connect(browseButton, SIGNAL(clicked()), this, SLOT(slot_browse()));
	}

    connect(validateButton, SIGNAL(clicked()), this, SLOT(accept()));
	
    QVBoxLayout *Vlt = new QVBoxLayout;
    QHBoxLayout *Hlt = new QHBoxLayout;
    QHBoxLayout *HltLbl = new QHBoxLayout;
    Vlt->addWidget(m_answerLbl);
    HltLbl->addWidget(m_answer);
	if( browseNeed )
		HltLbl->addWidget(browseButton);
	Hlt->addItem(Spacer1);
    Hlt->addWidget(validateButton);
    Hlt->addItem(Spacer2);
    Vlt->addLayout(HltLbl);
    Vlt->addLayout(Hlt);

    setLayout(Vlt);
}
Exemplo n.º 4
0
Principal::Principal(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Principal)
{
    ui->setupUi(this);
    r = -1;
    QPixmap pixmap1("icon/add.png");
    QPixmap pixmap2("icon/conf.png");
    QPixmap pixmap3("icon/del.png");
    QPixmap pixmap4("icon/Sair.png");
    QPixmap pixmap5("icon/pasta.png");
    QPixmap pixmap6("icon/detalhe.png");
    QIcon ButtonIcon(pixmap1);
    QIcon ButtonIcon1(pixmap2);
    QIcon ButtonIcon2(pixmap3);
    QIcon ButtonIcon3(pixmap4);
    QIcon ButtonIcon4(pixmap5);
    QIcon ButtonIcon5(pixmap6);
    ui->add_3->setIcon(ButtonIcon);
    ui->add_3->setIconSize(pixmap1.rect().size());
    ui->add_3->setStyleSheet(styleSheet().append(QString("border-image:url(icon/1.png);")));
    ui->alterar->setIcon(ButtonIcon1);
    ui->alterar->setIconSize(pixmap1.rect().size());
    ui->alterar->setStyleSheet(styleSheet().append(QString("border-image:url(icon/1.png);")));
    ui->deletar->setIcon(ButtonIcon2);
    ui->deletar->setIconSize(pixmap1.rect().size());
    ui->deletar->setStyleSheet(styleSheet().append(QString("border-image:url(icon/1.png);")));
    ui->sair->setIcon(ButtonIcon3);
    ui->sair->setIconSize(pixmap1.rect().size());
    ui->sair->setStyleSheet(styleSheet().append(QString("border-image:url(icon/1.png);")));
    ui->pasta->setIcon(ButtonIcon4);
    ui->pasta->setIconSize(pixmap1.rect().size());
    ui->pasta->setStyleSheet(styleSheet().append(QString("border-image:url(icon/1.png);")));
    AnimeDao a;
    if(a.getStatus() == true){
        ui->statusBar->showMessage("Quantidade de Animes Cadastrados: "+QString::number(a.getLista().length()));
    }
    preencheTabela(a.getLista());
    QPixmap pixmap9("icon/icon.png");
    this->setWindowIcon(pixmap9);

}
Exemplo n.º 5
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QPixmap pixmap("://imagenes/adim.ico");
    QIcon ButtonIcon(pixmap);
    ui->pushButton->setIcon(ButtonIcon);
    ui->pushButton->setIconSize(pixmap.rect().size());

    QPixmap pixmap2("://imagenes/users.ico");
    QIcon ButtonIcon2(pixmap2);
    ui->pushButton_2->setIcon(ButtonIcon2);
    ui->pushButton_2->setIconSize(pixmap2.rect().size());

    QPixmap pixmap3("://imagenes/logout.ico");
    QIcon ButtonIcon3(pixmap3);
    ui->pushButton_3->setIcon(ButtonIcon3);
    ui->pushButton_3->setIconSize(pixmap3.rect().size());

    //this->miGrafo;

}
ImageWindows::ImageWindows(QImage image, QString name, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ImageWindows)
{
    ui->setupUi(this);

    imageLbl=new qlabel_image();

    //Signal émit par la class qlabel_image pour la lecture en dynamique de la position des pixels
    connect(imageLbl, SIGNAL(Mouse_Pos()), this, SLOT(Mouse_current_pos()));
    connect(imageLbl, SIGNAL(Mouse_Pressed()), this, SLOT(Mouse_pressed()));
    connect(imageLbl, SIGNAL(Mouse_ClickLeft()), this, SLOT(MouseClickLeft()));
    connect(imageLbl, SIGNAL(Mouse_ReleasePos()), this, SLOT(Mouse_release_pos()));
    imageLbl->setMouseTracking(true);

   // setFixedHeight(image.height());
   // setFixedWidth(image.width());
    image_ihm = image;
    m_coeffZoom=1;
    affichageImage(image_ihm,m_coeffZoom,ui->scrollArea_Image);
     /*QLabel *imageLabel = new QLabel;
     imageLabel->setBackgroundRole(QPalette::Base);
     imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     imageLabel->setScaledContents(true);
     imageLabel -> setPixmap(QPixmap::fromImage(image));
     ui->scrollArea_Image->setBackgroundRole(QPalette::Dark);
     ui->scrollArea_Image->setWidget(imageLabel);

*/
    //ui ->label_Image -> setPixmap(QPixmap::fromImage(*image));
    QString txt =  QString::number(image.width())  + " x " + QString::number(image.height());
    ui->lbl_imageSize->setText(txt);

    if(image_ihm.isGrayscale())
        ui->lbl_imageDepth->setText("niveau de gris");
    else
        ui->lbl_imageDepth->setText("couleur");




    /*int index = pathImage.lastIndexOf("/");
    std::cout << "index : " << index;
    m_StrImageName = pathImage.left(index);*/
    m_StrImageName = name;
    setWindowTitle(m_StrImageName);


    QPixmap pixmap("actions/document-save-3.ico");
    QIcon ButtonIcon(pixmap);
    ui->pushB_Save->setIcon(ButtonIcon);
    QSize size = pixmap.rect().size();
    size.setHeight(size.height() -10);
    size.setWidth(size.width() -10);
    ui->pushB_Save->setIconSize(size);


    QPixmap pixmap2("actions/zoom-in-3.ico");
    QIcon ButtonIcon2(pixmap2);
    ui->pushB_ZoomIn->setIcon(ButtonIcon2);
    QSize size1 = pixmap2.rect().size();
    size1.setHeight(size1.height() -10);
    size1.setWidth(size1.width() -10);
    ui->pushB_ZoomIn->setIconSize(size1);


    QPixmap pixmap3("actions/zoom-out-3.ico");
    QIcon ButtonIcon3(pixmap3);
    ui->pushB_ZoomOut->setIcon(ButtonIcon3);
    QSize size2 = pixmap3.rect().size();
    size2.setHeight(size2.height() -10);
    size2.setWidth(size2.width() -10);
    ui->pushB_ZoomOut->setIconSize(size2);



}
Exemplo n.º 7
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //////////////////////////////////////////////////////////
    // Setting up connections
    sglMapper = new QSignalMapper(this);

    // Connect widget to mapper
    connect(ui->opcionBoton_1, SIGNAL(clicked()), sglMapper, SLOT(map()));
    connect(ui->opcionBoton_2, SIGNAL(clicked()), sglMapper, SLOT(map()));
    connect(ui->opcionBoton_3, SIGNAL(clicked()), sglMapper, SLOT(map()));
    connect(ui->opcionBoton_4, SIGNAL(clicked()), sglMapper, SLOT(map()));

    // Connect mapper to slot
    connect(sglMapper, SIGNAL(mapped(int)), this, SLOT(setPantalla(int)));

    // Conexiones simples signal/slot
    connect(ui->cancelBoton, SIGNAL(clicked(bool)), this, SLOT(close()));
    connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setBorrar()));
    connect(ui->borrarBoton, SIGNAL(clicked(bool)), ui->lineEdit, SLOT(clear()));
    connect(ui->okBoton, SIGNAL(clicked(bool)), this, SLOT(enviarInformacion()));

    //////////////////////////////////////////////////////////
    // Setting up UI
    resetPantalla();
    setPantalla(static_cast<int>(Estado::BIENVENIDA));

    // Create and set validator
    QIntValidator *validator = new QIntValidator(1, 1000000);   // Taking numbers from 1 to 100
    ui->lineEdit->setValidator(validator);
    ui->lineEdit->setAlignment(Qt::AlignRight);

    // Charge image icon
    QPixmap Icono1("../grafica/Moneda_1.png");
    QIcon ButtonIcon1(Icono1);
    ui->opcionBoton_1->setIcon(ButtonIcon1);
    ui->opcionBoton_1->setIconSize(QSize(20, 20));

    QPixmap Icono2("../grafica/Moneda_2.png");
    QIcon ButtonIcon2(Icono2);
    ui->opcionBoton_2->setIcon(ButtonIcon2);
    ui->opcionBoton_2->setIconSize(QSize(20, 20));

    QPixmap Icono3("../grafica/Moneda_3.png");
    QIcon ButtonIcon3(Icono3);
    ui->opcionBoton_3->setIcon(ButtonIcon3);
    ui->opcionBoton_3->setIconSize(QSize(20, 20));

    QPixmap Icono4("../grafica/Moneda_4.png");
    QIcon ButtonIcon4(Icono4);
    ui->opcionBoton_4->setIcon(ButtonIcon4);
    ui->opcionBoton_4->setIconSize(QSize(20, 20));

    QPixmap cancelar("../grafica/Cancel.png");
    QIcon ButtonIconCancel(cancelar);
    ui->cancelBoton->setIcon(ButtonIconCancel);
    ui->cancelBoton->setIconSize(QSize(20, 20));

    QPixmap borrar("../grafica/Borrar.png");
    QIcon ButtonIconBorrar(borrar);
    ui->borrarBoton->setIcon(ButtonIconBorrar);
    ui->borrarBoton->setIconSize(QSize(20, 20));
}