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

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

?? mainwindow.cpp

?? C++ GUI Programming with Qt 4一書中的chap03源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#include <QtGui>

#include "finddialog.h"
#include "gotocelldialog.h"
#include "mainwindow.h"
#include "sortdialog.h"
#include "spreadsheet.h"

MainWindow::MainWindow()
{
    spreadsheet = new Spreadsheet;
    setCentralWidget(spreadsheet);

    createActions();
    createMenus();
    createContextMenu();
    createToolBars();
    createStatusBar();

    readSettings();

    findDialog = 0;

    setWindowIcon(QIcon(":/images/icon.png"));
    setCurrentFile("");
}

void MainWindow::closeEvent(QCloseEvent *event)
{
    if (okToContinue()) {
        writeSettings();
        event->accept();
    } else {
        event->ignore();
    }
}

void MainWindow::newFile()
{
    if (okToContinue()) {
        spreadsheet->clear();
        setCurrentFile("");
    }
}

void MainWindow::open()
{
    if (okToContinue()) {
        QString fileName = QFileDialog::getOpenFileName(this,
                                   tr("Open Spreadsheet"), ".",
                                   tr("Spreadsheet files (*.sp)"));
        if (!fileName.isEmpty())
            loadFile(fileName);
    }
}

bool MainWindow::save()
{
    if (curFile.isEmpty()) {
        return saveAs();
    } else {
        return saveFile(curFile);
    }
}

bool MainWindow::saveAs()
{
    QString fileName = QFileDialog::getSaveFileName(this,
                               tr("Save Spreadsheet"), ".",
                               tr("Spreadsheet files (*.sp)"));
    if (fileName.isEmpty())
        return false;

    return saveFile(fileName);
}

void MainWindow::find()
{
    if (!findDialog) {
        findDialog = new FindDialog(this);
        connect(findDialog, SIGNAL(findNext(const QString &,
                                            Qt::CaseSensitivity)),
                spreadsheet, SLOT(findNext(const QString &,
                                           Qt::CaseSensitivity)));
        connect(findDialog, SIGNAL(findPrevious(const QString &,
                                                Qt::CaseSensitivity)),
                spreadsheet, SLOT(findPrevious(const QString &,
                                               Qt::CaseSensitivity)));
    }

    findDialog->show();
    findDialog->activateWindow();
}

void MainWindow::goToCell()
{
    GoToCellDialog dialog(this);
    if (dialog.exec()) {
        QString str = dialog.lineEdit->text().toUpper();
        spreadsheet->setCurrentCell(str.mid(1).toInt() - 1,
                                    str[0].unicode() - 'A');
    }
}

void MainWindow::sort()
{
    SortDialog dialog(this);
    QTableWidgetSelectionRange range = spreadsheet->selectedRange();
    dialog.setColumnRange('A' + range.leftColumn(),
                          'A' + range.rightColumn());

    if (dialog.exec()) {
        SpreadsheetCompare compare;
        compare.keys[0] =
              dialog.primaryColumnCombo->currentIndex();
        compare.keys[1] =
              dialog.secondaryColumnCombo->currentIndex() - 1;
        compare.keys[2] =
              dialog.tertiaryColumnCombo->currentIndex() - 1;
        compare.ascending[0] =
              (dialog.primaryOrderCombo->currentIndex() == 0);
        compare.ascending[1] =
              (dialog.secondaryOrderCombo->currentIndex() == 0);
        compare.ascending[2] =
              (dialog.tertiaryOrderCombo->currentIndex() == 0);
        spreadsheet->sort(compare);
    }
}

void MainWindow::about()
{
    QMessageBox::about(this, tr("About Spreadsheet"),
            tr("<h2>Spreadsheet 1.1</h2>"
               "<p>Copyright &copy; 2006 Software Inc."
               "<p>Spreadsheet is a small application that "
               "demonstrates QAction, QMainWindow, QMenuBar, "
               "QStatusBar, QTableWidget, QToolBar, and many other "
               "Qt classes."));
}

void MainWindow::openRecentFile()
{
    if (okToContinue()) {
        QAction *action = qobject_cast<QAction *>(sender());
        if (action)
            loadFile(action->data().toString());
    }
}

void MainWindow::updateStatusBar()
{
    locationLabel->setText(spreadsheet->currentLocation());
    formulaLabel->setText(spreadsheet->currentFormula());
}

void MainWindow::spreadsheetModified()
{
    setWindowModified(true);
    updateStatusBar();
}

void MainWindow::createActions()
{
    newAction = new QAction(tr("&New"), this);
    newAction->setIcon(QIcon(":/images/new.png"));
    newAction->setShortcut(tr("Ctrl+N"));
    newAction->setStatusTip(tr("Create a new spreadsheet file"));
    connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));

    openAction = new QAction(tr("&Open..."), this);
    openAction->setIcon(QIcon(":/images/open.png"));
    openAction->setShortcut(tr("Ctrl+O"));
    openAction->setStatusTip(tr("Open an existing spreadsheet file"));
    connect(openAction, SIGNAL(triggered()), this, SLOT(open()));

    saveAction = new QAction(tr("&Save"), this);
    saveAction->setIcon(QIcon(":/images/save.png"));
    saveAction->setShortcut(tr("Ctrl+S"));
    saveAction->setStatusTip(tr("Save the spreadsheet to disk"));
    connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));

    saveAsAction = new QAction(tr("Save &As..."), this);
    saveAsAction->setStatusTip(tr("Save the spreadsheet under a new "
                                  "name"));
    connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs()));

    for (int i = 0; i < MaxRecentFiles; ++i) {
        recentFileActions[i] = new QAction(this);
        recentFileActions[i]->setVisible(false);
        connect(recentFileActions[i], SIGNAL(triggered()),
                this, SLOT(openRecentFile()));
    }

    exitAction = new QAction(tr("E&xit"), this);
    exitAction->setShortcut(tr("Ctrl+Q"));
    exitAction->setStatusTip(tr("Exit the application"));
    connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));

    cutAction = new QAction(tr("Cu&t"), this);
    cutAction->setIcon(QIcon(":/images/cut.png"));
    cutAction->setShortcut(tr("Ctrl+X"));
    cutAction->setStatusTip(tr("Cut the current selection's contents "
                               "to the clipboard"));
    connect(cutAction, SIGNAL(triggered()), spreadsheet, SLOT(cut()));

    copyAction = new QAction(tr("&Copy"), this);
    copyAction->setIcon(QIcon(":/images/copy.png"));
    copyAction->setShortcut(tr("Ctrl+C"));
    copyAction->setStatusTip(tr("Copy the current selection's contents "
                                "to the clipboard"));
    connect(copyAction, SIGNAL(triggered()), spreadsheet, SLOT(copy()));

    pasteAction = new QAction(tr("&Paste"), this);
    pasteAction->setIcon(QIcon(":/images/paste.png"));
    pasteAction->setShortcut(tr("Ctrl+V"));
    pasteAction->setStatusTip(tr("Paste the clipboard's contents into "
                                 "the current selection"));
    connect(pasteAction, SIGNAL(triggered()),
            spreadsheet, SLOT(paste()));

    deleteAction = new QAction(tr("&Delete"), this);
    deleteAction->setShortcut(tr("Del"));
    deleteAction->setStatusTip(tr("Delete the current selection's "
                                  "contents"));
    connect(deleteAction, SIGNAL(triggered()),
            spreadsheet, SLOT(del()));

    selectRowAction = new QAction(tr("&Row"), this);
    selectRowAction->setStatusTip(tr("Select all the cells in the "
                                     "current row"));
    connect(selectRowAction, SIGNAL(triggered()),
            spreadsheet, SLOT(selectCurrentRow()));

    selectColumnAction = new QAction(tr("&Column"), this);
    selectColumnAction->setStatusTip(tr("Select all the cells in the "
                                        "current column"));
    connect(selectColumnAction, SIGNAL(triggered()),
            spreadsheet, SLOT(selectCurrentColumn()));

    selectAllAction = new QAction(tr("&All"), this);
    selectAllAction->setShortcut(tr("Ctrl+A"));
    selectAllAction->setStatusTip(tr("Select all the cells in the "
                                     "spreadsheet"));
    connect(selectAllAction, SIGNAL(triggered()),
            spreadsheet, SLOT(selectAll()));

    findAction = new QAction(tr("&Find..."), this);
    findAction->setIcon(QIcon(":/images/find.png"));
    findAction->setShortcut(tr("Ctrl+F"));
    findAction->setStatusTip(tr("Find a matching cell"));
    connect(findAction, SIGNAL(triggered()), this, SLOT(find()));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成va人在线观看| 成人免费视频国产在线观看| 国产在线精品一区二区夜色| 91免费版pro下载短视频| 日韩免费高清av| 亚洲精品国产一区二区精华液| 久久精品国产秦先生| 91国产视频在线观看| 国产日韩精品久久久| 日韩av在线发布| 欧美性色黄大片手机版| 欧美国产激情一区二区三区蜜月| 午夜亚洲福利老司机| 91激情在线视频| 国产精品三级在线观看| 国产综合久久久久影院| 91精品国产综合久久久久久漫画 | 欧美一区二区女人| 亚洲三级小视频| 成人毛片在线观看| 国产日韩欧美高清在线| 国产一区二区三区久久久| 91精品国产综合久久久蜜臀图片| 一区二区高清免费观看影视大全 | 国产亚洲一区二区三区四区| 日本中文一区二区三区| 欧美日韩午夜在线视频| 亚洲综合激情网| 色乱码一区二区三区88| 亚洲欧美精品午睡沙发| 成年人午夜久久久| **欧美大码日韩| 白白色 亚洲乱淫| 亚洲欧洲国产日韩| 99在线视频精品| 亚洲精品日韩一| 91福利国产成人精品照片| 一区二区免费看| 欧美性大战久久久久久久蜜臀 | 久久午夜色播影院免费高清| 久久精品久久精品| 久久精品综合网| 国产a久久麻豆| 国产精品免费视频观看| 9l国产精品久久久久麻豆| 亚洲视频电影在线| 欧美特级限制片免费在线观看| 一区二区三区免费在线观看| 欧美老肥妇做.爰bbww视频| 日韩国产欧美一区二区三区| 欧美va在线播放| 国产suv精品一区二区6| 亚洲婷婷综合久久一本伊一区| 在线视频一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 日韩欧美色综合| 国产精品456露脸| 亚洲日本护士毛茸茸| 欧美日韩国产成人在线免费| 蜜桃av噜噜一区| 国产精品久久久久aaaa| 欧美性受极品xxxx喷水| 韩国三级电影一区二区| 国产精品福利在线播放| 欧美精品xxxxbbbb| 国产成人久久精品77777最新版本| 国产精品福利一区| 欧美一级黄色大片| yourporn久久国产精品| 青草av.久久免费一区| 国产日韩综合av| 欧美一区二区播放| 国产91在线观看丝袜| 午夜天堂影视香蕉久久| 亚洲国产精品成人综合 | 高清国产一区二区三区| 亚洲一区二区在线播放相泽| 久久久久久**毛片大全| 色哦色哦哦色天天综合| 国产一区二区看久久| 亚洲狠狠爱一区二区三区| 国产欧美一区二区三区鸳鸯浴| 欧亚一区二区三区| 大白屁股一区二区视频| 久久国产视频网| 亚洲一线二线三线久久久| 国产日韩精品一区二区浪潮av| 51精品国自产在线| 91久久精品国产91性色tv| 国产精品99久久不卡二区| 天堂成人国产精品一区| 中文字幕在线不卡一区二区三区| 日韩欧美一级精品久久| 欧美日韩午夜影院| 在线观看日韩精品| 97久久超碰国产精品| 成人性生交大合| 国产成人免费视频精品含羞草妖精| 日韩av在线播放中文字幕| 亚洲一区二区三区四区五区中文 | 欧美一级二级在线观看| 欧美亚洲国产bt| 色哟哟日韩精品| 丁香婷婷综合激情五月色| 国内精品在线播放| 另类欧美日韩国产在线| 日本伊人色综合网| 日韩精品一级二级| 午夜激情久久久| 亚洲午夜视频在线| 亚洲激情综合网| 亚洲精品日产精品乱码不卡| 中文字幕一区二区三区av| 国产精品免费人成网站| 国产精品美女久久福利网站| 国产区在线观看成人精品| 久久久久久久久久看片| 久久精品视频免费| 国产目拍亚洲精品99久久精品| 国产亚洲欧美中文| 国产精品系列在线| 国产精品国产三级国产aⅴ中文| 国产精品毛片久久久久久久| 中文字幕一区二区三区不卡| 亚洲素人一区二区| 亚洲国产乱码最新视频| 亚洲第一精品在线| 麻豆视频一区二区| 国产乱对白刺激视频不卡| 成人激情午夜影院| 91福利在线免费观看| 欧美精品久久天天躁| 精品国产精品网麻豆系列 | 韩国视频一区二区| 成人激情校园春色| 欧美亚洲自拍偷拍| 884aa四虎影成人精品一区| 26uuu久久综合| ●精品国产综合乱码久久久久| 亚洲精品国产a久久久久久| 午夜亚洲福利老司机| 国产一区三区三区| 91香蕉视频mp4| 欧美一区二区在线视频| 久久精品人人做人人爽人人| 亚洲女子a中天字幕| 蜜桃av一区二区| 99综合电影在线视频| 欧美剧情片在线观看| 国产日韩高清在线| 午夜在线成人av| 国产99精品国产| 欧美日韩大陆在线| 国产精品久久一级| 青青草视频一区| 91首页免费视频| 欧美tickling网站挠脚心| 亚洲欧美激情视频在线观看一区二区三区| 亚洲综合一区二区| 国产精品系列在线观看| 欧美日韩国产成人在线免费| 国产欧美精品在线观看| 天堂在线亚洲视频| hitomi一区二区三区精品| 日韩无一区二区| 亚洲一二三四区| 成人精品在线视频观看| 欧美一二三在线| 一区二区成人在线视频| 成人综合婷婷国产精品久久 | 亚洲高清久久久| 国产91综合网| 精品国产一区二区三区忘忧草| 亚洲精品日韩一| 丁香另类激情小说| 久久综合九色欧美综合狠狠| 亚洲成人中文在线| 色欧美乱欧美15图片| 中文无字幕一区二区三区 | 国产精品91xxx| 日韩欧美一卡二卡| 日韩不卡一区二区| 欧美美女直播网站| 一区二区三区精品在线| www.日韩大片| 国产欧美日韩精品在线| 国产一区二区美女| 日韩一级片在线播放| 日韩成人dvd| 91精品欧美一区二区三区综合在 | 视频一区二区三区中文字幕| 色综合一区二区三区| 国产精品久久精品日日| 国产成人亚洲综合a∨婷婷| 日韩免费高清av| 国产在线精品国自产拍免费| 精品国产91久久久久久久妲己| 久久爱www久久做| 精品国产一区二区三区av性色| 蜜臀久久99精品久久久久久9 |