mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-08 04:44:13 +02:00
b9d459b0e6
The slot was auto-connected by name to QComboBox::activated(QString), which Qt 6 removed, so connectSlotsByName() found no signal and picking a variable in the "Texte composé" dialog did nothing. activated(int) exists in Qt 5 and Qt 6; the slot never used its argument and reads currentData() as before. Same fix as the CompositeTextEditDialog half of #674, which was closed unmerged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef COMPOSITETEXTEDITDIALOG_H
|
|
#define COMPOSITETEXTEDITDIALOG_H
|
|
|
|
#include <QDialog>
|
|
|
|
namespace Ui {
|
|
class CompositeTextEditDialog;
|
|
}
|
|
|
|
class DynamicElementTextItem;
|
|
|
|
/**
|
|
@brief The CompositeTextEditDialog class
|
|
CompositeTextEditDialog display a dialog use to write the complex text
|
|
of a dynamic element text item.
|
|
This dialog provide a QComboBox to quickly add an information of the element
|
|
in the composite text.
|
|
*/
|
|
class CompositeTextEditDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CompositeTextEditDialog(DynamicElementTextItem *text, QWidget *parent = nullptr);
|
|
explicit CompositeTextEditDialog(QString text, bool report, QWidget *parent = nullptr);
|
|
~CompositeTextEditDialog() override;
|
|
|
|
QString plainText() const;
|
|
|
|
private slots:
|
|
void on_m_info_cb_activated(int index);
|
|
|
|
protected:
|
|
void focusInEvent(QFocusEvent *event) override;
|
|
|
|
private :
|
|
void setUpComboBox(bool is_report);
|
|
QString infoToVar(const QString& info) const;
|
|
|
|
private:
|
|
Ui::CompositeTextEditDialog *ui;
|
|
QString m_default_text;
|
|
DynamicElementTextItem *m_text = nullptr;
|
|
};
|
|
|
|
#endif // COMPOSITETEXTEDITDIALOG_H
|