public class TutorialPartIII extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_tutorial_part_iii);
//*
this.requestWindowFeature(Window.FEATURE_NO_TITLE); // (NEW)
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); // (NEW)
//*/
///
//*
GLSurfaceView view = new GLSurfaceView(this);
view.setRenderer(new OpenGLRenderer());
setContentView(view);
//*/
}
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created: Sat Nov 17 16:13:03 2012
** by: Qt User Interface Compiler version 4.8.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QGridLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QPushButton>
#include <QtGui/QSplitter>
#include <QtGui/QStatusBar>
#include <QtGui/QTextEdit>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QAction *action_N;
QAction *action;
QWidget *centralWidget;
QGridLayout *gridLayout;
QSplitter *splitter;
QPushButton *pushButton_3;
QPushButton *pushButton;
QPushButton *pushButton_2;
QTextEdit *textEdit;
QMenuBar *menuBar;
QMenu *menu_F;
QMenu *menu;
QToolBar *mainToolBar;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(400, 300);
action_N = new QAction(MainWindow);
action_N->setObjectName(QString::fromUtf8("action_N"));
QIcon icon;
icon.addFile(QString::fromUtf8(":/File/images/UpArrow.ico"), QSize(), QIcon::Normal, QIcon::Off);
action_N->setIcon(icon);
action = new QAction(MainWindow);
action->setObjectName(QString::fromUtf8("action"));
QIcon icon1;
icon1.addFile(QString::fromUtf8(":/File/images/Cross.ico"), QSize(), QIcon::Normal, QIcon::Off);
action->setIcon(icon1);
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
gridLayout = new QGridLayout(centralWidget);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
splitter = new QSplitter(centralWidget);
splitter->setObjectName(QString::fromUtf8("splitter"));
splitter->setOrientation(Qt::Vertical);
pushButton_3 = new QPushButton(splitter);
pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));
splitter->addWidget(pushButton_3);
pushButton = new QPushButton(splitter);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
splitter->addWidget(pushButton);
pushButton_2 = new QPushButton(splitter);
pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
splitter->addWidget(pushButton_2);
gridLayout->addWidget(splitter, 0, 0, 1, 1);
textEdit = new QTextEdit(centralWidget);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
gridLayout->addWidget(textEdit, 0, 1, 1, 1);
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 400, 23));
menu_F = new QMenu(menuBar);
menu_F->setObjectName(QString::fromUtf8("menu_F"));
menu = new QMenu(menuBar);
menu->setObjectName(QString::fromUtf8("menu"));
MainWindow->setMenuBar(menuBar);
mainToolBar = new QToolBar(MainWindow);
mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QString::fromUtf8("statusBar"));
MainWindow->setStatusBar(statusBar);
menuBar->addAction(menu_F->menuAction());
menuBar->addAction(menu->menuAction());
menu_F->addAction(action_N);
menu->addAction(action);
mainToolBar->addAction(action_N);
mainToolBar->addSeparator();
mainToolBar->addAction(action);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
action_N->setText(QApplication::translate("MainWindow", "\346\226\260\345\273\272(&N)", 0, QApplication::UnicodeUTF8));
action_N->setShortcut(QApplication::translate("MainWindow", "Ctrl+N", 0, QApplication::UnicodeUTF8));
action->setText(QApplication::translate("MainWindow", "\345\244\215\345\210\266(&C)", 0, QApplication::UnicodeUTF8));
action->setShortcut(QApplication::translate("MainWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8));
pushButton_3->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8));
pushButton_2->setText(QApplication::translate("MainWindow", "PushButton", 0, QApplication::UnicodeUTF8));
menu_F->setTitle(QApplication::translate("MainWindow", "\346\226\207\344\273\266(&F)", 0, QApplication::UnicodeUTF8));
menu->setTitle(QApplication::translate("MainWindow", "\347\274\226\350\276\221", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class MainWindowInUi: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindowInUi;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindowInUi *ui;
};
#endif // MAINWINDOW_H
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindowInUi)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
标签:layout,setupUi,pushButton,QApplication,ui,QString,action,include,MainWindow
From: https://blog.51cto.com/gjwrxz/6508473