Chery-picking new upstream release 0.11.1.

* Removed some build dependencies:
  -cmake
  -libqt5xdg-dev
  -libqt5xdgiconloader-dev
  -pkg-config
  -qttools5-dev
  -qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Added Recommends galternatives
ubuntu/cosmic debian/0.11.1-1
Alf Gaida 8 years ago
parent f2573945ac
commit f6a88cd690

3
.gitignore vendored

@ -1,3 +0,0 @@
build
lxqt-config.kdev4
*/translations/lxqt-config

@ -1,7 +1,28 @@
lxqt-config-0.11.0 / 2016-09-24 lxqt-config-0.11.1 / 2017-01-01
=============================== ===============================
* lxqt-config-monitor: remove unnecessary wait before settings load (#114)
* Fix self icontheme update (#113)
* liblxqt-config-cursor: Don't check for null pointer before deleting it
* liblxqt-config-cursor: Explicitly ignore function return value
* Updated and added *_da.desktop files and removed da_DK
* Use FindXCB CMake module
* Activate items on releasing Enter instead of pressing it. (#78)
* Update and rename lxqt-config_fr_FR.desktop to lxqt-config_fr.desktop
* Fix faulty link in README.md
* if not set, set the build type to Release
* Desktop entry files: Update French translation
* lxqt-config: Avoid multiple spawn on auto-repeat
* Fix loading of translations for brightness
* Create lxqt-config-brightness_it.desktop
* Remove cpack (#104)
* lxqt-config-brightness: Add GenericName and Comment to desktop entry
0.11.0 / 2016-09-24
===================
* Release 0.11.0: Add changelog
* appearance: Avoid blocking when setting wallpaper * appearance: Avoid blocking when setting wallpaper
* appearance: Do (not) change wallpaper with theme * appearance: Do (not) change wallpaper with theme
* all: Remove XdgIcon & XdgIconLoader usage * all: Remove XdgIcon & XdgIconLoader usage

@ -28,6 +28,11 @@ find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(lxqt REQUIRED QUIET) find_package(lxqt REQUIRED QUIET)
include(LXQtCompilerSettings NO_POLICY_SCOPE) include(LXQtCompilerSettings NO_POLICY_SCOPE)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include(LXQtTranslate) include(LXQtTranslate)
add_subdirectory(src) add_subdirectory(src)
@ -52,13 +57,3 @@ endif()
if (WITH_LOCALE) if (WITH_LOCALE)
add_subdirectory(lxqt-config-locale) add_subdirectory(lxqt-config-locale)
endif() endif()
# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include(CPack)

@ -55,7 +55,7 @@ The "Configuration Center" (binary `lxqt-config`) is summarizing and providing v
![Configuration Center (lxqt-config)](lxqt-config.png) ![Configuration Center (lxqt-config)](lxqt-config.png)
First of all these are the ones belonging to repository lxqt-config described [above](https://github.com/pmattern/lxqt-config#configuration-gui-tools). Next, it is hosting counterparts of several other LXQt components like "Desktop Notifications" of [lxqt-notificationd](https://github.com/lxde/lxqt-notificationd), "Shortcut Keys" of [lxqt-globalkeyshortcuts](https://github.com/lxde/lxqt-globalkeyshortcuts) or the tools provided by [lxqt-admin](https://github.com/lxde/lxqt-admin). Third-party applications can include their configuration tools in "Configuration Center", too. This applies e. g. to "Connman UI Setup" of [cmst](https://github.com/andrew-bibb/cmst) or "SDDM Configuration" of [sddm-config-editor](https://github.com/hagabaka/sddm-config-editor). First of all these are the ones belonging to repository lxqt-config described [above](https://github.com/lxde/lxqt-config#configuration-gui-tools). Next, it is hosting counterparts of several other LXQt components like "Desktop Notifications" of [lxqt-notificationd](https://github.com/lxde/lxqt-notificationd), "Shortcut Keys" of [lxqt-globalkeyshortcuts](https://github.com/lxde/lxqt-globalkeyshortcuts) or the tools provided by [lxqt-admin](https://github.com/lxde/lxqt-admin). Third-party applications can include their configuration tools in "Configuration Center", too. This applies e. g. to "Connman UI Setup" of [cmst](https://github.com/andrew-bibb/cmst) or "SDDM Configuration" of [sddm-config-editor](https://github.com/hagabaka/sddm-config-editor).
## Installation ## Installation

16
debian/changelog vendored

@ -1,3 +1,19 @@
lxqt-config (0.11.1-1) unstable; urgency=medium
* Chery-picking new upstream release 0.11.1.
* Removed some build dependencies:
-cmake
-libqt5xdg-dev
-libqt5xdgiconloader-dev
-pkg-config
-qttools5-dev
-qttools5-dev-tools
* Bumped build dependency liblxqt0-dev (>= 0.11.1)
* Bumped years in d/copyright
* Added Recommends galternatives
-- Alf Gaida <agaida@siduction.org> Mon, 02 Jan 2017 12:36:49 +0100
lxqt-config (0.11.0-2) unstable; urgency=medium lxqt-config (0.11.0-2) unstable; urgency=medium
* Chery-picking new upstream release 0.11.0 * Chery-picking new upstream release 0.11.0

11
debian/control vendored

@ -7,21 +7,15 @@ Uploaders: Alf Gaida <agaida@siduction.org>,
Section: x11 Section: x11
Priority: optional Priority: optional
Build-Depends: debhelper (>= 10), Build-Depends: debhelper (>= 10),
cmake (>= 3.0.2),
libkf5screen-dev, libkf5screen-dev,
libkf5windowsystem-dev, libkf5windowsystem-dev,
liblxqt0-dev (>= 0.11.0), liblxqt0-dev (>= 0.11.1),
libqt5svg5-dev, libqt5svg5-dev,
libqt5x11extras5-dev, libqt5x11extras5-dev,
libqt5xdg-dev (>= 2.0.0),
libqt5xdgiconloader-dev (>= 2.0.0),
libx11-dev, libx11-dev,
libxcursor-dev, libxcursor-dev,
libxfixes-dev, libxfixes-dev,
pkg-config,
qtbase5-private-dev, qtbase5-private-dev,
qttools5-dev,
qttools5-dev-tools,
zlib1g-dev zlib1g-dev
Standards-Version: 3.9.8 Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-config.git/?h=debian/sid Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-config.git/?h=debian/sid
@ -32,7 +26,8 @@ Package: lxqt-config
Architecture: any Architecture: any
Depends: ${misc:Depends}, Depends: ${misc:Depends},
${shlibs:Depends} ${shlibs:Depends}
Recommends: lxqt-config-l10n Recommends: galternatives,
lxqt-config-l10n
Description: LXQt system settings center Description: LXQt system settings center
The LXQt system settings center The LXQt system settings center
. .

4
debian/copyright vendored

@ -3,7 +3,7 @@ Upstream-Name: lxqt-config
Source: https://github.com/lxde/lxqt-config Source: https://github.com/lxde/lxqt-config
Files: * Files: *
Copyright: 2012-2016 LXQt team Copyright: 2012-2017 LXQt team
2010-2012 Razor team 2010-2012 Razor team
2013 Christian Surlykke 2013 Christian Surlykke
2014 Hong Jen Yee (PCMan) <pcman.tw@gmail.com> 2014 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
@ -84,7 +84,7 @@ Copyright: 2015 Kai Uwe Broulik <kde@privat.broulik.de>
License: LGPL-2.0+ License: LGPL-2.0+
Files: debian/* Files: debian/*
Copyright: 2014-2016 Alf Gaida <agaida@siduction.org> Copyright: 2014-2017 Alf Gaida <agaida@siduction.org>
2015 Andrew Lee (李健秋) <ajqlee@debian.org> 2015 Andrew Lee (李健秋) <ajqlee@debian.org>
License: LGPL-2.1+ License: LGPL-2.1+

4
debian/rules vendored

@ -10,8 +10,8 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
override_dh_auto_configure: override_dh_auto_configure:
dh_auto_configure -- \ dh_auto_configure -- \
-DPULL_TRANSLATIONS=OFF\ -DPULL_TRANSLATIONS=OFF \
-DUPDATE_TRANSLATIONS=OFF\ -DUPDATE_TRANSLATIONS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=RelWithDebInfo
override_dh_makeshlibs: override_dh_makeshlibs:

@ -1,9 +1,7 @@
project(lxqt-config-cursor) project(lxqt-config-cursor)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
find_package(PkgConfig REQUIRED) find_package(XCB REQUIRED xcb)
pkg_check_modules(XCB REQUIRED xcb)
include_directories(${XCB_INCLUDE_DIRS}) include_directories(${XCB_INCLUDE_DIRS})
link_libraries(${XCB_LIBRARIES}) link_libraries(${XCB_LIBRARIES})

@ -59,9 +59,9 @@ void XCursorImage::convertARGB2PreMul (QImage &img) {
switch (img.format()) { switch (img.format()) {
case QImage::Format_ARGB32_Premultiplied: return; case QImage::Format_ARGB32_Premultiplied: return;
case QImage::Format_ARGB32: break; case QImage::Format_ARGB32: break;
default: img.convertToFormat(QImage::Format_ARGB32/*_Premultiplied*/); default: (void) img.convertToFormat(QImage::Format_ARGB32/*_Premultiplied*/);
} }
img.convertToFormat(QImage::Format_ARGB32_Premultiplied); // this shouldn't convert anything (void) img.convertToFormat(QImage::Format_ARGB32_Premultiplied); // this shouldn't convert anything
// so convert it! // so convert it!
for (int y = img.height()-1; y >= 0; y--) { for (int y = img.height()-1; y >= 0; y--) {
quint8 *line = (quint8 *)img.scanLine(y); quint8 *line = (quint8 *)img.scanLine(y);
@ -150,7 +150,7 @@ void XCursorImage::genXCursorImg (QByteArray &res) const {
baPutDW(res, (quint32)mDelay); baPutDW(res, (quint32)mDelay);
// now put the pixels // now put the pixels
QImage i = mImage->copy(); QImage i = mImage->copy();
i.convertToFormat(QImage::Format_ARGB32_Premultiplied); (void) i.convertToFormat(QImage::Format_ARGB32_Premultiplied);
//i.convertToFormat(QImage::Format_ARGB32); //i.convertToFormat(QImage::Format_ARGB32);
for (int y = 0; y < i.height(); y++) { for (int y = 0; y < i.height(); y++) {
const uchar *sl = i.scanLine(y); const uchar *sl = i.scanLine(y);

@ -84,7 +84,8 @@ XCursorImageXCur::~XCursorImageXCur () {
void XCursorImageXCur::parseImgData (const void *aImgData) { void XCursorImageXCur::parseImgData (const void *aImgData) {
mIsValid = false; mIsValid = false;
if (mImage) delete mImage; mImage = 0; delete mImage; // It's fine to delete a null pointer
mImage = 0;
const quint32 *data = (const quint32 *)aImgData; const quint32 *data = (const quint32 *)aImgData;
if (getDW(data) != 36) return; // header size if (getDW(data) != 36) return; // header size
if (getDW(data+1) != 0xfffd0002L) return; // magic if (getDW(data+1) != 0xfffd0002L) return; // magic

@ -138,9 +138,12 @@ IconThemeConfig::~IconThemeConfig()
void IconThemeConfig::iconThemeSelected(QTreeWidgetItem *item, int column) void IconThemeConfig::iconThemeSelected(QTreeWidgetItem *item, int column)
{ {
Q_UNUSED(column); Q_UNUSED(column);
QString theme = item->data(0, Qt::UserRole).toString(); const QString theme = item->data(0, Qt::UserRole).toString();
if (!theme.isEmpty()) if (!theme.isEmpty())
{ {
// Ensure that this widget also updates it's own icons
QIcon::setThemeName(theme);
m_settings->setValue("icon_theme", theme); m_settings->setValue("icon_theme", theme);
m_settings->sync(); m_settings->sync();
} }

@ -1,4 +1,4 @@
# Translations # Translations
Comment[da]=Indstilling af LXQt udseende Name[da]=Udseende
GenericName[da]=Indstilling af LXQt Udseende GenericName[da]=Udseendeindstillinger
Name[da]=Indstilling af LXQt Udseende Comment[da]=Udseendeindstillinger for LXQt

@ -1,4 +0,0 @@
# Translations
Comment[da_DK]=Indstil udseende på LXQt skrivebord
GenericName[da_DK]=Indstilling af LXQt Udseende
Name[da_DK]=Indstilling af LXQt Udseende

@ -0,0 +1,4 @@
# Translations
Name[fr]=Apparence
GenericName[fr]=Configurer l'apparence
Comment[fr]=Configurer l'apparence de LXQt

@ -1,4 +0,0 @@
# Translations
Comment[fr_FR]=Configurer l'apparence du bureau LXQt
GenericName[fr_FR]=Configuration de l'apparence de LXQt
Name[fr_FR]=Configuration de l'apparence de LXQt

@ -3,16 +3,12 @@ project(lxqt-config-brightness)
find_package(Qt5Widgets REQUIRED QUIET) find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5X11Extras REQUIRED QUIET) find_package(Qt5X11Extras REQUIRED QUIET)
find_package(PkgConfig) find_package(XCB REQUIRED xcb xcb-randr)
pkg_check_modules(XRANDR xcb-randr)
pkg_check_modules(XCB xcb)
set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras) set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras)
include_directories ( include_directories (
${XRANDR_INCLUDE_DIRS}
${XCB_INCLUDE_DIRS} ${XCB_INCLUDE_DIRS}
) )
@ -65,13 +61,12 @@ lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME})
lxqt_translate_desktop(DESKTOP_FILES SOURCES "resources/${PROJECT_NAME}.desktop.in") lxqt_translate_desktop(DESKTOP_FILES SOURCES "resources/${PROJECT_NAME}.desktop.in")
add_executable(${PROJECT_NAME} ${CPP_FILES} ${UI_FILES} ${QM_FILES} ${DESKTOP_FILES}) add_executable(${PROJECT_NAME} ${CPP_FILES} ${UI_FILES} ${QM_FILES} ${DESKTOP_FILES} ${QM_LOADER})
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}
${QTX_LIBRARIES} ${QTX_LIBRARIES}
${XRANDR_LDFLAGS} ${XCB_LIBRARIES}
${XCB_LDFLAGS}
lxqt lxqt
) )

@ -17,7 +17,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string notr="true">Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>

@ -1,5 +1,7 @@
[Desktop Entry] [Desktop Entry]
Name=Brightness Settings Name=Brightness
GenericName=Brightness Settings
Comment=Configure brightness
Exec=lxqt-config-brightness Exec=lxqt-config-brightness
Terminal=false Terminal=false
Type=Application Type=Application
@ -7,4 +9,4 @@ Icon=brightnesssettings
Categories=Settings;DesktopSettings;Qt;LXQt;HardwareSettings; Categories=Settings;DesktopSettings;Qt;LXQt;HardwareSettings;
OnlyShowIn=LXQt; OnlyShowIn=LXQt;
#TRANSLATIONS_DIR=translations #TRANSLATIONS_DIR=translations

@ -0,0 +1,4 @@
# Translations
Name[da]=Lysstyrke
GenericName[da]=Lysstyrkeindstillinger
Comment[da]=Konfigurér lysstyrke

@ -0,0 +1,3 @@
Name[fr]=Paramètres de luminosité
GenericName[fr]=Paramètres de luminosité de l'écran
Comment[fr]=Régler la luminosité et le contraste de l'écran

@ -0,0 +1,2 @@
Name[it]=Luminosità
Comment[it]=Permette di cambiare la luminosità e il contrasto dello schermo

@ -0,0 +1,4 @@
# Translations
Name[da]=Filtilknytninger
GenericName[da]=Filtilknytningsindstillinger
Comment[da]=Konfigurér programmer tilknyttet kendte filtyper

@ -0,0 +1,3 @@
Name[fr]=Association des fichiers
GenericName[fr]=Paramètres d'association des fichiers
Comment[fr]=Configurer les applications associées avec les types de fichier

@ -0,0 +1,4 @@
# Translations
Name[da]=Tastatur og mus
GenericName[da]=Input-indstillinger
Comment[da]=Konfigurér tastatur, mus og andre input-enheder

@ -0,0 +1,3 @@
Name[fr]=Clavier et Souris
GenericName[fr]=Paramètres des périphériques d'entrée
Comment[fr]=Configurer les claviers, souris et les autres périphériques d'entrée

@ -0,0 +1,4 @@
# Translations
Name[da]=Sprog
GenericName[da]=Sprogindstillinger
Comment[da]=Sprogindstillinger for LXQt

@ -0,0 +1,3 @@
Name[fr]=Région
GenericName[fr]=Paramètres de la région
Comment[fr]=Paramètres de la région pour LXQt

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string notr="true">Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>

@ -26,13 +26,11 @@
#include <KScreen/SetConfigOperation> #include <KScreen/SetConfigOperation>
#include <LXQt/Settings> #include <LXQt/Settings>
#include <KScreen/EDID> #include <KScreen/EDID>
#include <QThread>
#include <QCoreApplication> #include <QCoreApplication>
LoadSettings::LoadSettings(QObject *parent):QObject(parent) LoadSettings::LoadSettings(QObject *parent):QObject(parent)
{ {
QThread::sleep(10); // KScreen is slow loading screen modes
KScreen::GetConfigOperation *operation = new KScreen::GetConfigOperation(); KScreen::GetConfigOperation *operation = new KScreen::GetConfigOperation();
connect(operation, &KScreen::GetConfigOperation::finished, [this, operation] (KScreen::ConfigOperation *op) { connect(operation, &KScreen::GetConfigOperation::finished, [this, operation] (KScreen::ConfigOperation *op) {
KScreen::GetConfigOperation *configOp = qobject_cast<KScreen::GetConfigOperation *>(op); KScreen::GetConfigOperation *configOp = qobject_cast<KScreen::GetConfigOperation *>(op);

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string notr="true">Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>

@ -0,0 +1,4 @@
# Translations
Name[da]=Skærmindstillinger
GenericName[da]=Skærmindstillinger
Comment[da]=Konfigurér skærme

@ -0,0 +1,3 @@
Name[fr]=Paramètres de l'écran
GenericName[fr]=Paramètres de l'écran
Comment[fr]=Configurer les écrans

@ -213,6 +213,7 @@ private:
LXQtConfig::MainWindow::MainWindow() : QMainWindow() LXQtConfig::MainWindow::MainWindow() : QMainWindow()
{ {
setupUi(this); setupUi(this);
view->installEventFilter(this);
/* To always have the intended layout on startup, /* To always have the intended layout on startup,
the listview should be shown after it's fully formed. */ the listview should be shown after it's fully formed. */
@ -225,7 +226,7 @@ LXQtConfig::MainWindow::MainWindow() : QMainWindow()
view->setUniformItemSizes(true); view->setUniformItemSizes(true);
view->setCategoryDrawer(new QCategoryDrawerV3(view)); view->setCategoryDrawer(new QCategoryDrawerV3(view));
connect(view, &QAbstractItemView::activated, this, &MainWindow::activateItem); connect(view, &QAbstractItemView::activated, [this] (const QModelIndex & index) { pendingActivation = index; });
view->setFocus(); view->setFocus();
QTimer::singleShot(0, [this] { setSizing(); }); QTimer::singleShot(0, [this] { setSizing(); });
@ -249,13 +250,50 @@ void LXQtConfig::MainWindow::load()
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
void LXQtConfig::MainWindow::activateItem(const QModelIndex &index) void LXQtConfig::MainWindow::activateItem()
{ {
if (!index.isValid()) if (pendingActivation.isValid())
return; {
model->activateItem(pendingActivation);
pendingActivation = QModelIndex{};
}
}
QModelIndex orig = proxyModel->mapToSource(index); /*Note: all this delayed activation is here to workaround the auto-repeated
model->activateItem(orig); * Enter/Return key activation -> if the user keeps pressing the enter/return
* we normaly will keep activating (spawning new processes) until the focus
* isn't stolen from our window. New process is not spawned until the
* (non-autorepeated) KeyRelease is delivered.
*
* ref https://github.com/lxde/lxqt/issues/965
*/
bool LXQtConfig::MainWindow::eventFilter(QObject * watched, QEvent * event)
{
if (view != watched)
return false;
switch (event->type())
{
case QEvent::KeyPress:
case QEvent::KeyRelease:
{
QKeyEvent * ev = dynamic_cast<QKeyEvent *>(event);
switch (ev->key())
{
case Qt::Key_Enter:
case Qt::Key_Return:
if (QEvent::KeyRelease == ev->type() && !ev->isAutoRepeat())
activateItem();
}
}
break;
case QEvent::MouseButtonRelease:
activateItem();
break;
default:
//keep warnings quiet
break;
}
return false;
} }
void LXQtConfig::MainWindow::setSizing() void LXQtConfig::MainWindow::setSizing()

@ -52,18 +52,20 @@ public:
protected: protected:
virtual bool event(QEvent * event) override; virtual bool event(QEvent * event) override;
virtual bool eventFilter(QObject * watched, QEvent * event) override;
private: private:
QCategorizedSortFilterProxyModel *proxyModel; QCategorizedSortFilterProxyModel *proxyModel;
ConfigPaneModel *model; ConfigPaneModel *model;
QPersistentModelIndex pendingActivation;
private: private:
void builGroup(const QDomElement& xml); void builGroup(const QDomElement& xml);
void setSizing(); void setSizing();
void activateItem();
private slots: private slots:
void load(); void load();
void activateItem(const QModelIndex &index);
}; };
}; // namespace }; // namespace

@ -516,6 +516,7 @@ void QCategorizedView::Private::_k_slotCollapseOrExpandClicked(QModelIndex)
QCategorizedView::QCategorizedView(QWidget *parent) QCategorizedView::QCategorizedView(QWidget *parent)
: QListView(parent) : QListView(parent)
, d(new Private(this)) , d(new Private(this))
, enterPressed(false)
{ {
} }
@ -1536,6 +1537,45 @@ void QCategorizedView::slotLayoutChanged()
} }
} }
void QCategorizedView::keyPressEvent(QKeyEvent *event)
{
// Don't emit activated() by pressing Enter! ...
switch (event->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
if (state() != EditingState) {
event->ignore();
if (hasFocus() && !event->isAutoRepeat())
enterPressed = true; // Pressed after getting focus.
return;
}
break;
default: break;
}
QAbstractItemView::keyPressEvent(event);
}
void QCategorizedView::keyReleaseEvent(QKeyEvent *event)
{
// ... Emit activated() by releasing Enter instead!
switch (event->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
if (hasFocus() && state() != EditingState
&& !event->isAutoRepeat() // No multiple signals.
&& enterPressed // No signal if Enter is pressed before getting focus.
&& currentIndex().isValid()) {
emit activated(currentIndex());
event->accept();
enterPressed = false;
return;
}
break;
default: break;
}
QAbstractItemView::keyReleaseEvent(event);
}
//END: Public part //END: Public part
#include "moc_qcategorizedview.cpp" #include "moc_qcategorizedview.cpp"

@ -318,6 +318,9 @@ protected:
int start, int start,
int end); int end);
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
protected Q_SLOTS: protected Q_SLOTS:
/** /**
* @internal * @internal
@ -348,6 +351,11 @@ protected Q_SLOTS:
private: private:
class Private; class Private;
Private *const d; Private *const d;
/**
* For knowing that Enter is pressed after
* the widget gets focus and not before that.
*/
bool enterPressed;
Q_PRIVATE_SLOT(d, void _k_slotCollapseOrExpandClicked(QModelIndex)) Q_PRIVATE_SLOT(d, void _k_slotCollapseOrExpandClicked(QModelIndex))
}; };

@ -1,4 +1,4 @@
# Translations # Translations
Comment[da]=Indstil LXQt moduler Name[da]=LXQt-konfigurationscenter
GenericName[da]=LXQt Indstillingscenter GenericName[da]=Systemindstillinger
Name[da]=LXQt Indstillingscenter Comment[da]=Konfigurér dit system

@ -1,4 +0,0 @@
# Translations
Comment[da_DK]=Indstil LXQt moduler
GenericName[da_DK]=LXQt Indstillinger
Name[da_DK]=LXQt Konfigurationsstyring

@ -0,0 +1,4 @@
# Translations
Comment[fr]=Configurer les modules de LXQt
GenericName[fr]=Configuration de LXQt
Name[fr]=Centre de configuration de LXQt

@ -1,4 +0,0 @@
# Translations
Comment[fr_FR]=Configurer les modules de LXQt
GenericName[fr_FR]=Configuration de LXQt
Name[fr_FR]=Centre de configuration de LXQt
Loading…
Cancel
Save