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 
39  DtTextEditorWidget(QWidget* parentWidget, bool isHTML = false);
40 
44  void setText(const std::string& text);
45  std::string text() const;
47 
48  signals:
49  void commitButtonPressed();
50 
51  protected slots:
52  virtual void onCommitButtonPressed();
53  virtual void onCancelButtonPressed();
54  virtual void onToggleButtonPressed();
55 
56  protected:
57  QVBoxLayout* myMainLayout;
58 
59  QTextEdit * myTextEdit;
60  QTextBrowser* myDescriptionView;
61 
62  QDialogButtonBox* myButtonBox;
64  };
65 
72  class DT_DLL_VRVCOREQT DtScriptEditorWidget : public QWidget
73  {
74  Q_OBJECT
75 
76  public:
77 
81  DtScriptEditorWidget(QWidget* parentWidget, bool isHTML = false);
82 
85 
89  void setText(const std::string& text);
90  std::string text() const;
92 
95  void setWindowTitle(const QString & title);
96 
97  signals:
98  void onScriptValueChanged(const std::string&);
99 
100  protected slots:
101  virtual void onEditButtonPressed();
102  virtual void onCommitButtonPressed();
103  virtual void onLineEditChanged();
104 
105  protected:
106  QHBoxLayout * myMainLayout;
110  };
111 }
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:72
QVBoxLayout * myMainLayout
Definition: DtScriptEditorWidget.h:57
QDialogButtonBox * myButtonBox
Definition: DtScriptEditorWidget.h:62
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
QTextBrowser * myDescriptionView
Definition: DtScriptEditorWidget.h:60
QTextEdit * myTextEdit
Definition: DtScriptEditorWidget.h:59
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:108
QLineEdit * myLineEdit
Definition: DtScriptEditorWidget.h:109
DtTextEditorWidget * myTextEditorWidget
Definition: DtScriptEditorWidget.h:107
QHBoxLayout * myMainLayout
Definition: DtScriptEditorWidget.h:106
QPushButton * myToggleButton
Definition: DtScriptEditorWidget.h:63

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)