Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. 1- handling mouse's event , 2- downloaded library and didn't work
Qt 6.11 is out! See what's new in the release blog

1- handling mouse's event , 2- downloaded library and didn't work

Scheduled Pinned Locked Moved General and Desktop
15 Posts 3 Posters 5.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Project try
    wrote on last edited by
    #1

    Hey,

    I wanted to ask if I could handle the mouse event which is when I point , I mean you right click and drag it " a blue thing appears " and you could select anything you want , hopefully you guys knew what I'm talking about , for example if you want to delete 5 files , you first drag the mouse to them and it'll select them all and then you could press delete. how can I handle that event ?

    my second question is:

    I'm trying to use a library called QtMel

    http://kibsoft.ru/

    I've done all what it says , I downloaded Libav & QtMultimediaKit & QtMEL and put them in a file , every one is in it's own file , then I downloaded opencv and installed it normally

    then tried to do this in my project's pro file:

    INCLUDEPATH += C:\Encoding\QtMel_Library\include
    LIBS += C:\Encoding\QtMel_Library\lib

    CONFIG(debug, debug|release) {
    LIBS += -lqtmeld1
    } else {
    LIBS += -lqtmel1
    }
    and when I tried to include the Recorder header , when I write Rec only it shows that there's a header called recorder but when I include it and then compile my program it says:

    error: C1083: Cannot open include file: 'Recorder': No such file or directory

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2
      1. You are talking about controlling a selection. The QAbstractItemView and QGraphicsView descendants provide support for selections on their underlying model/scene. Your example of selecting 5 files to delete would be based on selecting from a list, tree or table view.

      2. The INCLUDEPATH is wrong, the file exists but is not readable, or you have not run qmake since modifying the PRO file so the new include path options are not being given to the compiler etc.

      Once you resolve your INCLUDEPATH Issue, your LIBS value is incorrect and will cause linking issue (you are not getting that far yet). It should include "-L" and read (per the QtMEL page):
      @
      INCLUDEPATH += C:/Encoding/QtMel_Library/include
      LIBS += -LC:/Encoding/QtMel_Library/lib

      CONFIG(debug, debug|release) {
      LIBS += -lqtmeld1
      } else {
      LIBS += -lqtmel1
      }
      @
      Notice that I have used forward slashes in paths to avoid easy-to-make backslash escaping errors.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Project try
        wrote on last edited by
        #3

        Thanks , I'll check the classes that you've said in the first question hopefully it'll help

        about the second question I think I'll use opencv alone and I used this:

        INCLUDEPATH += C:/Users/myuser/Downloads/Programs/opencv/build/include
        CONFIG(release,debug|release){
        LIBS +=-LC:/Users/myuser/Downloads/Programs/opencv/build/x86/vc11/staticlib

        }

        when I include:

        #include<opencv/cv.h>
        #include<opencv/highgui.h>

        it works fine and all without any error but when I actually try to use things like Mat it doesn't work , for example here's what I did:

        @private:
        Ui::MainWindow *ui;
        VideoCapture cap;@

        the errors:

        @
        error: C2146: syntax error : missing ';' before identifier 'cap'

        error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int

        error: C2146: syntax error : missing ';' before identifier 'cap'

        error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int

        error: C2146: syntax error : missing ';' before identifier 'cap'

        error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int

        @

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Project try
          wrote on last edited by
          #4

          Oh right , I must use the namespace cv :)

          anyways there are new problems :D

          whenever I use a variable lets say Mat this happens:
          @
          mainwindow.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ)

          mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)

          mainwindow.obj:-1: error: LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPAHH@Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)

          debug\CaptureTools.exe:-1: error: LNK1120: 3 unresolved externals

          @

          I tried to clean it and run qmake then rebuild but the same problems happens.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            Linker errors => LIBS is wrong, you have not told qmake which OpenCV libraries you want linked (-l options), just where to find them (-L options).

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Project try
              wrote on last edited by
              #6

              Sorry didn't understand what you've said :(

              I followed your comment before but still it's not working:
              @
              INCLUDEPATH += C:/Users/myuser/Downloads/Programs/opencv/build/include/
              LIBS +=-LC:/Users/myuser/Downloads/Programs/opencv/build/x86/vc11/staticlib/@

              should I copy every name of the libs and replace -L with -l ? can I just include the whole file ? how ?

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Project try
                wrote on last edited by
                #7

                I downloaded a new version , and found two folders one for the source and I assumed it's for those who wants to build one , and the build folder which is the one that I used , put this in my pro file:
                @
                INCLUDEPATH += C:/opencv/build/include
                LIBS +=-LC:/opencv/build/x86/vc11/staticlib
                CONFIG(debug, debug|release){
                LIBS +=-lopencv_core249
                LIBS +=-lopencv_core249d
                LIBS +=-lopencv_highgui249
                LIBS +=-lopencv_highgui249d\

                }@

                and found this error:
                @
                :-1: error: LNK1104: cannot open file '+=-lopencv_core249d.obj'
                @

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  @
                  LIBS +=-lopencv_core249
                  LIBS +=-lopencv_core249d
                  LIBS +=-lopencv_highgui249
                  LIBS +=-lopencv_highgui249d
                  @

                  Should be

                  @
                  CONFIG(debug, debug|release){
                  LIBS +=
                  -lopencv_core249d
                  -lopencv_highgui249d
                  }

                  CONFIG(release, debug|release){
                  LIBS +=
                  -lopencv_core249
                  -lopencv_highgui249d
                  @

                  Using a backslashe after every line just concatenates them

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Project try
                    wrote on last edited by
                    #9

                    Thanks , I'll restart my computer then try your solution , hopefully it'll work.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Project try
                      wrote on last edited by
                      #10

                      Well it didn't work :(

                      now it shows about 211 errors along with the ones before , can I just compile my own opencv ? I've been following a lot of tutorials on how to do so but I have no luck completing it , always shows an error in the cmake gui :(

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        Project try
                        wrote on last edited by
                        #11

                        Well , I still have the same problem maybe a little more :(

                        I've tried in the pro file:

                        @

                        INCLUDEPATH += C:/opencv249/build/include
                        LIBS +=-LC:/opencv249/build/x64/vc12/staticlib
                        CONFIG(debug,debug|release){
                        LIBS+=
                        -lopencv_core249d
                        -lopencv_highgui249d
                        }
                        CONFIG(debug,debug|release){
                        LIBS+=
                        -lopencv_core249
                        -lopencv_highgui249
                        }

                        @

                        included:

                        @
                        #include<opencv/cv.h>
                        #include<opencv/highgui.h>
                        @

                        wrote this code " an example "

                        @

                        IplImage*img=cvLoadImage("C:\Users\myuser\QT\build-CaptureTools-Unnamed-Debug\Fri May 2 2014_3039.png");
                        cvNamedWindow("example",CV_WINDOW_AUTOSIZE);
                        cvShowImage("example",img);
                        cvWaitKey(0);
                        cvReleaseImage(&img);
                        cvDestroyWindow("example");
                        @

                        these errors happens:

                        @

                        C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

                        C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

                        C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvReleaseImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvNamedWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvShowImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvDestroyWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvLoadImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvWaitKey referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)

                        debug\CaptureTools.exe:-1: error: LNK1120: 6 unresolved externals

                        @

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Project try
                          wrote on last edited by
                          #12

                          Well new problem after following a solution from a guy in qt center website:
                          when using debug mode:
                          :-1: error: LNK1104: cannot open file 'opencv_core246d.lib'

                          when using release mode:
                          :-1: error: LNK1104: cannot open file 'opencv_core246.lib'

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            What version of Qt did you install and what compiler are you using ?

                            The last problem is a typo ? You have OpenCV 2.4.9 and you have linked to the 2.4.6 library

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Project try
                              wrote on last edited by
                              #14

                              I'm using Qt 5.1.1 I built it statically , the compiler is msvc11 x86

                              Yeah , I fixed the last problem ,I even downloaded another version but still the same problem..

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                Project try
                                wrote on last edited by
                                #15

                                for anyone with the same problem:

                                http://www.qtcentre.org/threads/58975-Couldn-t-link-opencv-with-qt-creator-this-error-happens?p=262379#post262379

                                I followed what he said and I think it's working now " need to test it more " but at least it compiled without errors"

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved