C++ (Qt)#pragma once;#ifndef MAINWIDGET_H#define MAINWIDGET_H #include <QWidget> namespace TextDocumentEditor {namespace Ui {class MainWidget;} class MainWidget : public QWidget{ Q_OBJECT public: explicit MainWidget(QWidget *parent = 0); ~MainWidget(); private: Ui::MainWidget *_ui;};}#endif // MAINWIDGET_H
C++ (Qt)#include "MainWidget.h"#include "ui_MainWidget.h"using namespace TextDocumentEditor; MainWidget::MainWidget(QWidget *parent) : QWidget(parent), _ui(new Ui::MainWidget){ _ui->setupUi(this);} MainWidget::~MainWidget(){ delete _ui;}
C++ (Qt)namespace TextDocumentEditor {namespace Ui { class MainWidget : public QWidget{...}; } // UI} // TextDocumentEditor
C++ (Qt)namespace TextDocumentEditor {#include "ui_MainWidget.h" }
C++ (Qt)namespace Ui {class MainWidget;} namespace TextDocumentEditor {class MainWidget : public QWidget{ Q_OBJECT public: explicit MainWidget(QWidget *parent = 0); ~MainWidget(); private: Ui::MainWidget *_ui;};}
C++ (Qt)namespace TextDocumentEditor {namespace Ui {class MainWidget;} class MainWidget : public QWidget{ Q_OBJECT public: explicit MainWidget(QWidget *parent = 0); ~MainWidget();private: Ui::MainWidget *_ui;};}
#ifndef DEBUGGER_H#define DEBUGGER_H#include <QtGui/QWidget>#include "ui_debugger.h"#include <windows.h>#include <QMap>#include <QDebug>class Debugger : public QWidget{ Q_OBJECTpublic: Debugger(QWidget *parent = 0, Qt::WFlags flags = 0); ~Debugger();private: Ui::DebuggerClass ui; bool winEvent ( MSG * message, long * result ); QMap<long, QString> mapWinMessage;};#endif // DEBUGGER_H
#ifndef GLASS_H#define GLASS_H#include<QFrame>#include <QColor>namespace Ui{ class Glass;}class Glass : public QFrame{ Q_OBJECT Q_PROPERTY(unsigned int m_rows READ isReadRows WRITE setWriteRows) Q_PROPERTY(unsigned int m_columns READ isReadColumns WRITE setWriteColumns)public: explicit Glass(QWidget *parent = 0); unsigned int isReadRows(); void setWriteRows(unsigned int); unsigned int isReadColumns(); void setWriteColumns(unsigned int); bool isStarted; virtual ~Glass();protected: void paintEvent(QPaintEvent *event);private: bool GameOn; unsigned int m_rows; unsigned int m_columns; //QColor* glass; //Figure* CurrentFigure; //Figure* NextFigure; unsigned int Account; static const unsigned int FieldSize = 10; Ui::Glass *ui;signals: void initGlass();public slots: void doInit();};#endif // GLASS_H
#include "glass.h"//#include "ui_mainwindow.h"#include <QWidget>Glass::Glass(QWidget *parent): QFrame(parent), ui(new Ui::Glass){ GameOn = false; m_rows = 0; m_columns = 0; QColor* glass; //Figure* CurrentFigure; //Figure* NextFigure; Account = 0; isStarted = false; ui->setupUi(this);};Glass::~Glass(){ delete ui;};unsigned int Glass::isReadRows(){ return m_rows;};void Glass::setWriteRows(unsigned int rows){ m_rows = rows;};unsigned int Glass::isReadColumns(){ return m_columns;};void Glass::setWriteColumns(unsigned int columns){ m_columns = columns;};//void Glass::initGlass()//{//};void Glass::doInit(){ bool GlassElements[10][20] = {false};};void Glass::paintEvent(QPaintEvent *event){ QFrame::paintEvent(event); //QPainter painter(this);}
#include "glass.h"#include "ui_glass.h"#include <QWidget>