mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR). Used clang-format 18.1.8. New actions to validate code formatting is added. Update .clang-format with disabling of include sorting. It is temporary changes, then include will be sorted. Apply formatting for /src and /tools folder. The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ShapeView_OpenFileDialog_H
|
||||
#define ShapeView_OpenFileDialog_H
|
||||
@@ -36,58 +36,65 @@ class QToolButton;
|
||||
class QWidget;
|
||||
|
||||
//! \class ShapeView_OpenButton
|
||||
//! Class that contains push button and the button processing. It obtains a file name from the default or current
|
||||
//! directory and gives the name into TInspector communicator
|
||||
//! Object name of the button is the name of the plugin to get the default directory, or the current directory is used.
|
||||
//! Class that contains push button and the button processing. It obtains a file name from the
|
||||
//! default or current directory and gives the name into TInspector communicator Object name of the
|
||||
//! button is the name of the plugin to get the default directory, or the current directory is used.
|
||||
class ShapeView_OpenButton : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
ShapeView_OpenButton (QObject* theParent) : QObject (theParent), myStartButton (0) {}
|
||||
ShapeView_OpenButton(QObject* theParent)
|
||||
: QObject(theParent),
|
||||
myStartButton(0)
|
||||
{
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~ShapeView_OpenButton() {}
|
||||
|
||||
//! Returns the start button, if this is the first call, it creates the button and connect it to the slot
|
||||
//! Returns the start button, if this is the first call, it creates the button and connect it to
|
||||
//! the slot
|
||||
Standard_EXPORT QPushButton* StartButton();
|
||||
|
||||
//! Sets the default directory of plugin.
|
||||
void SetPluginDir (const TCollection_AsciiString& thePluginName, const TCollection_AsciiString& theDefaultDir)
|
||||
{ myDefaultDirs[thePluginName] = theDefaultDir; }
|
||||
void SetPluginDir(const TCollection_AsciiString& thePluginName,
|
||||
const TCollection_AsciiString& theDefaultDir)
|
||||
{
|
||||
myDefaultDirs[thePluginName] = theDefaultDir;
|
||||
}
|
||||
|
||||
private slots:
|
||||
|
||||
//! Processes the button click, open default/current directory to select open file, calls OpenFile of communicator
|
||||
//! Processes the button click, open default/current directory to select open file, calls OpenFile
|
||||
//! of communicator
|
||||
void onStartButtonClicked();
|
||||
|
||||
signals:
|
||||
|
||||
//! Signals about opening file clicked
|
||||
//! \param theFileName an output file name
|
||||
void OpenFile (const QString& theFileName);
|
||||
void OpenFile(const QString& theFileName);
|
||||
|
||||
private:
|
||||
|
||||
QPushButton* myStartButton; //!< processed button
|
||||
std::map<TCollection_AsciiString, TCollection_AsciiString> myDefaultDirs; //!< plugins default directories
|
||||
std::map<TCollection_AsciiString, TCollection_AsciiString>
|
||||
myDefaultDirs; //!< plugins default directories
|
||||
};
|
||||
|
||||
//! \class ShapeView_OpenFileDialog
|
||||
//! Control that contains table view of samples and line to select a file name from other directory.
|
||||
//! Click on element of samples table view calls this sample opening else after entering(or opening) file name
|
||||
//! the import becomes active. Click on the button will open selected file if it is possible
|
||||
//! Click on element of samples table view calls this sample opening else after entering(or opening)
|
||||
//! file name the import becomes active. Click on the button will open selected file if it is
|
||||
//! possible
|
||||
class ShapeView_OpenFileDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
||||
//! Constructor
|
||||
ShapeView_OpenFileDialog (QWidget* theParent, const QString& theDataDirName);
|
||||
ShapeView_OpenFileDialog(QWidget* theParent, const QString& theDataDirName);
|
||||
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~ShapeView_OpenFileDialog() Standard_OVERRIDE {}
|
||||
|
||||
@@ -95,7 +102,7 @@ public:
|
||||
//! \param theParent a parent for the new dialog
|
||||
//! \param theDataDirName path to default samples directory
|
||||
//! \returns a file name from the open file dialog
|
||||
static QString OpenFile (QWidget* theParent, const QString& theDataDirName);
|
||||
static QString OpenFile(QWidget* theParent, const QString& theDataDirName);
|
||||
|
||||
//! Returns selection name from the dialog
|
||||
QString GetFileName() const { return myFileName; }
|
||||
@@ -103,11 +110,12 @@ public:
|
||||
private slots:
|
||||
|
||||
//! Stores name of selected sample file
|
||||
void onSampleSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected);
|
||||
void onSampleSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected);
|
||||
|
||||
//! Updates enabling state of Open file button, it is enabled if the file by the entered path exists
|
||||
//! \param theText a file name text in line edit
|
||||
void onNameChanged (const QString& theText);
|
||||
//! Updates enabling state of Open file button, it is enabled if the file by the entered path
|
||||
//! exists \param theText a file name text in line edit
|
||||
void onNameChanged(const QString& theText);
|
||||
|
||||
//! Open file dialog to select a file name. Fills file name line, enable import button
|
||||
void onSelectClicked();
|
||||
@@ -116,27 +124,25 @@ private slots:
|
||||
void onApplySelectClicked();
|
||||
|
||||
private:
|
||||
|
||||
//! Creates view of file names in samples directory
|
||||
//! \param theFileNames a container of names
|
||||
//! \return table view
|
||||
QTableView* createTableView (const QStringList& theFileNames);
|
||||
QTableView* createTableView(const QStringList& theFileNames);
|
||||
|
||||
//! Creates view model and fills it by the file names
|
||||
//! \param theFileNames a container of names
|
||||
//! \return model
|
||||
QAbstractItemModel* createModel (const QStringList& theFileNames);
|
||||
QAbstractItemModel* createModel(const QStringList& theFileNames);
|
||||
|
||||
//! Generates container of file names in samples directory
|
||||
//! \return container of names
|
||||
QStringList readSampleNames();
|
||||
|
||||
private:
|
||||
|
||||
QString myDataDir; //!< samples directory
|
||||
QString myFileName; //!< result file name
|
||||
QTableView* mySamplesView; //!< view of sample file names
|
||||
QLineEdit* mySelectedName; //!< alternative control to open file
|
||||
QString myDataDir; //!< samples directory
|
||||
QString myFileName; //!< result file name
|
||||
QTableView* mySamplesView; //!< view of sample file names
|
||||
QLineEdit* mySelectedName; //!< alternative control to open file
|
||||
QToolButton* myFolderApplyOpen; //!< button to open file
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user