mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-14 20:24:54 -04:00
--User changes
-Eliminate delay when switching between single and double precision. --Code changes -Variation tree and associated widgets no longer actually contain variation objects, only IDs.
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
/// by index or by weight. It supports weights less than, equal to, or
|
||||
/// greater than zero.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class VariationTreeWidgetItem : public QTreeWidgetItem
|
||||
{
|
||||
public:
|
||||
@ -56,24 +55,24 @@ private:
|
||||
int column = treeWidget()->sortColumn();
|
||||
eVariationId index1, index2;
|
||||
double weight1 = 0, weight2 = 0;
|
||||
VariationTreeWidgetItem<T>* varItemWidget;
|
||||
VariationTreeDoubleSpinBox<T>* spinBox1, *spinBox2;
|
||||
VariationTreeWidgetItem* varItemWidget;
|
||||
VariationTreeDoubleSpinBox* spinBox1, *spinBox2;
|
||||
|
||||
QWidget* itemWidget1 = treeWidget()->itemWidget(const_cast<VariationTreeWidgetItem<T>*>(this), 1);//Get the widget for the second column.
|
||||
auto itemWidget1 = treeWidget()->itemWidget(const_cast<VariationTreeWidgetItem*>(this), 1);//Get the widget for the second column.
|
||||
|
||||
if ((spinBox1 = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(itemWidget1)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||
if ((spinBox1 = dynamic_cast<VariationTreeDoubleSpinBox*>(itemWidget1)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||
{
|
||||
QWidget* itemWidget2 = treeWidget()->itemWidget(const_cast<QTreeWidgetItem*>(&other), 1);//Get the widget for the second column of the widget item passed in.
|
||||
auto itemWidget2 = treeWidget()->itemWidget(const_cast<QTreeWidgetItem*>(&other), 1);//Get the widget for the second column of the widget item passed in.
|
||||
|
||||
if ((spinBox2 = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(itemWidget2)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||
if ((spinBox2 = dynamic_cast<VariationTreeDoubleSpinBox*>(itemWidget2)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||
{
|
||||
if (spinBox1->IsParam() || spinBox2->IsParam())//Do not sort params, their order will always remain the same.
|
||||
return false;
|
||||
|
||||
weight1 = spinBox1->value();
|
||||
weight2 = spinBox2->value();
|
||||
index1 = spinBox1->GetVariation()->VariationId();
|
||||
index2 = spinBox2->GetVariation()->VariationId();
|
||||
index1 = spinBox1->GetVariationId();
|
||||
index2 = spinBox2->GetVariationId();
|
||||
|
||||
if (column == 0)//First column clicked, sort by variation index.
|
||||
{
|
||||
|
Reference in New Issue
Block a user