image

mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
 
#include <QMainWindow>
#include <QtConcurrent/QtConcurrentRun>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
 
class MainWindow : public QMainWindow
{
 Q_OBJECT
 
public:
 MainWindow(QWidget *parent = nullptr);
 ~MainWindow();
 
private slots:
 void on_pushButton_start_clicked();
 
 void on_pushButton_stop_clicked();
 
private:
 Ui::MainWindow *ui;
 int counter;
 bool running;
 
private:
 void addCounter();
};
#endif // MAINWINDOW_H

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

Change tabPosition
Change tabShape

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
Unfortunately Qt creator in linux does not support BGR888 format, so we have to convert the image to RGB format by using cvtColor funtion before displaying it.
Mat img = imread("lena.jpg");
cvtColor(img, img, COLOR_BGR2RGB);
auto w = ui->label->width();
auto h = ui->label->height();
ui->label->setPixmap(
 QPixmap::fromImage(
 QImage(img.data, img.cols, img.rows, img.step, QImage::Format_RGB888)
 ).scaled(w, h, Qt::KeepAspectRatio)

);

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

INCLUDEPATH += /usr/local/include/opencv4/
LIBS+= -L/usr/local/lib/ \
`pkg-config --cflags --libs opencv4`

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QTime>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
 : QMainWindow(parent)
 , ui(new Ui::MainWindow)
{
 ui->setupUi(this);
}
 
MainWindow::~MainWindow()
{
 delete ui;
}
 
 
void MainWindow::on_pushButton_clicked()
{
 QMessageBox::about(this, "About", "This is an about dialog");
}
 
void MainWindow::on_pushButton_2_clicked()
{
 QMessageBox::aboutQt(this, "Something about QT");
}
 
void MainWindow::on_pushButton_3_clicked()
{
 QMessageBox::critical(this,"Error occured","You should check out what happened!");
}
 
void MainWindow::on_pushButton_4_clicked()
{
 QTime dt_now = QTime::currentTime();
 QMessageBox::information(this, "Current Time: ", dt_now.toString());
}
 
void MainWindow::on_pushButton_5_clicked()
{
 QMessageBox::StandardButton reply = QMessageBox::question(this, "Login","Are you ready to go?",
 QMessageBox::Yes | QMessageBox::No);
 if(reply == QMessageBox::Yes)
 {
 QMessageBox::information(this, "Yes", "You've selected 'Yes' button");
 qDebug() << "Yes is clicked" << endl;
 }else if(reply == QMessageBox::No)
 {
 QMessageBox::information(this, "No", "You've selected 'No' button");
 qDebug() << "No is clicked" << endl;
 }
}
 
void MainWindow::on_pushButton_6_clicked()
{
 QMessageBox::warning(this, "Warning","Some warning messages have occured!");
}

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
Downloading Git for Windows

me1237guy 發表在 痞客邦 留言(0) 人氣()

image

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
Platform: Windows 10
OpenCV: 4.2.0
Qt Creator: 4.11.0

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
 
 
 
 

me1237guy 發表在 痞客邦 留言(0) 人氣()

image
download Qt 5.14.1

me1237guy 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。