Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to reset column types when changing the ordinal threshold #5392

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

boutinb
Copy link
Contributor

@boutinb boutinb commented Jan 15, 2024

Fixes jasp-stats/jasp-issues#2426

If you change the threshold between Categorical and Scale, it might be handy to reset the variable types with this new value.

I have also redesigned a bit the Preferences/Data to have the same look as the other preferences menus.

…hold

Fixes jasp-stats/jasp-issues#2426

If you change the threshold between Categorical and Scale, it might be handy to reset the variable types with this new value.

I have also redesigned a bit the Preferences/Data to have the same look as the other preferences memus.
@boutinb boutinb requested a review from JorisGoosen January 15, 2024 10:51
@shun2wang
Copy link
Contributor

Seems the build test failed.

@JorisGoosen
Copy link
Contributor

[ 70%] Building CXX object Desktop/CMakeFiles/JASP.dir/gui/preferencesmodel.cpp.o
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:81:62: error: no declaration matches ‘bool PreferencesModel::customThresholdScale() const’
   81 | #define GET_PREF_FUNC(TYPE, NAME, SETTING, TO_FUNC)     TYPE PreferencesModel::NAME() const { return Settings::value(SETTING).TO_FUNC; }
      |                                                              ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:81:62: note: in definition of macro ‘GET_PREF_FUNC’
   81 | #define GET_PREF_FUNC(TYPE, NAME, SETTING, TO_FUNC)     TYPE PreferencesModel::NAME() const { return Settings::value(SETTING).TO_FUNC; }
      |                                                              ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:101:1: note: in expansion of macro ‘GET_PREF_FUNC_BOOL’
  101 | GET_PREF_FUNC_BOOL(     customThresholdScale,           Settings::USE_CUSTOM_THRESHOLD_SCALE                            )
      | ^~~~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:81:62: note: no functions named ‘bool PreferencesModel::customThresholdScale() const’
   81 | #define GET_PREF_FUNC(TYPE, NAME, SETTING, TO_FUNC)     TYPE PreferencesModel::NAME() const { return Settings::value(SETTING).TO_FUNC; }
      |                                                              ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:81:62: note: in definition of macro ‘GET_PREF_FUNC’
   81 | #define GET_PREF_FUNC(TYPE, NAME, SETTING, TO_FUNC)     TYPE PreferencesModel::NAME() const { return Settings::value(SETTING).TO_FUNC; }
      |                                                              ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:101:1: note: in expansion of macro ‘GET_PREF_FUNC_BOOL’
  101 | GET_PREF_FUNC_BOOL(     customThresholdScale,           Settings::USE_CUSTOM_THRESHOLD_SCALE                            )
      | ^~~~~~~~~~~~~~~~~~
In file included from /home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:1:
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.h:12:7: note: ‘class PreferencesModel’ defined here
   12 | class PreferencesModel : public PreferencesModelBase
      |       ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:410:6: error: no declaration matches ‘void PreferencesModel::setCustomThresholdScale(bool)’
  410 | void PreferencesModel::setCustomThresholdScale(bool newCustomThresholdScale)
      |      ^~~~~~~~~~~~~~~~
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:410:6: note: no functions named ‘void PreferencesModel::setCustomThresholdScale(bool)’
In file included from /home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.cpp:1:
/home/runner/work/jasp-desktop/jasp-desktop/Desktop/gui/preferencesmodel.h:12:7: note: ‘class PreferencesModel’ defined here
   12 | class PreferencesModel : public PreferencesModelBase
      |       ^~~~~~~~~~~~~~~~
gmake[2]: *** [Desktop/CMakeFiles/JASP.dir/build.make:1326: Desktop/CMakeFiles/JASP.dir/gui/preferencesmodel.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:888: Desktop/CMakeFiles/JASP.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Error: Process completed with exit code 2.

@boutinb
Copy link
Contributor Author

boutinb commented Jan 15, 2024

Forget again to update preferencesmodel.cpp.in in place of preferencesmodel.cpp...
It should work now.

@@ -25,7 +25,7 @@ DataSetTableModel::DataSetTableModel(bool showInactive)
{

connect(DataSetPackage::pkg(), &DataSetPackage::columnsFilteredCountChanged, this, &DataSetTableModel::columnsFilteredCountChanged );
connect(DataSetPackage::pkg(), &DataSetPackage::columnDataTypeChanged, this, &DataSetTableModel::columnTypeChanged );
connect(DataSetPackage::pkg(), &DataSetPackage::columnDataTypeChanged, this, [&](QString colName) { emit columnTypeChanged(colName, int(DataSetPackage::pkg()->getColumnType(colName))); });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lekker

Copy link
Contributor

@JorisGoosen JorisGoosen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better like this

@JorisGoosen JorisGoosen merged commit 88d4086 into jasp-stats:development Jan 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: Change threshhold default for nominal/ordinal OR allow summing up ordinal (Likert) data
3 participants