我是Qt编程的初学者,并使用代码块进行编程.我创建了3个文件communic.h,commmunicate.cpp和main.cpp,如下所示:
communicate.h
#ifndef COMMUNICATE_H
#define COMMUNICATE_H
#include <QWidget>
#include <QApplication>
#include <QPushButton>
#include <QLabel>
class Communicate : public QWidget
{
Q_OBJECT
public:
Communicate(QWidget *parent = 0);
private slots:
void OnPlus();
void OnMinus();
private:
QLabel *label;
};
#endif
Run Code Online (Sandbox Code Playgroud)
communicate.cpp
#include "communicate.h"
Communicate::Communicate(QWidget *parent)
: QWidget(parent)
{
QPushButton *plus = new QPushButton("+", this);
plus->setGeometry(50, 40, 75, 30);
QPushButton *minus = new QPushButton("-", this);
minus->setGeometry(50, 100, 75, 30);
label = new QLabel("0", this);
label->setGeometry(190, 80, 20, 30);
connect(plus, SIGNAL(clicked()), this, SLOT(OnPlus()));
connect(minus, SIGNAL(clicked()), …Run Code Online (Sandbox Code Playgroud) 我有两个long int类型的变量,如下所示:
long int a=-2147483648, b=-2147483648;
a=a+b;
printf("%d",a);
Run Code Online (Sandbox Code Playgroud)
我变零了.我尝试将类型更改为long long int,但我仍然没有得到正确的答案.
我正在做一个图像处理项目.我需要从一个varible(cv_image <bgr_pixel>)到另一个变量(cv_image <bgr_pixel>)中提取一个感兴趣的区域dlib::rectangle varible
在OpenCV中,它像:
Mat mainImage=cv::imread(location,0);
Mat roi = mainImage(cv::Rect(0,0,100,100))
Run Code Online (Sandbox Code Playgroud)
在Dlib中有没有类似的方法?