| 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(([]() -> QString { enum { Size = sizeof(u"" "Qt/customColors/")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Qt/customColors/" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()) + QString::number(i));return qstring_literal_temp; | 0 | ||||||||||||||||||
| 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(([]() -> QString { enum { Size = sizeof(u"" "Qt/customColors/")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Qt/customColors/" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()) + QString::number(i), customRgb[i]);return qstring_literal_temp;never executed: settings.setValue(([]() -> QString { enum { Size = sizeof(u"" "Qt/customColors/")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Qt/customColors/" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()) + 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 | {} never executed: end of block | 0 | ||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | QFileDialogOptions::FileDialogOptions options; | - | ||||||||||||||||||
| 342 | QString windowTitle; | - | ||||||||||||||||||
| 343 | - | |||||||||||||||||||
| 344 | QFileDialogOptions::ViewMode viewMode; | - | ||||||||||||||||||
| 345 | QFileDialogOptions::FileMode fileMode; | - | ||||||||||||||||||
| 346 | QFileDialogOptions::AcceptMode acceptMode; | - | ||||||||||||||||||
| 347 | QString labels[QFileDialogOptions::DialogLabelCount]; | - | ||||||||||||||||||
| 348 | QDir::Filters filters; | - | ||||||||||||||||||
| 349 | QList<QUrl> sidebarUrls; | - | ||||||||||||||||||
| 350 | QStringList nameFilters; | - | ||||||||||||||||||
| 351 | QStringList mimeTypeFilters; | - | ||||||||||||||||||
| 352 | QString defaultSuffix; | - | ||||||||||||||||||
| 353 | QStringList history; | - | ||||||||||||||||||
| 354 | QUrl initialDirectory; | - | ||||||||||||||||||
| 355 | QString initiallySelectedNameFilter; | - | ||||||||||||||||||
| 356 | QList<QUrl> initiallySelectedFiles; | - | ||||||||||||||||||
| 357 | QStringList supportedSchemes; | - | ||||||||||||||||||
| 358 | }; | - | ||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate) | - | ||||||||||||||||||
| 361 | { | - | ||||||||||||||||||
| 362 | } never executed: end of block | 0 | ||||||||||||||||||
| 363 | - | |||||||||||||||||||
| 364 | QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||||||||
| 365 | { | - | ||||||||||||||||||
| 366 | } never executed: end of block | 0 | ||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | QFileDialogOptions &QFileDialogOptions::operator=(const QFileDialogOptions &rhs) | - | ||||||||||||||||||
| 369 | { | - | ||||||||||||||||||
| 370 | if (this != &rhs
| 0 | ||||||||||||||||||
| 371 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||||||||
| 372 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||||||||
| 373 | } | - | ||||||||||||||||||
| 374 | - | |||||||||||||||||||
| 375 | QFileDialogOptions::~QFileDialogOptions() | - | ||||||||||||||||||
| 376 | { | - | ||||||||||||||||||
| 377 | } | - | ||||||||||||||||||
| 378 | - | |||||||||||||||||||
| 379 | QString QFileDialogOptions::windowTitle() const | - | ||||||||||||||||||
| 380 | { | - | ||||||||||||||||||
| 381 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||||||||
| 382 | } | - | ||||||||||||||||||
| 383 | - | |||||||||||||||||||
| 384 | void QFileDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||||||||
| 385 | { | - | ||||||||||||||||||
| 386 | d->windowTitle = title; | - | ||||||||||||||||||
| 387 | } never executed: end of block | 0 | ||||||||||||||||||
| 388 | - | |||||||||||||||||||
| 389 | void QFileDialogOptions::setOption(QFileDialogOptions::FileDialogOption option, bool on) | - | ||||||||||||||||||
| 390 | { | - | ||||||||||||||||||
| 391 | if (!(d->options & option) != !on
| 0 | ||||||||||||||||||
| 392 | setOptions(d->options ^ option); never executed: setOptions(d->options ^ option); | 0 | ||||||||||||||||||
| 393 | } never executed: end of block | 0 | ||||||||||||||||||
| 394 | - | |||||||||||||||||||
| 395 | bool QFileDialogOptions::testOption(QFileDialogOptions::FileDialogOption option) const | - | ||||||||||||||||||
| 396 | { | - | ||||||||||||||||||
| 397 | return never executed: d->options & option;return d->options & option;never executed: return d->options & option; | 0 | ||||||||||||||||||
| 398 | } | - | ||||||||||||||||||
| 399 | - | |||||||||||||||||||
| 400 | void QFileDialogOptions::setOptions(FileDialogOptions options) | - | ||||||||||||||||||
| 401 | { | - | ||||||||||||||||||
| 402 | if (options != d->options
| 0 | ||||||||||||||||||
| 403 | d->options = options; never executed: d->options = options; | 0 | ||||||||||||||||||
| 404 | } never executed: end of block | 0 | ||||||||||||||||||
| 405 | - | |||||||||||||||||||
| 406 | QFileDialogOptions::FileDialogOptions QFileDialogOptions::options() const | - | ||||||||||||||||||
| 407 | { | - | ||||||||||||||||||
| 408 | return never executed: d->options;return d->options;never executed: return d->options; | 0 | ||||||||||||||||||
| 409 | } | - | ||||||||||||||||||
| 410 | - | |||||||||||||||||||
| 411 | QDir::Filters QFileDialogOptions::filter() const | - | ||||||||||||||||||
| 412 | { | - | ||||||||||||||||||
| 413 | return never executed: d->filters;return d->filters;never executed: return d->filters; | 0 | ||||||||||||||||||
| 414 | } | - | ||||||||||||||||||
| 415 | - | |||||||||||||||||||
| 416 | void QFileDialogOptions::setFilter(QDir::Filters filters) | - | ||||||||||||||||||
| 417 | { | - | ||||||||||||||||||
| 418 | d->filters = filters; | - | ||||||||||||||||||
| 419 | } never executed: end of block | 0 | ||||||||||||||||||
| 420 | - | |||||||||||||||||||
| 421 | void QFileDialogOptions::setViewMode(QFileDialogOptions::ViewMode mode) | - | ||||||||||||||||||
| 422 | { | - | ||||||||||||||||||
| 423 | d->viewMode = mode; | - | ||||||||||||||||||
| 424 | } never executed: end of block | 0 | ||||||||||||||||||
| 425 | - | |||||||||||||||||||
| 426 | QFileDialogOptions::ViewMode QFileDialogOptions::viewMode() const | - | ||||||||||||||||||
| 427 | { | - | ||||||||||||||||||
| 428 | return never executed: d->viewMode;return d->viewMode;never executed: return d->viewMode; | 0 | ||||||||||||||||||
| 429 | } | - | ||||||||||||||||||
| 430 | - | |||||||||||||||||||
| 431 | void QFileDialogOptions::setFileMode(QFileDialogOptions::FileMode mode) | - | ||||||||||||||||||
| 432 | { | - | ||||||||||||||||||
| 433 | d->fileMode = mode; | - | ||||||||||||||||||
| 434 | } never executed: end of block | 0 | ||||||||||||||||||
| 435 | - | |||||||||||||||||||
| 436 | QFileDialogOptions::FileMode QFileDialogOptions::fileMode() const | - | ||||||||||||||||||
| 437 | { | - | ||||||||||||||||||
| 438 | return never executed: d->fileMode;return d->fileMode;never executed: return d->fileMode; | 0 | ||||||||||||||||||
| 439 | } | - | ||||||||||||||||||
| 440 | - | |||||||||||||||||||
| 441 | void QFileDialogOptions::setAcceptMode(QFileDialogOptions::AcceptMode mode) | - | ||||||||||||||||||
| 442 | { | - | ||||||||||||||||||
| 443 | d->acceptMode = mode; | - | ||||||||||||||||||
| 444 | } never executed: end of block | 0 | ||||||||||||||||||
| 445 | - | |||||||||||||||||||
| 446 | QFileDialogOptions::AcceptMode QFileDialogOptions::acceptMode() const | - | ||||||||||||||||||
| 447 | { | - | ||||||||||||||||||
| 448 | return never executed: d->acceptMode;return d->acceptMode;never executed: return d->acceptMode; | 0 | ||||||||||||||||||
| 449 | } | - | ||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | void QFileDialogOptions::setSidebarUrls(const QList<QUrl> &urls) | - | ||||||||||||||||||
| 452 | { | - | ||||||||||||||||||
| 453 | d->sidebarUrls = urls; | - | ||||||||||||||||||
| 454 | } never executed: end of block | 0 | ||||||||||||||||||
| 455 | - | |||||||||||||||||||
| 456 | QList<QUrl> QFileDialogOptions::sidebarUrls() const | - | ||||||||||||||||||
| 457 | { | - | ||||||||||||||||||
| 458 | return never executed: d->sidebarUrls;return d->sidebarUrls;never executed: return d->sidebarUrls; | 0 | ||||||||||||||||||
| 459 | } | - | ||||||||||||||||||
| 460 | - | |||||||||||||||||||
| 461 | void QFileDialogOptions::setNameFilters(const QStringList &filters) | - | ||||||||||||||||||
| 462 | { | - | ||||||||||||||||||
| 463 | d->nameFilters = filters; | - | ||||||||||||||||||
| 464 | } never executed: end of block | 0 | ||||||||||||||||||
| 465 | - | |||||||||||||||||||
| 466 | QStringList QFileDialogOptions::nameFilters() const | - | ||||||||||||||||||
| 467 | { | - | ||||||||||||||||||
| 468 | return never executed: d->nameFilters;return d->nameFilters;never executed: return d->nameFilters; | 0 | ||||||||||||||||||
| 469 | } | - | ||||||||||||||||||
| 470 | - | |||||||||||||||||||
| 471 | void QFileDialogOptions::setMimeTypeFilters(const QStringList &filters) | - | ||||||||||||||||||
| 472 | { | - | ||||||||||||||||||
| 473 | d->mimeTypeFilters = filters; | - | ||||||||||||||||||
| 474 | } never executed: end of block | 0 | ||||||||||||||||||
| 475 | - | |||||||||||||||||||
| 476 | QStringList QFileDialogOptions::mimeTypeFilters() const | - | ||||||||||||||||||
| 477 | { | - | ||||||||||||||||||
| 478 | return never executed: d->mimeTypeFilters;return d->mimeTypeFilters;never executed: return d->mimeTypeFilters; | 0 | ||||||||||||||||||
| 479 | } | - | ||||||||||||||||||
| 480 | - | |||||||||||||||||||
| 481 | void QFileDialogOptions::setDefaultSuffix(const QString &suffix) | - | ||||||||||||||||||
| 482 | { | - | ||||||||||||||||||
| 483 | d->defaultSuffix = suffix; | - | ||||||||||||||||||
| 484 | if (d->defaultSuffix.size() > 1
| 0 | ||||||||||||||||||
| 485 | d->defaultSuffix.remove(0, 1); never executed: d->defaultSuffix.remove(0, 1); | 0 | ||||||||||||||||||
| 486 | } never executed: end of block | 0 | ||||||||||||||||||
| 487 | - | |||||||||||||||||||
| 488 | QString QFileDialogOptions::defaultSuffix() const | - | ||||||||||||||||||
| 489 | { | - | ||||||||||||||||||
| 490 | return never executed: d->defaultSuffix;return d->defaultSuffix;never executed: return d->defaultSuffix; | 0 | ||||||||||||||||||
| 491 | } | - | ||||||||||||||||||
| 492 | - | |||||||||||||||||||
| 493 | void QFileDialogOptions::setHistory(const QStringList &paths) | - | ||||||||||||||||||
| 494 | { | - | ||||||||||||||||||
| 495 | d->history = paths; | - | ||||||||||||||||||
| 496 | } never executed: end of block | 0 | ||||||||||||||||||
| 497 | - | |||||||||||||||||||
| 498 | QStringList QFileDialogOptions::history() const | - | ||||||||||||||||||
| 499 | { | - | ||||||||||||||||||
| 500 | return never executed: d->history;return d->history;never executed: return d->history; | 0 | ||||||||||||||||||
| 501 | } | - | ||||||||||||||||||
| 502 | - | |||||||||||||||||||
| 503 | void QFileDialogOptions::setLabelText(QFileDialogOptions::DialogLabel label, const QString &text) | - | ||||||||||||||||||
| 504 | { | - | ||||||||||||||||||
| 505 | if (label >= 0
| 0 | ||||||||||||||||||
| 506 | d->labels[label] = text; never executed: d->labels[label] = text; | 0 | ||||||||||||||||||
| 507 | } never executed: end of block | 0 | ||||||||||||||||||
| 508 | - | |||||||||||||||||||
| 509 | QString QFileDialogOptions::labelText(QFileDialogOptions::DialogLabel label) const | - | ||||||||||||||||||
| 510 | { | - | ||||||||||||||||||
| 511 | return never executed: (label >= 0return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
never executed: return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString(); | 0 | ||||||||||||||||||
| 512 | } | - | ||||||||||||||||||
| 513 | - | |||||||||||||||||||
| 514 | bool QFileDialogOptions::isLabelExplicitlySet(DialogLabel label) | - | ||||||||||||||||||
| 515 | { | - | ||||||||||||||||||
| 516 | return never executed: label >= 0return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
never executed: return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty(); | 0 | ||||||||||||||||||
| 517 | } | - | ||||||||||||||||||
| 518 | - | |||||||||||||||||||
| 519 | QUrl QFileDialogOptions::initialDirectory() const | - | ||||||||||||||||||
| 520 | { | - | ||||||||||||||||||
| 521 | return never executed: d->initialDirectory;return d->initialDirectory;never executed: return d->initialDirectory; | 0 | ||||||||||||||||||
| 522 | } | - | ||||||||||||||||||
| 523 | - | |||||||||||||||||||
| 524 | void QFileDialogOptions::setInitialDirectory(const QUrl &directory) | - | ||||||||||||||||||
| 525 | { | - | ||||||||||||||||||
| 526 | d->initialDirectory = directory; | - | ||||||||||||||||||
| 527 | } never executed: end of block | 0 | ||||||||||||||||||
| 528 | - | |||||||||||||||||||
| 529 | QString QFileDialogOptions::initiallySelectedNameFilter() const | - | ||||||||||||||||||
| 530 | { | - | ||||||||||||||||||
| 531 | return never executed: d->initiallySelectedNameFilter;return d->initiallySelectedNameFilter;never executed: return d->initiallySelectedNameFilter; | 0 | ||||||||||||||||||
| 532 | } | - | ||||||||||||||||||
| 533 | - | |||||||||||||||||||
| 534 | void QFileDialogOptions::setInitiallySelectedNameFilter(const QString &filter) | - | ||||||||||||||||||
| 535 | { | - | ||||||||||||||||||
| 536 | d->initiallySelectedNameFilter = filter; | - | ||||||||||||||||||
| 537 | } never executed: end of block | 0 | ||||||||||||||||||
| 538 | - | |||||||||||||||||||
| 539 | QList<QUrl> QFileDialogOptions::initiallySelectedFiles() const | - | ||||||||||||||||||
| 540 | { | - | ||||||||||||||||||
| 541 | return never executed: d->initiallySelectedFiles;return d->initiallySelectedFiles;never executed: return d->initiallySelectedFiles; | 0 | ||||||||||||||||||
| 542 | } | - | ||||||||||||||||||
| 543 | - | |||||||||||||||||||
| 544 | void QFileDialogOptions::setInitiallySelectedFiles(const QList<QUrl> &files) | - | ||||||||||||||||||
| 545 | { | - | ||||||||||||||||||
| 546 | d->initiallySelectedFiles = files; | - | ||||||||||||||||||
| 547 | } never executed: end of block | 0 | ||||||||||||||||||
| 548 | - | |||||||||||||||||||
| 549 | - | |||||||||||||||||||
| 550 | void QFileDialogOptions::setSupportedSchemes(const QStringList &schemes) | - | ||||||||||||||||||
| 551 | { | - | ||||||||||||||||||
| 552 | d->supportedSchemes = schemes; | - | ||||||||||||||||||
| 553 | } never executed: end of block | 0 | ||||||||||||||||||
| 554 | - | |||||||||||||||||||
| 555 | QStringList QFileDialogOptions::supportedSchemes() const | - | ||||||||||||||||||
| 556 | { | - | ||||||||||||||||||
| 557 | return never executed: d->supportedSchemes;return d->supportedSchemes;never executed: return d->supportedSchemes; | 0 | ||||||||||||||||||
| 558 | } | - | ||||||||||||||||||
| 559 | - | |||||||||||||||||||
| 560 | - | |||||||||||||||||||
| 561 | bool QPlatformFileDialogHelper::isSupportedUrl(const QUrl &url) const | - | ||||||||||||||||||
| 562 | { | - | ||||||||||||||||||
| 563 | return never executed: url.isLocalFile();return url.isLocalFile();never executed: return url.isLocalFile(); | 0 | ||||||||||||||||||
| 564 | } | - | ||||||||||||||||||
| 565 | const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const | - | ||||||||||||||||||
| 566 | { | - | ||||||||||||||||||
| 567 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||||||||
| 568 | } | - | ||||||||||||||||||
| 569 | - | |||||||||||||||||||
| 570 | void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptions> &options) | - | ||||||||||||||||||
| 571 | { | - | ||||||||||||||||||
| 572 | m_options = options; | - | ||||||||||||||||||
| 573 | } never executed: end of block | 0 | ||||||||||||||||||
| 574 | - | |||||||||||||||||||
| 575 | const char *QPlatformFileDialogHelper::filterRegExp = | - | ||||||||||||||||||
| 576 | "^(.*)\\(([a-zA-Z0-9_.,*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; | - | ||||||||||||||||||
| 577 | - | |||||||||||||||||||
| 578 | - | |||||||||||||||||||
| 579 | QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter) | - | ||||||||||||||||||
| 580 | { | - | ||||||||||||||||||
| 581 | QRegExp regexp(QString::fromLatin1(filterRegExp)); | - | ||||||||||||||||||
| 582 | ((!(regexp.isValid())) ? qt_assert("regexp.isValid()",__FILE__,662) : qt_noop()); | - | ||||||||||||||||||
| 583 | QString f = filter; | - | ||||||||||||||||||
| 584 | int i = regexp.indexIn(f); | - | ||||||||||||||||||
| 585 | if (i >= 0
| 0 | ||||||||||||||||||
| 586 | f = regexp.cap(2); never executed: f = regexp.cap(2); | 0 | ||||||||||||||||||
| 587 | return never executed: f.split(QLatin1Char(' '), QString::SkipEmptyParts);return f.split(QLatin1Char(' '), QString::SkipEmptyParts);never executed: return f.split(QLatin1Char(' '), QString::SkipEmptyParts); | 0 | ||||||||||||||||||
| 588 | } | - | ||||||||||||||||||
| 589 | - | |||||||||||||||||||
| 590 | - | |||||||||||||||||||
| 591 | - | |||||||||||||||||||
| 592 | class QMessageDialogOptionsPrivate : public QSharedData | - | ||||||||||||||||||
| 593 | { | - | ||||||||||||||||||
| 594 | public: | - | ||||||||||||||||||
| 595 | QMessageDialogOptionsPrivate() : | - | ||||||||||||||||||
| 596 | icon(QMessageDialogOptions::NoIcon), | - | ||||||||||||||||||
| 597 | buttons(QPlatformDialogHelper::Ok) | - | ||||||||||||||||||
| 598 | {} never executed: end of block | 0 | ||||||||||||||||||
| 599 | - | |||||||||||||||||||
| 600 | QString windowTitle; | - | ||||||||||||||||||
| 601 | QMessageDialogOptions::Icon icon; | - | ||||||||||||||||||
| 602 | QString text; | - | ||||||||||||||||||
| 603 | QString informativeText; | - | ||||||||||||||||||
| 604 | QString detailedText; | - | ||||||||||||||||||
| 605 | QPlatformDialogHelper::StandardButtons buttons; | - | ||||||||||||||||||
| 606 | }; | - | ||||||||||||||||||
| 607 | - | |||||||||||||||||||
| 608 | QMessageDialogOptions::QMessageDialogOptions() : d(new QMessageDialogOptionsPrivate) | - | ||||||||||||||||||
| 609 | { | - | ||||||||||||||||||
| 610 | } never executed: end of block | 0 | ||||||||||||||||||
| 611 | - | |||||||||||||||||||
| 612 | QMessageDialogOptions::QMessageDialogOptions(const QMessageDialogOptions &rhs) : d(rhs.d) | - | ||||||||||||||||||
| 613 | { | - | ||||||||||||||||||
| 614 | } never executed: end of block | 0 | ||||||||||||||||||
| 615 | - | |||||||||||||||||||
| 616 | QMessageDialogOptions &QMessageDialogOptions::operator=(const QMessageDialogOptions &rhs) | - | ||||||||||||||||||
| 617 | { | - | ||||||||||||||||||
| 618 | if (this != &rhs
| 0 | ||||||||||||||||||
| 619 | d = rhs.d; never executed: d = rhs.d; | 0 | ||||||||||||||||||
| 620 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||||||||
| 621 | } | - | ||||||||||||||||||
| 622 | - | |||||||||||||||||||
| 623 | QMessageDialogOptions::~QMessageDialogOptions() | - | ||||||||||||||||||
| 624 | { | - | ||||||||||||||||||
| 625 | } | - | ||||||||||||||||||
| 626 | - | |||||||||||||||||||
| 627 | QString QMessageDialogOptions::windowTitle() const | - | ||||||||||||||||||
| 628 | { | - | ||||||||||||||||||
| 629 | return never executed: d->windowTitle;return d->windowTitle;never executed: return d->windowTitle; | 0 | ||||||||||||||||||
| 630 | } | - | ||||||||||||||||||
| 631 | - | |||||||||||||||||||
| 632 | void QMessageDialogOptions::setWindowTitle(const QString &title) | - | ||||||||||||||||||
| 633 | { | - | ||||||||||||||||||
| 634 | d->windowTitle = title; | - | ||||||||||||||||||
| 635 | } never executed: end of block | 0 | ||||||||||||||||||
| 636 | - | |||||||||||||||||||
| 637 | QMessageDialogOptions::Icon QMessageDialogOptions::icon() const | - | ||||||||||||||||||
| 638 | { | - | ||||||||||||||||||
| 639 | return never executed: d->icon;return d->icon;never executed: return d->icon; | 0 | ||||||||||||||||||
| 640 | } | - | ||||||||||||||||||
| 641 | - | |||||||||||||||||||
| 642 | void QMessageDialogOptions::setIcon(Icon icon) | - | ||||||||||||||||||
| 643 | { | - | ||||||||||||||||||
| 644 | d->icon = icon; | - | ||||||||||||||||||
| 645 | } never executed: end of block | 0 | ||||||||||||||||||
| 646 | - | |||||||||||||||||||
| 647 | QString QMessageDialogOptions::text() const | - | ||||||||||||||||||
| 648 | { | - | ||||||||||||||||||
| 649 | return never executed: d->text;return d->text;never executed: return d->text; | 0 | ||||||||||||||||||
| 650 | } | - | ||||||||||||||||||
| 651 | - | |||||||||||||||||||
| 652 | void QMessageDialogOptions::setText(const QString &text) | - | ||||||||||||||||||
| 653 | { | - | ||||||||||||||||||
| 654 | d->text = text; | - | ||||||||||||||||||
| 655 | } never executed: end of block | 0 | ||||||||||||||||||
| 656 | - | |||||||||||||||||||
| 657 | QString QMessageDialogOptions::informativeText() const | - | ||||||||||||||||||
| 658 | { | - | ||||||||||||||||||
| 659 | return never executed: d->informativeText;return d->informativeText;never executed: return d->informativeText; | 0 | ||||||||||||||||||
| 660 | } | - | ||||||||||||||||||
| 661 | - | |||||||||||||||||||
| 662 | void QMessageDialogOptions::setInformativeText(const QString &informativeText) | - | ||||||||||||||||||
| 663 | { | - | ||||||||||||||||||
| 664 | d->informativeText = informativeText; | - | ||||||||||||||||||
| 665 | } never executed: end of block | 0 | ||||||||||||||||||
| 666 | - | |||||||||||||||||||
| 667 | QString QMessageDialogOptions::detailedText() const | - | ||||||||||||||||||
| 668 | { | - | ||||||||||||||||||
| 669 | return never executed: d->detailedText;return d->detailedText;never executed: return d->detailedText; | 0 | ||||||||||||||||||
| 670 | } | - | ||||||||||||||||||
| 671 | - | |||||||||||||||||||
| 672 | void QMessageDialogOptions::setDetailedText(const QString &detailedText) | - | ||||||||||||||||||
| 673 | { | - | ||||||||||||||||||
| 674 | d->detailedText = detailedText; | - | ||||||||||||||||||
| 675 | } never executed: end of block | 0 | ||||||||||||||||||
| 676 | - | |||||||||||||||||||
| 677 | void QMessageDialogOptions::setStandardButtons(QPlatformDialogHelper::StandardButtons buttons) | - | ||||||||||||||||||
| 678 | { | - | ||||||||||||||||||
| 679 | d->buttons = buttons; | - | ||||||||||||||||||
| 680 | } never executed: end of block | 0 | ||||||||||||||||||
| 681 | - | |||||||||||||||||||
| 682 | QPlatformDialogHelper::StandardButtons QMessageDialogOptions::standardButtons() const | - | ||||||||||||||||||
| 683 | { | - | ||||||||||||||||||
| 684 | return never executed: d->buttons;return d->buttons;never executed: return d->buttons; | 0 | ||||||||||||||||||
| 685 | } | - | ||||||||||||||||||
| 686 | - | |||||||||||||||||||
| 687 | QPlatformDialogHelper::ButtonRole QPlatformDialogHelper::buttonRole(QPlatformDialogHelper::StandardButton button) | - | ||||||||||||||||||
| 688 | { | - | ||||||||||||||||||
| 689 | switch (button) { | - | ||||||||||||||||||
| 690 | case never executed: Ok:case Ok:never executed: case Ok: | 0 | ||||||||||||||||||
| 691 | case never executed: Save:case Save:never executed: case Save: | 0 | ||||||||||||||||||
| 692 | case never executed: Open:case Open:never executed: case Open: | 0 | ||||||||||||||||||
| 693 | case never executed: SaveAll:case SaveAll:never executed: case SaveAll: | 0 | ||||||||||||||||||
| 694 | case never executed: Retry:case Retry:never executed: case Retry: | 0 | ||||||||||||||||||
| 695 | case never executed: Ignore:case Ignore:never executed: case Ignore: | 0 | ||||||||||||||||||
| 696 | return never executed: AcceptRole;return AcceptRole;never executed: return AcceptRole; | 0 | ||||||||||||||||||
| 697 | - | |||||||||||||||||||
| 698 | case never executed: Cancel:case Cancel:never executed: case Cancel: | 0 | ||||||||||||||||||
| 699 | case never executed: Close:case Close:never executed: case Close: | 0 | ||||||||||||||||||
| 700 | case never executed: Abort:case Abort:never executed: case Abort: | 0 | ||||||||||||||||||
| 701 | return never executed: RejectRole;return RejectRole;never executed: return RejectRole; | 0 | ||||||||||||||||||
| 702 | - | |||||||||||||||||||
| 703 | case never executed: Discard:case Discard:never executed: case Discard: | 0 | ||||||||||||||||||
| 704 | return never executed: DestructiveRole;return DestructiveRole;never executed: return DestructiveRole; | 0 | ||||||||||||||||||
| 705 | - | |||||||||||||||||||
| 706 | case never executed: Help:case Help:never executed: case Help: | 0 | ||||||||||||||||||
| 707 | return never executed: HelpRole;return HelpRole;never executed: return HelpRole; | 0 | ||||||||||||||||||
| 708 | - | |||||||||||||||||||
| 709 | case never executed: Apply:case Apply:never executed: case Apply: | 0 | ||||||||||||||||||
| 710 | return never executed: ApplyRole;return ApplyRole;never executed: return ApplyRole; | 0 | ||||||||||||||||||
| 711 | - | |||||||||||||||||||
| 712 | case never executed: Yes:case Yes:never executed: case Yes: | 0 | ||||||||||||||||||
| 713 | case never executed: YesToAll:case YesToAll:never executed: case YesToAll: | 0 | ||||||||||||||||||
| 714 | return never executed: YesRole;return YesRole;never executed: return YesRole; | 0 | ||||||||||||||||||
| 715 | - | |||||||||||||||||||
| 716 | case never executed: No:case No:never executed: case No: | 0 | ||||||||||||||||||
| 717 | case never executed: NoToAll:case NoToAll:never executed: case NoToAll: | 0 | ||||||||||||||||||
| 718 | return never executed: NoRole;return NoRole;never executed: return NoRole; | 0 | ||||||||||||||||||
| 719 | - | |||||||||||||||||||
| 720 | case never executed: RestoreDefaults:case RestoreDefaults:never executed: case RestoreDefaults: | 0 | ||||||||||||||||||
| 721 | case never executed: Reset:case Reset:never executed: case Reset: | 0 | ||||||||||||||||||
| 722 | return never executed: ResetRole;return ResetRole;never executed: return ResetRole; | 0 | ||||||||||||||||||
| 723 | - | |||||||||||||||||||
| 724 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 725 | break; never executed: break; | 0 | ||||||||||||||||||
| 726 | } | - | ||||||||||||||||||
| 727 | return never executed: InvalidRole;return InvalidRole;never executed: return InvalidRole; | 0 | ||||||||||||||||||
| 728 | } | - | ||||||||||||||||||
| 729 | - | |||||||||||||||||||
| 730 | const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy) | - | ||||||||||||||||||
| 731 | { | - | ||||||||||||||||||
| 732 | if (policy == UnknownLayout
| 0 | ||||||||||||||||||
| 733 | - | |||||||||||||||||||
| 734 | - | |||||||||||||||||||
| 735 | - | |||||||||||||||||||
| 736 | policy = KdeLayout; | - | ||||||||||||||||||
| 737 | - | |||||||||||||||||||
| 738 | - | |||||||||||||||||||
| 739 | - | |||||||||||||||||||
| 740 | } never executed: end of block | 0 | ||||||||||||||||||
| 741 | return never executed: buttonRoleLayouts[orientation == Qt::Vertical][policy];return buttonRoleLayouts[orientation == Qt::Vertical][policy];never executed: return buttonRoleLayouts[orientation == Qt::Vertical][policy]; | 0 | ||||||||||||||||||
| 742 | } | - | ||||||||||||||||||
| 743 | const QSharedPointer<QMessageDialogOptions> &QPlatformMessageDialogHelper::options() const | - | ||||||||||||||||||
| 744 | { | - | ||||||||||||||||||
| 745 | return never executed: m_options;return m_options;never executed: return m_options; | 0 | ||||||||||||||||||
| 746 | } | - | ||||||||||||||||||
| 747 | - | |||||||||||||||||||
| 748 | void QPlatformMessageDialogHelper::setOptions(const QSharedPointer<QMessageDialogOptions> &options) | - | ||||||||||||||||||
| 749 | { | - | ||||||||||||||||||
| 750 | m_options = options; | - | ||||||||||||||||||
| 751 | } never executed: end of block | 0 | ||||||||||||||||||
| 752 | - | |||||||||||||||||||
| 753 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |