Qt命名規(guī)范以及快捷鍵

untitled.pro

//Qt 包含的模塊
QT       += core gui

//大于4版本以上包含 widget 模塊
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

//目標(biāo)  模板生成的.exe程序的名稱
TARGET = untitled_second
//模板  應(yīng)用程序模板 Application
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


SOURCES += \
        main.cpp \ //源文件
        mainwindow.cpp

HEADERS += \
        mainwindow.h //頭文件

FORMS += \
        mainwindow.ui

mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

//包含頭文件 QMainWindow 窗口類
#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT //Q_OBJECT宏,允許類中使用信號(hào)和槽的機(jī)制

public:
    explicit MainWindow(QWidget *parent = 0); //構(gòu)造函數(shù)
    ~MainWindow(); //析構(gòu)函數(shù)

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
// 命名規(guī)范
// 類名 首字母大寫,單詞和單詞之間首字母大寫
// 函數(shù)名 變量名稱 首字母小寫, 單詞和單詞之間首字母大寫

// 快捷鍵
// 注釋 Ctrl + /
// 運(yùn)行 Ctrl + r
// 編譯 Ctrl + b
// 字體縮放 Ctrl +鼠標(biāo)滾輪
// 查找 Ctrl + l 
// 整行移動(dòng) Ctrl + shift + 1或者的 l
// 幫助文檔 F1
// 自動(dòng)對(duì)齊 Ctrl + i
// 同名之間的 .h 和 cpp 切換 F4

//幫助文檔 第一種方式 F1 第二種 左鍵按鈕 第三種 C:\Qt\Qt5.9.0\5.9\mingw53_32\bin\assistant.exe
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容