Gui: fix regression: show commands of selected category in Toolbar tab

This commit is contained in:
wmayer
2022-11-10 21:09:03 +01:00
committed by wwmayer
parent a95aefdb18
commit 84d0f4fb6f
3 changed files with 14 additions and 2 deletions

View File

@@ -85,8 +85,6 @@ public:
AccelLineEdit *currentShortcut = nullptr);
protected:
void showEvent(QShowEvent* e) override;
/** @name Internal helper function for handling command list widgets
*/
//@{
@@ -115,6 +113,7 @@ protected Q_SLOTS:
void onModifyMacroAction(const QByteArray&) override;
protected:
void showEvent(QShowEvent* e) override;
void changeEvent(QEvent *e) override;
void setShortcutOfCurrentAction(const QString&);

View File

@@ -782,6 +782,17 @@ void DlgCustomToolbarsImp::moveDownCustomCommand(const QString& name, const QByt
}
}
void DlgCustomToolbarsImp::showEvent(QShowEvent* event)
{
Q_UNUSED(event);
// If we did this already in the constructor we wouldn't get the vertical scrollbar if needed.
// The problem was noticed with Qt 4.1.4 but may arise with any later version.
if (firstShow) {
ui->categoryBox->activated(ui->categoryBox->currentIndex());
firstShow = false;
}
}
void DlgCustomToolbarsImp::changeEvent(QEvent *e)
{
DlgCustomToolbars::changeEvent(e);

View File

@@ -102,6 +102,7 @@ public:
~DlgCustomToolbarsImp() override;
protected:
void showEvent(QShowEvent* e) override;
void changeEvent(QEvent *e) override;
void addCustomToolbar(const QString&) override;
void removeCustomToolbar(const QString&) override;
@@ -114,6 +115,7 @@ protected:
private:
QList<QAction*> getActionGroup(QAction*);
void setActionGroup(QAction*, const QList<QAction*>& group);
bool firstShow = true;
};
/** This class implements the creation of user defined toolbox bars.