小编The*_*ast的帖子

二进制数的正则表达式可被5整除

我想写一个正则表达式的二进制数可被5整除.
我已经完成了二进制数的正则表达式,可以被2和3整除,但我找不到一个5.

有什么建议?

regex binary division

9
推荐指数
1
解决办法
1万
查看次数

如何在 QT Creator 中自动包含所需的标题

我在 QT Creator 中有一个项目,我希望在使用新对象时自动包含头文件。这就像在 Eclipse 中:在使用 Ctrl+Alt+Space 调用新对象时添加所需的标题:将包含所有需要的标题。

这是一个例子

#include <QApplication>
#include <QPushButton>  /* Header that i want to include automatically */

 int main( int argc, char *argv[ ] )
{
    QApplication app( argc, argv) ;
    QWidget fenetre;
/*Add needed headers when invoking a new object like ctrl+alt+space in eclipse*/
    QPushButton bouton( "Bonjour", &fenetre) ;
    bouton. move(70,60);
    fenetre. show( ) ;
    return app. exec( ) ;
}
Run Code Online (Sandbox Code Playgroud)

关于如何在 QT Creator 中执行此操作的任何建议?谢谢

c++ qt header qt-creator qpushbutton

5
推荐指数
2
解决办法
3291
查看次数

如何在Qt中设置应用程序图标

尝试为我的QT应用程序设置图标时遇到一些麻烦。

该图标名为“ room.ico”,与源文件位于同一目录中。

这是代码:

#include <QApplication>
#include <QWidget>

int main( int argc, char *argv[ ] )
{
   QApplication app( argc, argv) ;
   QWidget fenetre;
   fenetre.setWindowIcon(QIcon("room.ico")); // Nothing happens
   fenetre.setWindowTitle("Heloo");    
   fenetre.show();
   return app.exec() ;
}
Run Code Online (Sandbox Code Playgroud)

我尝试添加win32:RC_ICONS += room.ico.pro file但是没有用。我也尝试过,"./room.ico"但仍然没有图标。

我试图用这个:

QPixmap pixmap = QPixmap ("room.ico");
fenetre.setWindowIcon(QIcon(pixmap));
Run Code Online (Sandbox Code Playgroud)

你猜怎么着 !!!它没有用...我只是QT的新手:p

任何建议将不胜感激,谢谢

c++ qt qpixmap qicon qapplication

4
推荐指数
1
解决办法
7319
查看次数

如何使用带有树莓派相机模块的OpenCV C ++在彩色模式下获取图像

我正在使用带有opencv 3 gold和raspicam-0.1.3 libarrry的raspberry pi 2作为pi相机模块,我已经测试了以下代码,它可以正常工作,但它为我提供了灰度模式(黑白)图像,但是我想要彩色模式(RGB)

这是代码:

#include <ctime>
#include <iostream>
#include <raspicam/raspicam_cv.h>
using namespace std; 

int main ( int argc,char **argv ) {

    time_t timer_begin,timer_end;
    raspicam::RaspiCam_Cv Camera;
    cv::Mat image;
    int nCount=100;
    //set camera params
    Camera.set( CV_CAP_PROP_FORMAT, CV_8UC1 );
    //Open camera
    cout<<"Opening Camera..."<<endl;
    if (!Camera.open()) {cerr<<"Error opening the camera"<<endl;return -1;}
    //Start capture
    cout<<"Capturing "<<nCount<<" frames ...."<<endl;
    time ( &timer_begin );
    for ( int i=0; i<nCount; i++ ) {
        Camera.grab();
        Camera.retrieve ( image);
        if ( i%5==0 )  cout<<"\r captured "<<i<<" images"<<std::flush; …
Run Code Online (Sandbox Code Playgroud)

c++ camera opencv colors raspberry-pi2

0
推荐指数
1
解决办法
3945
查看次数

返回类型的含义(*Read)(void*p,void*buf,size_t*size);

我正在使用VS 2013和c开发一个现有项目.

我来到这个功能,但我不明白这意味着什么:

  int (*Read)(void *p, void *buf, size_t *size);
Run Code Online (Sandbox Code Playgroud)

我所知道的是它是一个返回指向int的指针的函数,但我想知道:

  1. 为什么void as type意味着在处理参数时(可能是通用指针?)
  2. 什么(*读)意味着在这种情况下(我认为这是一个演员!)

真正知道我在这里使用的是完整的依赖项:

typedef struct
{
  #ifdef USE_WINDOWS_FILE
  HANDLE handle;
  #else
  FILE *file;
  #endif
} CSzFile;

typedef struct
{
  int (*Read)(void *p, void *buf, size_t *size);
} ISeqInStream;

typedef struct
{
  ISeqInStream s;
  CSzFile file;
} CFileSeqInStream;

 CFileSeqInStream inStream;
Run Code Online (Sandbox Code Playgroud)

最后的目标是打开一个文件,但为什么所有这些并发症!

任何帮助将不胜感激,谢谢.

c pointers return-type void visual-studio-2013

0
推荐指数
1
解决办法
444
查看次数

C中的微控制器启动代码是什么?何时/为什么/如何修改?

这是关于启动代码的一般问题.我知道它就像引导程序或重置或上电后运行的第一件事,它调用主函数.

但我想知道它的主要/核心功能.

例如(在谷歌搜索),

重置目标系统后立即执行启动代码.Keil启动代码按顺序执行(可选)以下操作:

? Clears internal data memory
? Clears external data memory
? Clears paged external data memory
? Initializes the small model reentrant stack and pointer
? Initializes the large model reentrant stack and pointer
? Initializes the compact model reentrant stack and pointer
? Initializes the 8051 hardware stack pointer
? Transfers control to code that initializes global variables or to the main C function if
there are no initialized global variables
Run Code Online (Sandbox Code Playgroud)

Nb:启动代码总是用汇编语言编写,因为它取决于CPU目标.

谢谢你的时间

microcontroller assembly startup

-1
推荐指数
1
解决办法
1368
查看次数