⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 QWT5.01用于Qt开发的二维图形库程序
💻 CPP
字号:
#include <qapplication.h>
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include "plot.h"

class MainWindow: public QMainWindow
{
public:
    MainWindow(QWidget *parent = NULL):
        QMainWindow(parent)
    {   
        Plot *plot = new Plot(this);
        setCentralWidget(plot);

        QToolBar *toolBar = new QToolBar(this);

        QToolButton *btnLoad = new QToolButton(toolBar);
        
#if QT_VERSION >= 0x040000
        btnLoad->setText("Load SVG");
        btnLoad->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
        toolBar->addWidget(btnLoad);
#else
        btnLoad->setTextLabel("Load SVG");
        btnLoad->setUsesTextLabel(true);
#endif

        addToolBar(toolBar);

        connect(btnLoad, SIGNAL(clicked()), plot, SLOT(loadSVG())); 
    }
};

int main(int argc, char **argv)
{
    QApplication a(argc, argv);

    MainWindow w;
#if QT_VERSION < 0x040000
    a.setMainWidget(&w);
#endif
    w.resize(600,400);
    w.show();

    int rv = a.exec();
    return rv;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -