亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mainwindow.cpp

?? 這個是QT3C++編程書(齊亮翻譯)里5,6章的代碼
?? CPP
字號:
#include <qaction.h>#include <qapplication.h>#include <qlabel.h>#include <qmenubar.h>#include <qmessagebox.h>#include <qstatusbar.h>#include <qworkspace.h>#include "editor.h"#include "mainwindow.h"MainWindow::MainWindow(QWidget *parent, const char *name)    : QMainWindow(parent, name){    workspace = new QWorkspace(this);    setCentralWidget(workspace);    connect(workspace, SIGNAL(windowActivated(QWidget *)),            this, SLOT(updateMenus()));    connect(workspace, SIGNAL(windowActivated(QWidget *)),            this, SLOT(updateModIndicator()));    createActions();    createMenus();    createToolBars();    createStatusBar();    setCaption(tr("Editor"));    setIcon(QPixmap::fromMimeSource("icon.png"));}void MainWindow::createActions(){    newAct = new QAction(tr("&New"), tr("Ctrl+N"), this);    newAct->setIconSet(QPixmap::fromMimeSource("new.png"));    newAct->setStatusTip(tr("Create a new file"));    connect(newAct, SIGNAL(activated()), this, SLOT(newFile()));    openAct = new QAction(tr("&Open..."), tr("Ctrl+O"), this);    openAct->setIconSet(QPixmap::fromMimeSource("open.png"));    openAct->setStatusTip(tr("Open an existing file"));    connect(openAct, SIGNAL(activated()), this, SLOT(open()));    saveAct = new QAction(tr("&Save"), tr("Ctrl+S"), this);    saveAct->setIconSet(QPixmap::fromMimeSource("save.png"));    saveAct->setStatusTip(tr("Save the file to disk"));    connect(saveAct, SIGNAL(activated()), this, SLOT(save()));    saveAsAct = new QAction(tr("Save &As..."), 0, this);    saveAsAct->setStatusTip(tr("Save the file under a new name"));    connect(saveAsAct, SIGNAL(activated()), this, SLOT(saveAs()));    exitAct = new QAction(tr("E&xit"), tr("Ctrl+Q"), this);    exitAct->setStatusTip(tr("Exit the application"));    connect(exitAct, SIGNAL(activated()), this, SLOT(close()));    cutAct = new QAction(tr("Cu&t"), tr("Ctrl+X"), this);    cutAct->setIconSet(QPixmap::fromMimeSource("cut.png"));    cutAct->setStatusTip(tr("Cut the current selection to the "                            "clipboard"));    connect(cutAct, SIGNAL(activated()), this, SLOT(cut()));    copyAct = new QAction(tr("&Copy"), tr("Ctrl+C"), this);    copyAct->setIconSet(QPixmap::fromMimeSource("copy.png"));    copyAct->setStatusTip(tr("Copy the current selection to the "                             "clipboard"));    connect(copyAct, SIGNAL(activated()), this, SLOT(copy()));    pasteAct = new QAction(tr("&Paste"), tr("Ctrl+V"), this);    pasteAct->setIconSet(QPixmap::fromMimeSource("paste.png"));    pasteAct->setStatusTip(tr("Paste the clipboard's contents at "                              "the cursor position"));    connect(pasteAct, SIGNAL(activated()), this, SLOT(paste()));    deleteAct = new QAction(tr("&Delete"), tr("Del"), this);    deleteAct->setIconSet(QPixmap::fromMimeSource("delete.png"));    deleteAct->setStatusTip(tr("Delete the current selection"));    connect(deleteAct, SIGNAL(activated()), this, SLOT(del()));    closeAct = new QAction(tr("Cl&ose"), tr("Ctrl+F4"), this);    closeAct->setStatusTip(tr("Close the active window"));    connect(closeAct, SIGNAL(activated()),            workspace, SLOT(closeActiveWindow()));    closeAllAct = new QAction(tr("Close &All"), 0, this);    closeAllAct->setStatusTip(tr("Close all the windows"));    connect(closeAllAct, SIGNAL(activated()),            workspace, SLOT(closeAllWindows()));    tileAct = new QAction(tr("&Tile"), 0, this);    tileAct->setStatusTip(tr("Tile the windows"));    connect(tileAct, SIGNAL(activated()), workspace, SLOT(tile()));    cascadeAct = new QAction(tr("&Cascade"), 0, this);    cascadeAct->setStatusTip(tr("Cascade the windows"));    connect(cascadeAct, SIGNAL(activated()),            workspace, SLOT(cascade()));    nextAct = new QAction(tr("Ne&xt"), tr("Ctrl+F6"), this);    nextAct->setStatusTip(tr("Move the focus to the next window"));    connect(nextAct, SIGNAL(activated()),            workspace, SLOT(activateNextWindow()));    previousAct = new QAction(tr("Pre&vious"),                              tr("Ctrl+Shift+F6"), this);    previousAct->setStatusTip(tr("Move the focus to the previous "                                 "window"));    connect(previousAct, SIGNAL(activated()),            workspace, SLOT(activatePreviousWindow()));    aboutAct = new QAction(tr("&About"), 0, this);    aboutAct->setStatusTip(tr("Show the application's About box"));    connect(aboutAct, SIGNAL(activated()), this, SLOT(about()));    aboutQtAct = new QAction(tr("About &Qt"), 0, this);    aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));    connect(aboutQtAct, SIGNAL(activated()), qApp, SLOT(aboutQt()));}void MainWindow::createMenus(){    fileMenu = new QPopupMenu(this);    newAct->addTo(fileMenu);    openAct->addTo(fileMenu);    saveAct->addTo(fileMenu);    saveAsAct->addTo(fileMenu);    fileMenu->insertSeparator();    exitAct->addTo(fileMenu);    editMenu = new QPopupMenu(this);    cutAct->addTo(editMenu);    copyAct->addTo(editMenu);    pasteAct->addTo(editMenu);    deleteAct->addTo(editMenu);    windowsMenu = new QPopupMenu(this);    createWindowsMenu();    helpMenu = new QPopupMenu(this);    aboutAct->addTo(helpMenu);    aboutQtAct->addTo(helpMenu);    menuBar()->insertItem(tr("&File"), fileMenu);    menuBar()->insertItem(tr("&Edit"), editMenu);    menuBar()->insertItem(tr("&Windows"), windowsMenu);    menuBar()->insertSeparator();    menuBar()->insertItem(tr("&Help"), helpMenu);}void MainWindow::createToolBars(){    fileToolBar = new QToolBar(tr("File"), this);    newAct->addTo(fileToolBar);    openAct->addTo(fileToolBar);    saveAct->addTo(fileToolBar);    editToolBar = new QToolBar(tr("Edit"), this);    cutAct->addTo(editToolBar);    copyAct->addTo(editToolBar);    pasteAct->addTo(editToolBar);}void MainWindow::createStatusBar(){    readyLabel = new QLabel(tr(" Ready"), this);    modLabel = new QLabel(tr(" MOD "), this);    modLabel->setAlignment(AlignHCenter);    modLabel->setMinimumSize(modLabel->sizeHint());    modLabel->clear();    statusBar()->addWidget(readyLabel, 1);    statusBar()->addWidget(modLabel);}void MainWindow::newFile(){    Editor *editor = createEditor();    editor->newFile();    editor->show();}Editor *MainWindow::createEditor(){    Editor *editor = new Editor(workspace);    connect(editor, SIGNAL(copyAvailable(bool)),            this, SLOT(copyAvailable(bool)));    connect(editor, SIGNAL(modificationChanged(bool)),            this, SLOT(updateModIndicator()));    return editor;}void MainWindow::open(){    Editor *editor = createEditor();    if (editor->open())        editor->show();    else        editor->close();}void MainWindow::openFile(const QString &fileName){    Editor *editor = createEditor();    if (editor->openFile(fileName))        editor->show();    else        editor->close();}void MainWindow::save(){    if (activeEditor()) {        activeEditor()->save();        updateModIndicator();    }}Editor *MainWindow::activeEditor(){    return (Editor *)workspace->activeWindow();}void MainWindow::saveAs(){    if (activeEditor()) {        activeEditor()->saveAs();        updateModIndicator();    }}void MainWindow::cut(){    if (activeEditor())        activeEditor()->cut();}void MainWindow::copy(){    if (activeEditor())        activeEditor()->copy();}void MainWindow::paste(){    if (activeEditor())        activeEditor()->paste();}void MainWindow::del(){    if (activeEditor())        activeEditor()->del();}void MainWindow::about(){    QMessageBox::about(this, tr("About Editor"),            tr("<h2>Editor 1.0</h2>"               "<p>Copyright &copy; 2004 Software Inc."               "<p>Editor is a small application that demonstrates "               "<b>QWorkspace</b>."));}void MainWindow::updateMenus(){    bool hasEditor = (activeEditor() != 0);    saveAct->setEnabled(hasEditor);    saveAsAct->setEnabled(hasEditor);    pasteAct->setEnabled(hasEditor);    deleteAct->setEnabled(hasEditor);    copyAvailable(activeEditor()                  && activeEditor()->hasSelectedText());    closeAct->setEnabled(hasEditor);    closeAllAct->setEnabled(hasEditor);    tileAct->setEnabled(hasEditor);    cascadeAct->setEnabled(hasEditor);    nextAct->setEnabled(hasEditor);    previousAct->setEnabled(hasEditor);    windowsMenu->clear();    createWindowsMenu();}void MainWindow::createWindowsMenu(){    closeAct->addTo(windowsMenu);    closeAllAct->addTo(windowsMenu);    windowsMenu->insertSeparator();    tileAct->addTo(windowsMenu);    cascadeAct->addTo(windowsMenu);    windowsMenu->insertSeparator();    nextAct->addTo(windowsMenu);    previousAct->addTo(windowsMenu);    if (activeEditor()) {        windowsMenu->insertSeparator();        windows = workspace->windowList();        int numVisibleEditors = 0;        for (int i = 0; i < (int)windows.count(); ++i) {            QWidget *win = windows.at(i);            if (!win->isHidden()) {                QString text = tr("%1 %2")                               .arg(numVisibleEditors + 1)                               .arg(win->caption());                if (numVisibleEditors < 9)                    text.prepend("&");                int id = windowsMenu->insertItem(                              text, this, SLOT(activateWindow(int)));                bool isActive = (activeEditor() == win);                windowsMenu->setItemChecked(id, isActive);                windowsMenu->setItemParameter(id, i);                ++numVisibleEditors;            }        }    }}void MainWindow::activateWindow(int param){    QWidget *win = windows.at(param);    win->show();    win->setFocus();}void MainWindow::copyAvailable(bool available){    cutAct->setEnabled(available);    copyAct->setEnabled(available);}void MainWindow::updateModIndicator(){    if (activeEditor() && activeEditor()->isModified())        modLabel->setText(tr("MOD"));    else        modLabel->clear();}void MainWindow::closeEvent(QCloseEvent *event){    workspace->closeAllWindows();    if (activeEditor())        event->ignore();    else        event->accept();}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品欧美经典| 日韩经典一区二区| 婷婷成人综合网| 国产盗摄视频一区二区三区| 欧美伦理影视网| 中文字幕在线观看不卡视频| 美女国产一区二区三区| 91无套直看片红桃| 26uuu精品一区二区| 亚洲成人午夜影院| 91丨九色丨黑人外教| 欧美va天堂va视频va在线| 亚洲综合另类小说| 91在线高清观看| 国产欧美精品区一区二区三区| 日日夜夜免费精品| 色噜噜偷拍精品综合在线| 国产女主播一区| 国产精品综合在线视频| 日韩欧美专区在线| 日韩精品亚洲专区| 欧美日韩亚洲丝袜制服| 亚洲精品高清在线| 99精品欧美一区| 一区在线播放视频| 北条麻妃国产九九精品视频| 国产欧美一区二区精品性| 国产在线不卡一区| 日韩欧美一区在线| 秋霞午夜av一区二区三区| 欧美视频一区二区三区四区| 亚洲一区二区三区小说| 在线观看成人小视频| 一区二区三区美女| 欧美无人高清视频在线观看| 五月天婷婷综合| 91精品国产乱码久久蜜臀| 免费在线观看视频一区| 欧美一级精品在线| 国内精品国产成人国产三级粉色| 精品免费国产二区三区| 九九视频精品免费| 国产性天天综合网| jlzzjlzz欧美大全| 亚洲一区二区视频在线| 在线播放视频一区| 国产一区999| 国产精品午夜在线观看| 一本大道综合伊人精品热热| 亚洲国产美国国产综合一区二区| 制服.丝袜.亚洲.另类.中文| 国产乱码一区二区三区| 国产亚洲欧美日韩俺去了| voyeur盗摄精品| 亚洲五月六月丁香激情| 日韩精品一区二| 成人精品免费视频| 亚洲狠狠爱一区二区三区| 日韩欧美视频一区| 成人精品国产一区二区4080| 亚洲综合区在线| 日韩你懂的在线播放| av不卡在线观看| 亚洲成av人片在www色猫咪| 日韩久久久精品| 99国产麻豆精品| 美女mm1313爽爽久久久蜜臀| 综合久久久久综合| 91麻豆精品国产自产在线观看一区| 国产麻豆午夜三级精品| 亚洲一二三级电影| 2021中文字幕一区亚洲| 欧美亚洲图片小说| 国产91丝袜在线18| 日韩成人一级片| 国产精品女同一区二区三区| 欧美日韩免费电影| 成人精品鲁一区一区二区| 日韩福利电影在线观看| 中文字幕一区二区三区蜜月| 日韩精品一区二区三区中文精品| 色婷婷av一区二区三区软件 | 欧美一级在线观看| 成人国产精品免费观看视频| 免费xxxx性欧美18vr| 亚洲女同ⅹxx女同tv| 久久免费精品国产久精品久久久久| 欧美日韩综合在线免费观看| 成人午夜免费电影| 蓝色福利精品导航| 亚洲第一福利一区| 亚洲欧美日韩国产中文在线| 日本一区二区视频在线观看| 欧美成人一区二区三区在线观看| 欧美日韩免费观看一区二区三区 | 奇米综合一区二区三区精品视频| 国产精品久久久久久妇女6080 | 欧美人与z0zoxxxx视频| gogo大胆日本视频一区| 国产乱码精品一品二品| 水蜜桃久久夜色精品一区的特点| 亚洲狼人国产精品| 国产精品拍天天在线| 国产拍揄自揄精品视频麻豆| 久久久精品欧美丰满| 精品sm在线观看| 欧美一区午夜精品| 欧美乱妇15p| 欧美午夜精品久久久久久孕妇| 色综合久久久久综合99| 91免费看片在线观看| 91在线高清观看| 91视频一区二区三区| 不卡的电视剧免费网站有什么| 懂色av噜噜一区二区三区av| 高清不卡一二三区| 成人丝袜视频网| 成人激情黄色小说| av中文字幕亚洲| 97精品国产露脸对白| 99国产欧美久久久精品| 9人人澡人人爽人人精品| 99视频精品全部免费在线| 成人精品在线视频观看| 91在线小视频| 日本电影欧美片| 欧美视频在线不卡| 日韩一区二区三免费高清| 欧美大尺度电影在线| 欧美精品一区男女天堂| 久久久久国产精品厨房| 久久久精品人体av艺术| 亚洲欧美一区二区三区国产精品| 一二三四区精品视频| 日韩成人午夜电影| 国产黑丝在线一区二区三区| 色偷偷一区二区三区| 欧美精品自拍偷拍| 久久久无码精品亚洲日韩按摩| 国产精品护士白丝一区av| 樱桃国产成人精品视频| 肉色丝袜一区二区| 国产一区二区三区av电影| 粉嫩aⅴ一区二区三区四区 | 91网站最新地址| 欧美网站大全在线观看| 精品国产成人在线影院| 欧美国产精品劲爆| 亚洲成人手机在线| 国产久卡久卡久卡久卡视频精品| av动漫一区二区| 欧美美女一区二区| 欧美激情在线免费观看| 亚洲制服丝袜在线| 激情综合色综合久久综合| 99久久精品国产麻豆演员表| 欧美精品三级日韩久久| 国产亚洲综合色| 亚洲一区二区三区国产| 国产精品一区一区| 欧美精品一级二级| 综合久久久久久| 韩国欧美国产一区| 欧美唯美清纯偷拍| 亚洲国产成人自拍| 麻豆精品在线观看| 91浏览器入口在线观看| 91精品国产高清一区二区三区蜜臀 | 久久超碰97中文字幕| 日本道在线观看一区二区| 久久亚洲精华国产精华液 | 国产一区二区在线视频| 91久久人澡人人添人人爽欧美| 久久这里只有精品6| 丝袜脚交一区二区| 色老综合老女人久久久| 国产精品入口麻豆原神| 裸体在线国模精品偷拍| 欧美亚洲综合色| 1000部国产精品成人观看| 国产一区二区三区在线观看精品| 88在线观看91蜜桃国自产| 亚洲情趣在线观看| 99久久亚洲一区二区三区青草| 久久免费视频色| 奇米精品一区二区三区在线观看| 欧美日韩免费视频| 一片黄亚洲嫩模| 91在线国内视频| 欧美国产一区视频在线观看| 国产精品综合在线视频| 欧美精品一区二区精品网| 日本欧美大码aⅴ在线播放| 色综合天天视频在线观看| 中文字幕在线一区二区三区| 粉嫩一区二区三区在线看| 久久夜色精品一区| 国产在线看一区| 久久久久久久久伊人| 国产一区二区影院|