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. how to make a customized constructor in Qt ...

how to make a customized constructor in Qt ...

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 2.1k Views 2 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.
  • kasysbiK Offline
    kasysbiK Offline
    kasysbi
    wrote on last edited by
    #1

    I'm triying to make a customized constructor like this
    class SelectPlanDialog : public QDialog
    {
    Q_OBJECT

    public:
    explicit SelectPlanDialog(QWidget *parent = 0);
    explicit SelectPlanDialog(QStringList &idChsed, QStringList &planChsed, int maxSampleSize);
    ...
    and for some reason it doesnt work...pls how can i fix it?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      in what way "doesnt work" ?

      Do you get compile error?

      kasysbiK 1 Reply Last reply
      3
      • kasysbiK Offline
        kasysbiK Offline
        kasysbi
        wrote on last edited by
        #3

        when i run it the solution have an error, something with "test.exe a quitté avec code -1073741819"

        1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          in what way "doesnt work" ?

          Do you get compile error?

          kasysbiK Offline
          kasysbiK Offline
          kasysbi
          wrote on last edited by
          #4

          @mrjj
          when i run it the solution have an error, something with "test.exe a quitté avec code -1073741819"

          mrjjM 1 Reply Last reply
          0
          • kasysbiK kasysbi

            @mrjj
            when i run it the solution have an error, something with "test.exe a quitté avec code -1073741819"

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @kasysbi said in how to make a customized constructor in Qt ...:

            quitté avec code

            Is that something like "Application closed with error code -1073741819" ?

            Why do you think its related to your constructor ?

            kasysbiK 2 Replies Last reply
            3
            • mrjjM mrjj

              @kasysbi said in how to make a customized constructor in Qt ...:

              quitté avec code

              Is that something like "Application closed with error code -1073741819" ?

              Why do you think its related to your constructor ?

              kasysbiK Offline
              kasysbiK Offline
              kasysbi
              wrote on last edited by
              #6

              @mrjj
              yes

              1 Reply Last reply
              0
              • mrjjM mrjj

                @kasysbi said in how to make a customized constructor in Qt ...:

                quitté avec code

                Is that something like "Application closed with error code -1073741819" ?

                Why do you think its related to your constructor ?

                kasysbiK Offline
                kasysbiK Offline
                kasysbi
                wrote on last edited by
                #7

                @mrjj
                i think its related to my constructor because at the time i try not to overload that constructor everything work fine. Then i overload it aigain and this appear to my screen 0_1502839290469_Untitled.jpg
                with that error code -1073741819

                jsulmJ 1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Charlie_Hdz
                  wrote on last edited by
                  #8

                  explicit keyword means that you want to explicitly pass the parameter with the same type without implicit conversion made by the compiler.

                  Try to kick off the explicit and see what happens

                  Thanks

                  Kind Regards,
                  Enrique Hernandez
                  gearstech.com.mx
                  chernandez@gearstech.com.mx

                  kasysbiK 1 Reply Last reply
                  0
                  • kasysbiK kasysbi

                    @mrjj
                    i think its related to my constructor because at the time i try not to overload that constructor everything work fine. Then i overload it aigain and this appear to my screen 0_1502839290469_Untitled.jpg
                    with that error code -1073741819

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @kasysbi Can you show the content of that constructor and the code where you use it?
                    "how to make a customized constructor in Qt" - this isn't a Qt topic as Qt is not a programming language. It's a C++ topic.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    4
                    • C Charlie_Hdz

                      explicit keyword means that you want to explicitly pass the parameter with the same type without implicit conversion made by the compiler.

                      Try to kick off the explicit and see what happens

                      Thanks

                      kasysbiK Offline
                      kasysbiK Offline
                      kasysbi
                      wrote on last edited by
                      #10

                      @Charlie_Hdz
                      i were right...i did as you said, removed the explicit type and it finaly worked. thanks!

                      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