Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13298e8

Browse files
committed
Fix: QMenuBar is diplayed on Windows
1 parent 41af3f1 commit 13298e8

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

cvVideo/cvVideo.pro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,17 @@ macx {
1919
-lopencv_imgproc
2020
}
2121

22+
## OpenCV settings for Windows and OpenCV 2.4.2
23+
win32 {
24+
INCLUDEPATH += "C:\\opencv\\build\\include" \
25+
"C:\\opencv\\build\\include\\opencv" \
26+
"C:\\opencv\\build\\include\\opencv2"
27+
28+
LIBS += -L"C:\\opencv\\build\\x86\\vc10\\lib" \
29+
-lopencv_core242 \
30+
-lopencv_highgui242 \
31+
-lopencv_imgproc242
32+
}
33+
2234
# Runs this app automatically after the building has succeeded
2335
#QMAKE_POST_LINK=./$$TARGET

cvVideo/cvWindow.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ cvWindow::cvWindow()
1717
resize(480, 240);
1818

1919
_menu = new QMenu("File");
20-
_menu->addAction("Open", this, SLOT(_open()));
20+
_menu->addAction("Op3n", this, SLOT(_open()));
2121
_menu->addSeparator();
22-
_menu->addAction("Exit");
23-
_menu->addAction("Exit", this, SLOT(close()));
22+
_menu->addAction("Ex1t", this, SLOT(close()));
2423
_menu_bar.addMenu(_menu);
24+
25+
setMenuBar(&_menu_bar);
2526
}
2627

2728
cvWindow::~cvWindow()

cvVideo/cvWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <QGridLayout>
2+
#include <QMainWindow>
33
#include <QMenu>
44
#include <QMenuBar>
55
#include <QImage>
@@ -8,7 +8,7 @@
88
#include <highgui.h>
99

1010

11-
class cvWindow : public QWidget
11+
class cvWindow : public QMainWindow
1212
{
1313
Q_OBJECT
1414

0 commit comments

Comments
 (0)