qt

no such file or directory

坚强是说给别人听的谎言 提交于 2021-02-17 05:40:26
问题 i'm trying to get the image from my webcam using qt, opencv here's my codes: .pro file: #------------------------------------------------- # # Project created by QtCreator 2013-12-20T07:42:20 # #------------------------------------------------- QT += core gui TARGET = QtCvCapture TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp \ imagecapture.cpp \ moc_imagecapture.cpp \ moc_mainwindow.cpp HEADERS += mainwindow.h \ imagecapture.h \ ui_mainwindow.h FORMS += mainwindow.ui #include opencv for

no such file or directory

核能气质少年 提交于 2021-02-17 05:40:07
问题 i'm trying to get the image from my webcam using qt, opencv here's my codes: .pro file: #------------------------------------------------- # # Project created by QtCreator 2013-12-20T07:42:20 # #------------------------------------------------- QT += core gui TARGET = QtCvCapture TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp \ imagecapture.cpp \ moc_imagecapture.cpp \ moc_mainwindow.cpp HEADERS += mainwindow.h \ imagecapture.h \ ui_mainwindow.h FORMS += mainwindow.ui #include opencv for

How to catch .erase exception in vectors?

送分小仙女□ 提交于 2021-02-17 04:54:30
问题 I have declared this vector in a code and I want to capture .erase exception in the following situation : When MyVec has no member and I want to delete one of its indices, it will throw an error. I want to capture this error. if there's no way to capture this kind of error, Does changing std::vector into alternative ones in Qt like Qlist or ... help to find a solution? what about other alternatives in C++ ? void Main() { std::vector <int> MyVec; MyVec.clear(); try { MyVec.erase(MyVec.begin())

Linking OpenCV to Qt Creator

不羁的心 提交于 2021-02-17 03:27:27
问题 I'm trying to use opencv 4 in QT creator, I'm working on Mac but I can't be able to link the library, I always have a error like on picture 2. please help me, I'm really hopeless. 回答1: First of all be sure you installed OpenCV correctly and working fine. You can check OpenCV exist or not by: pkg-config --modversion opencv It depends how you installed OpenCV but linking OpenCV libraries and flags to Qt is simply like adding these two line to your .pro file: INCLUDEPATH += /usr/local/include

Dynamically change text qlabel

血红的双手。 提交于 2021-02-17 03:16:43
问题 Sorry for my english. I need to change the text qlabel dynamically. class Game: { ... std::shared_ptr<QWidget> m_hint; QLabel *m_label; QHBoxLayout *m_layout; } void Game::setTextToHint(std::string str) { m_label = new QLabel(); m_layout = new QHBoxLayout(); m_label->setText(QString::fromUtf8(str.c_str())); m_layout->addWidget(m_label); m_hint->setLayout(m_layout); } And i use this function eg twice: setTextToHint("One"); setTextToHint("First"); But ultimately label = "One" Ok i understood. I

Dynamically change text qlabel

心不动则不痛 提交于 2021-02-17 03:15:02
问题 Sorry for my english. I need to change the text qlabel dynamically. class Game: { ... std::shared_ptr<QWidget> m_hint; QLabel *m_label; QHBoxLayout *m_layout; } void Game::setTextToHint(std::string str) { m_label = new QLabel(); m_layout = new QHBoxLayout(); m_label->setText(QString::fromUtf8(str.c_str())); m_layout->addWidget(m_label); m_hint->setLayout(m_layout); } And i use this function eg twice: setTextToHint("One"); setTextToHint("First"); But ultimately label = "One" Ok i understood. I

how can I transfer Component.onCompleted:{} method from ui.qml to .qml?

和自甴很熟 提交于 2021-02-17 02:00:19
问题 I am developing a project by seperating ui.qml files and .qml files . So, I am writing the functionality codes(javascript codes) into .qml file and I am writing design codes in ui.qml file . However I have a problem with using Component.onComplete functionality in .qml file. for example : MapDisplayForm.ui.qml Item{ id:item1 property alias map1 Map{ id: map1 Component.OnCompleted : { //this is the function that i should write in Map.qml } } } MapDisplay.qml MapDisplayForm{ //it does not

qt positioning controls in QMdiSubWindow

你离开我真会死。 提交于 2021-02-17 01:53:13
问题 I have problem with positioning controls in QMdiSubWindow derivate. I designed my window using QtDesigner, and it looks like this: When I run the app it looks like this (button on the title bar): It gets ok only in maximized mode: But I would like it to always look OK. Here's a part of .ui file: <widget class="QPushButton" name="btnToggleEdit"> <property name="geometry"> <rect> <x>10</x> <y>10</y> <width>75</width> <height>23</height> </rect> </property> <property name="text"> <string>Edit<

qt positioning controls in QMdiSubWindow

烂漫一生 提交于 2021-02-17 01:52:21
问题 I have problem with positioning controls in QMdiSubWindow derivate. I designed my window using QtDesigner, and it looks like this: When I run the app it looks like this (button on the title bar): It gets ok only in maximized mode: But I would like it to always look OK. Here's a part of .ui file: <widget class="QPushButton" name="btnToggleEdit"> <property name="geometry"> <rect> <x>10</x> <y>10</y> <width>75</width> <height>23</height> </rect> </property> <property name="text"> <string>Edit<

How to change Icon image of QAction when press QToolButton

☆樱花仙子☆ 提交于 2021-02-16 20:21:56
问题 I want to remove border of QToolButton when mouse hover. I want to change icon image of QAction when press QToolButton. i changed stylesheet for QToolButton but it is not working, please help I want to remove border of QToolButton when mouse hover. I changed stylesheet for QToolButton QToolButton:hover{ border: none; } QToolButton:pressed{ border: none; } but it display border bottom and button move to left like image 回答1: For a “Warm-up”, I started with a QPushButton . This class provides