How to go on next page using push button in qt c++ with out use of signal and slots?












-2















I created table widget with check box and push button.



Now ,how to go on next page with all checked data, after click on push button.










share|improve this question




















  • 2





    Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

    – Basile Starynkevitch
    Jan 1 at 7:08











  • But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

    – Harnish Shah
    Jan 1 at 12:18













  • Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

    – Basile Starynkevitch
    Jan 1 at 12:18













  • Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

    – Basile Starynkevitch
    Jan 1 at 12:31











  • Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

    – Basile Starynkevitch
    Jan 1 at 12:45


















-2















I created table widget with check box and push button.



Now ,how to go on next page with all checked data, after click on push button.










share|improve this question




















  • 2





    Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

    – Basile Starynkevitch
    Jan 1 at 7:08











  • But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

    – Harnish Shah
    Jan 1 at 12:18













  • Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

    – Basile Starynkevitch
    Jan 1 at 12:18













  • Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

    – Basile Starynkevitch
    Jan 1 at 12:31











  • Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

    – Basile Starynkevitch
    Jan 1 at 12:45
















-2












-2








-2








I created table widget with check box and push button.



Now ,how to go on next page with all checked data, after click on push button.










share|improve this question
















I created table widget with check box and push button.



Now ,how to go on next page with all checked data, after click on push button.







qt qt5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 11:57









Yvette Colomb

20.3k1470112




20.3k1470112










asked Jan 1 at 6:45









Harnish ShahHarnish Shah

34




34








  • 2





    Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

    – Basile Starynkevitch
    Jan 1 at 7:08











  • But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

    – Harnish Shah
    Jan 1 at 12:18













  • Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

    – Basile Starynkevitch
    Jan 1 at 12:18













  • Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

    – Basile Starynkevitch
    Jan 1 at 12:31











  • Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

    – Basile Starynkevitch
    Jan 1 at 12:45
















  • 2





    Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

    – Basile Starynkevitch
    Jan 1 at 7:08











  • But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

    – Harnish Shah
    Jan 1 at 12:18













  • Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

    – Basile Starynkevitch
    Jan 1 at 12:18













  • Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

    – Basile Starynkevitch
    Jan 1 at 12:31











  • Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

    – Basile Starynkevitch
    Jan 1 at 12:45










2




2





Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

– Basile Starynkevitch
Jan 1 at 7:08





Without some Minimal, Complete, and Verifiable example your question is unclear. You need to define a Qt slot doing that appropriate operation. Read more about Qt signals and slots

– Basile Starynkevitch
Jan 1 at 7:08













But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

– Harnish Shah
Jan 1 at 12:18







But i don't want to use signal and slots @BasileStarynkevitch I just want to switch between two window with data using push button. If i click on push button then it can take all checked data and go to the next window.

– Harnish Shah
Jan 1 at 12:18















Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

– Basile Starynkevitch
Jan 1 at 12:18







Then you should not use Qt. Since Qt signals and slots is the basic mechanism in Qt for that (and to tailor the behavior of some Qt widgets, such as buttons).

– Basile Starynkevitch
Jan 1 at 12:18















Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

– Basile Starynkevitch
Jan 1 at 12:31





Your code is poorly formatted and is not an Minimal, Complete, and Verifiable example. It should have a main function to become one

– Basile Starynkevitch
Jan 1 at 12:31













Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

– Basile Starynkevitch
Jan 1 at 12:45







Please edit your question to improve it a lot: format properly your code, extend it to make it some Minimal, Complete, and Verifiable example (with a main), and explain in details (with several paragraphs) why you don't want to use Qt signals and slots.

– Basile Starynkevitch
Jan 1 at 12:45














1 Answer
1






active

oldest

votes


















1














the initial question was:




How to go on next page using push button in qt c++ without use of Qt signals and slots?




This is practically impossible, and certainly inadvisable, since Qt signals and slots is the basic foundational mechanism of Qt, used everywhere inside it.



Be sure to take more time to understand Qt signals and slots and study several Qt tutorials and examples. Consider also studying the source code of Qt5 itself (since it is free software). And you can also find many Qt open source applications (e.g. on github, gitlab, inside a Linux distribution, etc...) which should be inspirational (if you don't have time, you could pay some Qt consulting corporation to do your work).



My recommendation is to create some Qt QPushButton (perhaps subclassing that) and connect its clicked signal to your appropriate slot somewhere. The calculator example should be inspirational. You probably should subclass QTableWidget to add a new slot, and use that for your m_pTableWidget or at least declare your MainWindow::on_pushButton_clicked as a public slot (and of course connect it appropriately).



If you don't want to use Qt signals and slots, you should give up using Qt and choose some other widget toolkit. They all have some notification machinery (at least based on callbacks), and IMHO the design of Qt signals and slots is quite good (and sometimes better than what other toolkits provide).





Read also How to debug small programs



It seems that you don't understand the design principles of Qt (i.e. the fact that Qt signals and slots are central to Qt, so you should use them extensively). So I recommend taking a few days to study carefully the documentation of Qt (it is well written, but extensive; start with Getting Started Programming with Qt Widgets) and the source code of existing examples (including Qt itself); throw your current code to the trash bin; then rewrite it with an iterative and incremental development approach : code a few dozen lines at once, compile them (with all warnings and debug info, so g++ -Wall -Wextra -g with GCC), improve them to get no warnings, test your incomplete program - using the GDB debugger -, make sure it works as you want it to, and add one more small feature (perhaps just a single new widget) and repeat. Of course, use a version control system (I recommend git) and commit your code frequently (at least, at every loop of your iterative and incremental development approach).



NB. you have changed your question entirely (at first, you refused to use Qt signals and slots; now you accept to use them). Of course, you need to read carefully the documentation of every used widget (including the superclasses), notably of QTableWidget and of QTableView. And you need to define what a "page" is (and what going to the next page means), since QTableWidget don't know about them.



take time (several days or a few weeks) to read the documentation of Qt.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993545%2fhow-to-go-on-next-page-using-push-button-in-qt-c-with-out-use-of-signal-and-sl%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    the initial question was:




    How to go on next page using push button in qt c++ without use of Qt signals and slots?




    This is practically impossible, and certainly inadvisable, since Qt signals and slots is the basic foundational mechanism of Qt, used everywhere inside it.



    Be sure to take more time to understand Qt signals and slots and study several Qt tutorials and examples. Consider also studying the source code of Qt5 itself (since it is free software). And you can also find many Qt open source applications (e.g. on github, gitlab, inside a Linux distribution, etc...) which should be inspirational (if you don't have time, you could pay some Qt consulting corporation to do your work).



    My recommendation is to create some Qt QPushButton (perhaps subclassing that) and connect its clicked signal to your appropriate slot somewhere. The calculator example should be inspirational. You probably should subclass QTableWidget to add a new slot, and use that for your m_pTableWidget or at least declare your MainWindow::on_pushButton_clicked as a public slot (and of course connect it appropriately).



    If you don't want to use Qt signals and slots, you should give up using Qt and choose some other widget toolkit. They all have some notification machinery (at least based on callbacks), and IMHO the design of Qt signals and slots is quite good (and sometimes better than what other toolkits provide).





    Read also How to debug small programs



    It seems that you don't understand the design principles of Qt (i.e. the fact that Qt signals and slots are central to Qt, so you should use them extensively). So I recommend taking a few days to study carefully the documentation of Qt (it is well written, but extensive; start with Getting Started Programming with Qt Widgets) and the source code of existing examples (including Qt itself); throw your current code to the trash bin; then rewrite it with an iterative and incremental development approach : code a few dozen lines at once, compile them (with all warnings and debug info, so g++ -Wall -Wextra -g with GCC), improve them to get no warnings, test your incomplete program - using the GDB debugger -, make sure it works as you want it to, and add one more small feature (perhaps just a single new widget) and repeat. Of course, use a version control system (I recommend git) and commit your code frequently (at least, at every loop of your iterative and incremental development approach).



    NB. you have changed your question entirely (at first, you refused to use Qt signals and slots; now you accept to use them). Of course, you need to read carefully the documentation of every used widget (including the superclasses), notably of QTableWidget and of QTableView. And you need to define what a "page" is (and what going to the next page means), since QTableWidget don't know about them.



    take time (several days or a few weeks) to read the documentation of Qt.






    share|improve this answer






























      1














      the initial question was:




      How to go on next page using push button in qt c++ without use of Qt signals and slots?




      This is practically impossible, and certainly inadvisable, since Qt signals and slots is the basic foundational mechanism of Qt, used everywhere inside it.



      Be sure to take more time to understand Qt signals and slots and study several Qt tutorials and examples. Consider also studying the source code of Qt5 itself (since it is free software). And you can also find many Qt open source applications (e.g. on github, gitlab, inside a Linux distribution, etc...) which should be inspirational (if you don't have time, you could pay some Qt consulting corporation to do your work).



      My recommendation is to create some Qt QPushButton (perhaps subclassing that) and connect its clicked signal to your appropriate slot somewhere. The calculator example should be inspirational. You probably should subclass QTableWidget to add a new slot, and use that for your m_pTableWidget or at least declare your MainWindow::on_pushButton_clicked as a public slot (and of course connect it appropriately).



      If you don't want to use Qt signals and slots, you should give up using Qt and choose some other widget toolkit. They all have some notification machinery (at least based on callbacks), and IMHO the design of Qt signals and slots is quite good (and sometimes better than what other toolkits provide).





      Read also How to debug small programs



      It seems that you don't understand the design principles of Qt (i.e. the fact that Qt signals and slots are central to Qt, so you should use them extensively). So I recommend taking a few days to study carefully the documentation of Qt (it is well written, but extensive; start with Getting Started Programming with Qt Widgets) and the source code of existing examples (including Qt itself); throw your current code to the trash bin; then rewrite it with an iterative and incremental development approach : code a few dozen lines at once, compile them (with all warnings and debug info, so g++ -Wall -Wextra -g with GCC), improve them to get no warnings, test your incomplete program - using the GDB debugger -, make sure it works as you want it to, and add one more small feature (perhaps just a single new widget) and repeat. Of course, use a version control system (I recommend git) and commit your code frequently (at least, at every loop of your iterative and incremental development approach).



      NB. you have changed your question entirely (at first, you refused to use Qt signals and slots; now you accept to use them). Of course, you need to read carefully the documentation of every used widget (including the superclasses), notably of QTableWidget and of QTableView. And you need to define what a "page" is (and what going to the next page means), since QTableWidget don't know about them.



      take time (several days or a few weeks) to read the documentation of Qt.






      share|improve this answer




























        1












        1








        1







        the initial question was:




        How to go on next page using push button in qt c++ without use of Qt signals and slots?




        This is practically impossible, and certainly inadvisable, since Qt signals and slots is the basic foundational mechanism of Qt, used everywhere inside it.



        Be sure to take more time to understand Qt signals and slots and study several Qt tutorials and examples. Consider also studying the source code of Qt5 itself (since it is free software). And you can also find many Qt open source applications (e.g. on github, gitlab, inside a Linux distribution, etc...) which should be inspirational (if you don't have time, you could pay some Qt consulting corporation to do your work).



        My recommendation is to create some Qt QPushButton (perhaps subclassing that) and connect its clicked signal to your appropriate slot somewhere. The calculator example should be inspirational. You probably should subclass QTableWidget to add a new slot, and use that for your m_pTableWidget or at least declare your MainWindow::on_pushButton_clicked as a public slot (and of course connect it appropriately).



        If you don't want to use Qt signals and slots, you should give up using Qt and choose some other widget toolkit. They all have some notification machinery (at least based on callbacks), and IMHO the design of Qt signals and slots is quite good (and sometimes better than what other toolkits provide).





        Read also How to debug small programs



        It seems that you don't understand the design principles of Qt (i.e. the fact that Qt signals and slots are central to Qt, so you should use them extensively). So I recommend taking a few days to study carefully the documentation of Qt (it is well written, but extensive; start with Getting Started Programming with Qt Widgets) and the source code of existing examples (including Qt itself); throw your current code to the trash bin; then rewrite it with an iterative and incremental development approach : code a few dozen lines at once, compile them (with all warnings and debug info, so g++ -Wall -Wextra -g with GCC), improve them to get no warnings, test your incomplete program - using the GDB debugger -, make sure it works as you want it to, and add one more small feature (perhaps just a single new widget) and repeat. Of course, use a version control system (I recommend git) and commit your code frequently (at least, at every loop of your iterative and incremental development approach).



        NB. you have changed your question entirely (at first, you refused to use Qt signals and slots; now you accept to use them). Of course, you need to read carefully the documentation of every used widget (including the superclasses), notably of QTableWidget and of QTableView. And you need to define what a "page" is (and what going to the next page means), since QTableWidget don't know about them.



        take time (several days or a few weeks) to read the documentation of Qt.






        share|improve this answer















        the initial question was:




        How to go on next page using push button in qt c++ without use of Qt signals and slots?




        This is practically impossible, and certainly inadvisable, since Qt signals and slots is the basic foundational mechanism of Qt, used everywhere inside it.



        Be sure to take more time to understand Qt signals and slots and study several Qt tutorials and examples. Consider also studying the source code of Qt5 itself (since it is free software). And you can also find many Qt open source applications (e.g. on github, gitlab, inside a Linux distribution, etc...) which should be inspirational (if you don't have time, you could pay some Qt consulting corporation to do your work).



        My recommendation is to create some Qt QPushButton (perhaps subclassing that) and connect its clicked signal to your appropriate slot somewhere. The calculator example should be inspirational. You probably should subclass QTableWidget to add a new slot, and use that for your m_pTableWidget or at least declare your MainWindow::on_pushButton_clicked as a public slot (and of course connect it appropriately).



        If you don't want to use Qt signals and slots, you should give up using Qt and choose some other widget toolkit. They all have some notification machinery (at least based on callbacks), and IMHO the design of Qt signals and slots is quite good (and sometimes better than what other toolkits provide).





        Read also How to debug small programs



        It seems that you don't understand the design principles of Qt (i.e. the fact that Qt signals and slots are central to Qt, so you should use them extensively). So I recommend taking a few days to study carefully the documentation of Qt (it is well written, but extensive; start with Getting Started Programming with Qt Widgets) and the source code of existing examples (including Qt itself); throw your current code to the trash bin; then rewrite it with an iterative and incremental development approach : code a few dozen lines at once, compile them (with all warnings and debug info, so g++ -Wall -Wextra -g with GCC), improve them to get no warnings, test your incomplete program - using the GDB debugger -, make sure it works as you want it to, and add one more small feature (perhaps just a single new widget) and repeat. Of course, use a version control system (I recommend git) and commit your code frequently (at least, at every loop of your iterative and incremental development approach).



        NB. you have changed your question entirely (at first, you refused to use Qt signals and slots; now you accept to use them). Of course, you need to read carefully the documentation of every used widget (including the superclasses), notably of QTableWidget and of QTableView. And you need to define what a "page" is (and what going to the next page means), since QTableWidget don't know about them.



        take time (several days or a few weeks) to read the documentation of Qt.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 2 at 8:51

























        answered Jan 1 at 12:25









        Basile StarynkevitchBasile Starynkevitch

        178k13171369




        178k13171369
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993545%2fhow-to-go-on-next-page-using-push-button-in-qt-c-with-out-use-of-signal-and-sl%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            Npm cannot find a required file even through it is in the searched directory