Results 1 to 20 of 20

Thread: how to get the last groupbox changed event in my program?

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default how to get the last groupbox changed event in my program?

    consider the following scenario, there's a list view on the left side of the window, so each clicked item in the list would lead to an associated page in the stackedPage widget on the right side. This window is setup to take care of camera settings. There are two things which I would like to discuss with you about how the process should go on when the user clicks the APPLY button; to apply the new settings:

    1. Each time this window pops on, the user may not be able in setting all the options of the list view items, so from a general point of view, It's better that I know which list views has the user clicked to change the setting!

    2. For each list item, as I said there is a few group box items on the stackedpage containing radiobuttons. I exactly need to know which radio buttons have new settings so that I can only configure those when the user clicks on the APPLY button.

    what I am looking for is exactly how I can implement this scenario minimizing the code ?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    I think you should not try to implement it that way. You are asking 'how do I query my ui to find out which data is dirty?'. The answer is 'you should not be doing that anyway'.

    You can easily resolve this issue with signals. when the user makes a change, the gui should emit that changed value through a signal. Then you will know exactly what has changed, and what the new value is. The receiver of these signals is then responsible for efficient updating of your settings, and you do not need to query the ui at all - this decouples the ui from the data.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    I understand, this is good if the data gets manipulated by the SLOT on the fly by emission.
    But, we also need to take into account that nothing is gonna change before the user clicks the APPLY button after all.
    This way, imagine, when APPLY happens, 10 radio buttons inside 10 different group boxes have been updated. Therefore, the slot should keep track of all
    changes signaled to it until APPLY is clicked.
    how can I keep track of all group boxes then? considering that I need the values as well as group box ids or string names, to know what function to call.

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    I understand, this is good if the data gets manipulated by the SLOT on the fly by emission.
    No, this does not have to be for on-the-fly manipulation of your 'real config'.

    But, we also need to take into account that nothing is gonna change before the user clicks the APPLY button after all.
    Yes. What I have said is perfectly compatible with that.

    how can I keep track of all group boxes then?
    Sigh. You are back to coupling ui to data?

    You have some class that accepts the ui signals. This class knows the variable and the new value. When user hits 'apply', signal is sent from ui to the class that holds the updated values, and then that class finally pushes the changes into the current config.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    I understand, this is good if the data gets manipulated by the SLOT on the fly by emission.
    No, this does not have to be for on-the-fly manipulation of your 'real config'.

    But, we also need to take into account that nothing is gonna change before the user clicks the APPLY button after all.
    Yes. What I have said is perfectly compatible with that.

    how can I keep track of all group boxes then?
    Sigh. You are back to coupling ui to data?

    You have some class that accepts the ui signals. This class knows the variable and the new value. When user hits 'apply', signal is sent from ui to the class that holds the updated values, and then that class finally pushes the changes into the current config.
    : ) what about if the user makes some changes n then clicks Cancel? this way new values are updated in the class without setting the configurations
    and there would be no way to get back to the previous settings..

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    no, wrong again. The 'real' config has not changed so of course the original state can be recovered.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  7. #7
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    no, wrong again. The 'real' config has not changed so of course the original state can be recovered.
    m sorry, this still looks not clear to me. imagine we have 2 group boxes, 3 radio buttons in each. in the settings class we have QRadioButton variables for each of the 9 radiobuttons. we use these variables to store the configuration. could you clarify your visulaization with this?
    Last edited by saman_artorious; 28th July 2012 at 19:18. Reason: updated contents

  8. #8
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    There shouldn't be any radio buttons in a settings class. Settings are data.

    your gui might be 2 group boxes with 3 radio buttons each, but this only represents two variables, each with 3 possible values

    e.g. gui:

    speed group box
    - fast
    - medium
    - slow

    size group box
    - big
    - medium
    - small

    That represents data (speed, size):
    Qt Code:
    1. struct Config
    2. {
    3. QString speed;
    4. QString size;
    5. };
    To copy to clipboard, switch view to plain text mode 

    That would be held in some config store:
    Qt Code:
    1. class IConfigSource
    2. {
    3. public:
    4. virtual Config config() const;
    5. virtual void setConfig(const Config& cfg);
    6. };
    7.  
    8. class ConfigSource : public IConfigSource
    9. {
    10. public:
    11. Config config() const {return config_;}
    12. void setConfig(const Config& cfg) {config_ = cfg;}
    13.  
    14. private:
    15. Config config_;
    16. };
    To copy to clipboard, switch view to plain text mode 

    which could be updated via something lile
    Qt Code:
    1. class ConfigUpdater : QObject
    2. {
    3. Q_OBJECT
    4. public:
    5. ConfigUpdater(IConfigSource& src) : src_(src) {}
    6.  
    7. public slots:
    8. void apply() {src_.setConfig(tempConfig);}
    9. void cancel() (tempConfig = src_.config();)
    10.  
    11. void updateSpeed(QString s) {tempConfig_.Speed = s;}
    12. void updateSize(QString s) {tempConfig_.Size = s;}
    13.  
    14. private:
    15. Config tempConfig_;
    16. IConfigSource& src_
    17. };
    To copy to clipboard, switch view to plain text mode 

    Of course, still to be considered is how to deal with valid options for particular variables, but let's not do that right now...
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  9. #9
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    the main window that my settings menu reside on is a QMainWindow. you think it is better to create a variable of type ConfigUpdater in the MainWindow class or modify the QMainWindow class to ConfigUpdater? here is more info:

    Qt Code:
    1. struct Config
    2. {
    3. /* General Options */
    4. QString general_key_lock;
    5. QString general_back_light;
    6. QString general_slow_shutter;
    7. QString general_high_resolution;
    8. QString general_picture_flip;
    9. QString general_freeze;
    10. QString general_lr_reverse;
    11. QString general_slow_shutter_power;
    12. QString general_icr_power;
    13.  
    14. QString general_shutter;
    15. QString general_automatic_exposure;
    16. QString general_aperture_control;
    17. QString general_iris;
    18.  
    19. QString general_camera_wb;
    20. QString general_external_lock;
    21. QString general_stabilizer;
    22.  
    23. /* WD settings */
    24. QString wide_dynamic;
    25. QString wd_screen_display;
    26. QString wd_highlightCorrection;
    27. QString wd_shadowCorrection;
    28. QString wd_detectionSens;
    29.  
    30. /* Picture Effect */
    31. QString picture_effect_setting;
    32. QString picture_flip_setting;
    33.  
    34. };
    35.  
    36. class IConfigSource
    37. {
    38. public:
    39. virtual Config config() const;
    40. virtual void setConfig(const Config& cfg);
    41. };
    42.  
    43. class ConfigSource : public IConfigSource
    44. {
    45. public:
    46. Config config() const {return config_;}
    47. void setConfig(const Config& cfg) {config_ = cfg;}
    48.  
    49. private:
    50. Config config_;
    51. };
    52.  
    53. class ConfigUpdater : QObject
    54. {
    55. Q_OBJECT
    56. public:
    57. ConfigUpdater(ConfigSource& src) : src_(src) {}
    58.  
    59. public slots:
    60. void apply () {src_.setConfig(tempConfig_);}
    61. void cancel() {tempConfig_ = src_.config();}
    62.  
    63. void updateGeneralBackLight(QString s) {tempConfig_.general_back_light = s;}
    64. void updateGeneralKeyLock(QString s) {tempConfig_.general_key_lock = s;}
    65. void updateGeneralSlowShutter(QString s) {tempConfig_.general_slow_shutter = s;}
    66. void updateGeneralHighResolution(QString s) {tempConfig_.general_high_resolution = s;}
    67. void updateGeneralPictureFlip(QString s) {tempConfig_.general_picture_flip = s;}
    68. void updateGeneralFreeze(QString s) {tempConfig_.general_freeze = s;}
    69. void updateGeneralLRReverse(QString s) {tempConfig_.general_lr_reverse = s;}
    70. void updateGeneralSlowShutterPower(QString s) {tempConfig_.general_slow_shutter_power = s;}
    71. void updateGeneralICRPower(QString s) {tempConfig_.general_icr_power = s;}
    72.  
    73. void updateGeneralShutter(QString s) {tempConfig_.general_shutter = s;}
    74. void updateGeneralAutomaticExposure(QString s) {tempConfig_.general_automatic_exposure = s;}
    75. void updateGeneralApertureControl(QString s) {tempConfig_.general_aperture_control = s;}
    76. void updateGeneralIris(QString s) {tempConfig_.general_iris = s;}
    77. void updateGeneralCameraWB(QString s) {tempConfig_.general_camera_wb = s;}
    78. void updateGeneralExternalLock(QString s) {tempConfig_.general_external_lock = s;}
    79. void updateGeneralStabilizer(QString s) {tempConfig_.general_stabilizer = s;}
    80.  
    81.  
    82. private:
    83. Config tempConfig_;
    84. ConfigSource& src_;
    85. };
    86.  
    87.  
    88. namespace Ui {
    89. class SettingsWindow;
    90. }
    91.  
    92. class SettingsWindow : public QMainWindow
    93. {
    94. Q_OBJECT
    95.  
    96. public:
    97. explicit SettingsWindow(QWidget *parent = 0);
    98.  
    99. ~SettingsWindow();
    100.  
    101. signals:
    102. void sendToPLC(QByteArray );
    103. public slots:
    104. void getRow(QModelIndex);
    105. private slots:
    106. void on_pushButton_5_clicked();
    107.  
    108. void on_pushButton_3_clicked();
    109.  
    110. private:
    111.  
    112. private:
    113. Ui::SettingsWindow *ui;
    114.  
    115.  
    116. };
    To copy to clipboard, switch view to plain text mode 
    Last edited by saman_artorious; 29th July 2012 at 09:34. Reason: updated contents

  10. #10
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    this is separate question of what I asked above. could you see if what i say is correct:
    the settings Mainwindow is called by the Application main window. So, to set the settings menu to default values the first time the it pops up, Config structure shall be passed as a parameter from Main window to the settings Window. (i don't know if a data structure could be passed to the settings window when it is called ? if not so, shall I hide the setting window each time instead of cloding it?) -- If I send the Config default data as a parameter to settings window, what happens after the window closes? would all Config data structure be removed from memory? if so, our both temp and src_ structures gets released?

  11. #11
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    Again, mainwindow is a gui construct so it shouldn't get too friendly with the settings. And the mainwindow isn't even the gui window where you change the settings.

    As for your other questions, they are covered by basic c++ understanding so maybe better in a different thread.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  12. #12
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    Again, mainwindow is a gui construct so it shouldn't get too friendly with the settings. And the mainwindow isn't even the gui window where you change the settings.

    As for your other questions, they are covered by basic c++ understanding so maybe better in a different thread.
    I didn't get the answer to my question clearly. How should I progress considering my previous post?

  13. #13
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    you think it is better to create a variable of type ConfigUpdater in the MainWindow class or modify the QMainWindow class to ConfigUpdater?
    Neither.

    Config structure shall be passed as a parameter from Main window to the settings Window
    No, Config structure shouldn't even be in mainwindow.

    what happens after the window closes? would all Config data structure be removed from memory? if so, our both temp and src_ structures gets released?
    Be aware there is a difference between a window hiding and a window closing/being destroyed. As for what happens when a class is destroyed, this follows normal rules of c++ and Qt clean-up considering Qt parenting. You can read about this elsewhere.

    Imo you should consider a class that knows about the config source, and also knows how to create the gui. Then it would just require a signal/slot connection to show the config gui with up-to-date config.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  14. #14
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    you think it is better to create a variable of type ConfigUpdater in the MainWindow class or modify the QMainWindow class to ConfigUpdater?
    Neither.

    Config structure shall be passed as a parameter from Main window to the settings Window
    No, Config structure shouldn't even be in mainwindow.

    what happens after the window closes? would all Config data structure be removed from memory? if so, our both temp and src_ structures gets released?
    Be aware there is a difference between a window hiding and a window closing/being destroyed. As for what happens when a class is destroyed, this follows normal rules of c++ and Qt clean-up considering Qt parenting. You can read about this elsewhere.

    Imo you should consider a class that knows about the config source, and also knows how to create the gui. Then it would just require a signal/slot connection to show the config gui with up-to-date config.
    one more question, the MainWindow initially keeps the default setting value which can pass through to the settings mainwindow when it is called. it can also be stored in the settings window though. My question is that whenever the settings window closes, new updated settings gets lost! if I send the updated values to the Main caller window via signal, then whenever the settings window gets called, it would receive the last updated settings from the caller window. is this a good way? because I cannot find any other way to keep the updated values as the settings window loses all data each time it is closed?

  15. #15
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    one more question, the MainWindow initially keeps the default setting value..
    Why do you ask for explicit information then ignore it?

    because I cannot find any other way to keep the updated values as the settings window loses all data each time it is closed?
    No. It seems like you didn't read anything from the post you quoted.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  16. #16
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    one more question, the MainWindow initially keeps the default setting value..
    Why do you ask for explicit information then ignore it?

    because I cannot find any other way to keep the updated values as the settings window loses all data each time it is closed?
    No. It seems like you didn't read anything from the post you quoted.
    what I suggested is exactly what is here:
    Imo you should consider a class that knows about the config source, and also knows how to create the gui. Then it would just require a signal/slot connection to show the config gui with up-to-date config.

  17. #17
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    one more question, the MainWindow initially keeps the default setting value which can pass through to the settings mainwindow when it is called. it can also be stored in the settings window though. My question is that whenever the settings window closes, new updated settings gets lost!

    What do you think the ConfigSource is for?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  18. #18
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get the last groupbox changed event in my program?

    just for illustrative purposes (ie if you copy/paste it wont work...)

    Qt Code:
    1. class IGuiCreator : public QObject
    2. {
    3. public slots:
    4. virtual QWidget* create() const = 0;
    5. };
    6.  
    7. class ConfigMgr : QObject
    8. {
    9. public:
    10. ConfigMgr(IConfigSource& src, const IGuiCreator& guiCreator) ...
    11.  
    12. public slots:
    13. void showGui()
    14. {
    15. // get current config
    16. // make gui & setup with config
    17. }
    18.  
    19.  
    20. signals:
    21. // we need to change ConfigSource to emit signals when apply() is called so we can link that signal with this one
    22. void configChanged(const Config&);
    23.  
    24. private:
    25. IConfigSource& src_;
    26. const IGuiCreator& guiCreator_;
    27. };
    28.  
    29.  
    30. int main(...)
    31. {
    32. QApplication app(...);
    33.  
    34. ConfigMgr mgr;
    35. MainWindow yourmainwindow;
    36.  
    37. QObject::connect( /* connect signal 'show config gui' from mainwindow to slot 'show config gui' on config mgr */ );
    38.  
    39. /* you can connect the configChanged() signal here as well */
    40.  
    41. yourmainwindow.show();
    42. app.exec();
    43. }
    To copy to clipboard, switch view to plain text mode 
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  19. #19
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Quote Originally Posted by amleto View Post
    one more question, the MainWindow initially keeps the default setting value which can pass through to the settings mainwindow when it is called. it can also be stored in the settings window though. My question is that whenever the settings window closes, new updated settings gets lost!

    What do you think the ConfigSource is for?
    I want you to help me clarify the following problem please.
    1. I do not know if this way is but, but I added a reference to ConfigSource in the Settings class constructor. So, before the Main Window get destructed, I can save the src_ values permanently to a file. I hope this is not redundant, or maybe we don't need it as the ConfigSource and updater classes exist. ?

    2. As we used a reference to refer to src_, the program gives unexpected error when I call it's cancel and update methods to update it.

    This is inside Main Window constructor, before I call the Settings Window
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. ConfigSource cfg;
    7. settings = new SettingsWindow(cfg,this);
    To copy to clipboard, switch view to plain text mode 

    Settings and Config classes
    Qt Code:
    1. #ifndef SETTINGSWINDOW_H
    2. #define SETTINGSWINDOW_H
    3.  
    4. #include <QMainWindow>
    5. #include <QModelIndex>
    6.  
    7. #include <QSignalMapper>
    8. #include <QRadioButton>
    9. #include <QSpinBox>
    10. #include <QTimer>
    11.  
    12. #include "cameracommands.h"
    13.  
    14. struct Config
    15. {
    16. /* General Options */
    17. QString general_key_lock;
    18. QString general_back_light;
    19. };
    20.  
    21.  
    22. class ConfigSource
    23. {
    24. public:
    25.  
    26. ConfigSource() {
    27.  
    28. config_.general_aperture_control = "Reset";
    29. config_.general_automatic_exposure = "Full Auto";
    30. config_.general_back_light = "OFF";
    31. }
    32.  
    33. Config config() const {return config_;}
    34.  
    35. void setConfig(const Config& cfg) {config_ = cfg;}
    36.  
    37. private:
    38.  
    39. Config config_;
    40. };
    41.  
    42. class ConfigUpdater : public QObject
    43. {
    44. Q_OBJECT
    45. public:
    46. ConfigUpdater(ConfigSource& src) : src_(src) {}
    47.  
    48. public slots:
    49.  
    50. void apply () {src_.setConfig(tempConfig_);}
    51. void cancel() {tempConfig_ = src_.config();}
    52.  
    53. public:
    54.  
    55. void updateGeneralBackLight(QString s) {tempConfig_.general_back_light = s; qDebug() << "BackLight updated :)";}
    56. void updateGeneralKeyLock(QString s) {tempConfig_.general_key_lock = s; qDebug() << "KeyLock updated :)";}
    57.  
    58. Config tempConfig_;
    59. ConfigSource& src_;
    60. };
    61.  
    62. //----------------------------
    63.  
    64. namespace Ui {
    65. class SettingsWindow;
    66. }
    67.  
    68. class SettingsWindow : public QMainWindow
    69. {
    70. Q_OBJECT
    71.  
    72. public:
    73. explicit SettingsWindow(ConfigSource &src, QWidget *parent = 0);
    74.  
    75. ~SettingsWindow();
    76.  
    77. private slots:
    78. void on_pushButton_5_clicked();
    79. void on_pushButton_3_clicked();
    80. void on_sendToMainButton_clicked();
    81.  
    82. private:
    83. void print_config(Config cfg);
    84.  
    85. Ui::SettingsWindow *ui;
    86. ConfigUpdater *config_updater;
    87. };
    88.  
    89. #endif // SETTINGSWINDOW_H
    To copy to clipboard, switch view to plain text mode 

    Settings Window cpp
    Qt Code:
    1. SettingsWindow::SettingsWindow(ConfigSource &src, QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::SettingsWindow)
    4. {
    5. /* initializations */
    6. ui->setupUi(this);
    7. config_updater = new ConfigUpdater(src);
    To copy to clipboard, switch view to plain text mode 

    As I mentioned above, the program terminates when I attempt to call he Cancel and Update method!

    config_updater->cancel();

  20. #20
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the last groupbox changed event in my program?

    Problem solved.

Similar Threads

  1. How to catch event, then objectName changed.
    By sergey_85 in forum Qt Programming
    Replies: 1
    Last Post: 25th April 2010, 20:05
  2. how to catch close event in this program? [pyqt]
    By pyqt123 in forum Qt Programming
    Replies: 15
    Last Post: 14th December 2009, 11:30
  3. Groupbox has no borders ?
    By vieraci in forum Qt Programming
    Replies: 12
    Last Post: 30th April 2009, 12:46
  4. System time changed event
    By varunjajee in forum Qt Programming
    Replies: 2
    Last Post: 8th April 2009, 06:05
  5. A Shadow of my groupBox
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2008, 21:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.