more work on smart pointer transition of PTextEdit.

This commit is contained in:
suter_a 2023-10-22 09:23:07 +02:00
parent f9b1ef9dcc
commit 9c2e981e2a
2 changed files with 4 additions and 6 deletions

View File

@ -122,8 +122,6 @@ PTextEdit::PTextEdit( QWidget *parent )
fMsr2DataParam = nullptr;
fFindReplaceData = nullptr;
fTabWidget = nullptr;
// setup menus
setupFileActions();
setupEditActions();
@ -131,9 +129,9 @@ PTextEdit::PTextEdit( QWidget *parent )
setupMusrActions();
setupHelpActions();
fTabWidget = new QTabWidget( this );
fTabWidget = std::make_unique<QTabWidget>( this );
fTabWidget->setMovable(true); // allows to shuffle around tabs
setCentralWidget( fTabWidget );
setCentralWidget( fTabWidget.get() );
textFamily(fAdmin->getFontName());
textSize(QString("%1").arg(fAdmin->getFontSize()));
@ -154,7 +152,7 @@ PTextEdit::PTextEdit( QWidget *parent )
fileNew();
}
connect( fTabWidget, SIGNAL( currentChanged(int) ), this, SLOT( applyFontSettings(int) ));
connect( fTabWidget.get(), SIGNAL( currentChanged(int) ), this, SLOT( applyFontSettings(int) ));
fLastDirInUse = fAdmin->getDefaultSavePath();
}

View File

@ -189,7 +189,7 @@ private:
std::unique_ptr<QComboBox> fComboSize; ///< combo box for the font size
bool fFontChanging; ///< flag needed to prevent some textChanged feature to occure when only the font changed
QTabWidget *fTabWidget; ///< tab widget in which the text editor(s) are placed
std::unique_ptr<QTabWidget> fTabWidget; ///< tab widget in which the text editor(s) are placed
QMap<PSubTextEdit*, QString> fFilenames; ///< mapper between tab widget object and filename
QMenu *fRecentFilesMenu; ///< recent file menu