ptz 发布的文章

1. 获取容器的最大最小值,注意返回的不是数值,需要 *。

```c++ min_data = min_element(myarr.begin(),myarr.end()); auto mydata = minmax_element(myarr.begin(),myarr.end()); cout<<"min: " << mydata.first << " max: " << *mydata.second << "\n";

QVector::iterator max = std::max_element(std::begin(data) std::end(data));


参考: https://en.cppreference.com/w/cpp/algorithm/minmax
https://blog.csdn.net/weixin_43971252/article/details/88831917
https://www.icxbk.com/ask/detail?tid=38382
https://blog.csdn.net/Littlehero_121/article/details/100565527

# 2. 需要字符串中的字串:
```c++
QString QString::mid(int position, int n = -1) const

std::basic_string::substr(size_type __pos, size_type __n) const
basic_string substr(size_type pos = 0, size_type count = npos);

参考:https://blog.csdn.net/u014252478/article/details/80034026

3. 信号与槽

https://blog.csdn.net/humanking7/article/details/86071134 https://www.cnblogs.com/raina/p/11312097.html

4. 当需要容器即可以随机存取,也可以在头部添加删除数据的时候,可以选用 deque。

参考: https://blog.csdn.net/weixin_42462202/article/details/87537503 https://blog.csdn.net/gogokongyin/article/details/51178378

5. mainwindow 里面 增加 graphicview,可以把 graphicview 当作一个 widget 来添加。

```c++ m_view1 = new View("left front"); ui->gridLayout->addWidget(m_view1, 0, 0);


# 6. 两个 QString 比较不区分大小写

qDebug() << str1.compare(str2, Qt::CaseInsensitive);


参考: https://blog.csdn.net/Colin_RZL/article/details/106642982

# 7. QTextBrowser的一些设置
https://blog.csdn.net/u010779194/article/details/9075309

# 8. timer 暂停就用 stop(),恢复就用 start()
参考: https://oomake.com/question/5276301  
https://bbs.csdn.net/topics/310074466  

# 9. 菜单项快捷键使用 `&`, 比如说: `File(&F)`
参考: https://blog.csdn.net/weixin_44591035/article/details/102674002  

# 10. about 提示框 `QMessageBox::about(this, tr("About消息框"), tr("这是一个About消息框测试!"));`
参考: https://blog.csdn.net/qq_36908789/article/details/106439905  

# 11. 菜单项 connect 槽函数,信号是 `&QAction::triggered`
参考: https://blog.csdn.net/dianzishi123/article/details/85854321  

工程的配置中, user 的选项卡,after build/rebuild 的两条命令可以设置为

  1. fromelf --text -c -o "$L@L.asm" "#L"
  2. fromelf --bin -o "$L@L.bin" "#L"

class Process : public QObject
{
    Q_OBJECT
public:
    Process()
    {
        connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadData()));
        m_process.setReadChannel(QProcess::StandardOutput);
        m_process.start("cmd /c ping /t www.qt.io");
    }

private slots:
    void onReadData()
    {
        qDebug() << m_process.readAllStandardOutput(); 
    }

private:
    QProcess m_process;
};

参考: https://zhuanlan.zhihu.com/p/86206831

git 生成 ssh key,执行下面代码即可:

git config --global  --list 
git config --global  user.name "这里换上你的用户名"
git config --global user.email "这里换上你的邮箱"
ssh-keygen -t rsa -C "这里换上你的邮箱"

id_rsa.pub 把这个文件当中的 key 放到 服务器配置里面即可。

参考: https://blog.csdn.net/lqlqlq007/article/details/78983879 https://git-scm.com/book/zh/v2/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-%E7%94%9F%E6%88%90-SSH-%E5%85%AC%E9%92%A5