摘要: 函数原型 bool QObject::inherits ( const char * lname ) const //来自官方文档 QTimer *timer = new QTimer; // QTimer inherits QObject timer->inherits("QTimer"); // 阅读全文
posted @ 2021-07-16 01:41 Azuki_op 阅读(1039) 评论(0) 推荐(0)
摘要: 安装crontab: yum install crontabs crontab服务操作说明: /sbin/service crond start //启动服务 /sbin/service crond stop //关闭服务 /sbin/service crond restart //重启服务 /sb 阅读全文
posted @ 2021-07-16 01:29 Azuki_op 阅读(76) 评论(0) 推荐(0)
摘要: #include <QtXml> private: const QString CONFIG_PATH = "./config.xml"; const QString UDP_STR = "udp"; const QString TCP_STR = "tcp"; const QString SQL_ 阅读全文
posted @ 2021-07-16 01:14 Azuki_op 阅读(69) 评论(0) 推荐(0)
摘要: 单例模式:: 只实例化一次对象 分为饿汉式单例类和懒汉式单例类。 一般结合工厂模式使用 优点: 1.减少了时间和空间的开销(new) 2.提高了封装性,使得外部不易改动实例 单线程中: Singleton* getinstance() { if(instance == NULL) { instanc 阅读全文
posted @ 2021-07-16 01:08 Azuki_op 阅读(28) 评论(0) 推荐(0)
摘要: int main { QTextCodec *codec = QTextCodex::codexForName("UTF-8"); QTextCodec::setCodeForLocale(codec); QTextCodec::setCodeForCStrings(codec); QTextCod 阅读全文
posted @ 2021-07-16 01:02 Azuki_op 阅读(135) 评论(0) 推荐(0)
摘要: #include <Tlhelp32.h> #include <windows.h> #include <tlhelp32.h> #include "psapi.h" #include <Tlhelp32.h> void terminateMYSQL() { HANDLE hSnapShot=Cre 阅读全文
posted @ 2021-07-16 00:56 Azuki_op 阅读(776) 评论(0) 推荐(0)
摘要: #!/bin/sh command="/usr/local/Presto/presto-server-0.100/bin/launcher run" #路径 appname=presto-server #进程名 logfile=/usr/local/log/presto_monitor.log #l 阅读全文
posted @ 2021-07-16 00:52 Azuki_op 阅读(281) 评论(0) 推荐(0)
摘要: #include <math.h> #include <QSqlDatabase> #include <QSqlQuery> #include <QSqlError> #include <QNetworkAddressEntry> #include <QNetworkInterface> priva 阅读全文
posted @ 2021-07-16 00:46 Azuki_op 阅读(901) 评论(0) 推荐(0)
摘要: void Parse::sysshutdown() { // Mymethod::record(QString("Switch machine message received")); QProcess *parent; QString program = "sudo"; QStringList a 阅读全文
posted @ 2021-07-16 00:33 Azuki_op 阅读(216) 评论(0) 推荐(0)
摘要: 图标: 将一个图标文件(ico) 复制到项目源程序目录下 在项目配置项里添加一行代码 RC_ICONS = AppIcon.ico //Appicon时图标文件名称 信号与槽的第五个参数::连接方式 Qt::AutoConnection:: QT::DirectConnection : 信号被发射时 阅读全文
posted @ 2021-07-16 00:29 Azuki_op 阅读(73) 评论(0) 推荐(0)
摘要: // findChild找到名为 pushButton_sm_ i 的button设置Text for(int i=0 ;i<10; i++){ QPushButton* btn = ui->widget->findChild<QPushButton*>(QString("pushButton_sm 阅读全文
posted @ 2021-07-16 00:21 Azuki_op 阅读(2574) 评论(0) 推荐(0)