Changeset fbfc488 in sasview for src/sas/qtgui/Utilities
- Timestamp:
- Nov 9, 2017 8:43:55 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- d6b8a1d
- Parents:
- 7969b9c
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/03/17 10:58:39)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:55)
- Location:
- src/sas/qtgui/Utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/GuiUtils.py
r4992ff2 rfbfc488 249 249 plot_item = item.child(index) 250 250 if plot_item.isCheckable(): 251 plot_data = plot_item.child(0).data() #.toPyObject()251 plot_data = plot_item.child(0).data() 252 252 if plot_data.id is not None and plot_data.id == py_update_data.id: 253 253 # replace data section in item … … 270 270 Adds 'update_data' to that row. 271 271 """ 272 #assert isinstance(update_data, QtCore.QVariant)273 #py_update_data = update_data.toPyObject()274 272 py_update_data = update_data 275 273 … … 339 337 if str(item.text()) == filename: 340 338 # TODO: assure item type is correct (either data1/2D or Plotter) 341 plot_data.append(item.child(0).data()) #.toPyObject())339 plot_data.append(item.child(0).data()) 342 340 # Going 1 level deeper only 343 341 for index_2 in range(item.rowCount()): … … 345 343 if item_2 and item_2.isCheckable(): 346 344 # TODO: assure item type is correct (either data1/2D or Plotter) 347 plot_data.append(item_2.child(0).data()) #.toPyObject())345 plot_data.append(item_2.child(0).data()) 348 346 349 347 return plot_data … … 361 359 if item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 362 360 # TODO: assure item type is correct (either data1/2D or Plotter) 363 plot_data.append((item, item.child(0).data())) #.toPyObject()))361 plot_data.append((item, item.child(0).data())) 364 362 # Going 1 level deeper only 365 363 for index_2 in range(item.rowCount()): … … 367 365 if item_2 and item_2.isCheckable() and item_2.checkState() == QtCore.Qt.Checked: 368 366 # TODO: assure item type is correct (either data1/2D or Plotter) 369 plot_data.append((item_2, item_2.child(0).data())) #.toPyObject()))367 plot_data.append((item_2, item_2.child(0).data())) 370 368 371 369 return plot_data … … 635 633 636 634 def validate(self, input, pos): 637 try: 638 Formula(str(input)) 639 self._setStyleSheet("") 640 return QtGui.QValidator.Acceptable, pos 641 642 except Exception as e: 643 self._setStyleSheet("background-color:pink;") 644 return QtGui.QValidator.Intermediate, pos 635 636 self._setStyleSheet("") 637 return QtGui.QValidator.Acceptable, pos 638 639 #try: 640 # Formula(str(input)) 641 # self._setStyleSheet("") 642 # return QtGui.QValidator.Acceptable, pos 643 644 #except Exception as e: 645 # self._setStyleSheet("background-color:pink;") 646 # return QtGui.QValidator.Intermediate, pos 645 647 646 648 def _setStyleSheet(self, value): … … 756 758 The assumption - data stored in SasView standard, in child 0 757 759 """ 758 return item.child(0).data() #.toPyObject()760 return item.child(0).data() 759 761 760 762 def formatNumber(value, high=False): … … 806 808 else: 807 809 return name 810 811 def toDouble(value_string): 812 """ 813 toFloat conversion which cares deeply about user's locale 814 """ 815 # Holy shit this escalated quickly in Qt5. 816 # No more float() cast on general locales. 817 value = QtCore.QLocale().toFloat(value_string) 818 if value[1]: 819 return value[0] 820 821 # Try generic locale 822 value = QtCore.QLocale(QtCore.QLocale('en_US')).toFloat(value_string) 823 if value[1]: 824 return value[0] 825 else: 826 raise ValueError -
src/sas/qtgui/Utilities/IPythonWidget.py
r4992ff2 rfbfc488 3 3 from PyQt5 import QtWidgets 4 4 5 ##from PyQt4import QtSvg5 from PyQt5 import QtSvg 6 6 7 7 def new_load_qt(api_options): … … 18 18 # Do some monkey patching to satisfy pyinstaller complaining 19 19 # about pyside/pyqt confusion 20 qt_loaders.load_qt = new_load_qt21 qtconsole_qt_loaders.load_qt = qtconsole_new_load_qt20 #qt_loaders.load_qt = new_load_qt 21 #qtconsole_qt_loaders.load_qt = qtconsole_new_load_qt 22 22 23 23 from qtconsole.rich_jupyter_widget import RichJupyterWidget
Note: See TracChangeset
for help on using the changeset viewer.