| 1 |
/*************************************************************************** |
| 2 |
stylemodel.cpp |
| 3 |
------------------- |
| 4 |
Style model |
| 5 |
------------------- |
| 6 |
Copyright 2006-2008, David Johnson |
| 7 |
Please see the header file for copyright and license information |
| 8 |
***************************************************************************/ |
| 9 |
|
| 10 |
#include <QApplication> |
| 11 |
#include <QMessageBox> |
| 12 |
#include <QPair> |
| 13 |
|
| 14 |
#include "data.h"cxx . . $ `<file>/src/data.h`/ |
| 15 |
#include "stylemodel.h"cxx . . $ `<file>/src/stylemodel.h`/ |
| 16 |
|
| 17 |
using namespace Resource; |
| 18 |
|
| 19 |
////////////////////////////////////////////////////////////////////////////// |
| 20 |
// StyleModel() |
| 21 |
// ------------ |
| 22 |
// Constructor |
| 23 |
|
| 24 |
StyleModelcxx . . $ StyleModel#::StyleModelcxx . . $ StyleModel#StyleModel(18a1c0fddfd4057f).(QObjectcxx . . $ QObject# *parent, StyleListcxx . . $ StyleList# *list) |
| 25 |
: QAbstractTableModelcxx . . $ QAbstractTableModel#(parent), list_cxx . . $ StyleModel#list_.(list) |
| 26 |
{} |
| 27 |
|
| 28 |
StyleModelcxx . . $ StyleModel#::~cxx . . $ StyleModel#`~StyleModel`(ced63f7c635d850d).StyleModelcxx . . $ StyleModel#(){} |
| 29 |
|
| 30 |
////////////////////////////////////////////////////////////////////////////// |
| 31 |
// flush() |
| 32 |
// ------- |
| 33 |
// Reset the model |
| •34 |
// The reset() method is obsolete with Qt5. |
| 35 |
|
| 36 |
void StyleModelcxx . . $ StyleModel#::flushcxx . . $ StyleModel#flush(49f6e7a06ebc5aa8).() |
| 37 |
{ |
| •38 |
// reset(); |
| 39 |
} |
| 40 |
|
| 41 |
////////////////////////////////////////////////////////////////////////////// |
| 42 |
// data() |
| 43 |
// ------ |
| 44 |
// Return data at index |
| 45 |
|
| 46 |
QVariantcxx . . $ QVariant# StyleModelcxx . . $ StyleModel#::datacxx . . $ StyleModel#data(69b5b18a001c0029).(const QModelIndexcxx . . $ QModelIndex# &index, int role) const |
| 47 |
{ |
| 48 |
if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 49 |
if (index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).() >= list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 50 |
|
| 51 |
// row is the entry in the QList |
| 52 |
const Stylecxx . . $ Style# &style = list_cxx . . $ StyleModel#list_.->atcxx . . $ QList#at(e2681f9bb6b2f357).(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()); |
| 53 |
|
| 54 |
// column is the style "field" |
| 55 |
if (role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) { |
| 56 |
switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) { |
| 57 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 58 |
return stylecxx . . $ QVariant#QVariant(3520e46b33348bf6)..namecxx . . $ Style#name(a2fb7a6ce195d51).(); |
| 59 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 60 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.oglow_cxx . . $ Style#oglow_., 'f', 3); |
| 61 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 62 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.oghi_cxx . . $ Style#oghi_., 'f', 3); |
| 63 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 64 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.fglow_cxx . . $ Style#fglow_., 'f', 3); |
| 65 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 66 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.fghi_cxx . . $ Style#fghi_., 'f', 3); |
| 67 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 68 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.ibulow_cxx . . $ Style#ibulow_.); |
| 69 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 70 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.ibuhi_cxx . . $ Style#ibuhi_.); |
| 71 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 72 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.srmlow_cxx . . $ Style#srmlow_.); |
| 73 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 74 |
return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.srmhi_cxx . . $ Style#srmhi_.); |
| 75 |
default: |
| 76 |
return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 77 |
} |
| 78 |
} else if (role == Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) { |
| 79 |
switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) { |
| 80 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 81 |
return stylecxx . . $ QVariant#QVariant(3520e46b33348bf6)..namecxx . . $ Style#name(a2fb7a6ce195d51).(); |
| 82 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 83 |
return stylecxx . . $ QVariant#QVariant(ba8836b59fb42830)..oglow_cxx . . $ Style#oglow_.; |
| 84 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 85 |
return stylecxx . . $ QVariant#QVariant(ba8836b59fb42830)..oghi_cxx . . $ Style#oghi_.; |
| 86 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 87 |
return stylecxx . . $ QVariant#QVariant(ba8836b59fb42830)..fglow_cxx . . $ Style#fglow_.; |
| 88 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 89 |
return stylecxx . . $ QVariant#QVariant(ba8836b59fb42830)..fghi_cxx . . $ Style#fghi_.; |
| 90 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 91 |
return stylecxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..ibulow_cxx . . $ Style#ibulow_.; |
| 92 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 93 |
return stylecxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..ibuhi_cxx . . $ Style#ibuhi_.; |
| 94 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 95 |
return stylecxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..srmlow_cxx . . $ Style#srmlow_.; |
| 96 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 97 |
return stylecxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..srmhi_cxx . . $ Style#srmhi_.; |
| 98 |
default: |
| 99 |
return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 100 |
} |
| 101 |
} else if (role == Qtcxx . . $ Qt/::TextAlignmentRolecxx . . $ Qt/TextAlignmentRole.) { |
| 102 |
switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) { |
| 103 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 104 |
return Qtcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).::AlignLeftcxx . . $ Qt/AlignLeft.; |
| 105 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 106 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 107 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 108 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 109 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 110 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 111 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 112 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 113 |
default: |
| 114 |
return Qtcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).::AlignRightcxx . . $ Qt/AlignRight.; |
| 115 |
} |
| 116 |
} else { |
| 117 |
return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
////////////////////////////////////////////////////////////////////////////// |
| 122 |
// setData() |
| 123 |
// --------- |
| 124 |
// Set data at index |
| 125 |
|
| 126 |
bool StyleModelcxx . . $ StyleModel#::setDatacxx . . $ StyleModel#setData(6d1d8401440d0a2c).(const QModelIndexcxx . . $ QModelIndex# &index, |
| 127 |
const QVariantcxx . . $ QVariant# &value, int role) |
| 128 |
{ |
| 129 |
static bool deleting = false; |
| 130 |
|
| 131 |
Stylecxx . . $ Style# stylecxx . . $ Style#Style(49f6e7a06ebc5aa8).; |
| 132 |
QStringcxx . . $ QString# namecxx . . $ QString#QString(ced63f7c635d850d).; |
| 133 |
int row = index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 134 |
int column = index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).(); |
| 135 |
|
| 136 |
if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return false; |
| 137 |
if (role != Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) return false; |
| 138 |
if ((row >= list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) |
| 139 |
&& (column != NAMEcxx . . $ StyleModel#NAME.)) return false; |
| 140 |
|
| 141 |
// grab existing style |
| 142 |
if (row < list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) style =cxx . . $ Style#`operator=`(73c14b8dd1039aa8). list_cxx . . $ StyleModel#list_.->valuecxx . . $ QList#value(b4be2ec6940d8d62).(row); |
| 143 |
|
| 144 |
switch (column) { |
| 145 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 146 |
// editing name as several special cases |
| 147 |
name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 148 |
|
| 149 |
// deleting name deletes style |
| 150 |
if (name.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 151 |
if (row >= list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) return false; // empty |
| 152 |
|
| 153 |
// TODO: for some reason this gets entered recursively... |
| 154 |
if (deleting) return false; |
| 155 |
deleting = true; |
| 156 |
|
| 157 |
// remove style |
| 158 |
beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(index.parentcxx . . $ QModelIndex#parent(a394cbc57608ce34).(), row, row); |
| 159 |
|
| 160 |
list_cxx . . $ StyleModel#list_.->removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(row); |
| 161 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ StyleModel#modified(49f6e7a06ebc5aa8).(); |
| 162 |
endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).(); |
| 163 |
|
| 164 |
deleting = false; |
| 165 |
return true; |
| 166 |
} |
| 167 |
|
| 168 |
// changed name |
| 169 |
style.setNamecxx . . $ Style#setName(3520e46b33348bf6).(name); |
| 170 |
break; |
| 171 |
|
| 172 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 173 |
style.oglow_cxx . . $ Style#oglow_. = value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).(); |
| 174 |
break; |
| 175 |
|
| 176 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 177 |
style.oghi_cxx . . $ Style#oghi_. = value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).(); |
| 178 |
break; |
| 179 |
|
| 180 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 181 |
style.fglow_cxx . . $ Style#fglow_. = value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).(); |
| 182 |
break; |
| 183 |
|
| 184 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 185 |
style.fghi_cxx . . $ Style#fghi_. = value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).(); |
| 186 |
break; |
| 187 |
|
| 188 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 189 |
style.ibulow_cxx . . $ Style#ibulow_. = value.toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).(); |
| 190 |
break; |
| 191 |
|
| 192 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 193 |
style.ibuhi_cxx . . $ Style#ibuhi_. = value.toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).(); |
| 194 |
break; |
| 195 |
|
| 196 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 197 |
style.srmlow_cxx . . $ Style#srmlow_. = value.toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).(); |
| 198 |
break; |
| 199 |
|
| 200 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 201 |
style.srmhi_cxx . . $ Style#srmhi_. = value.toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).(); |
| 202 |
break; |
| 203 |
|
| 204 |
default: |
| 205 |
return false; |
| 206 |
} |
| 207 |
|
| 208 |
list_cxx . . $ StyleModel#list_.->replacecxx . . $ QList#replace(20dcc09d4a3213bb).(row, style); |
| 209 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ StyleModel#modified(49f6e7a06ebc5aa8).(); |
| 210 |
|
| 211 |
// whole row may have changed |
| 212 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! dataChangedcxx . . $ QAbstractItemModel#dataChanged(ae8a85c811f0c28a).(index.siblingcxx . . $ QModelIndex#sibling(ed2c7c7bbed3ca7f).(row, NAMEcxx . . $ StyleModel#NAME.), |
| 213 |
index.siblingcxx . . $ QModelIndex#sibling(ed2c7c7bbed3ca7f).(row, SRMHIcxx . . $ StyleModel#SRMHI.)); |
| 214 |
|
| 215 |
return true; |
| 216 |
} |
| 217 |
|
| 218 |
////////////////////////////////////////////////////////////////////////////// |
| 219 |
// insertRows() |
| 220 |
// ------------ |
| 221 |
// Insert rows into table |
| 222 |
|
| 223 |
bool StyleModelcxx . . $ StyleModel#::insertRowscxx . . $ StyleModel#insertRows(c4e00837c4ba3150).(int row, int count, const QModelIndexcxx . . $ QModelIndex#&) |
| 224 |
{ |
| 225 |
if (count != 1) return false; // only insert one row at a time |
| 226 |
if ((row < 0) || (row >= list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).())) row = list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 227 |
|
| 228 |
Stylecxx . . $ Style# style = Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->stylecxx . . $ Data#style(d153d65730aa8714).(trcxx . . $ StyleModel#tr(75d9f1c324b4579d).("Generic")); |
| 229 |
|
| 230 |
beginInsertRowscxx . . $ QAbstractItemModel#beginInsertRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), row, row); |
| 231 |
list_cxx . . $ StyleModel#list_.->insertcxx . . $ QList#insert(20dcc09d4a3213bb).(row, style); |
| 232 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ StyleModel#modified(49f6e7a06ebc5aa8).(); |
| 233 |
endInsertRowscxx . . $ QAbstractItemModel#endInsertRows(49f6e7a06ebc5aa8).(); |
| 234 |
return true; |
| 235 |
} |
| 236 |
|
| 237 |
////////////////////////////////////////////////////////////////////////////// |
| 238 |
// removeRows() |
| 239 |
// ------------ |
| 240 |
// Remove rows from table |
| 241 |
|
| 242 |
bool StyleModelcxx . . $ StyleModel#::removeRowscxx . . $ StyleModel#removeRows(c4e00837c4ba3150).(int row, int count, const QModelIndexcxx . . $ QModelIndex#&) |
| 243 |
{ |
| 244 |
if (count != 1) return false; // only remove one row at a time |
| 245 |
if ((row < 0) || (row >= list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).())) return false; |
| 246 |
|
| 247 |
int status = QMessageBoxcxx . . $ QMessageBox#::questioncxx . . $ QMessageBox#question(a9e3742e6f7b4147).(QApplicationcxx . . $ QApplication#::activeWindowcxx . . $ QApplication#activeWindow(9b769eeb00a33a04).(), |
| 248 |
TITLEcxx . . $ Resource/TITLE. +cxx . . $ operator+(57364c1b23444736). trcxx . . $ StyleModel#tr(75d9f1c324b4579d).(" - Delete?"), |
| 249 |
trcxx . . $ StyleModel#tr(75d9f1c324b4579d).("Do you wish to remove this entry?"), |
| 250 |
QMessageBoxcxx . . $ QMessageBox#::Yescxx . . $ QMessageBox#Yes. |cxx . . $ `operator|`(67530149e923fc12). QMessageBoxcxx . . $ QMessageBox#::Cancelcxx . . $ QMessageBox#Cancel.); |
| 251 |
if (status == QMessageBoxcxx . . $ QMessageBox#::Cancelcxx . . $ QMessageBox#Cancel.) { |
| 252 |
return false; |
| 253 |
} |
| 254 |
|
| 255 |
beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), row, row); |
| 256 |
list_cxx . . $ StyleModel#list_.->removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(row); |
| 257 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ StyleModel#modified(49f6e7a06ebc5aa8).(); |
| 258 |
endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).(); |
| 259 |
return true; |
| 260 |
} |
| 261 |
|
| 262 |
////////////////////////////////////////////////////////////////////////////// |
| 263 |
// headerData() |
| 264 |
// ------------ |
| 265 |
// Return header information |
| 266 |
|
| 267 |
QVariantcxx . . $ QVariant# StyleModelcxx . . $ StyleModel#::headerDatacxx . . $ StyleModel#headerData(b8cfec0985494997).(int section, Qtcxx . . $ Qt/::Orientationcxx . . $ Qt/Orientation# orientation, |
| 268 |
int role) const |
| 269 |
{ |
| 270 |
if (orientation == Qtcxx . . $ Qt/::Horizontalcxx . . $ Qt/Horizontal. && role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) { |
| 271 |
switch (section) { |
| 272 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 273 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Style"); |
| 274 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 275 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Min. OG"); |
| 276 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 277 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Max. OG"); |
| 278 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 279 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Min. FG"); |
| 280 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 281 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Max. FG"); |
| 282 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 283 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Min. IBU"); |
| 284 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 285 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Max. IBU"); |
| 286 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 287 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Min. SRM"); |
| 288 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 289 |
return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Max. SRM"); |
| 290 |
default: |
| 291 |
return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 292 |
} |
| 293 |
} |
| 294 |
|
| 295 |
return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 296 |
} |
| 297 |
|
| 298 |
////////////////////////////////////////////////////////////////////////////// |
| 299 |
// flags() |
| 300 |
// ------ |
| 301 |
// Return flags at index |
| 302 |
|
| 303 |
Qtcxx . . $ Qt/::ItemFlagscxx . . $ Qt/ItemFlags# StyleModelcxx . . $ StyleModel#::flagscxx . . $ StyleModel#flags(36b38c1b3d3f7b45).(const QModelIndexcxx . . $ QModelIndex# &index) const |
| 304 |
{ |
| 305 |
if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::ItemIsEnabledcxx . . $ Qt/ItemIsEnabled.; |
| 306 |
|
| 307 |
return QAbstractTableModelcxx . . $ QAbstractTableModel#::flagscxx . . $ QAbstractTableModel#flags(36b38c1b3d3f7b45).(index) |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). Qtcxx . . $ Qt/::ItemIsEditablecxx . . $ Qt/ItemIsEditable.; |
| 308 |
} |
| 309 |
|
| 310 |
////////////////////////////////////////////////////////////////////////////// |
| 311 |
// rowCount() |
| 312 |
// ---------- |
| 313 |
// Return number of rows of data |
| 314 |
|
| 315 |
int StyleModelcxx . . $ StyleModel#::rowCountcxx . . $ StyleModel#rowCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const |
| 316 |
{ |
| 317 |
return list_cxx . . $ StyleModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 318 |
} |
| 319 |
|
| 320 |
////////////////////////////////////////////////////////////////////////////// |
| 321 |
// columnCount() |
| 322 |
// ------------- |
| 323 |
// Return number of columns of data |
| 324 |
|
| 325 |
int StyleModelcxx . . $ StyleModel#::columnCountcxx . . $ StyleModel#columnCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const |
| 326 |
{ |
| 327 |
return COUNTcxx . . $ StyleModel#COUNT.; |
| 328 |
} |
| 329 |
|
| 330 |
////////////////////////////////////////////////////////////////////////////// |
| 331 |
// sort() |
| 332 |
// ------ |
| 333 |
// Sort by column |
| 334 |
|
| 335 |
void StyleModelcxx . . $ StyleModel#::sortcxx . . $ StyleModel#sort(11168df8d4e8286d).(int column, Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder# order) |
| 336 |
{ |
| 337 |
QListcxx . . $ QList#<QPaircxx . . $ QPair#<QStringcxx . . $ QString#,Stylecxx . . $ Style#> > sortlistcxx . . $ QList#QList(ced63f7c635d850d).; |
| 338 |
|
| 339 |
foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(Style style, *list_) { |
| 340 |
QStringcxx . . $ QString# fieldcxx . . $ QString#QString(ced63f7c635d850d).; |
| 341 |
switch (column) { |
| 342 |
case NAMEcxx . . $ StyleModel#NAME.: |
| 343 |
field =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). style.namecxx . . $ Style#name(a2fb7a6ce195d51).(); |
| 344 |
break; |
| 345 |
case OGLOWcxx . . $ StyleModel#OGLOW.: |
| 346 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.oglow_cxx . . $ Style#oglow_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 347 |
break; |
| 348 |
case OGHIcxx . . $ StyleModel#OGHI.: |
| 349 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.oghi_cxx . . $ Style#oghi_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 350 |
break; |
| 351 |
case FGLOWcxx . . $ StyleModel#FGLOW.: |
| 352 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.fglow_cxx . . $ Style#fglow_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 353 |
break; |
| 354 |
case FGHIcxx . . $ StyleModel#FGHI.: |
| 355 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(style.fghi_cxx . . $ Style#fghi_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 356 |
break; |
| 357 |
case IBULOWcxx . . $ StyleModel#IBULOW.: |
| 358 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.ibulow_cxx . . $ Style#ibulow_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 359 |
break; |
| 360 |
case IBUHIcxx . . $ StyleModel#IBUHI.: |
| 361 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.ibuhi_cxx . . $ Style#ibuhi_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 362 |
break; |
| 363 |
case SRMLOWcxx . . $ StyleModel#SRMLOW.: |
| 364 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.srmlow_cxx . . $ Style#srmlow_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 365 |
break; |
| 366 |
case SRMHIcxx . . $ StyleModel#SRMHI.: |
| 367 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(style.srmhi_cxx . . $ Style#srmhi_.).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(6,'0'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 368 |
break; |
| 369 |
default: |
| 370 |
field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 371 |
break; |
| 372 |
} |
| 373 |
sortlist.appendcxx . . $ QList#append(77d9f17553126ecb).(QPaircxx . . $ QPair#QPair(ce1e23113bcdb2b4).<QStringcxx . . $ QString#,Stylecxx . . $ Style#>(field, style)); |
| 374 |
} |
| 375 |
|
| 376 |
// sort list |
| 377 |
qSortcxx . . $ qSort(249673c20e2b8d5).(sortlist.begincxx . . $ QList#begin(ca2520f641887418).(), sortlist.endcxx . . $ QList#end(ca2520f641887418).()); |
| 378 |
|
| 379 |
// create new list |
| 380 |
list_cxx . . $ StyleModel#list_.->clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 381 |
QPaircxx . . $ QPair#<QStringcxx . . $ QString#,Stylecxx . . $ Style#> paircxx . . $ QPair#QPair(7d94e3e767b7b77f).; |
| 382 |
foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(pair, sortlist) { |
| 383 |
if (order == Qtcxx . . $ Qt/::AscendingOrdercxx . . $ Qt/AscendingOrder.) |
| 384 |
list_cxx . . $ StyleModel#list_.->appendcxx . . $ QList#append(77d9f17553126ecb).(pair.secondcxx . . $ QPair#second.); |
| 385 |
else |
| 386 |
list_cxx . . $ StyleModel#list_.->prependcxx . . $ QList#prepend(77d9f17553126ecb).(pair.secondcxx . . $ QPair#second.); |
| 387 |
} |
| 388 |
|
| 389 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! layoutChangedcxx . . $ QAbstractItemModel#layoutChanged(17ff3201f1a6fa68).(); |
| 390 |
} |