C++ (Qt)#include <QtGui/QApplication>#include "logonwin.h"int main(int argc, char *argv[]){ QApplication a(argc, argv); LogonWin w; w.show(); return a.exec();}
C++ (Qt)#include "logonwin.h"#include "ui_logonwin.h"//#include <QGraphicsView>//#include <QImage>//#include <QGraphicsScene> LogonWin::LogonWin(QWidget *parent) : QMainWindow(parent), ui(new Ui::LogonWin){ ui->setupUi(this);} LogonWin::~LogonWin(){ QGraphicsPixmapItem *item = addPixmap(); graphicsView = addPixmap("redo.png"); delete ui;}
C++ (Qt)#ifndef LOGONWIN_H#define LOGONWIN_H #include <QtGui/QMainWindow> namespace Ui{ class LogonWin;} class LogonWin : public QMainWindow{ Q_OBJECT public: LogonWin(QWidget *parent = 0); ~LogonWin(); private: Ui::LogonWin *ui;}; #endif // LOGONWIN_H
C++ (Qt)# -------------------------------------------------# Project created by QtCreator 2009-08-19T20:20:40# -------------------------------------------------TARGET = pointerrrTEMPLATE = appSOURCES += main.cpp \ logonwin.cppHEADERS += logonwin.hFORMS += logonwin.uiOTHER_FILES += redo.png
C++ (Qt)/********************************************************************************** Form generated from reading ui file 'logonwin.ui'**** Created: Wed 19. Aug 21:21:50 2009** by: Qt User Interface Compiler version 4.5.1**** WARNING! All changes made in this file will be lost when recompiling ui file!********************************************************************************/ #ifndef UI_LOGONWIN_H#define UI_LOGONWIN_H #include <QtCore/QVariant>#include <QtGui/QAction>#include <QtGui/QApplication>#include <QtGui/QButtonGroup>#include <QtGui/QGraphicsView>#include <QtGui/QHeaderView>#include <QtGui/QLineEdit>#include <QtGui/QMainWindow>#include <QtGui/QWidget> QT_BEGIN_NAMESPACE class Ui_LogonWin{public: QWidget *centralWidget; QLineEdit *lineEdit; QGraphicsView *graphicsView; void setupUi(QMainWindow *LogonWin) { if (LogonWin->objectName().isEmpty()) LogonWin->setObjectName(QString::fromUtf8("LogonWin")); LogonWin->resize(600, 400); QPalette palette; QBrush brush(QColor(255, 255, 255, 255)); brush.setStyle(Qt::SolidPattern); palette.setBrush(QPalette::Active, QPalette::WindowText, brush); QBrush brush1(QColor(0, 0, 0, 255)); brush1.setStyle(Qt::SolidPattern); palette.setBrush(QPalette::Active, QPalette::Button, brush1); palette.setBrush(QPalette::Active, QPalette::Light, brush1); palette.setBrush(QPalette::Active, QPalette::Midlight, brush1); palette.setBrush(QPalette::Active, QPalette::Dark, brush1); palette.setBrush(QPalette::Active, QPalette::Mid, brush1); palette.setBrush(QPalette::Active, QPalette::Text, brush); palette.setBrush(QPalette::Active, QPalette::BrightText, brush); palette.setBrush(QPalette::Active, QPalette::ButtonText, brush); palette.setBrush(QPalette::Active, QPalette::Base, brush1); palette.setBrush(QPalette::Active, QPalette::Window, brush1); palette.setBrush(QPalette::Active, QPalette::Shadow, brush1); palette.setBrush(QPalette::Active, QPalette::AlternateBase, brush1); QBrush brush2(QColor(255, 255, 220, 255)); brush2.setStyle(Qt::SolidPattern); palette.setBrush(QPalette::Active, QPalette::ToolTipBase, brush2); palette.setBrush(QPalette::Active, QPalette::ToolTipText, brush1); palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush); palette.setBrush(QPalette::Inactive, QPalette::Button, brush1); palette.setBrush(QPalette::Inactive, QPalette::Light, brush1); palette.setBrush(QPalette::Inactive, QPalette::Midlight, brush1); palette.setBrush(QPalette::Inactive, QPalette::Dark, brush1); palette.setBrush(QPalette::Inactive, QPalette::Mid, brush1); palette.setBrush(QPalette::Inactive, QPalette::Text, brush); palette.setBrush(QPalette::Inactive, QPalette::BrightText, brush); palette.setBrush(QPalette::Inactive, QPalette::ButtonText, brush); palette.setBrush(QPalette::Inactive, QPalette::Base, brush1); palette.setBrush(QPalette::Inactive, QPalette::Window, brush1); palette.setBrush(QPalette::Inactive, QPalette::Shadow, brush1); palette.setBrush(QPalette::Inactive, QPalette::AlternateBase, brush1); palette.setBrush(QPalette::Inactive, QPalette::ToolTipBase, brush2); palette.setBrush(QPalette::Inactive, QPalette::ToolTipText, brush1); palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush1); palette.setBrush(QPalette::Disabled, QPalette::Button, brush1); palette.setBrush(QPalette::Disabled, QPalette::Light, brush1); palette.setBrush(QPalette::Disabled, QPalette::Midlight, brush1); palette.setBrush(QPalette::Disabled, QPalette::Dark, brush1); palette.setBrush(QPalette::Disabled, QPalette::Mid, brush1); palette.setBrush(QPalette::Disabled, QPalette::Text, brush1); palette.setBrush(QPalette::Disabled, QPalette::BrightText, brush); palette.setBrush(QPalette::Disabled, QPalette::ButtonText, brush1); palette.setBrush(QPalette::Disabled, QPalette::Base, brush1); palette.setBrush(QPalette::Disabled, QPalette::Window, brush1); palette.setBrush(QPalette::Disabled, QPalette::Shadow, brush1); palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush1); palette.setBrush(QPalette::Disabled, QPalette::ToolTipBase, brush2); palette.setBrush(QPalette::Disabled, QPalette::ToolTipText, brush1); LogonWin->setPalette(palette); centralWidget = new QWidget(LogonWin); centralWidget->setObjectName(QString::fromUtf8("centralWidget")); lineEdit = new QLineEdit(centralWidget); lineEdit->setObjectName(QString::fromUtf8("lineEdit")); lineEdit->setGeometry(QRect(140, 300, 301, 21)); QPalette palette1; QBrush brush3(QColor(0, 171, 0, 255)); brush3.setStyle(Qt::SolidPattern); palette1.setBrush(QPalette::Active, QPalette::Text, brush3); palette1.setBrush(QPalette::Inactive, QPalette::Text, brush3); palette1.setBrush(QPalette::Disabled, QPalette::Text, brush1); lineEdit->setPalette(palette1); QFont font; font.setFamily(QString::fromUtf8("Trendy")); font.setPointSize(10); lineEdit->setFont(font); lineEdit->setAlignment(Qt::AlignCenter); graphicsView = new QGraphicsView(centralWidget); graphicsView->setObjectName(QString::fromUtf8("graphicsView")); graphicsView->setGeometry(QRect(170, 30, 256, 192)); QBrush brush4(QColor(38, 38, 38, 255)); brush4.setStyle(Qt::DiagCrossPattern); graphicsView->setBackgroundBrush(brush4); graphicsView->setSceneRect(QRectF(0, 0, 10, 10)); LogonWin->setCentralWidget(centralWidget); retranslateUi(LogonWin); QMetaObject::connectSlotsByName(LogonWin); } // setupUi void retranslateUi(QMainWindow *LogonWin) { LogonWin->setWindowTitle(QApplication::translate("LogonWin", "LogonWin", 0, QApplication::UnicodeUTF8)); lineEdit->setText(QApplication::translate("LogonWin", "Enter you name", 0, QApplication::UnicodeUTF8));#ifndef QT_NO_WHATSTHIS graphicsView->setWhatsThis(QApplication::translate("LogonWin", "Logo", 0, QApplication::UnicodeUTF8));#endif // QT_NO_WHATSTHIS Q_UNUSED(LogonWin); } // retranslateUi }; namespace Ui { class LogonWin: public Ui_LogonWin {};} // namespace Ui QT_END_NAMESPACE #endif // UI_LOGONWIN_H
LogonWin::LogonWin(QWidget *parent) : QMainWindow(parent), ui(new Ui::LogonWin){ ui->setupUi(this);} LogonWin::~LogonWin(){ QGraphicsPixmapItem *item = addPixmap(); graphicsView = addPixmap("redo.png"); delete ui;}
LogonWin::LogonWin(QWidget *parent) : QMainWindow(parent), ui(new Ui::LogonWin){ ui->setupUi(this); QGraphicsScene * scene = new QGraphicsScene (); scene->addPixmap(QPixmap(":/resource.png")); ui->graphicsView->setScene(scene);} LogonWin::~LogonWin(){ delete ui;}