Add persistence to Python console word wrap
This commit is contained in:
parent
b9fea9ce73
commit
f2467d7044
|
@ -1,111 +1,263 @@
|
|||
<ui version="4.0" >
|
||||
<author></author>
|
||||
<comment></comment>
|
||||
<exportmacro></exportmacro>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Gui::Dialog::DlgGeneral</class>
|
||||
<widget class="QWidget" name="Gui::Dialog::DlgGeneral" >
|
||||
<property name="geometry" >
|
||||
<widget class="QWidget" name="Gui::Dialog::DlgGeneral">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>390</width>
|
||||
<width>396</width>
|
||||
<height>553</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="GroupBox5" >
|
||||
<property name="title" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="GroupBox5">
|
||||
<property name="title">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="3" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="GroupBox7">
|
||||
<property name="title">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>352</width>
|
||||
<height>221</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QGroupBox" name="GroupBox10" >
|
||||
<property name="title" >
|
||||
<string>Start up</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<widget class="Gui::PrefCheckBox" name="SplashScreen" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabel1_4">
|
||||
<property name="text">
|
||||
<string>Change language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="Languages"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="GroupBox3">
|
||||
<property name="title">
|
||||
<string>Main window</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="recentFileListLabel">
|
||||
<property name="text">
|
||||
<string>Size of recent file list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefSpinBox" name="RecentFiles">
|
||||
<property name="value">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>RecentFiles</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>RecentFiles</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="tiledBackground">
|
||||
<property name="text">
|
||||
<string>Enable tiled background</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="styleSheetLabel">
|
||||
<property name="text">
|
||||
<string>Style sheet:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="StyleSheets"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="windowStyleLabel">
|
||||
<property name="text">
|
||||
<string>Window style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="WindowStyle"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="iconSizeLabel">
|
||||
<property name="text">
|
||||
<string>Size of toolbar icons:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="toolbarIconSize"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="GroupBox10">
|
||||
<property name="title">
|
||||
<string>Start up</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="SplashScreen">
|
||||
<property name="text">
|
||||
<string>Enable splash screen at start up</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ShowSplasher</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>General</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="tabReportLabel" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="tabReportLabel">
|
||||
<property name="text">
|
||||
<string>Switch to tab of report window:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QComboBox" name="AutoloadModuleCombo" />
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="AutoloadModuleCombo"/>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="Gui::PrefComboBox" name="AutoloadTabCombo" >
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::PrefComboBox" name="AutoloadTabCombo">
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AutoloadTab</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>General</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="autoModuleLabel" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="autoModuleLabel">
|
||||
<property name="text">
|
||||
<string>Auto load module after start up:</string>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -115,206 +267,71 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="GroupBox7" >
|
||||
<property name="title" >
|
||||
<string>Language</string>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="GroupBox11">
|
||||
<property name="title">
|
||||
<string>Python console</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout" name="_4">
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
<item row="0" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="PythonWordWrap">
|
||||
<property name="text">
|
||||
<string>Enable word wrap</string>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabel1_4" >
|
||||
<property name="text" >
|
||||
<string>Change language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="Languages" />
|
||||
</item>
|
||||
</layout>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>PythonWordWrap</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>General</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QGroupBox" name="GroupBox3" >
|
||||
<property name="title" >
|
||||
<string>Main window</string>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="recentFileListLabel" >
|
||||
<property name="text" >
|
||||
<string>Size of recent file list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefSpinBox" name="RecentFiles" >
|
||||
<property name="value" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0" >
|
||||
<cstring>RecentFiles</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0" >
|
||||
<cstring>RecentFiles</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="tiledBackground" >
|
||||
<property name="text" >
|
||||
<string>Enable tiled background</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="styleSheetLabel" >
|
||||
<property name="text" >
|
||||
<string>Style sheet:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="StyleSheets" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="windowStyleLabel" >
|
||||
<property name="text" >
|
||||
<string>Window style:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="WindowStyle" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="iconSizeLabel" >
|
||||
<property name="text" >
|
||||
<string>Size of toolbar icons:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="toolbarIconSize" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>352</width>
|
||||
<height>221</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
|
@ -322,6 +339,7 @@
|
|||
<tabstop>WindowStyle</tabstop>
|
||||
<tabstop>RecentFiles</tabstop>
|
||||
<tabstop>SplashScreen</tabstop>
|
||||
<tabstop>PythonWordWrap</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "DockWindowManager.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PrefWidgets.h"
|
||||
#include "PythonConsole.h"
|
||||
#include "Language/Translator.h"
|
||||
|
||||
using namespace Gui::Dialog;
|
||||
|
@ -126,6 +127,17 @@ void DlgGeneralImp::saveSettings()
|
|||
AutoloadTabCombo->onSave();
|
||||
RecentFiles->onSave();
|
||||
SplashScreen->onSave();
|
||||
PythonWordWrap->onSave();
|
||||
|
||||
PythonConsole* pcPython = new PythonConsole(this);
|
||||
bool pythonWordWrap = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General")->GetBool("PythonWordWrap", true);
|
||||
|
||||
if (pythonWordWrap) {
|
||||
pcPython->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
// set new user defined style
|
||||
//(void)QApplication::setStyle(WindowStyle->currentText());
|
||||
|
@ -199,6 +211,7 @@ void DlgGeneralImp::loadSettings()
|
|||
AutoloadTabCombo->onRestore();
|
||||
RecentFiles->onRestore();
|
||||
SplashScreen->onRestore();
|
||||
PythonWordWrap->onRestore();
|
||||
|
||||
// fill up styles
|
||||
//
|
||||
|
|
|
@ -371,7 +371,15 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
|
|||
|
||||
// Python console
|
||||
PythonConsole* pcPython = new PythonConsole(this);
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General");
|
||||
|
||||
if (hGrp->GetBool("PythonWordWrap", true)) {
|
||||
pcPython->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
pcPython->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
|
||||
pcPython->setObjectName
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "FileDialog.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <CXX/Exception.hxx>
|
||||
|
@ -443,6 +442,15 @@ void PythonConsole::OnChange( Base::Subject<const char*> &rCaller,const char* sR
|
|||
Q_UNUSED(rCaller);
|
||||
ParameterGrp::handle hPrefGrp = getWindowParameter();
|
||||
|
||||
bool pythonWordWrap = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General")->GetBool("PythonWordWrap", true);
|
||||
|
||||
if (pythonWordWrap) {
|
||||
this->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
this->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) {
|
||||
int fontSize = hPrefGrp->GetInt("FontSize", 10);
|
||||
QString fontFamily = QString::fromLatin1(hPrefGrp->GetASCII("Font", "Courier").c_str());
|
||||
|
@ -1183,12 +1191,26 @@ void PythonConsole::contextMenuEvent ( QContextMenuEvent * e )
|
|||
|
||||
QAction* wrap = menu.addAction(tr("Word wrap"));
|
||||
wrap->setCheckable(true);
|
||||
wrap->setChecked(this->wordWrapMode() != QTextOption::NoWrap);
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General");
|
||||
if (hGrp->GetBool("PythonWordWrap", true)) {
|
||||
wrap->setChecked(true);
|
||||
this->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
} else {
|
||||
wrap->setChecked(false);
|
||||
this->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
QAction* exec = menu.exec(e->globalPos());
|
||||
if (exec == wrap) {
|
||||
this->setWordWrapMode(wrap->isChecked()
|
||||
? QTextOption::WrapAtWordBoundaryOrAnywhere : QTextOption::NoWrap);
|
||||
if (wrap->isChecked()) {
|
||||
this->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
hGrp->SetBool("PythonWordWrap", true);
|
||||
} else {
|
||||
this->setWordWrapMode(QTextOption::NoWrap);
|
||||
hGrp->SetBool("PythonWordWrap", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user