Apply clang-format

This commit is contained in:
Martchus 2017-05-04 22:46:37 +02:00
parent 2dcbc02f4b
commit 0599eb354d
30 changed files with 398 additions and 246 deletions

View File

@ -10,7 +10,8 @@
/*!
\namespace Dialogs
\brief Provides common dialogs such as AboutDialog, EnterPasswordDialog and SettingsDialog.
\brief Provides common dialogs such as AboutDialog, EnterPasswordDialog and
SettingsDialog.
*/
namespace Dialogs {
@ -23,12 +24,17 @@ namespace Dialogs {
/*!
* \brief Constructs an about dialog with the provided information.
* \param parent Specifies the parent widget.
* \param applicationName Specifies the name of the application. If empty, QApplication::applicationName() will be used.
* \param creator Specifies the creator of the application. If empty, QApplication::organizationName() will be used.
* \param version Specifies the version of the application. If empty, QApplication::applicationVersion() will be used.
* \param applicationName Specifies the name of the application. If empty,
* QApplication::applicationName() will be used.
* \param creator Specifies the creator of the application. If empty,
* QApplication::organizationName() will be used.
* \param version Specifies the version of the application. If empty,
* QApplication::applicationVersion() will be used.
* \param description Specifies a short description about the application.
* \param website Specifies the URL to the website of the application. If empty, QApplication::organizationDomain() will be used.
* \param image Specifies the application icon. If the image is null, the standard information icon will be used.
* \param website Specifies the URL to the website of the application. If empty,
* QApplication::organizationDomain() will be used.
* \param image Specifies the application icon. If the image is null, the
* standard information icon will be used.
*/
AboutDialog::AboutDialog(QWidget *parent, const QString &applicationName, const QString &creator, const QString &version, const QString &website,
const QString &description, const QImage &image)
@ -48,9 +54,10 @@ AboutDialog::AboutDialog(QWidget *parent, const QString &applicationName, const
}
m_ui->creatorLabel->setText(tr("developed by %1").arg(creator.isEmpty() ? QApplication::organizationName() : creator));
m_ui->versionLabel->setText(version.isEmpty() ? QApplication::applicationVersion() : version);
m_ui->websiteLabel->setText(
tr("For updates and bug reports visit the <a href=\"%1\" style=\"text-decoration: underline; color: palette(link);\">project website</a>.")
.arg(website.isEmpty() ? QApplication::organizationDomain() : website));
m_ui->websiteLabel->setText(tr(
"For updates and bug reports visit the <a href=\"%1\" "
"style=\"text-decoration: underline; color: palette(link);\">project "
"website</a>.").arg(website.isEmpty() ? QApplication::organizationDomain() : website));
m_ui->descLabel->setText(description);
m_iconScene = new QGraphicsScene(this);
auto *item = image.isNull()
@ -63,7 +70,8 @@ AboutDialog::AboutDialog(QWidget *parent, const QString &applicationName, const
}
/*!
* \brief Constructs an about dialog with the specified \a parent, \a description and \a image.
* \brief Constructs an about dialog with the specified \a parent, \a
* description and \a image.
*/
AboutDialog::AboutDialog(QWidget *parent, const QString &description, const QImage &image)
: AboutDialog(parent, QString(), QString(), QString(), QString(), description, image)

View File

@ -25,7 +25,8 @@ namespace Dialogs {
/*!
* \class Dialogs::EnterPasswordDialog
* \brief The EnterPasswordDialog class provides a simple dialog to ask the user for a password.
* \brief The EnterPasswordDialog class provides a simple dialog to ask the user
* for a password.
*/
/*!
@ -78,7 +79,8 @@ EnterPasswordDialog::~EnterPasswordDialog()
}
/*!
* \brief Returns the description. The description is shown under the instruction text.
* \brief Returns the description. The description is shown under the
* instruction text.
* \sa setDescription()
*/
QString EnterPasswordDialog::description() const
@ -120,7 +122,8 @@ void EnterPasswordDialog::setPromptForUserName(bool prompt)
}
/*!
* \brief Returns an indication whether a verification (password has to be entered twice) is required.
* \brief Returns an indication whether a verification (password has to be
* entered twice) is required.
*
* \sa EnterPasswordDialog::setVerificationRequired()
*/
@ -132,7 +135,8 @@ bool EnterPasswordDialog::isVerificationRequired() const
/*!
* \brief Returns an indication whether the user is force to enter a password.
*
* If no password is required, the user is allowed to skip the dialog without entering
* If no password is required, the user is allowed to skip the dialog without
* entering
* a password.
*
* \sa EnterPasswordDialog::setPasswordRequired()
@ -145,7 +149,8 @@ bool EnterPasswordDialog::isPasswordRequired() const
/*!
* \brief Sets whether the user is force to enter a password.
*
* If no password is required, the user is allowed to skip the dialog without entering
* If no password is required, the user is allowed to skip the dialog without
* entering
* a password.
*
* \sa EnterPasswordDialog::isPasswordRequired()
@ -158,7 +163,8 @@ void EnterPasswordDialog::setPasswordRequired(bool value)
}
/*!
* \brief Updates the relevant controls to show entered characters or to mask them them.
* \brief Updates the relevant controls to show entered characters or to mask
* them them.
*
* This private slot is called when m_ui->showPasswordCheckBox is clicked.
*/
@ -170,7 +176,8 @@ void EnterPasswordDialog::updateShowPassword()
}
/*!
* \brief Sets whether a verification (password has to be entered twice) is required.
* \brief Sets whether a verification (password has to be entered twice) is
* required.
*
* \sa EnterPasswordDialog::isVerificationRequired()
*/
@ -216,9 +223,11 @@ bool EnterPasswordDialog::event(QEvent *event)
}
/*!
* \brief Internal method to notice when the capslock key is pressed by the user.
* \brief Internal method to notice when the capslock key is pressed by the
* user.
*
* Invocation of this method is done by installing the event filter in the constructor.
* Invocation of this method is done by installing the event filter in the
* constructor.
*/
bool EnterPasswordDialog::eventFilter(QObject *sender, QEvent *event)
{
@ -259,7 +268,8 @@ bool EnterPasswordDialog::eventFilter(QObject *sender, QEvent *event)
}
/*!
* \brief Sets the dialog status to QDialog::Accepted if a valid password has been enterd.
* \brief Sets the dialog status to QDialog::Accepted if a valid password has
* been enterd.
* Displays an error message otherwise.
*
* This private slot is called when m_ui->confirmPushButton is clicked.
@ -280,7 +290,8 @@ void EnterPasswordDialog::confirm()
} else {
if (isVerificationRequired() && (password != repeatedPassword) && !m_ui->showPasswordCheckBox->isChecked()) {
if (repeatedPassword.isEmpty()) {
QMessageBox::warning(this, windowTitle(), tr("You have to enter the new password twice to ensure you enterd it correct."));
QMessageBox::warning(this, windowTitle(), tr("You have to enter the new password twice to "
"ensure you enterd it correct."));
} else {
QMessageBox::warning(this, windowTitle(), tr("You mistyped the password."));
}
@ -294,13 +305,17 @@ void EnterPasswordDialog::confirm()
}
/*!
* \brief Returns an indication whether the capslock key is pressed using platform specific functions.
* \brief Returns an indication whether the capslock key is pressed using
* platform specific functions.
*
* \remarks - Returns always false for unsupported platforms.
* - This method always returns false when the detection is not supported. It is supported under X11
* - This method always returns false when the detection is not
* supported. It is supported under X11
* and Windows.
* - The function requires the application to be linked against X11 on Linux/Unix.
* - This static function will be used internally to detect whether the capslock key is pressed
* - The function requires the application to be linked against X11 on
* Linux/Unix.
* - This static function will be used internally to detect whether the
* capslock key is pressed
* when initializing the dialog.
*/
bool EnterPasswordDialog::isCapslockPressed()

View File

@ -13,16 +13,16 @@ namespace ThreadingUtils {
template <typename Mutex = QMutex> class AdoptLocker {
public:
/*!
* \brief Constructs the locker for the specified \a mutex.
*/
* \brief Constructs the locker for the specified \a mutex.
*/
AdoptLocker(Mutex &mutex)
: m_mutex(mutex)
{
}
/*!
* \brief Unlocks the mutex specified when constructing the instance.
*/
* \brief Unlocks the mutex specified when constructing the instance.
*/
~AdoptLocker()
{
m_mutex.unlock();

View File

@ -15,15 +15,20 @@ namespace MiscUtils {
* \class DBusNotification
* \brief The DBusNotification class emits D-Bus notifications.
*
* D-Bus notifications are only available if the library has been compiled with support for it by specifying
* CMake option `DBUS_NOTIFICATIONS`. If support is available, the macro `QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS`
* D-Bus notifications are only available if the library has been compiled with
* support for it by specifying
* CMake option `DBUS_NOTIFICATIONS`. If support is available, the macro
* `QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS`
* is defined.
*
* **Usage**
*
* First create a new instance. The constructor allows to set basic parameters. To set more parameters, use
* setter methods. Call show() to actually show the notification. This method can also be used to update
* the currently shown notification (it will not be updated automatically by just using the setter methods).
* First create a new instance. The constructor allows to set basic parameters.
* To set more parameters, use
* setter methods. Call show() to actually show the notification. This method
* can also be used to update
* the currently shown notification (it will not be updated automatically by
* just using the setter methods).
*
* \sa https://developer.gnome.org/notification-spec
*/
@ -115,7 +120,8 @@ void DBusNotification::setIcon(NotificationIcon icon)
}
/*!
* \brief Makes the notification object delete itself when the notification has been closed or an error occured.
* \brief Makes the notification object delete itself when the notification has
* been closed or an error occured.
*/
void DBusNotification::deleteOnCloseOrError()
{
@ -125,8 +131,10 @@ void DBusNotification::deleteOnCloseOrError()
/*!
* \brief Shows the notification.
* \remarks If called when a previous notification is still shown, the previous notification is updated.
* \returns Returns false is the D-Bus daemon isn't reachable and true otherwise.
* \remarks If called when a previous notification is still shown, the previous
* notification is updated.
* \returns Returns false is the D-Bus daemon isn't reachable and true
* otherwise.
*/
bool DBusNotification::show()
{
@ -144,8 +152,10 @@ bool DBusNotification::show()
/*!
* \brief Updates the message and shows/updates the notification.
* \remarks If called when a previous notification is still shown, the previous notification is updated.
* \returns Returns false is the D-Bus daemon isn't reachable and true otherwise. The message is updated in any case.
* \remarks If called when a previous notification is still shown, the previous
* notification is updated.
* \returns Returns false is the D-Bus daemon isn't reachable and true
* otherwise. The message is updated in any case.
*/
bool DBusNotification::show(const QString &message)
{
@ -156,11 +166,14 @@ bool DBusNotification::show(const QString &message)
/*!
* \brief Updates the message and shows/updates the notification.
* \remarks
* - If called when a previous notification is still shown, the previous notification is updated. In this
* - If called when a previous notification is still shown, the previous
* notification is updated. In this
* case the specified \a line will be appended to the current message.
* - If called when no previous notification is still shown, the previous message is completely replaced
* - If called when no previous notification is still shown, the previous
* message is completely replaced
* by \a line and shown as a new notification.
* \returns Returns false is the D-Bus daemon isn't reachable and true otherwise. The message is updated in any case.
* \returns Returns false is the D-Bus daemon isn't reachable and true
* otherwise. The message is updated in any case.
*/
bool DBusNotification::update(const QString &line)
{
@ -178,7 +191,8 @@ bool DBusNotification::update(const QString &line)
/*!
* \brief Hides the notification (if still visible).
* \remarks On success, the signal closed() is emitted with the reason NotificationCloseReason::Manually.
* \remarks On success, the signal closed() is emitted with the reason
* NotificationCloseReason::Manually.
*/
void DBusNotification::hide()
{
@ -232,7 +246,8 @@ void DBusNotification::handleActionInvoked(uint id, const QString &action)
if (i != pendingNotifications.end()) {
DBusNotification *notification = i->second;
emit notification->actionInvoked(action);
// Plasma 5 also closes the notification but doesn't emit the NotificationClose signal
// Plasma 5 also closes the notification but doesn't emit the
// NotificationClose signal
// -> just consider the notification closed
emit notification->closed(NotificationCloseReason::ActionInvoked);
notification->m_id = 0;
@ -254,18 +269,21 @@ void DBusNotification::handleActionInvoked(uint id, const QString &action)
* \brief Sets the message to be shown.
* \remarks
* - Might also be set via show() and update().
* - Can contain the following HTML tags: `<b>`, `<i>`, `<u>`, `<a href="...">` and `<img src="..." alt="..."/>`
* - Can contain the following HTML tags: `<b>`, `<i>`, `<u>`, `<a href="...">`
* and `<img src="..." alt="..."/>`
*/
/*!
* \fn DBusNotification::timeout()
* \brief Returns the number of milliseconds the notification will be visible after calling show().
* \brief Returns the number of milliseconds the notification will be visible
* after calling show().
* \sa setTimeout() for more details.
*/
/*!
* \fn DBusNotification::setTimeout()
* \brief Sets the number of milliseconds the notification will be visible after calling show().
* \brief Sets the number of milliseconds the notification will be visible after
* calling show().
* \remarks
* - Set to 0 for non-expiring notifications.
* - Set to -1 to let the notification daemon decide.
@ -282,7 +300,8 @@ void DBusNotification::handleActionInvoked(uint id, const QString &action)
* \brief Sets the list of available actions.
* \remarks
* The list consists of pairs of action IDs and action labels, eg.
* `QStringList({QStringLiteral("first_id"), tr("First action"), QStringLiteral("second_id"), tr("Second action"), ...})`
* `QStringList({QStringLiteral("first_id"), tr("First action"),
* QStringLiteral("second_id"), tr("Second action"), ...})`
* \sa actionInvoked() signal
*/

View File

@ -115,7 +115,8 @@ inline const QString &DBusNotification::icon() const
/*!
* \brief Sets the icon name.
* \remarks
* The specified \a icon should be either an URI (file:// is the only URI schema supported
* The specified \a icon should be either an URI (file:// is the only URI schema
* supported
* right now) or a name in an icon theme.
*/
inline void DBusNotification::setIcon(const QString &icon)

View File

@ -7,7 +7,8 @@ namespace DesktopUtils {
/*!
* \brief Shows the specified file or directory using the default file browser.
* \remarks \a path musn't be specified as URL. (Conversion to URL is the purpose of this function).
* \remarks \a path musn't be specified as URL. (Conversion to URL is the
* purpose of this function).
*/
bool openLocalFileOrDir(const QString &path)
{

View File

@ -44,7 +44,8 @@ QString generateWindowTitle(DocumentStatus documentStatus, const QString &docume
case DocumentStatus::NoDocument:
return QCoreApplication::applicationName();
default:
return QString(); // to suppress warning: "control reaches end of non-void function"
return QString(); // to suppress warning: "control reaches end of non-void
// function"
}
}
@ -72,17 +73,21 @@ QColor instructionTextColor()
#endif
/*!
* \brief Returns the stylesheet for dialogs and other windows used in my applications.
* \brief Returns the stylesheet for dialogs and other windows used in my
* applications.
*/
const QString &dialogStyle()
{
#ifdef Q_OS_WIN32
static const auto style
= QStringLiteral("#mainWidget { color: palette(text); background-color: palette(base); border: none; }"
"#bottomWidget { background-color: palette(window); color: palette(window-text); border-top: 1px solid %1; }"
"QMessageBox QLabel, QInputDialog QLabel, *[classNames~=\"heading\"] { font-size: 12pt; color: %2; }"
"*[classNames~=\"input-invalid\"] { color: red; }")
.arg(windowFrameColor().name(), instructionTextColor().name());
static const auto style = QStringLiteral("#mainWidget { color: palette(text); background-color: "
"palette(base); border: none; }"
"#bottomWidget { background-color: palette(window); "
"color: palette(window-text); border-top: 1px solid %1; }"
"QMessageBox QLabel, QInputDialog QLabel, "
"*[classNames~=\"heading\"] { font-size: 12pt; color: %2; "
"}"
"*[classNames~=\"input-invalid\"] { color: red; }")
.arg(windowFrameColor().name(), instructionTextColor().name());
#else
static const auto style = QStringLiteral("*[classNames~=\"heading\"] { font-weight: bold; }"
"*[classNames~=\"input-invalid\"] { color: red; }");
@ -93,8 +98,10 @@ const QString &dialogStyle()
#ifdef QT_UTILITIES_GUI_QTWIDGETS
/*!
* \brief Moves the specified \a widget in the middle of the (available) screen area. If there are multiple
* screens available, the screen where the cursor currently is located is chosen.
* \brief Moves the specified \a widget in the middle of the (available) screen
* area. If there are multiple
* screens available, the screen where the cursor currently is located is
* chosen.
*/
void centerWidget(QWidget *widget)
{
@ -103,8 +110,10 @@ void centerWidget(QWidget *widget)
}
/*!
* \brief Moves the specified \a widget to the corner which is closest to the current cursor position.
* If there are multiple screens available, the screen where the cursor currently is located is chosen.
* \brief Moves the specified \a widget to the corner which is closest to the
* current cursor position.
* If there are multiple screens available, the screen where the cursor
* currently is located is chosen.
*/
void cornerWidget(QWidget *widget)
{
@ -127,7 +136,8 @@ void makeHeading(QWidget *widget)
/*!
* \brief Updates the widget style.
* \remarks Useful when dynamic properties are used in the stylesheet because
* the widget style does not update automatically when a property changes.
* the widget style does not update automatically when a property
* changes.
*/
void updateStyle(QWidget *widget)
{

View File

@ -12,12 +12,16 @@ QT_FORWARD_DECLARE_CLASS(QColor)
namespace Dialogs {
/*!
* \brief The DocumentStatus enum specifies the status of the document in a window.
* \brief The DocumentStatus enum specifies the status of the document in a
* window.
*/
enum class DocumentStatus {
NoDocument, /**< There is no document opened. The document path is ignored in this case. */
Saved, /**< There is a document opened. All modifications have been saved yet. */
Unsaved /**< There is a document opened and there are unsaved modifications. */
NoDocument, /**< There is no document opened. The document path is ignored in
this case. */
Saved, /**< There is a document opened. All modifications have been saved yet.
*/
Unsaved /**< There is a document opened and there are unsaved modifications.
*/
};
QString QT_UTILITIES_EXPORT generateWindowTitle(DocumentStatus documentStatus, const QString &documentPath);

View File

@ -12,7 +12,8 @@ namespace MiscUtils {
/*!
* \class RecentMenuManager
* \brief The RecentMenuManager class manages the entries for a "recently opened files" menu.
* \brief The RecentMenuManager class manages the entries for a "recently opened
* files" menu.
*/
/*!
@ -22,7 +23,8 @@ namespace MiscUtils {
* \remarks
* - Menu title and icon are set within the constructor.
* - The current menu entries are cleared.
* - The menu entries shouldn't be manipulated manually by the caller till the manager is destructed.
* - The menu entries shouldn't be manipulated manually by the caller till the
* manager is destructed.
* - The manager does not take ownership over \a menu.
*/
RecentMenuManager::RecentMenuManager(QMenu *menu, QObject *parent)
@ -74,7 +76,8 @@ QStringList RecentMenuManager::save()
}
/*!
* \brief Ensures an entry for the specified \a path is present and the first entry in the list.
* \brief Ensures an entry for the specified \a path is present and the first
* entry in the list.
*/
void RecentMenuManager::addEntry(const QString &path)
{
@ -126,7 +129,8 @@ void RecentMenuManager::clearEntries()
}
/*!
* \brief Internally called to emit fileSelected() after an action has been triggered.
* \brief Internally called to emit fileSelected() after an action has been
* triggered.
*/
void RecentMenuManager::handleActionTriggered()
{
@ -138,7 +142,8 @@ void RecentMenuManager::handleActionTriggered()
} else {
QMessageBox msg;
msg.setWindowTitle(tr("Recently opened files - ") + QCoreApplication::applicationName());
msg.setText(tr("The selected file can't be found anymore. Do you want to delete the obsolete entry from the list?"));
msg.setText(tr("The selected file can't be found anymore. Do you want "
"to delete the obsolete entry from the list?"));
msg.setIcon(QMessageBox::Warning);
QPushButton *keepEntryButton = msg.addButton(tr("keep entry"), QMessageBox::NoRole);
QPushButton *deleteEntryButton = msg.addButton(tr("delete entry"), QMessageBox::YesRole);
@ -162,6 +167,7 @@ void RecentMenuManager::handleActionTriggered()
/*!
* \fn RecentMenuManager::fileSelected()
* \brief Emitted after the user selected a file.
* \remarks Only emitted when the selected file still existed; otherwise the user is ask whether to keep or delete the entry.
* \remarks Only emitted when the selected file still existed; otherwise the
* user is ask whether to keep or delete the entry.
*/
}

View File

@ -13,17 +13,17 @@ namespace ThreadingUtils {
template <typename Mutex = QMutex> class TryLocker {
public:
/*!
* \brief Tries to lock the specified mutex.
*/
* \brief Tries to lock the specified mutex.
*/
TryLocker(Mutex &mutex)
: m_mutex(mutex.tryLock() ? &mutex : nullptr)
{
}
/*!
* \brief Unlocks the mutex specified when constructing.
* \remarks Does nothing if the mutex couldn't be locked in the first place.
*/
* \brief Unlocks the mutex specified when constructing.
* \remarks Does nothing if the mutex couldn't be locked in the first place.
*/
~TryLocker()
{
if (m_mutex) {
@ -32,16 +32,16 @@ public:
}
/*!
* \brief Returns whether the mutex could be locked.
*/
* \brief Returns whether the mutex could be locked.
*/
bool isLocked() const
{
return m_mutex != nullptr;
}
/*!
* \brief Returns whether the mutex could be locked.
*/
* \brief Returns whether the mutex could be locked.
*/
operator bool() const
{
return m_mutex != nullptr;

View File

@ -11,12 +11,14 @@ namespace Models {
/*!
* \class Models::ChecklistItem
* \brief The ChecklistItem class provides an item for use with the ChecklistModel class.
* \brief The ChecklistItem class provides an item for use with the
* ChecklistModel class.
*/
/*!
* \class Models::ChecklistModel
* \brief The ChecklistModel class provides a generic model for storing checkable items.
* \brief The ChecklistModel class provides a generic model for storing
* checkable items.
*/
/*!
@ -169,7 +171,8 @@ void ChecklistModel::setItems(const QList<ChecklistItem> &items)
}
/*!
* \brief Restores the IDs and checkstates read from the specified \a settings object.
* \brief Restores the IDs and checkstates read from the specified \a settings
* object.
*
* The items will be read from the array with the specified \a name.
*

View File

@ -149,21 +149,22 @@ void ColorButton::paintEvent(QPaintEvent *event)
p.setBrushOrigin((r.width() % pixSize + pixSize) / 2 + corr, (r.height() % pixSize + pixSize) / 2 + corr);
p.fillRect(r, br);
//const int adjX = qRound(r.width() / 4.0);
//const int adjY = qRound(r.height() / 4.0);
//p.fillRect(r.adjusted(adjX, adjY, -adjX, -adjY),
// const int adjX = qRound(r.width() / 4.0);
// const int adjY = qRound(r.height() / 4.0);
// p.fillRect(r.adjusted(adjX, adjY, -adjX, -adjY),
// QColor(d_ptr->shownColor().rgb()));
/*
p.fillRect(r.adjusted(0, r.height() * 3 / 4, 0, 0),
QColor(d_ptr->shownColor().rgb()));
p.fillRect(r.adjusted(0, 0, 0, -r.height() * 3 / 4),
QColor(d_ptr->shownColor().rgb()));
*/
p.fillRect(r.adjusted(0, r.height() * 3 / 4, 0, 0),
QColor(d_ptr->shownColor().rgb()));
p.fillRect(r.adjusted(0, 0, 0, -r.height() * 3 / 4),
QColor(d_ptr->shownColor().rgb()));
*/
/*
const QColor frameColor0(0, 0, 0, qRound(0.2 * (0xFF - d_ptr->shownColor().alpha())));
p.setPen(frameColor0);
p.drawRect(r.adjusted(adjX, adjY, -adjX - 1, -adjY - 1));
*/
const QColor frameColor0(0, 0, 0, qRound(0.2 * (0xFF -
d_ptr->shownColor().alpha())));
p.setPen(frameColor0);
p.drawRect(r.adjusted(adjX, adjY, -adjX - 1, -adjY - 1));
*/
const QColor frameColor1(0, 0, 0, 26);
p.setPen(frameColor1);

View File

@ -272,7 +272,8 @@ bool PaletteModel::setData(const QModelIndex &index, const QVariant &value, int
idxBegin = PaletteModel::index(QPalette::Base, 0);
break;
case QPalette::Highlight:
//m_palette.setBrush(QPalette::Disabled, QPalette::Highlight, c.dark(120));
// m_palette.setBrush(QPalette::Disabled, QPalette::Highlight,
// c.dark(120));
break;
default:
m_palette.setBrush(QPalette::Disabled, r, br);
@ -411,7 +412,8 @@ RoleEditor::RoleEditor(QWidget *parent)
layout->addWidget(m_label);
m_label->setAutoFillBackground(true);
m_label->setIndent(3); // ### hardcode it should have the same value of textMargin in QItemDelegate
m_label->setIndent(3); // ### hardcode it should have the same value of
// textMargin in QItemDelegate
setFocusProxy(m_label);
QToolButton *button = new QToolButton(this);
@ -461,8 +463,8 @@ QWidget *ColorDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
if (index.column() == 0) {
RoleEditor *editor = new RoleEditor(parent);
connect(editor, &RoleEditor::changed, this, &ColorDelegate::commitData);
//editor->setFocusPolicy(Qt::NoFocus);
//editor->installEventFilter(const_cast<ColorDelegate *>(this));
// editor->setFocusPolicy(Qt::NoFocus);
// editor->installEventFilter(const_cast<ColorDelegate *>(this));
ed = editor;
} else {
typedef void (BrushEditor::*BrushEditorWidgetSignal)(QWidget *);

View File

@ -26,7 +26,8 @@ class PaletteEditor;
/*!
* \brief The PaletteEditor class provides a dialog to customize a QPalette.
*
* This is taken from qttools/src/designer/src/components/propertyeditor/paletteeditor.cpp.
* This is taken from
* qttools/src/designer/src/components/propertyeditor/paletteeditor.cpp.
* In contrast to the original version this version doesn't provide a preview.
*/
class QT_UTILITIES_EXPORT PaletteEditor : public QDialog {

View File

@ -28,11 +28,15 @@ QtConfigArguments::QtConfigArguments()
: m_qtWidgetsGuiArg("qt-widgets-gui", 'g', "shows a Qt widgets based graphical user interface")
, m_qtQuickGuiArg("qt-quick-gui", 'q', "shows a Qt quick based graphical user interface")
, m_lngArg("lang", 'l', "sets the language for the Qt GUI")
, m_qmlDebuggerArg("qmljsdebugger", '\0', "enables QML debugging (see http://doc.qt.io/qt-5/qtquick-debugging.html)")
, m_qmlDebuggerArg("qmljsdebugger", '\0', "enables QML debugging (see "
"http://doc.qt.io/qt-5/"
"qtquick-debugging.html)")
, m_styleArg("style", '\0', "sets the Qt widgets style")
, m_iconThemeArg("icon-theme", '\0', "sets the icon theme and additional theme search paths for the Qt GUI")
, m_iconThemeArg("icon-theme", '\0', "sets the icon theme and additional "
"theme search paths for the Qt GUI")
, m_fontArg("font", '\0', "sets the font family and size (point) for the Qt GUI")
, m_libraryPathsArg("library-paths", '\0', "sets the list of directories to search when loading libraries (all existing paths will be deleted)")
, m_libraryPathsArg("library-paths", '\0', "sets the list of directories to search when loading "
"libraries (all existing paths will be deleted)")
, m_platformThemeArg("platformtheme", '\0', "specifies the Qt platform theme to be used")
{
// language
@ -76,7 +80,8 @@ QtConfigArguments::QtConfigArguments()
/*!
* \brief Applies the settings from the arguments.
* \remarks Also checks environment variables for the icon theme.
* \param preventApplyingDefaultFont If true, the font will not be updated to some default value if no font has been specified explicitly.
* \param preventApplyingDefaultFont If true, the font will not be updated to
* some default value if no font has been specified explicitly.
*/
void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
{
@ -136,7 +141,9 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
try {
font.setPointSize(stringToNumber<int>(m_fontArg.values().back()));
} catch (const ConversionException &) {
cerr << "Warning: The specified font size is no number and will be ignored." << endl;
cerr << "Warning: The specified font size is no number and will be "
"ignored."
<< endl;
}
QGuiApplication::setFont(font);
}

View File

@ -80,14 +80,18 @@ QString &additionalTranslationFilePath()
}
/*!
* \brief Loads and installs the appropriate Qt translation file for the current locale.
* \param repositoryNames Specifies the names of the Qt repositories to load translations for (eg. qtbase, qtscript, ...).
* \brief Loads and installs the appropriate Qt translation file for the current
* locale.
* \param repositoryNames Specifies the names of the Qt repositories to load
* translations for (eg. qtbase, qtscript, ...).
* \remarks
* - Translation files have to be placed in one of the following locations:
* * QLibraryInfo::location(QLibraryInfo::TranslationsPath) (used in UNIX)
* * ../share/qt/translations (used in Windows)
* - Translation files can also be built-in using by setting the CMake variable BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this function.
* - Translation files can also be built-in using by setting the CMake variable
* BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this
* function.
*/
void loadQtTranslationFile(std::initializer_list<QString> repositoryNames)
{
@ -95,15 +99,19 @@ void loadQtTranslationFile(std::initializer_list<QString> repositoryNames)
}
/*!
* \brief Loads and installs the appropriate Qt translation file for the specified locale.
* \param repositoryNames Specifies the names of the Qt repositories to load translations for (eg. qtbase, qtscript, ...).
* \brief Loads and installs the appropriate Qt translation file for the
* specified locale.
* \param repositoryNames Specifies the names of the Qt repositories to load
* translations for (eg. qtbase, qtscript, ...).
* \param localeName Specifies the name of the locale.
* \remarks
* - Translation files have to be placed in one of the following locations:
* * QLibraryInfo::location(QLibraryInfo::TranslationsPath) (used in UNIX)
* * ../share/qt/translations (used in Windows)
* - Translation files can also be built-in using by setting the CMake variable BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this function.
* - Translation files can also be built-in using by setting the CMake variable
* BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this
* function.
*/
void loadQtTranslationFile(initializer_list<QString> repositoryNames, const QString &localeName)
{
@ -128,7 +136,8 @@ void loadQtTranslationFile(initializer_list<QString> repositoryNames, const QStr
}
/*!
* \brief Loads and installs the appropriate application translation file for the current locale.
* \brief Loads and installs the appropriate application translation file for
* the current locale.
* \param applicationName Specifies the name of the application.
* \remarks
* - Translation files have to be placed in one of the following locations:
@ -137,8 +146,10 @@ void loadQtTranslationFile(initializer_list<QString> repositoryNames, const QStr
* * ../share/$application/translations (used in Windows)
* - Translation files must be named using the following scheme:
* * $application_$language.qm
* - Translation files can also be built-in using by setting the CMake variable BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this function.
* - Translation files can also be built-in using by setting the CMake variable
* BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this
* function.
*/
void loadApplicationTranslationFile(const QString &applicationName)
{
@ -151,7 +162,8 @@ void loadApplicationTranslationFile(const QString &applicationName)
}
/*!
* \brief Loads and installs the appropriate application translation file for the specified locale.
* \brief Loads and installs the appropriate application translation file for
* the specified locale.
* \param applicationName Specifies the name of the application.
* \param localeName Specifies the name of the locale.
* \remarks
@ -161,8 +173,10 @@ void loadApplicationTranslationFile(const QString &applicationName)
* * ../share/$application/translations (used in Windows)
* - Translation files must be named using the following scheme:
* * $application_$language.qm
* - Translation files can also be built-in using by setting the CMake variable BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this function.
* - Translation files can also be built-in using by setting the CMake variable
* BUILTIN_TRANSLATIONS.
* In this case it is also necessary to load the translations using this
* function.
*/
void loadApplicationTranslationFile(const QString &applicationName, const QString &localeName)
{
@ -188,7 +202,8 @@ void loadApplicationTranslationFile(const QString &applicationName, const QStrin
}
/*!
* \brief Loads and installs the appropriate application translation file for the current locale.
* \brief Loads and installs the appropriate application translation file for
* the current locale.
* \param applicationNames Specifies the names of the applications.
*/
void loadApplicationTranslationFile(const std::initializer_list<QString> &applicationNames)
@ -199,7 +214,8 @@ void loadApplicationTranslationFile(const std::initializer_list<QString> &applic
}
/*!
* \brief Loads and installs the appropriate application translation file for the specified locale.
* \brief Loads and installs the appropriate application translation file for
* the specified locale.
* \param applicationNames Specifies the names of the applications.
* \param localeName Specifies the name of the locale.
*/
@ -212,7 +228,9 @@ void loadApplicationTranslationFile(const std::initializer_list<QString> &applic
}
/*!
* \brief Convenience functions to check whether a QCoreApplication/QGuiApplication/QApplication singleton has been instantiated yet.
* \brief Convenience functions to check whether a
* QCoreApplication/QGuiApplication/QApplication singleton has been instantiated
* yet.
*/
namespace ApplicationInstances {
@ -251,8 +269,10 @@ bool hasCoreApp()
namespace ConfigFile {
/*!
* \brief Locates the config file with the specified \a fileName for the application with the specified \a applicationName.
* \remarks If \a settings is not nullptr, the path provided by that object is also considered.
* \brief Locates the config file with the specified \a fileName for the
* application with the specified \a applicationName.
* \remarks If \a settings is not nullptr, the path provided by that object is
* also considered.
*/
QString locateConfigFile(const QString &applicationName, const QString &fileName, const QSettings *settings)
{
@ -275,7 +295,8 @@ QString locateConfigFile(const QString &applicationName, const QString &fileName
if (QFile::exists(path)) {
return path;
} else {
// check whether there is the default version of the file under /usr/share/app/
// check whether there is the default version of the file under
// /usr/share/app/
path = QStringLiteral("../share/") % applicationName % QChar('/') % fileName;
if (QFile::exists(path)) {
return path;
@ -288,7 +309,8 @@ QString locateConfigFile(const QString &applicationName, const QString &fileName
if (QFile::exists(path)) {
return path;
} else {
// check whether there is the default version of the file under /usr/share/app/
// check whether there is the default version of the file under
// /usr/share/app/
path = QStringLiteral("/usr/share/") % applicationName % QChar('/') % fileName;
if (QFile::exists(path)) {
return path;

View File

@ -51,7 +51,8 @@ void OptionCategory::resetAllPages()
}
/*!
* \brief Returns whether the option category matches the specified \a searchKeyWord.
* \brief Returns whether the option category matches the specified \a
* searchKeyWord.
*/
bool OptionCategory::matches(const QString &searchKeyWord) const
{

View File

@ -6,7 +6,8 @@ namespace Dialogs {
/*!
* \class Dialogs::OptionCategoryFilterModel
* \brief The OptionCategoryFilterModel class is used by SettingsDialog to filter option categories.
* \brief The OptionCategoryFilterModel class is used by SettingsDialog to
* filter option categories.
*/
/*!

View File

@ -10,7 +10,8 @@ namespace Dialogs {
/*!
* \class Dialogs::OptionCategoryModel
* \brief The OptionCategoryModel class is used by SettingsDialog to store and display option categories.
* \brief The OptionCategoryModel class is used by SettingsDialog to store and
* display option categories.
*/
/*!

View File

@ -12,7 +12,8 @@ namespace Dialogs {
* \class Dialogs::OptionPage
* \brief The OptionPage class is the base class for SettingsDialog pages.
*
* The specified \a parentWindow might be used by some implementations as parent when showing dialogs.
* The specified \a parentWindow might be used by some implementations as parent
* when showing dialogs.
*/
/*!
@ -98,6 +99,7 @@ bool OptionPage::matches(const QString &searchKeyWord)
/*!
* \fn OptionPage::setupWidget()
* \brief Creates the widget for the page. Called in the first invocation of widget().
* \brief Creates the widget for the page. Called in the first invocation of
* widget().
*/
}

View File

@ -57,7 +57,8 @@ inline bool OptionPage::hasBeenShown() const
}
/*!
* \brief Returns the errors which haven been occurred when applying the changes.
* \brief Returns the errors which haven been occurred when applying the
* changes.
*/
inline const QStringList &OptionPage::errors() const
{
@ -65,9 +66,11 @@ inline const QStringList &OptionPage::errors() const
}
/*!
* \brief Returns the errors which haven been occurred when applying the changes.
* \brief Returns the errors which haven been occurred when applying the
* changes.
*
* Error messages should be added when implementing apply() and something goes wrong.
* Error messages should be added when implementing apply() and something goes
* wrong.
* In this case, apply() should return false.
*/
inline QStringList &OptionPage::errors()
@ -77,7 +80,8 @@ inline QStringList &OptionPage::errors()
/*!
* \class Dialogs::UiFileBasedOptionPage
* \brief The UiFileBasedOptionPage class is the base class for SettingsDialog pages using UI files
* \brief The UiFileBasedOptionPage class is the base class for SettingsDialog
* pages using UI files
* to describe the widget tree.
*
* \tparam UiClass Specifies the UI class generated by uic.
@ -137,7 +141,8 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
}
/*!
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient
* way.
* \remarks Must be closed with END_DECLARE_OPTION_PAGE.
*/
#define BEGIN_DECLARE_OPTION_PAGE(SomeClass) \
@ -152,7 +157,8 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
private:
/*!
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a
* convenient way.
* \remarks Must be closed with END_DECLARE_OPTION_PAGE.
*/
#define BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_CTOR(SomeClass) \
@ -169,7 +175,8 @@ template <class UiClass> inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
private:
/*!
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a
* convenient way.
* \remarks Must be closed with END_DECLARE_OPTION_PAGE.
*/
#define BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(SomeClass) \
@ -180,14 +187,16 @@ public:
private:
/*!
* \brief Must be used after BEGIN_DECLARE_OPTION_PAGE and BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE.
* \brief Must be used after BEGIN_DECLARE_OPTION_PAGE and
* BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE.
*/
#define END_DECLARE_OPTION_PAGE \
} \
;
/*!
* \brief Instantiates a class declared with BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE in a convenient way.
* \brief Instantiates a class declared with
* BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE in a convenient way.
* \remarks Might be required when the class is used by another application.
*/
#define INSTANTIATE_UI_FILE_BASED_OPTION_PAGE(SomeClass) \
@ -196,16 +205,19 @@ private:
}
/*!
* \brief Instantiates a class declared with BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE inside a given namespace in a convenient way.
* \brief Instantiates a class declared with
* BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE inside a given namespace in a
* convenient way.
* \remarks Might be required when the class is used by another application.
*/
#define INSTANTIATE_UI_FILE_BASED_OPTION_PAGE_NS(SomeNamespace, SomeClass) \
namespace Dialogs { \
template class UiFileBasedOptionPage< ::SomeNamespace::Ui::SomeClass>; \
template class UiFileBasedOptionPage<::SomeNamespace::Ui::SomeClass>; \
}
/*!
* \brief Declares external instantiation of class declared with BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE in a convenient way.
* \brief Declares external instantiation of class declared with
* BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE in a convenient way.
* \remarks Might be required when the class comes from an external library.
*/
#define DECLARE_EXTERN_UI_FILE_BASED_OPTION_PAGE(SomeClass) \
@ -217,7 +229,9 @@ private:
}
/*!
* \brief Declares external instantiation of class declared with BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE inside a given namespace in a convenient way.
* \brief Declares external instantiation of class declared with
* BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE inside a given namespace in a
* convenient way.
* \remarks Might be required when the class comes from an external library.
*/
#define DECLARE_EXTERN_UI_FILE_BASED_OPTION_PAGE_NS(SomeNamespace, SomeClass) \
@ -227,12 +241,13 @@ private:
} \
} \
namespace Dialogs { \
extern template class UiFileBasedOptionPage< ::SomeNamespace::Ui::SomeClass>; \
extern template class UiFileBasedOptionPage<::SomeNamespace::Ui::SomeClass>; \
}
/*!
* \brief Declares the method setupWidget() in a convenient way.
* \remarks Can be used between BEGIN_DECLARE_OPTION_PAGE and END_DECLARE_OPTION_PAGE.
* \remarks Can be used between BEGIN_DECLARE_OPTION_PAGE and
* END_DECLARE_OPTION_PAGE.
*/
#define DECLARE_SETUP_WIDGETS \
protected: \
@ -241,7 +256,8 @@ protected:
private:
/*!
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient
* way.
* \remarks Doesn't allow to declare additional class members.
*/
#define DECLARE_UI_FILE_BASED_OPTION_PAGE(SomeClass) \
@ -249,7 +265,8 @@ private:
END_DECLARE_OPTION_PAGE
/*!
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient
* way.
* \remarks Doesn't allow to declare additional class members.
*/
#define DECLARE_OPTION_PAGE(SomeClass) \
@ -258,7 +275,8 @@ private:
END_DECLARE_OPTION_PAGE
/*!
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a convenient way.
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a
* convenient way.
* \remarks Doesn't allow to declare additional class members.
*/
#define DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_SETUP(SomeClass) \

View File

@ -64,8 +64,10 @@ inline QtSettingsData::QtSettingsData()
/*!
* \brief Creates a new settings object.
* \remarks Settings are not restored automatically. Instead, some values (font, widget style, ...) are initialized
* from the current Qt configuration. These values are considered as system-default.
* \remarks Settings are not restored automatically. Instead, some values (font,
* widget style, ...) are initialized
* from the current Qt configuration. These values are considered as
* system-default.
*/
QtSettings::QtSettings()
: m_d(new QtSettingsData())
@ -74,7 +76,8 @@ QtSettings::QtSettings()
/*!
* \brief Destroys the settings object.
* \remarks Unlike QSettings not explicitely saved settings are not saved automatically.
* \remarks Unlike QSettings not explicitely saved settings are not saved
* automatically.
*/
QtSettings::~QtSettings()
{
@ -90,7 +93,8 @@ bool QtSettings::hasCustomFont() const
/*!
* \brief Restors the settings from the specified QSettings object.
* \remarks The restored values are not applied automatically (except translation path).
* \remarks The restored values are not applied automatically (except
* translation path).
* \sa apply(), save()
*/
void QtSettings::restore(QSettings &settings)
@ -142,8 +146,10 @@ void QtSettings::save(QSettings &settings) const
* \brief Applies the current configuraion.
* \remarks
* - Some settings take only affect after restarting the application.
* - QApplication/QGuiApplication must be instantiated before calling this method.
* - Hence it makes most sense to call this directly after instantiating QApplication/QGuiApplication.
* - QApplication/QGuiApplication must be instantiated before calling this
* method.
* - Hence it makes most sense to call this directly after instantiating
* QApplication/QGuiApplication.
*/
void QtSettings::apply()
{
@ -197,8 +203,10 @@ void QtSettings::apply()
/*!
* \brief Returns a new OptionCatecory containing all Qt related option pages.
* \remarks
* - The QtSettings instance does not keep the ownership over the returned category.
* - The pages of the returned category require the QtSetings instance which hence
* - The QtSettings instance does not keep the ownership over the returned
* category.
* - The pages of the returned category require the QtSetings instance which
* hence
* must be present as long as all pages are destroyed.
*/
OptionCategory *QtSettings::category()

View File

@ -19,7 +19,8 @@ namespace Dialogs {
/*!
* \class Dialogs::SettingsDialog
* \brief The SettingsDialog class provides a framework for creating settings dialogs with different categories and subcategories.
* \brief The SettingsDialog class provides a framework for creating settings
* dialogs with different categories and subcategories.
*/
/*!
@ -86,7 +87,8 @@ OptionCategory *SettingsDialog::category(int categoryIndex) const
}
/*!
* \brief Returns the page for the specified \a categoryIndex and the specified \a pageIndex.
* \brief Returns the page for the specified \a categoryIndex and the specified
* \a pageIndex.
*
* The settings dialog keeps ownership over the returned category.
* If no page for the specified indices a null pointer is returned.
@ -116,9 +118,11 @@ void SettingsDialog::showEvent(QShowEvent *event)
}
/*!
* \brief Shows the selected category specified by its model \a index in the category filter model.
* \brief Shows the selected category specified by its model \a index in the
* category filter model.
*
* This private slot is called when m_ui->categoriesListView->selectionModel()->currentChanged() is emitted.
* This private slot is called when
* m_ui->categoriesListView->selectionModel()->currentChanged() is emitted.
*/
void SettingsDialog::currentCategoryChanged(const QModelIndex &index)
{
@ -126,7 +130,8 @@ void SettingsDialog::currentCategoryChanged(const QModelIndex &index)
}
/*!
* \brief Sets the current category to the specified \a category and updates the relevant widgets to show it.
* \brief Sets the current category to the specified \a category and updates the
* relevant widgets to show it.
*/
void SettingsDialog::showCategory(OptionCategory *category)
{
@ -146,10 +151,13 @@ void SettingsDialog::showCategory(OptionCategory *category)
}
/*!
* \brief Enables *single-category mode* to show only the specified \a singleCategory.
* \brief Enables *single-category mode* to show only the specified \a
* singleCategory.
* \remarks
* - In *single-category mode* category selection, filter and heading are hidden.
* - The *single-category mode* can be disabled again by setting \a singleCategory to nullptr.
* - In *single-category mode* category selection, filter and heading are
* hidden.
* - The *single-category mode* can be disabled again by setting \a
* singleCategory to nullptr.
*/
void SettingsDialog::setSingleCategory(OptionCategory *singleCategory)
{
@ -215,7 +223,8 @@ void SettingsDialog::updateTabWidget()
}
/*!
* \brief Applies all changes. Calls OptionCategory::applyAllPages() for each category.
* \brief Applies all changes. Calls OptionCategory::applyAllPages() for each
* category.
*/
bool SettingsDialog::apply()
{
@ -249,7 +258,8 @@ bool SettingsDialog::apply()
}
/*!
* \brief Resets all changes. Calls OptionCategory::resetAllPages() for each category.
* \brief Resets all changes. Calls OptionCategory::resetAllPages() for each
* category.
*/
void SettingsDialog::reset()
{

View File

@ -68,7 +68,8 @@ inline bool SettingsDialog::isTabBarAlwaysVisible() const
}
/*!
* \brief Returns the category model used by the settings dialog to manage the categories.
* \brief Returns the category model used by the settings dialog to manage the
* categories.
*/
inline OptionCategoryModel *SettingsDialog::categoryModel()
{

View File

@ -39,12 +39,12 @@
<translation></translation>
</message>
<message>
<location filename="../aboutdialog/aboutdialog.cpp" line="49"/>
<location filename="../aboutdialog/aboutdialog.cpp" line="55"/>
<source>developed by %1</source>
<translation>entwickelt von %1</translation>
</message>
<message>
<location filename="../aboutdialog/aboutdialog.cpp" line="52"/>
<location filename="../aboutdialog/aboutdialog.cpp" line="57"/>
<source>For updates and bug reports visit the &lt;a href=&quot;%1&quot; style=&quot;text-decoration: underline; color: palette(link);&quot;&gt;project website&lt;/a&gt;.</source>
<translation>Für Aktualisierung und Melden von Fehlern besuche die &lt;a href=&quot;%1&quot; style=&quot;text-decoration: underline; color: palette(link);&quot;&gt;Webseite des Projekts&lt;/a&gt;.</translation>
</message>
@ -54,8 +54,8 @@
<message>
<location filename="../enterpassworddialog/enterpassworddialog.ui" line="12"/>
<location filename="../enterpassworddialog/enterpassworddialog.ui" line="51"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="180"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="195"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="187"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="202"/>
<source>Enter the password</source>
<translation>Passwort eingeben</translation>
</message>
@ -100,28 +100,28 @@
<translation>Bestätigen</translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="180"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="195"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="187"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="202"/>
<source>Enter the new password</source>
<translation>Neues Passwort festlegen</translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="277"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="287"/>
<source>You didn&apos;t enter a user name.</source>
<translation>Es wurde kein Benutzername eingegeben.</translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="279"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="289"/>
<source>You didn&apos;t enter a password.</source>
<translation>Es wurde kein Passwort eingegeben.</translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="283"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="293"/>
<source>You have to enter the new password twice to ensure you enterd it correct.</source>
<translation>Um sicher zu stellen, dass das neue Passwort richtig eingegeben wurde, muss es zweimal eingegeben werden.</translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="285"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="296"/>
<source>You mistyped the password.</source>
<translation>Erstes und zweites Passwort stimmen nicht überein.</translation>
</message>
@ -157,22 +157,22 @@
<context>
<name>Dialogs::PaletteModel</name>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="322"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="323"/>
<source>Color Role</source>
<translation>Farbrolle</translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="324"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="325"/>
<source>Active</source>
<translation>Aktiv</translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="326"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="327"/>
<source>Inactive</source>
<translation>Inaktiv</translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="328"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="329"/>
<source>Disabled</source>
<translation>Deaktiviert</translation>
</message>
@ -292,7 +292,7 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
</message>
<message>
<location filename="../settingsdialog/settingsdialog.ui" line="53"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="143"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="148"/>
<source>No category selected</source>
<translation>Keine Kategorie gewählt</translation>
</message>
@ -317,12 +317,12 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/settingsdialog.cpp" line="227"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="236"/>
<source>&lt;p&gt;&lt;b&gt;Errors occured when applying changes:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;Beim Anwenden der Einstellungen sind Fehler aufgetreten:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;</translation>
</message>
<message>
<location filename="../settingsdialog/settingsdialog.cpp" line="232"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="241"/>
<source>unknonw error</source>
<translation>unbekannter Fehler</translation>
</message>
@ -330,32 +330,32 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<context>
<name>MiscUtils::RecentMenuManager</name>
<message>
<location filename="../misc/recentmenumanager.cpp" line="33"/>
<location filename="../misc/recentmenumanager.cpp" line="35"/>
<source>&amp;Recent</source>
<translation>&amp;Zuletzt verwendet</translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="36"/>
<location filename="../misc/recentmenumanager.cpp" line="38"/>
<source>&amp;Clear list</source>
<translation>&amp;Liste löschen</translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="140"/>
<location filename="../misc/recentmenumanager.cpp" line="144"/>
<source>Recently opened files - </source>
<translation>Kürzlich geöffnete Dateien - </translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="141"/>
<location filename="../misc/recentmenumanager.cpp" line="145"/>
<source>The selected file can&apos;t be found anymore. Do you want to delete the obsolete entry from the list?</source>
<translation>Die ausgewählte Datei kann nicht mehr gefunden werden. Soll die Datei aus der Liste gelöscht werden?</translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="143"/>
<location filename="../misc/recentmenumanager.cpp" line="148"/>
<source>keep entry</source>
<translation>Eintrag behalten</translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="144"/>
<location filename="../misc/recentmenumanager.cpp" line="149"/>
<source>delete entry</source>
<translation>Eintrag löschen</translation>
</message>
@ -363,7 +363,7 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<context>
<name>QObject</name>
<message>
<location filename="../widgets/buttonoverlay.cpp" line="78"/>
<location filename="../widgets/buttonoverlay.cpp" line="84"/>
<source>Clear</source>
<translation>Text löschen</translation>
</message>
@ -371,7 +371,7 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<context>
<name>QtGui::QtLanguageOptionPage</name>
<message>
<location filename="../settingsdialog/qtsettings.cpp" line="367"/>
<location filename="../settingsdialog/qtsettings.cpp" line="375"/>
<source>recognized by Qt as</source>
<translation>von Qt erkannt als</translation>
</message>
@ -379,7 +379,7 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<context>
<name>QtGui::QtOptionCategory</name>
<message>
<location filename="../settingsdialog/qtsettings.cpp" line="207"/>
<location filename="../settingsdialog/qtsettings.cpp" line="215"/>
<source>Qt</source>
<translation></translation>
</message>
@ -410,24 +410,24 @@ Außerdem werden sie vielleicht vom QPA plugin überschrieben und funktionieren
<context>
<name>Widgets::PathSelection</name>
<message>
<location filename="../widgets/pathselection.cpp" line="54"/>
<location filename="../widgets/pathselection.cpp" line="74"/>
<location filename="../widgets/pathselection.cpp" line="55"/>
<location filename="../widgets/pathselection.cpp" line="75"/>
<source>Select ...</source>
<translation>Wählen ...</translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="79"/>
<location filename="../widgets/pathselection.cpp" line="80"/>
<source>Open</source>
<translation>Öffnen</translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="82"/>
<location filename="../widgets/pathselection.cpp" line="83"/>
<source>Explore</source>
<translation>Im Dateibrowser öffnen</translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="118"/>
<location filename="../widgets/pathselection.cpp" line="120"/>
<location filename="../widgets/pathselection.cpp" line="119"/>
<location filename="../widgets/pathselection.cpp" line="121"/>
<source>Select path</source>
<translation>Pfad auswählen</translation>
</message>

View File

@ -34,12 +34,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutdialog/aboutdialog.cpp" line="49"/>
<location filename="../aboutdialog/aboutdialog.cpp" line="55"/>
<source>developed by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutdialog/aboutdialog.cpp" line="52"/>
<location filename="../aboutdialog/aboutdialog.cpp" line="57"/>
<source>For updates and bug reports visit the &lt;a href=&quot;%1&quot; style=&quot;text-decoration: underline; color: palette(link);&quot;&gt;project website&lt;/a&gt;.</source>
<translation type="unfinished"></translation>
</message>
@ -49,8 +49,8 @@
<message>
<location filename="../enterpassworddialog/enterpassworddialog.ui" line="12"/>
<location filename="../enterpassworddialog/enterpassworddialog.ui" line="51"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="180"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="195"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="187"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="202"/>
<source>Enter the password</source>
<translation type="unfinished"></translation>
</message>
@ -95,28 +95,28 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="180"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="195"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="187"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="202"/>
<source>Enter the new password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="277"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="287"/>
<source>You didn&apos;t enter a user name.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="279"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="289"/>
<source>You didn&apos;t enter a password.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="283"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="293"/>
<source>You have to enter the new password twice to ensure you enterd it correct.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="285"/>
<location filename="../enterpassworddialog/enterpassworddialog.cpp" line="296"/>
<source>You mistyped the password.</source>
<translation type="unfinished"></translation>
</message>
@ -152,22 +152,22 @@
<context>
<name>Dialogs::PaletteModel</name>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="322"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="323"/>
<source>Color Role</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="324"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="325"/>
<source>Active</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="326"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="327"/>
<source>Inactive</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paletteeditor/paletteeditor.cpp" line="328"/>
<location filename="../paletteeditor/paletteeditor.cpp" line="329"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
@ -286,7 +286,7 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
</message>
<message>
<location filename="../settingsdialog/settingsdialog.ui" line="53"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="143"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="148"/>
<source>No category selected</source>
<translation type="unfinished"></translation>
</message>
@ -311,12 +311,12 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog/settingsdialog.cpp" line="227"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="236"/>
<source>&lt;p&gt;&lt;b&gt;Errors occured when applying changes:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog/settingsdialog.cpp" line="232"/>
<location filename="../settingsdialog/settingsdialog.cpp" line="241"/>
<source>unknonw error</source>
<translation type="unfinished"></translation>
</message>
@ -324,32 +324,32 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<context>
<name>MiscUtils::RecentMenuManager</name>
<message>
<location filename="../misc/recentmenumanager.cpp" line="33"/>
<location filename="../misc/recentmenumanager.cpp" line="35"/>
<source>&amp;Recent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="36"/>
<location filename="../misc/recentmenumanager.cpp" line="38"/>
<source>&amp;Clear list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="140"/>
<location filename="../misc/recentmenumanager.cpp" line="144"/>
<source>Recently opened files - </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="141"/>
<location filename="../misc/recentmenumanager.cpp" line="145"/>
<source>The selected file can&apos;t be found anymore. Do you want to delete the obsolete entry from the list?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="143"/>
<location filename="../misc/recentmenumanager.cpp" line="148"/>
<source>keep entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../misc/recentmenumanager.cpp" line="144"/>
<location filename="../misc/recentmenumanager.cpp" line="149"/>
<source>delete entry</source>
<translation type="unfinished"></translation>
</message>
@ -357,7 +357,7 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<context>
<name>QObject</name>
<message>
<location filename="../widgets/buttonoverlay.cpp" line="78"/>
<location filename="../widgets/buttonoverlay.cpp" line="84"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
@ -365,7 +365,7 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<context>
<name>QtGui::QtLanguageOptionPage</name>
<message>
<location filename="../settingsdialog/qtsettings.cpp" line="367"/>
<location filename="../settingsdialog/qtsettings.cpp" line="375"/>
<source>recognized by Qt as</source>
<translation type="unfinished"></translation>
</message>
@ -373,7 +373,7 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<context>
<name>QtGui::QtOptionCategory</name>
<message>
<location filename="../settingsdialog/qtsettings.cpp" line="207"/>
<location filename="../settingsdialog/qtsettings.cpp" line="215"/>
<source>Qt</source>
<translation type="unfinished"></translation>
</message>
@ -404,24 +404,24 @@ These settings might be overwritten by your Qt 5 platfrom integration plugin and
<context>
<name>Widgets::PathSelection</name>
<message>
<location filename="../widgets/pathselection.cpp" line="54"/>
<location filename="../widgets/pathselection.cpp" line="74"/>
<location filename="../widgets/pathselection.cpp" line="55"/>
<location filename="../widgets/pathselection.cpp" line="75"/>
<source>Select ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="79"/>
<location filename="../widgets/pathselection.cpp" line="80"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="82"/>
<location filename="../widgets/pathselection.cpp" line="83"/>
<source>Explore</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../widgets/pathselection.cpp" line="118"/>
<location filename="../widgets/pathselection.cpp" line="120"/>
<location filename="../widgets/pathselection.cpp" line="119"/>
<location filename="../widgets/pathselection.cpp" line="121"/>
<source>Select path</source>
<translation type="unfinished"></translation>
</message>

View File

@ -12,19 +12,24 @@
/*!
* \namespace Widgets
* \brief Provides a set of extended widgets such as ClearLineEdit and ClearComboBox.
* \brief Provides a set of extended widgets such as ClearLineEdit and
* ClearComboBox.
*/
namespace Widgets {
/*!
* \class Widgets::ButtonOverlay
* \brief The ButtonOverlay class is used to display buttons on top of other widgets.
* \brief The ButtonOverlay class is used to display buttons on top of other
* widgets.
*
* The class creates a new layout manager and sets it to the widget which is specified
* when constructing an instance. Thus this widget must not already have a layout manager.
* The class creates a new layout manager and sets it to the widget which is
* specified
* when constructing an instance. Thus this widget must not already have a
* layout manager.
*
* The class is used to implement widget customization like ClearLineEidt and ClearComboBox.
* The class is used to implement widget customization like ClearLineEidt and
* ClearComboBox.
*/
/*!
@ -71,9 +76,10 @@ void ButtonOverlay::setClearButtonEnabled(bool enabled)
// enable clear button
m_clearButton = new IconButton;
m_clearButton->setHidden(isCleared());
m_clearButton->setPixmap(/*QIcon::fromTheme(QStringLiteral("edit-clear"), */ QIcon(
QStringLiteral(":/qtutilities/icons/hicolor/48x48/actions/edit-clear.png") /*)*/)
.pixmap(16));
m_clearButton->setPixmap(
/*QIcon::fromTheme(QStringLiteral("edit-clear"), */ QIcon(QStringLiteral(":/qtutilities/icons/hicolor/48x48/actions/"
"edit-clear.png") /*)*/)
.pixmap(16));
m_clearButton->setGeometry(0, 0, 16, 16);
m_clearButton->setToolTip(QObject::tr("Clear"));
QObject::connect(m_clearButton, &IconButton::clicked, std::bind(&ButtonOverlay::handleClearButtonClicked, this));
@ -84,7 +90,8 @@ void ButtonOverlay::setClearButtonEnabled(bool enabled)
/*!
* \brief Shows an info button with the specified \a pixmap and \a infoText.
*
* If there is already an info button enabled, it gets replaced with the new button.
* If there is already an info button enabled, it gets replaced with the new
* button.
*
* \sa ButtonOverlay::disableInfoButton()
*/

View File

@ -8,7 +8,8 @@ namespace Widgets {
/*!
* \class Widgets::ClearSpinBox
* \brief A QSpinBox with an embedded button for clearing its contents and the ability to hide
* \brief A QSpinBox with an embedded button for clearing its contents and the
* ability to hide
* the minimum value.
*/

View File

@ -24,7 +24,8 @@ namespace Widgets {
/*!
* \class Widgets::PathSelection
* \brief A QLineEdit with a QPushButton next to it which allows to select file/directory via QFileDialog.
* \brief A QLineEdit with a QPushButton next to it which allows to select
* file/directory via QFileDialog.
*/
QCompleter *PathSelection::m_completer = nullptr;

View File

@ -65,7 +65,8 @@ inline void PathSelection::provideCustomFileMode(QFileDialog::FileMode customFil
/*!
* \brief Can be used to provide a custom file dialog.
*
* The default file mode is ignored when a custom file dialog has been specified.
* The default file mode is ignored when a custom file dialog has been
* specified.
*/
inline void PathSelection::provideCustomFileDialog(QFileDialog *customFileDialog)
{