VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtScriptEditorWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2020 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 class QLineEdit;
13 class QDialogButtonBox;
14 class QTextBrowser;
15 class QPushButton;
16 class QTextEdit;
17 class QVBoxLayout;
18 class QHBoxLayout;
19 
20 #include <vrvCoreQt/vrvCoreQt.h>
21 #include <QtWidgets/QWidget>
22 
23 namespace makVrv
24 {
30  class DT_DLL_VRVCOREQT DtTextEditorWidget : public QWidget
31  {
32  Q_OBJECT
33 
34  public:
35 
38  DtTextEditorWidget(QWidget* parentWidget, bool isHTML = false);
39 
43  void setText(const std::string& text);
44  std::string text() const;
46 
47  signals:
48  void commitButtonPressed();
49 
50  protected slots:
51  virtual void onCommitButtonPressed();
52  virtual void onCancelButtonPressed();
53  virtual void onToggleButtonPressed();
54 
55  protected:
56  QVBoxLayout* myMainLayout;
57 
58  QTextEdit * myTextEdit;
59  QTextBrowser* myDescriptionView;
60 
61  QDialogButtonBox* myButtonBox;
63  };
64 
71  class DT_DLL_VRVCOREQT DtScriptEditorWidget : public QWidget
72  {
73  Q_OBJECT
74 
75  public:
76 
79  DtScriptEditorWidget(QWidget* parentWidget, bool isHTML = false);
80 
83 
87  void setText(const std::string& text);
88  std::string text() const;
90 
93  void setWindowTitle(const QString & title);
94 
95  signals:
96  void onScriptValueChanged(const std::string&);
97 
98  protected slots:
99  virtual void onEditButtonPressed();
100  virtual void onCommitButtonPressed();
101  virtual void onLineEditChanged();
102 
103  protected:
104  QHBoxLayout * myMainLayout;
108  };
109 }
A widget that is (horizontally) composed of a QLineEdit widget and a QPushButton widget. The QLineEdit widget will hold some script text. The QPushButton will pop up a text editor dialog that allows the user to edit the script text using a multi-line text box (as opposed to the single-line text box). The user can indicate the widget is targeted toward editing HTML, so that the user can preview the HTML or view the HTML source as plain text.
Definition: DtScriptEditorWidget.h:71
QVBoxLayout * myMainLayout
Definition: DtScriptEditorWidget.h:56
QDialogButtonBox * myButtonBox
Definition: DtScriptEditorWidget.h:61
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
QTextBrowser * myDescriptionView
Definition: DtScriptEditorWidget.h:59
QTextEdit * myTextEdit
Definition: DtScriptEditorWidget.h:58
A dialog widget that allows the user to edit multi-line text. The user can indicate the widget is tar...
Definition: DtScriptEditorWidget.h:30
QPushButton * myEditButton
Definition: DtScriptEditorWidget.h:106
QLineEdit * myLineEdit
Definition: DtScriptEditorWidget.h:107
DtTextEditorWidget * myTextEditorWidget
Definition: DtScriptEditorWidget.h:105
QHBoxLayout * myMainLayout
Definition: DtScriptEditorWidget.h:104
QPushButton * myToggleButton
Definition: DtScriptEditorWidget.h:62

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)