• 大小: 1020KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-27
  • 语言: 其他
  • 标签: Qt  

资源简介

《Qt高级编程》,作者: (英)Mark Summerfield ,《qt高级编程》以工程实践为主旨,是对qt现有的700多个类和上百万字参考文档中部分关键技术深入、全面的讲解和探讨,如丰富的网络/桌面应用程序、多线程、富文本处理、图形/视图架构、模型/视图架构等;另外,除对每章主题内容的探讨外,还给出了许多与之相关的类、方法和技术细节,从而尽可能多地展示了qt的各种特色。

资源截图

代码片段和文件信息

/*
    Copyright (c) 2008-10 Qtrac Ltd. All rights reserved.
    This program or module is free software: you can redistribute it
    and/or modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation either version 2 of
    the License or version 3 of the License or (at your option) any
    later version. This program is distributed in the hope that it will
    be useful but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.
*/

#include “alt_key.hpp“
#include “kuhn_munkres.hpp“
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 


namespace {

typedef QSet CharSet;


struct StringItem
{
    explicit StringItem(const QString &string_=QString()
                        const CharSet alphabet=CharSet())
        : string(string_) ustring(string_.toUpper())
    {
        foreach (const QChar &c ustring)
            if (alphabet.contains(c))
                unique.insert(c);
    }

    void calculateWeights(int sizeOfAlphabet)
    {
        const double factor = unique.count() /
                static_cast(sizeOfAlphabet);
        QList characters = QList::fromSet(unique);
        qSort(characters);
        double weight;
        foreach (const QChar &c characters) {
            if (ustring[0] == c)    // First character‘s weight
                weight = factor;
            else if (ustring.contains(QString(“ %1“).arg(c))) {
                int pos = string.indexOf(QString(“ %1“).arg(c));
                if (pos > -1)       // Capital start of word‘s weight
                    weight = factor * 10;
                else {              // Start of word‘s weight
                    weight = factor * 100;
                    pos = ustring.indexOf(QString(“ %1“).arg(c));
                }
                weight += pos;
            }
            else                    // Any character‘s weight
                weight = (factor * 1000) + ustring.indexOf(c);
            weightOf[c] = weight;
        }
    }

    QString string;
    QString ustring;
    CharSet unique;
    QHash weightOf;
};


QStringList accelerated_(const QStringList &strings
                         const CharSet &alphabet)
{
    const double Invalid = std::numeric_limits::max();

    QList items;
    foreach (const QString &string strings)
        items.append(StringItem(string alphabet));

    CharSet alphabetSet;
    foreach (const StringItem &item items)
        alphabetSet |= item.unique;
    QList characters = QList::fromSet(alphabetSet);
    qSort(characters);
    QString alphabetString;
    foreach (const QChar &c characters)
        alphabetString.append(c);
    const int rows = items.count();
    const int columns = al

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12737  2010-07-18 14:51  aqp\aqp\alt_key.cpp

     文件       1896  2010-07-18 14:51  aqp\aqp\alt_key.hpp

     文件       7933  2010-07-18 14:21  aqp\aqp\aqp.cpp

     文件       3844  2010-07-26 16:51  aqp\aqp\aqp.hpp

     文件        121  2010-07-18 14:21  aqp\aqp\aqp.pro

     文件         90  2010-07-18 14:21  aqp\aqp\aqp.qrc

     文件       9168  2010-07-18 14:51  aqp\aqp\kuhn_munkres.cpp

     文件       2637  2010-07-18 14:51  aqp\aqp\kuhn_munkres.hpp

     文件       1316  2010-07-18 14:21  aqp\aqp\main.cpp

     文件      19306  2010-07-18 14:21  aqp\aqp\mime.types

     文件       7976  2010-07-18 14:21  aqp\browserwindow\browserwindow.cpp

     文件       2192  2010-07-18 14:21  aqp\browserwindow\browserwindow.hpp

     文件        497  2010-07-18 14:21  aqp\browserwindow\browserwindow.pro

     文件        271  2010-07-18 14:21  aqp\browserwindow\browserwindow.qrc

     文件       1604  2010-07-18 14:21  aqp\browserwindow\images\history.png

     文件       2138  2010-07-18 14:21  aqp\browserwindow\images\next.png

     文件       2149  2010-07-18 14:21  aqp\browserwindow\images\prev.png

     文件       1901  2010-07-18 14:21  aqp\browserwindow\images\reload.png

     文件       2230  2010-07-18 14:21  aqp\browserwindow\images\seturl.png

     文件       1630  2010-07-18 14:21  aqp\browserwindow\images\stop.png

     文件       1783  2010-07-18 14:21  aqp\browserwindow\images\zoomin.png

     文件       1749  2010-07-18 14:21  aqp\browserwindow\images\zoomout.png

     文件       4384  2010-07-18 14:21  aqp\browserwindow\main.cpp

     文件       4788  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizer.cpp

     文件       2360  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizer.hpp

     文件        288  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizer.pro

     文件       3793  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizerheader.cpp

     文件       1300  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizerheader.hpp

     文件       9220  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizerview.cpp

     文件       1864  2010-07-18 14:21  aqp\censusvisualizer\censusvisualizerview.hpp

............此处省略360个文件信息

评论

共有 条评论