| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformdialoghelper.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | static const int buttonRoleLayouts[2][5][14] = | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | - | |||||||||||||
| 9 | { | - | ||||||||||||
| 10 | - | |||||||||||||
| 11 | { QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::YesRole, QPlatformDialogHelper::AcceptRole, | - | ||||||||||||
| 12 | QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::NoRole, | - | ||||||||||||
| 13 | QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::ApplyRole, | - | ||||||||||||
| 14 | QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, | - | ||||||||||||
| 18 | QPlatformDialogHelper::Stretch, QPlatformDialogHelper::DestructiveRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 19 | QPlatformDialogHelper::AlternateRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::RejectRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 20 | QPlatformDialogHelper::AcceptRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::NoRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 21 | QPlatformDialogHelper::YesRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 22 | - | |||||||||||||
| 23 | - | |||||||||||||
| 24 | { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::YesRole, | - | ||||||||||||
| 25 | QPlatformDialogHelper::NoRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole, | - | ||||||||||||
| 26 | QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ActionRole, | - | ||||||||||||
| 30 | QPlatformDialogHelper::ApplyRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::DestructiveRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 31 | QPlatformDialogHelper::AlternateRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::RejectRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 32 | QPlatformDialogHelper::AcceptRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::NoRole | QPlatformDialogHelper::Reverse, | - | ||||||||||||
| 33 | QPlatformDialogHelper::YesRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 34 | - | |||||||||||||
| 35 | - | |||||||||||||
| 36 | { QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::Stretch, | - | ||||||||||||
| 37 | QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, | - | ||||||||||||
| 38 | QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL } | - | ||||||||||||
| 39 | }, | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | - | |||||||||||||
| 42 | { | - | ||||||||||||
| 43 | - | |||||||||||||
| 44 | { QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::YesRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole, | - | ||||||||||||
| 45 | QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ResetRole, | - | ||||||||||||
| 46 | QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 47 | - | |||||||||||||
| 48 | - | |||||||||||||
| 49 | { QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::RejectRole, | - | ||||||||||||
| 50 | QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole, | - | ||||||||||||
| 51 | QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | - | |||||||||||||
| 54 | { QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, | - | ||||||||||||
| 55 | QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ResetRole, | - | ||||||||||||
| 56 | QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 57 | - | |||||||||||||
| 58 | - | |||||||||||||
| 59 | { QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::RejectRole, | - | ||||||||||||
| 60 | QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::Stretch, | - | ||||||||||||
| 61 | QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }, | - | ||||||||||||
| 62 | - | |||||||||||||
| 63 | - | |||||||||||||
| 64 | { QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch, | - | ||||||||||||
| 65 | QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, | - | ||||||||||||
| 66 | QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL } | - | ||||||||||||
| 67 | } | - | ||||||||||||
| 68 | }; | - | ||||||||||||
| 69 | - | |||||||||||||
| 70 | QPlatformDialogHelper::QPlatformDialogHelper() | - | ||||||||||||
| 71 | { | - | ||||||||||||
| 72 | qRegisterMetaType<StandardButton>(); | - | ||||||||||||
| 73 | qRegisterMetaType<ButtonRole>(); | - | ||||||||||||
| 74 | } never executed: end of block | 0 | ||||||||||||
| 75 | - | |||||||||||||
| 76 | QPlatformDialogHelper::~QPlatformDialogHelper() | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | } | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | QVariant QPlatformDialogHelper::styleHint(StyleHint hint) const | - | ||||||||||||
| 81 | { | - | ||||||||||||
| 82 | return never executed: QPlatformDialogHelper::defaultStyleHint(hint);return QPlatformDialogHelper::defaultStyleHint(hint);never executed: return QPlatformDialogHelper::defaultStyleHint(hint); | 0 | ||||||||||||
| 83 | } | - | ||||||||||||
| 84 | - | |||||||||||||
| 85 | QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHint hint) | - | ||||||||||||
| 86 | { | - | ||||||||||||
| 87 | (void)hint;; | - | ||||||||||||
| 88 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||
| 89 | } | - | ||||||||||||
| 90 | - | |||||||||||||
| 91 | - | |||||||||||||
| 92 | - | |||||||||||||
| 93 | class QFontDialogOptionsPrivate : public QSharedData | - | ||||||||||||
| 94 | { | - | ||||||||||||
| 95 | public: | - | ||||||||||||
| 96 | QFontDialogOptionsPrivate() : options(0) {} never executed: end of block | 0 | ||||||||||||
| 97 | - | |||||||||||||
| 98 | QFontDialogOptions::FontDialogOptions options; | - | ||||||||||||
| 99 | QString windowTitle; | - | ||||||||||||
| 100 | }; | - | ||||||||||||
| 101 | - | |||||||||||||
| 102 | QFontDialogOptions::QFontDialogOptions() : d(new QFontDialogOptionsPrivate) | - | ||||||||||||
| 103 | { | - | ||||||||||||
| 104 | } never executed: end of block | 0 | ||||||||||||
| 105 | - | |||||||||||||
| 106 | QFontDialogOptions::QFontDialogOptions(const QFontDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||
| 107 | { | - | ||||||||||||
| 108 | } never executed: end of block | 0 | ||||||||||||
| 109 | - | |||||||||||||
| 110 | QFontDialogOptions &QFontDialogOptions::operator=(const QFontDialogOptions &rhs) | - | ||||||||||||
| 111 | { | - | ||||||||||||
| 112 | if (this != &rhs
| 0 | ||||||||||||
| 113 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||
| 114 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 115 | } | - | ||||||||||||
| 116 | - | |||||||||||||
| 117 | QFontDialogOptions::~QFontDialogOptions() | - | ||||||||||||
| 118 | { | - | ||||||||||||
| 119 | } | - | ||||||||||||
| 120 | - | |||||||||||||
| 121 | QString QFontDialogOptions::windowTitle() const | - | ||||||||||||
| 122 | { | - | ||||||||||||
| 123 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||
| 124 | } | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | void QFontDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||
| 127 | { | - | ||||||||||||
| 128 | d->windowTitle = title; | - | ||||||||||||
| 129 | } never executed: end of block | 0 | ||||||||||||
| 130 | - | |||||||||||||
| 131 | void QFontDialogOptions::setOption(QFontDialogOptions::FontDialogOption option, bool on) | - | ||||||||||||
| 132 | { | - | ||||||||||||
| 133 | if (!(d->options & option) != !on
| 0 | ||||||||||||
| 134 | setOptions(d->options ^ option); never executed: setOptions(d->options ^ option); | 0 | ||||||||||||
| 135 | } never executed: end of block | 0 | ||||||||||||
| 136 | - | |||||||||||||
| 137 | bool QFontDialogOptions::testOption(QFontDialogOptions::FontDialogOption option) const | - | ||||||||||||
| 138 | { | - | ||||||||||||
| 139 | return never executed: d->options & option;return d->options & option;never executed: return d->options & option; | 0 | ||||||||||||
| 140 | } | - | ||||||||||||
| 141 | - | |||||||||||||
| 142 | void QFontDialogOptions::setOptions(FontDialogOptions options) | - | ||||||||||||
| 143 | { | - | ||||||||||||
| 144 | if (options != d->options
| 0 | ||||||||||||
| 145 | d->options = options; never executed: d->options = options; | 0 | ||||||||||||
| 146 | } never executed: end of block | 0 | ||||||||||||
| 147 | - | |||||||||||||
| 148 | QFontDialogOptions::FontDialogOptions QFontDialogOptions::options() const | - | ||||||||||||
| 149 | { | - | ||||||||||||
| 150 | return never executed: d->options;return d->options;never executed: return d->options; | 0 | ||||||||||||
| 151 | } | - | ||||||||||||
| 152 | const QSharedPointer<QFontDialogOptions> &QPlatformFontDialogHelper::options() const | - | ||||||||||||
| 153 | { | - | ||||||||||||
| 154 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||
| 155 | } | - | ||||||||||||
| 156 | - | |||||||||||||
| 157 | void QPlatformFontDialogHelper::setOptions(const QSharedPointer<QFontDialogOptions> &options) | - | ||||||||||||
| 158 | { | - | ||||||||||||
| 159 | m_options = options; | - | ||||||||||||
| 160 | } never executed: end of block | 0 | ||||||||||||
| 161 | - | |||||||||||||
| 162 | - | |||||||||||||
| 163 | - | |||||||||||||
| 164 | class QColorDialogStaticData | - | ||||||||||||
| 165 | { | - | ||||||||||||
| 166 | public: | - | ||||||||||||
| 167 | enum { CustomColorCount = 16, StandardColorCount = 6 * 8 }; | - | ||||||||||||
| 168 | - | |||||||||||||
| 169 | QColorDialogStaticData(); | - | ||||||||||||
| 170 | inline void readSettings(); | - | ||||||||||||
| 171 | inline void writeSettings() const; | - | ||||||||||||
| 172 | - | |||||||||||||
| 173 | QRgb customRgb[CustomColorCount]; | - | ||||||||||||
| 174 | QRgb standardRgb[StandardColorCount]; | - | ||||||||||||
| 175 | bool customSet; | - | ||||||||||||
| 176 | }; | - | ||||||||||||
| 177 | - | |||||||||||||
| 178 | QColorDialogStaticData::QColorDialogStaticData() : customSet(false) | - | ||||||||||||
| 179 | { | - | ||||||||||||
| 180 | int i = 0; | - | ||||||||||||
| 181 | for (int g = 0; g < 4
| 0 | ||||||||||||
| 182 | for (int r = 0; r < 4
| 0 | ||||||||||||
| 183 | for (int b = 0; b < 3
| 0 | ||||||||||||
| 184 | standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2); never executed: standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2); | 0 | ||||||||||||
| 185 | std::fill(customRgb, customRgb + CustomColorCount, 0xffffffff); | - | ||||||||||||
| 186 | readSettings(); | - | ||||||||||||
| 187 | } never executed: end of block | 0 | ||||||||||||
| 188 | - | |||||||||||||
| 189 | void QColorDialogStaticData::readSettings() | - | ||||||||||||
| 190 | { | - | ||||||||||||
| 191 | - | |||||||||||||
| 192 | const QSettings settings(QSettings::UserScope, ([]() -> QString { enum { Size = sizeof(u"" "QtProject")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "QtProject" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp; | 0 | ||||||||||||
| 193 | for (int i = 0; i < int(CustomColorCount)
| 0 | ||||||||||||
| 194 | const QVariant v = settings.value(QLatin1String("Qt/customColors/") + QString::number(i)); | - | ||||||||||||
| 195 | if (v.isValid()
| 0 | ||||||||||||
| 196 | customRgb[i] = v.toUInt(); never executed: customRgb[i] = v.toUInt(); | 0 | ||||||||||||
| 197 | } never executed: end of block | 0 | ||||||||||||
| 198 | - | |||||||||||||
| 199 | } never executed: end of block | 0 | ||||||||||||
| 200 | - | |||||||||||||
| 201 | void QColorDialogStaticData::writeSettings() const | - | ||||||||||||
| 202 | { | - | ||||||||||||
| 203 | - | |||||||||||||
| 204 | if (!customSet
| 0 | ||||||||||||
| 205 | QSettings settings(QSettings::UserScope, ([]() -> QString { enum { Size = sizeof(u"" "QtProject")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "QtProject" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp; | 0 | ||||||||||||
| 206 | for (int i = 0; i < int(CustomColorCount)
| 0 | ||||||||||||
| 207 | settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]); never executed: settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]); | 0 | ||||||||||||
| 208 | } never executed: end of block | 0 | ||||||||||||
| 209 | - | |||||||||||||
| 210 | } never executed: end of block | 0 | ||||||||||||
| 211 | - | |||||||||||||
| 212 | namespace { namespace Q_QGS_qColorDialogStaticData { typedef QColorDialogStaticData Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<QColorDialogStaticData, Q_QGS_qColorDialogStaticData::innerFunction, Q_QGS_qColorDialogStaticData::guard> qColorDialogStaticData;return &holder.value; | 0 | ||||||||||||
| 213 | - | |||||||||||||
| 214 | class QColorDialogOptionsPrivate : public QSharedData | - | ||||||||||||
| 215 | { | - | ||||||||||||
| 216 | public: | - | ||||||||||||
| 217 | QColorDialogOptionsPrivate() : options(0) {} never executed: end of block | 0 | ||||||||||||
| 218 | - | |||||||||||||
| 219 | ~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); } never executed: end of block | 0 | ||||||||||||
| 220 | - | |||||||||||||
| 221 | QColorDialogOptions::ColorDialogOptions options; | - | ||||||||||||
| 222 | QString windowTitle; | - | ||||||||||||
| 223 | }; | - | ||||||||||||
| 224 | - | |||||||||||||
| 225 | QColorDialogOptions::QColorDialogOptions() : d(new QColorDialogOptionsPrivate) | - | ||||||||||||
| 226 | { | - | ||||||||||||
| 227 | } never executed: end of block | 0 | ||||||||||||
| 228 | - | |||||||||||||
| 229 | QColorDialogOptions::QColorDialogOptions(const QColorDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||
| 230 | { | - | ||||||||||||
| 231 | } never executed: end of block | 0 | ||||||||||||
| 232 | - | |||||||||||||
| 233 | QColorDialogOptions &QColorDialogOptions::operator=(const QColorDialogOptions &rhs) | - | ||||||||||||
| 234 | { | - | ||||||||||||
| 235 | if (this != &rhs
| 0 | ||||||||||||
| 236 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||
| 237 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 238 | } | - | ||||||||||||
| 239 | - | |||||||||||||
| 240 | QColorDialogOptions::~QColorDialogOptions() | - | ||||||||||||
| 241 | { | - | ||||||||||||
| 242 | } | - | ||||||||||||
| 243 | - | |||||||||||||
| 244 | QString QColorDialogOptions::windowTitle() const | - | ||||||||||||
| 245 | { | - | ||||||||||||
| 246 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||
| 247 | } | - | ||||||||||||
| 248 | - | |||||||||||||
| 249 | void QColorDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||
| 250 | { | - | ||||||||||||
| 251 | d->windowTitle = title; | - | ||||||||||||
| 252 | } never executed: end of block | 0 | ||||||||||||
| 253 | - | |||||||||||||
| 254 | void QColorDialogOptions::setOption(QColorDialogOptions::ColorDialogOption option, bool on) | - | ||||||||||||
| 255 | { | - | ||||||||||||
| 256 | if (!(d->options & option) != !on
| 0 | ||||||||||||
| 257 | setOptions(d->options ^ option); never executed: setOptions(d->options ^ option); | 0 | ||||||||||||
| 258 | } never executed: end of block | 0 | ||||||||||||
| 259 | - | |||||||||||||
| 260 | bool QColorDialogOptions::testOption(QColorDialogOptions::ColorDialogOption option) const | - | ||||||||||||
| 261 | { | - | ||||||||||||
| 262 | return never executed: d->options & option;return d->options & option;never executed: return d->options & option; | 0 | ||||||||||||
| 263 | } | - | ||||||||||||
| 264 | - | |||||||||||||
| 265 | void QColorDialogOptions::setOptions(ColorDialogOptions options) | - | ||||||||||||
| 266 | { | - | ||||||||||||
| 267 | if (options != d->options
| 0 | ||||||||||||
| 268 | d->options = options; never executed: d->options = options; | 0 | ||||||||||||
| 269 | } never executed: end of block | 0 | ||||||||||||
| 270 | - | |||||||||||||
| 271 | QColorDialogOptions::ColorDialogOptions QColorDialogOptions::options() const | - | ||||||||||||
| 272 | { | - | ||||||||||||
| 273 | return never executed: d->options;return d->options;never executed: return d->options; | 0 | ||||||||||||
| 274 | } | - | ||||||||||||
| 275 | - | |||||||||||||
| 276 | int QColorDialogOptions::customColorCount() | - | ||||||||||||
| 277 | { | - | ||||||||||||
| 278 | return never executed: QColorDialogStaticData::CustomColorCount;return QColorDialogStaticData::CustomColorCount;never executed: return QColorDialogStaticData::CustomColorCount; | 0 | ||||||||||||
| 279 | } | - | ||||||||||||
| 280 | - | |||||||||||||
| 281 | QRgb QColorDialogOptions::customColor(int index) | - | ||||||||||||
| 282 | { | - | ||||||||||||
| 283 | if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
| 0 | ||||||||||||
| 284 | return never executed: qRgb(255, 255, 255);return qRgb(255, 255, 255);never executed: return qRgb(255, 255, 255); | 0 | ||||||||||||
| 285 | return never executed: qColorDialogStaticData()->customRgb[index];return qColorDialogStaticData()->customRgb[index];never executed: return qColorDialogStaticData()->customRgb[index]; | 0 | ||||||||||||
| 286 | } | - | ||||||||||||
| 287 | - | |||||||||||||
| 288 | QRgb *QColorDialogOptions::customColors() | - | ||||||||||||
| 289 | { | - | ||||||||||||
| 290 | return never executed: qColorDialogStaticData()->customRgb;return qColorDialogStaticData()->customRgb;never executed: return qColorDialogStaticData()->customRgb; | 0 | ||||||||||||
| 291 | } | - | ||||||||||||
| 292 | - | |||||||||||||
| 293 | void QColorDialogOptions::setCustomColor(int index, QRgb color) | - | ||||||||||||
| 294 | { | - | ||||||||||||
| 295 | if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount)
| 0 | ||||||||||||
| 296 | return; never executed: return; | 0 | ||||||||||||
| 297 | qColorDialogStaticData()->customSet = true; | - | ||||||||||||
| 298 | qColorDialogStaticData()->customRgb[index] = color; | - | ||||||||||||
| 299 | } never executed: end of block | 0 | ||||||||||||
| 300 | - | |||||||||||||
| 301 | QRgb *QColorDialogOptions::standardColors() | - | ||||||||||||
| 302 | { | - | ||||||||||||
| 303 | return never executed: qColorDialogStaticData()->standardRgb;return qColorDialogStaticData()->standardRgb;never executed: return qColorDialogStaticData()->standardRgb; | 0 | ||||||||||||
| 304 | } | - | ||||||||||||
| 305 | - | |||||||||||||
| 306 | QRgb QColorDialogOptions::standardColor(int index) | - | ||||||||||||
| 307 | { | - | ||||||||||||
| 308 | if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
| 0 | ||||||||||||
| 309 | return never executed: qRgb(255, 255, 255);return qRgb(255, 255, 255);never executed: return qRgb(255, 255, 255); | 0 | ||||||||||||
| 310 | return never executed: qColorDialogStaticData()->standardRgb[index];return qColorDialogStaticData()->standardRgb[index];never executed: return qColorDialogStaticData()->standardRgb[index]; | 0 | ||||||||||||
| 311 | } | - | ||||||||||||
| 312 | - | |||||||||||||
| 313 | void QColorDialogOptions::setStandardColor(int index, QRgb color) | - | ||||||||||||
| 314 | { | - | ||||||||||||
| 315 | if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount)
| 0 | ||||||||||||
| 316 | return; never executed: return; | 0 | ||||||||||||
| 317 | qColorDialogStaticData()->standardRgb[index] = color; | - | ||||||||||||
| 318 | } never executed: end of block | 0 | ||||||||||||
| 319 | const QSharedPointer<QColorDialogOptions> &QPlatformColorDialogHelper::options() const | - | ||||||||||||
| 320 | { | - | ||||||||||||
| 321 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||
| 322 | } | - | ||||||||||||
| 323 | - | |||||||||||||
| 324 | void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOptions> &options) | - | ||||||||||||
| 325 | { | - | ||||||||||||
| 326 | m_options = options; | - | ||||||||||||
| 327 | } never executed: end of block | 0 | ||||||||||||
| 328 | - | |||||||||||||
| 329 | - | |||||||||||||
| 330 | - | |||||||||||||
| 331 | class QFileDialogOptionsPrivate : public QSharedData | - | ||||||||||||
| 332 | { | - | ||||||||||||
| 333 | public: | - | ||||||||||||
| 334 | QFileDialogOptionsPrivate() : options(0), | - | ||||||||||||
| 335 | viewMode(QFileDialogOptions::Detail), | - | ||||||||||||
| 336 | fileMode(QFileDialogOptions::AnyFile), | - | ||||||||||||
| 337 | acceptMode(QFileDialogOptions::AcceptOpen), | - | ||||||||||||
| 338 | filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs), | - | ||||||||||||
| 339 | useDefaultNameFilters(true) | - | ||||||||||||
| 340 | {} never executed: end of block | 0 | ||||||||||||
| 341 | - | |||||||||||||
| 342 | QFileDialogOptions::FileDialogOptions options; | - | ||||||||||||
| 343 | QString windowTitle; | - | ||||||||||||
| 344 | - | |||||||||||||
| 345 | QFileDialogOptions::ViewMode viewMode; | - | ||||||||||||
| 346 | QFileDialogOptions::FileMode fileMode; | - | ||||||||||||
| 347 | QFileDialogOptions::AcceptMode acceptMode; | - | ||||||||||||
| 348 | QString labels[QFileDialogOptions::DialogLabelCount]; | - | ||||||||||||
| 349 | QDir::Filters filters; | - | ||||||||||||
| 350 | QList<QUrl> sidebarUrls; | - | ||||||||||||
| 351 | bool useDefaultNameFilters; | - | ||||||||||||
| 352 | QStringList nameFilters; | - | ||||||||||||
| 353 | QStringList mimeTypeFilters; | - | ||||||||||||
| 354 | QString defaultSuffix; | - | ||||||||||||
| 355 | QStringList history; | - | ||||||||||||
| 356 | QUrl initialDirectory; | - | ||||||||||||
| 357 | QString initiallySelectedNameFilter; | - | ||||||||||||
| 358 | QList<QUrl> initiallySelectedFiles; | - | ||||||||||||
| 359 | QStringList supportedSchemes; | - | ||||||||||||
| 360 | }; | - | ||||||||||||
| 361 | - | |||||||||||||
| 362 | QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate) | - | ||||||||||||
| 363 | { | - | ||||||||||||
| 364 | } never executed: end of block | 0 | ||||||||||||
| 365 | - | |||||||||||||
| 366 | QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||
| 367 | { | - | ||||||||||||
| 368 | } never executed: end of block | 0 | ||||||||||||
| 369 | - | |||||||||||||
| 370 | QFileDialogOptions &QFileDialogOptions::operator=(const QFileDialogOptions &rhs) | - | ||||||||||||
| 371 | { | - | ||||||||||||
| 372 | if (this != &rhs
| 0 | ||||||||||||
| 373 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||
| 374 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 375 | } | - | ||||||||||||
| 376 | - | |||||||||||||
| 377 | QFileDialogOptions::~QFileDialogOptions() | - | ||||||||||||
| 378 | { | - | ||||||||||||
| 379 | } | - | ||||||||||||
| 380 | - | |||||||||||||
| 381 | QString QFileDialogOptions::windowTitle() const | - | ||||||||||||
| 382 | { | - | ||||||||||||
| 383 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||
| 384 | } | - | ||||||||||||
| 385 | - | |||||||||||||
| 386 | void QFileDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||
| 387 | { | - | ||||||||||||
| 388 | d->windowTitle = title; | - | ||||||||||||
| 389 | } never executed: end of block | 0 | ||||||||||||
| 390 | - | |||||||||||||
| 391 | void QFileDialogOptions::setOption(QFileDialogOptions::FileDialogOption option, bool on) | - | ||||||||||||
| 392 | { | - | ||||||||||||
| 393 | if (!(d->options & option) != !on
| 0 | ||||||||||||
| 394 | setOptions(d->options ^ option); never executed: setOptions(d->options ^ option); | 0 | ||||||||||||
| 395 | } never executed: end of block | 0 | ||||||||||||
| 396 | - | |||||||||||||
| 397 | bool QFileDialogOptions::testOption(QFileDialogOptions::FileDialogOption option) const | - | ||||||||||||
| 398 | { | - | ||||||||||||
| 399 | return never executed: d->options & option;return d->options & option;never executed: return d->options & option; | 0 | ||||||||||||
| 400 | } | - | ||||||||||||
| 401 | - | |||||||||||||
| 402 | void QFileDialogOptions::setOptions(FileDialogOptions options) | - | ||||||||||||
| 403 | { | - | ||||||||||||
| 404 | if (options != d->options
| 0 | ||||||||||||
| 405 | d->options = options; never executed: d->options = options; | 0 | ||||||||||||
| 406 | } never executed: end of block | 0 | ||||||||||||
| 407 | - | |||||||||||||
| 408 | QFileDialogOptions::FileDialogOptions QFileDialogOptions::options() const | - | ||||||||||||
| 409 | { | - | ||||||||||||
| 410 | return never executed: d->options;return d->options;never executed: return d->options; | 0 | ||||||||||||
| 411 | } | - | ||||||||||||
| 412 | - | |||||||||||||
| 413 | QDir::Filters QFileDialogOptions::filter() const | - | ||||||||||||
| 414 | { | - | ||||||||||||
| 415 | return never executed: d->filters;return d->filters;never executed: return d->filters; | 0 | ||||||||||||
| 416 | } | - | ||||||||||||
| 417 | - | |||||||||||||
| 418 | void QFileDialogOptions::setFilter(QDir::Filters filters) | - | ||||||||||||
| 419 | { | - | ||||||||||||
| 420 | d->filters = filters; | - | ||||||||||||
| 421 | } never executed: end of block | 0 | ||||||||||||
| 422 | - | |||||||||||||
| 423 | void QFileDialogOptions::setViewMode(QFileDialogOptions::ViewMode mode) | - | ||||||||||||
| 424 | { | - | ||||||||||||
| 425 | d->viewMode = mode; | - | ||||||||||||
| 426 | } never executed: end of block | 0 | ||||||||||||
| 427 | - | |||||||||||||
| 428 | QFileDialogOptions::ViewMode QFileDialogOptions::viewMode() const | - | ||||||||||||
| 429 | { | - | ||||||||||||
| 430 | return never executed: d->viewMode;return d->viewMode;never executed: return d->viewMode; | 0 | ||||||||||||
| 431 | } | - | ||||||||||||
| 432 | - | |||||||||||||
| 433 | void QFileDialogOptions::setFileMode(QFileDialogOptions::FileMode mode) | - | ||||||||||||
| 434 | { | - | ||||||||||||
| 435 | d->fileMode = mode; | - | ||||||||||||
| 436 | } never executed: end of block | 0 | ||||||||||||
| 437 | - | |||||||||||||
| 438 | QFileDialogOptions::FileMode QFileDialogOptions::fileMode() const | - | ||||||||||||
| 439 | { | - | ||||||||||||
| 440 | return never executed: d->fileMode;return d->fileMode;never executed: return d->fileMode; | 0 | ||||||||||||
| 441 | } | - | ||||||||||||
| 442 | - | |||||||||||||
| 443 | void QFileDialogOptions::setAcceptMode(QFileDialogOptions::AcceptMode mode) | - | ||||||||||||
| 444 | { | - | ||||||||||||
| 445 | d->acceptMode = mode; | - | ||||||||||||
| 446 | } never executed: end of block | 0 | ||||||||||||
| 447 | - | |||||||||||||
| 448 | QFileDialogOptions::AcceptMode QFileDialogOptions::acceptMode() const | - | ||||||||||||
| 449 | { | - | ||||||||||||
| 450 | return never executed: d->acceptMode;return d->acceptMode;never executed: return d->acceptMode; | 0 | ||||||||||||
| 451 | } | - | ||||||||||||
| 452 | - | |||||||||||||
| 453 | void QFileDialogOptions::setSidebarUrls(const QList<QUrl> &urls) | - | ||||||||||||
| 454 | { | - | ||||||||||||
| 455 | d->sidebarUrls = urls; | - | ||||||||||||
| 456 | } never executed: end of block | 0 | ||||||||||||
| 457 | - | |||||||||||||
| 458 | QList<QUrl> QFileDialogOptions::sidebarUrls() const | - | ||||||||||||
| 459 | { | - | ||||||||||||
| 460 | return never executed: d->sidebarUrls;return d->sidebarUrls;never executed: return d->sidebarUrls; | 0 | ||||||||||||
| 461 | } | - | ||||||||||||
| 462 | bool QFileDialogOptions::useDefaultNameFilters() const | - | ||||||||||||
| 463 | { | - | ||||||||||||
| 464 | return never executed: d->useDefaultNameFilters;return d->useDefaultNameFilters;never executed: return d->useDefaultNameFilters; | 0 | ||||||||||||
| 465 | } | - | ||||||||||||
| 466 | - | |||||||||||||
| 467 | void QFileDialogOptions::setUseDefaultNameFilters(bool dnf) | - | ||||||||||||
| 468 | { | - | ||||||||||||
| 469 | d->useDefaultNameFilters = dnf; | - | ||||||||||||
| 470 | } never executed: end of block | 0 | ||||||||||||
| 471 | - | |||||||||||||
| 472 | void QFileDialogOptions::setNameFilters(const QStringList &filters) | - | ||||||||||||
| 473 | { | - | ||||||||||||
| 474 | d->useDefaultNameFilters = filters.size() == 1
| 0 | ||||||||||||
| 475 | && filters.first() == QFileDialogOptions::defaultNameFilterString()
| 0 | ||||||||||||
| 476 | d->nameFilters = filters; | - | ||||||||||||
| 477 | } never executed: end of block | 0 | ||||||||||||
| 478 | - | |||||||||||||
| 479 | QStringList QFileDialogOptions::nameFilters() const | - | ||||||||||||
| 480 | { | - | ||||||||||||
| 481 | return never executed: d->useDefaultNameFilters ?return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters;never executed: return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters; | 0 | ||||||||||||
| 482 | QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters; never executed: return d->useDefaultNameFilters ? QStringList(QFileDialogOptions::defaultNameFilterString()) : d->nameFilters; | 0 | ||||||||||||
| 483 | } | - | ||||||||||||
| 484 | QString QFileDialogOptions::defaultNameFilterString() | - | ||||||||||||
| 485 | { | - | ||||||||||||
| 486 | return never executed: QCoreApplication::translate("QFileDialog", "All Files (*)");return QCoreApplication::translate("QFileDialog", "All Files (*)");never executed: return QCoreApplication::translate("QFileDialog", "All Files (*)"); | 0 | ||||||||||||
| 487 | } | - | ||||||||||||
| 488 | - | |||||||||||||
| 489 | void QFileDialogOptions::setMimeTypeFilters(const QStringList &filters) | - | ||||||||||||
| 490 | { | - | ||||||||||||
| 491 | d->mimeTypeFilters = filters; | - | ||||||||||||
| 492 | } never executed: end of block | 0 | ||||||||||||
| 493 | - | |||||||||||||
| 494 | QStringList QFileDialogOptions::mimeTypeFilters() const | - | ||||||||||||
| 495 | { | - | ||||||||||||
| 496 | return never executed: d->mimeTypeFilters;return d->mimeTypeFilters;never executed: return d->mimeTypeFilters; | 0 | ||||||||||||
| 497 | } | - | ||||||||||||
| 498 | - | |||||||||||||
| 499 | void QFileDialogOptions::setDefaultSuffix(const QString &suffix) | - | ||||||||||||
| 500 | { | - | ||||||||||||
| 501 | d->defaultSuffix = suffix; | - | ||||||||||||
| 502 | if (d->defaultSuffix.size() > 1
| 0 | ||||||||||||
| 503 | d->defaultSuffix.remove(0, 1); never executed: d->defaultSuffix.remove(0, 1); | 0 | ||||||||||||
| 504 | } never executed: end of block | 0 | ||||||||||||
| 505 | - | |||||||||||||
| 506 | QString QFileDialogOptions::defaultSuffix() const | - | ||||||||||||
| 507 | { | - | ||||||||||||
| 508 | return never executed: d->defaultSuffix;return d->defaultSuffix;never executed: return d->defaultSuffix; | 0 | ||||||||||||
| 509 | } | - | ||||||||||||
| 510 | - | |||||||||||||
| 511 | void QFileDialogOptions::setHistory(const QStringList &paths) | - | ||||||||||||
| 512 | { | - | ||||||||||||
| 513 | d->history = paths; | - | ||||||||||||
| 514 | } never executed: end of block | 0 | ||||||||||||
| 515 | - | |||||||||||||
| 516 | QStringList QFileDialogOptions::history() const | - | ||||||||||||
| 517 | { | - | ||||||||||||
| 518 | return never executed: d->history;return d->history;never executed: return d->history; | 0 | ||||||||||||
| 519 | } | - | ||||||||||||
| 520 | - | |||||||||||||
| 521 | void QFileDialogOptions::setLabelText(QFileDialogOptions::DialogLabel label, const QString &text) | - | ||||||||||||
| 522 | { | - | ||||||||||||
| 523 | if (label >= 0
| 0 | ||||||||||||
| 524 | d->labels[label] = text; never executed: d->labels[label] = text; | 0 | ||||||||||||
| 525 | } never executed: end of block | 0 | ||||||||||||
| 526 | - | |||||||||||||
| 527 | QString QFileDialogOptions::labelText(QFileDialogOptions::DialogLabel label) const | - | ||||||||||||
| 528 | { | - | ||||||||||||
| 529 | return never executed: (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();never executed: return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString(); | 0 | ||||||||||||
| 530 | } | - | ||||||||||||
| 531 | - | |||||||||||||
| 532 | bool QFileDialogOptions::isLabelExplicitlySet(DialogLabel label) | - | ||||||||||||
| 533 | { | - | ||||||||||||
| 534 | return never executed: label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();never executed: return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty(); | 0 | ||||||||||||
| 535 | } | - | ||||||||||||
| 536 | - | |||||||||||||
| 537 | QUrl QFileDialogOptions::initialDirectory() const | - | ||||||||||||
| 538 | { | - | ||||||||||||
| 539 | return never executed: d->initialDirectory;return d->initialDirectory;never executed: return d->initialDirectory; | 0 | ||||||||||||
| 540 | } | - | ||||||||||||
| 541 | - | |||||||||||||
| 542 | void QFileDialogOptions::setInitialDirectory(const QUrl &directory) | - | ||||||||||||
| 543 | { | - | ||||||||||||
| 544 | d->initialDirectory = directory; | - | ||||||||||||
| 545 | } never executed: end of block | 0 | ||||||||||||
| 546 | - | |||||||||||||
| 547 | QString QFileDialogOptions::initiallySelectedNameFilter() const | - | ||||||||||||
| 548 | { | - | ||||||||||||
| 549 | return never executed: d->initiallySelectedNameFilter;return d->initiallySelectedNameFilter;never executed: return d->initiallySelectedNameFilter; | 0 | ||||||||||||
| 550 | } | - | ||||||||||||
| 551 | - | |||||||||||||
| 552 | void QFileDialogOptions::setInitiallySelectedNameFilter(const QString &filter) | - | ||||||||||||
| 553 | { | - | ||||||||||||
| 554 | d->initiallySelectedNameFilter = filter; | - | ||||||||||||
| 555 | } never executed: end of block | 0 | ||||||||||||
| 556 | - | |||||||||||||
| 557 | QList<QUrl> QFileDialogOptions::initiallySelectedFiles() const | - | ||||||||||||
| 558 | { | - | ||||||||||||
| 559 | return never executed: d->initiallySelectedFiles;return d->initiallySelectedFiles;never executed: return d->initiallySelectedFiles; | 0 | ||||||||||||
| 560 | } | - | ||||||||||||
| 561 | - | |||||||||||||
| 562 | void QFileDialogOptions::setInitiallySelectedFiles(const QList<QUrl> &files) | - | ||||||||||||
| 563 | { | - | ||||||||||||
| 564 | d->initiallySelectedFiles = files; | - | ||||||||||||
| 565 | } never executed: end of block | 0 | ||||||||||||
| 566 | - | |||||||||||||
| 567 | - | |||||||||||||
| 568 | void QFileDialogOptions::setSupportedSchemes(const QStringList &schemes) | - | ||||||||||||
| 569 | { | - | ||||||||||||
| 570 | d->supportedSchemes = schemes; | - | ||||||||||||
| 571 | } never executed: end of block | 0 | ||||||||||||
| 572 | - | |||||||||||||
| 573 | QStringList QFileDialogOptions::supportedSchemes() const | - | ||||||||||||
| 574 | { | - | ||||||||||||
| 575 | return never executed: d->supportedSchemes;return d->supportedSchemes;never executed: return d->supportedSchemes; | 0 | ||||||||||||
| 576 | } | - | ||||||||||||
| 577 | - | |||||||||||||
| 578 | - | |||||||||||||
| 579 | bool QPlatformFileDialogHelper::isSupportedUrl(const QUrl &url) const | - | ||||||||||||
| 580 | { | - | ||||||||||||
| 581 | return never executed: url.isLocalFile();return url.isLocalFile();never executed: return url.isLocalFile(); | 0 | ||||||||||||
| 582 | } | - | ||||||||||||
| 583 | const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const | - | ||||||||||||
| 584 | { | - | ||||||||||||
| 585 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||
| 586 | } | - | ||||||||||||
| 587 | - | |||||||||||||
| 588 | void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptions> &options) | - | ||||||||||||
| 589 | { | - | ||||||||||||
| 590 | m_options = options; | - | ||||||||||||
| 591 | } never executed: end of block | 0 | ||||||||||||
| 592 | - | |||||||||||||
| 593 | const char *QPlatformFileDialogHelper::filterRegExp = | - | ||||||||||||
| 594 | "^(.*)\\(([a-zA-Z0-9_.,*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; | - | ||||||||||||
| 595 | - | |||||||||||||
| 596 | - | |||||||||||||
| 597 | QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter) | - | ||||||||||||
| 598 | { | - | ||||||||||||
| 599 | QRegExp regexp(QString::fromLatin1(filterRegExp)); | - | ||||||||||||
| 600 | ((!(regexp.isValid())) ? qt_assert("regexp.isValid()",__FILE__,705) : qt_noop()); | - | ||||||||||||
| 601 | QString f = filter; | - | ||||||||||||
| 602 | int i = regexp.indexIn(f); | - | ||||||||||||
| 603 | if (i >= 0
| 0 | ||||||||||||
| 604 | f = regexp.cap(2); never executed: f = regexp.cap(2); | 0 | ||||||||||||
| 605 | return never executed: f.split(QLatin1Char(' '), QString::SkipEmptyParts);return f.split(QLatin1Char(' '), QString::SkipEmptyParts);never executed: return f.split(QLatin1Char(' '), QString::SkipEmptyParts); | 0 | ||||||||||||
| 606 | } | - | ||||||||||||
| 607 | - | |||||||||||||
| 608 | - | |||||||||||||
| 609 | - | |||||||||||||
| 610 | class QMessageDialogOptionsPrivate : public QSharedData | - | ||||||||||||
| 611 | { | - | ||||||||||||
| 612 | public: | - | ||||||||||||
| 613 | QMessageDialogOptionsPrivate() : | - | ||||||||||||
| 614 | icon(QMessageDialogOptions::NoIcon), | - | ||||||||||||
| 615 | buttons(QPlatformDialogHelper::Ok) | - | ||||||||||||
| 616 | {} never executed: end of block | 0 | ||||||||||||
| 617 | - | |||||||||||||
| 618 | QString windowTitle; | - | ||||||||||||
| 619 | QMessageDialogOptions::Icon icon; | - | ||||||||||||
| 620 | QString text; | - | ||||||||||||
| 621 | QString informativeText; | - | ||||||||||||
| 622 | QString detailedText; | - | ||||||||||||
| 623 | QPlatformDialogHelper::StandardButtons buttons; | - | ||||||||||||
| 624 | }; | - | ||||||||||||
| 625 | - | |||||||||||||
| 626 | QMessageDialogOptions::QMessageDialogOptions() : d(new QMessageDialogOptionsPrivate) | - | ||||||||||||
| 627 | { | - | ||||||||||||
| 628 | } never executed: end of block | 0 | ||||||||||||
| 629 | - | |||||||||||||
| 630 | QMessageDialogOptions::QMessageDialogOptions(const QMessageDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||
| 631 | { | - | ||||||||||||
| 632 | } never executed: end of block | 0 | ||||||||||||
| 633 | - | |||||||||||||
| 634 | QMessageDialogOptions &QMessageDialogOptions::operator=(const QMessageDialogOptions &rhs) | - | ||||||||||||
| 635 | { | - | ||||||||||||
| 636 | if (this != &rhs
| 0 | ||||||||||||
| 637 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||
| 638 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 639 | } | - | ||||||||||||
| 640 | - | |||||||||||||
| 641 | QMessageDialogOptions::~QMessageDialogOptions() | - | ||||||||||||
| 642 | { | - | ||||||||||||
| 643 | } | - | ||||||||||||
| 644 | - | |||||||||||||
| 645 | QString QMessageDialogOptions::windowTitle() const | - | ||||||||||||
| 646 | { | - | ||||||||||||
| 647 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||
| 648 | } | - | ||||||||||||
| 649 | - | |||||||||||||
| 650 | void QMessageDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||
| 651 | { | - | ||||||||||||
| 652 | d->windowTitle = title; | - | ||||||||||||
| 653 | } never executed: end of block | 0 | ||||||||||||
| 654 | - | |||||||||||||
| 655 | QMessageDialogOptions::Icon QMessageDialogOptions::icon() const | - | ||||||||||||
| 656 | { | - | ||||||||||||
| 657 | return never executed: d->icon;return d->icon;never executed: return d->icon; | 0 | ||||||||||||
| 658 | } | - | ||||||||||||
| 659 | - | |||||||||||||
| 660 | void QMessageDialogOptions::setIcon(Icon icon) | - | ||||||||||||
| 661 | { | - | ||||||||||||
| 662 | d->icon = icon; | - | ||||||||||||
| 663 | } never executed: end of block | 0 | ||||||||||||
| 664 | - | |||||||||||||
| 665 | QString QMessageDialogOptions::text() const | - | ||||||||||||
| 666 | { | - | ||||||||||||
| 667 | return never executed: d->text;return d->text;never executed: return d->text; | 0 | ||||||||||||
| 668 | } | - | ||||||||||||
| 669 | - | |||||||||||||
| 670 | void QMessageDialogOptions::setText(const QString &text) | - | ||||||||||||
| 671 | { | - | ||||||||||||
| 672 | d->text = text; | - | ||||||||||||
| 673 | } never executed: end of block | 0 | ||||||||||||
| 674 | - | |||||||||||||
| 675 | QString QMessageDialogOptions::informativeText() const | - | ||||||||||||
| 676 | { | - | ||||||||||||
| 677 | return never executed: d->informativeText;return d->informativeText;never executed: return d->informativeText; | 0 | ||||||||||||
| 678 | } | - | ||||||||||||
| 679 | - | |||||||||||||
| 680 | void QMessageDialogOptions::setInformativeText(const QString &informativeText) | - | ||||||||||||
| 681 | { | - | ||||||||||||
| 682 | d->informativeText = informativeText; | - | ||||||||||||
| 683 | } never executed: end of block | 0 | ||||||||||||
| 684 | - | |||||||||||||
| 685 | QString QMessageDialogOptions::detailedText() const | - | ||||||||||||
| 686 | { | - | ||||||||||||
| 687 | return never executed: d->detailedText;return d->detailedText;never executed: return d->detailedText; | 0 | ||||||||||||
| 688 | } | - | ||||||||||||
| 689 | - | |||||||||||||
| 690 | void QMessageDialogOptions::setDetailedText(const QString &detailedText) | - | ||||||||||||
| 691 | { | - | ||||||||||||
| 692 | d->detailedText = detailedText; | - | ||||||||||||
| 693 | } never executed: end of block | 0 | ||||||||||||
| 694 | - | |||||||||||||
| 695 | void QMessageDialogOptions::setStandardButtons(QPlatformDialogHelper::StandardButtons buttons) | - | ||||||||||||
| 696 | { | - | ||||||||||||
| 697 | d->buttons = buttons; | - | ||||||||||||
| 698 | } never executed: end of block | 0 | ||||||||||||
| 699 | - | |||||||||||||
| 700 | QPlatformDialogHelper::StandardButtons QMessageDialogOptions::standardButtons() const | - | ||||||||||||
| 701 | { | - | ||||||||||||
| 702 | return never executed: d->buttons;return d->buttons;never executed: return d->buttons; | 0 | ||||||||||||
| 703 | } | - | ||||||||||||
| 704 | - | |||||||||||||
| 705 | QPlatformDialogHelper::ButtonRole QPlatformDialogHelper::buttonRole(QPlatformDialogHelper::StandardButton button) | - | ||||||||||||
| 706 | { | - | ||||||||||||
| 707 | switch (button) { | - | ||||||||||||
| 708 | case never executed: Ok:case Ok:never executed: case Ok: | 0 | ||||||||||||
| 709 | case never executed: Save:case Save:never executed: case Save: | 0 | ||||||||||||
| 710 | case never executed: Open:case Open:never executed: case Open: | 0 | ||||||||||||
| 711 | case never executed: SaveAll:case SaveAll:never executed: case SaveAll: | 0 | ||||||||||||
| 712 | case never executed: Retry:case Retry:never executed: case Retry: | 0 | ||||||||||||
| 713 | case never executed: Ignore:case Ignore:never executed: case Ignore: | 0 | ||||||||||||
| 714 | return never executed: AcceptRole;return AcceptRole;never executed: return AcceptRole; | 0 | ||||||||||||
| 715 | - | |||||||||||||
| 716 | case never executed: Cancel:case Cancel:never executed: case Cancel: | 0 | ||||||||||||
| 717 | case never executed: Close:case Close:never executed: case Close: | 0 | ||||||||||||
| 718 | case never executed: Abort:case Abort:never executed: case Abort: | 0 | ||||||||||||
| 719 | return never executed: RejectRole;return RejectRole;never executed: return RejectRole; | 0 | ||||||||||||
| 720 | - | |||||||||||||
| 721 | case never executed: Discard:case Discard:never executed: case Discard: | 0 | ||||||||||||
| 722 | return never executed: DestructiveRole;return DestructiveRole;never executed: return DestructiveRole; | 0 | ||||||||||||
| 723 | - | |||||||||||||
| 724 | case never executed: Help:case Help:never executed: case Help: | 0 | ||||||||||||
| 725 | return never executed: HelpRole;return HelpRole;never executed: return HelpRole; | 0 | ||||||||||||
| 726 | - | |||||||||||||
| 727 | case never executed: Apply:case Apply:never executed: case Apply: | 0 | ||||||||||||
| 728 | return never executed: ApplyRole;return ApplyRole;never executed: return ApplyRole; | 0 | ||||||||||||
| 729 | - | |||||||||||||
| 730 | case never executed: Yes:case Yes:never executed: case Yes: | 0 | ||||||||||||
| 731 | case never executed: YesToAll:case YesToAll:never executed: case YesToAll: | 0 | ||||||||||||
| 732 | return never executed: YesRole;return YesRole;never executed: return YesRole; | 0 | ||||||||||||
| 733 | - | |||||||||||||
| 734 | case never executed: No:case No:never executed: case No: | 0 | ||||||||||||
| 735 | case never executed: NoToAll:case NoToAll:never executed: case NoToAll: | 0 | ||||||||||||
| 736 | return never executed: NoRole;return NoRole;never executed: return NoRole; | 0 | ||||||||||||
| 737 | - | |||||||||||||
| 738 | case never executed: RestoreDefaults:case RestoreDefaults:never executed: case RestoreDefaults: | 0 | ||||||||||||
| 739 | case never executed: Reset:case Reset:never executed: case Reset: | 0 | ||||||||||||
| 740 | return never executed: ResetRole;return ResetRole;never executed: return ResetRole; | 0 | ||||||||||||
| 741 | - | |||||||||||||
| 742 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 743 | break; never executed: break; | 0 | ||||||||||||
| 744 | } | - | ||||||||||||
| 745 | return never executed: InvalidRole;return InvalidRole;never executed: return InvalidRole; | 0 | ||||||||||||
| 746 | } | - | ||||||||||||
| 747 | - | |||||||||||||
| 748 | const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy) | - | ||||||||||||
| 749 | { | - | ||||||||||||
| 750 | if (policy == UnknownLayout
| 0 | ||||||||||||
| 751 | - | |||||||||||||
| 752 | - | |||||||||||||
| 753 | - | |||||||||||||
| 754 | policy = KdeLayout; | - | ||||||||||||
| 755 | - | |||||||||||||
| 756 | - | |||||||||||||
| 757 | - | |||||||||||||
| 758 | } never executed: end of block | 0 | ||||||||||||
| 759 | return never executed: buttonRoleLayouts[orientation == Qt::Vertical][policy];return buttonRoleLayouts[orientation == Qt::Vertical][policy];never executed: return buttonRoleLayouts[orientation == Qt::Vertical][policy]; | 0 | ||||||||||||
| 760 | } | - | ||||||||||||
| 761 | const QSharedPointer<QMessageDialogOptions> &QPlatformMessageDialogHelper::options() const | - | ||||||||||||
| 762 | { | - | ||||||||||||
| 763 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||
| 764 | } | - | ||||||||||||
| 765 | - | |||||||||||||
| 766 | void QPlatformMessageDialogHelper::setOptions(const QSharedPointer<QMessageDialogOptions> &options) | - | ||||||||||||
| 767 | { | - | ||||||||||||
| 768 | m_options = options; | - | ||||||||||||
| 769 | } never executed: end of block | 0 | ||||||||||||
| 770 | - | |||||||||||||
| 771 | - | |||||||||||||
| Switch to Source code | Preprocessed file |