Giter Site home page Giter Site logo

qtskinui's Introduction

一个Qt + VS2013编写的GUI框架。用一张图片做背景,可轻松实现换皮肤功能

亮点:

###1. res目录下有N多种控件的图片, 应用output目录下的globalqss.config 即可将默认的控件都变成很漂亮

    QApplication a(argc, argv);
    a.setStyleSheet(load_txt_file(app_path() + QStringLiteral("globalqss.config")));

###2. UI界面都从Base_Widget继承,例如:

//这是主界面, 从QWidget继承
class Main_Form : public Base_Widget<QWidget> {
    ...
};

//这是对话框, 从QDialog继承
class About_Form : public Base_Widget<QDialog> {
    ...
};

###3. 所有UI的设计都用Qt Designer完成,然后再加载进对话框。示例代码:

namespace Ui {
    class UI_About;  //这个类Qt Designer设计好.ui文件后自动生成
};

class About_Form : public Base_Widget<QDialog> {
public:
    About_Form::About_Form(QWidget *parent /*= 0*/, Skin *skin /*= NULL*/)
        :BaseClass(parent, skin)
    {
        ui_ = new Ui::UI_About();
        this->setup_UI(ui_);    //这一行代码将Qt Designer设计好的界面加载,然后对话框就变得挺漂亮了
    }

private:
    Ui::UI_About *ui_;
};

###4. 效果示例: 请打开output目录下的 qtskinui.exe, 然后换几个图片。

怎么样?效果满意吧?来看看效果图:

qtskinui's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.