QtNovelUI/u_test/main.cpp

63 lines
1.6 KiB
C++

#include "unnnn.h"
#include <QApplication>
#include <QDebug>
#include <QDir>
#include <QDomDocument>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QMenuBar>
#include <QPushButton>
#include <QStyle>
#include <QToolBar>
#include <splitview.h>
using namespace SplitFrame;
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
// auto z = new QWidget();
// auto v = new XWidget();
// v->setParent(z);
// v->setGeometry(0, 50, 200, 100);
// z->show();
auto win = new QMainWindow();
win->setMinimumSize(800, 600);
win->menuBar()->addMenu("文件");
auto tbar = new QToolBar();
win->addToolBar(Qt::ToolBarArea::LeftToolBarArea, tbar);
tbar->addAction("添加");
auto aview = new BaseView("hello", new QWidget);
auto bview = new BaseView("world", new QWidget);
auto cview = new BaseView("everyone", new QWidget);
auto conv0 = new SplitView(aview, bview);
conv0->setSplitInfo(SplitType::SPLIT_V, 100, 8, true);
auto conv = new ViewPresent(conv0);
win->setCentralWidget(conv);
conv->append(cview, 0);
conv->registViewComp(aview);
conv->registViewComp(bview);
conv->registViewComp(cview);
win->show();
// auto w = new QWidget();
// QLabel w0, w1;
// w0.setPixmap(a.style()->standardIcon(QStyle::StandardPixmap::SP_ArrowUp).pixmap(QSize(20, 20)));
// w1.setText("hello");
// auto v = new QHBoxLayout(w);
// v->setMargin(0);
// v->setSpacing(1);
// v->addWidget(&w0, 0);
// v->addWidget(&w1, 1);
// w->show();
return a.exec();
}