Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable word wrapping on QWebView?
    primarykey
    data
    text
    <p>I'm using what I believe is a pretty standard example of a WYSIWYG editor from graphics-dojo built using a QWebView. The source can be found <a href="http://qt.gitorious.org/qt-labs/graphics-dojo/trees/master/htmleditor" rel="nofollow">here</a></p> <p>I'm trying to disable the word wrapping in the QWebView so if an element extends beyond the width of the window, a horizontal scrollbar will appear and no wrapping will occur. By default it appears that the text in the QWebView wraps at all window widths except when the width is resized to under about 100 pixels which is when the horizontal scrollbar appears. Given this behavior I know the horizontal scrollbar is enabled. I've looked at QWebView, QWebFrame, and QWebPage and can't seem to find any references to word wrapping. I wonder if it is a property of the underlying WebKit.</p> <p><strong>In summary</strong>: How can I disable word wrapping on a QWebView so that a horizontal scrollbar appearing is the default behavior?</p> <p>The QWebView is contained in the htmleditor.ui file like this.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ui version="4.0"&gt; &lt;class&gt;MainWindow&lt;/class&gt; &lt;widget class="QMainWindow" name="MainWindow"&gt; &lt;property name="geometry"&gt; &lt;rect&gt; &lt;x&gt;0&lt;/x&gt; &lt;y&gt;0&lt;/y&gt; &lt;width&gt;659&lt;/width&gt; &lt;height&gt;398&lt;/height&gt; &lt;/rect&gt; &lt;/property&gt; &lt;property name="windowTitle"&gt; &lt;string&gt;HTML Editor&lt;/string&gt; &lt;/property&gt; &lt;widget class="QWidget" name="centralwidget"&gt; &lt;layout class="QVBoxLayout" name="verticalLayout"&gt; &lt;property name="margin"&gt; &lt;number&gt;0&lt;/number&gt; &lt;/property&gt; &lt;item&gt; &lt;widget class="QTabWidget" name="tabWidget"&gt; &lt;property name="tabPosition"&gt; &lt;enum&gt;QTabWidget::South&lt;/enum&gt; &lt;/property&gt; &lt;property name="tabShape"&gt; &lt;enum&gt;QTabWidget::Rounded&lt;/enum&gt; &lt;/property&gt; &lt;property name="currentIndex"&gt; &lt;number&gt;0&lt;/number&gt; &lt;/property&gt; &lt;property name="documentMode"&gt; &lt;bool&gt;true&lt;/bool&gt; &lt;/property&gt; &lt;widget class="QWidget" name="tab"&gt; &lt;attribute name="title"&gt; &lt;string&gt;Tab 1&lt;/string&gt; &lt;/attribute&gt; &lt;layout class="QVBoxLayout" name="verticalLayout_2"&gt; &lt;property name="margin"&gt; &lt;number&gt;0&lt;/number&gt; &lt;/property&gt; &lt;item&gt; &lt;widget class="QWebView" name="webView"&gt; &lt;property name="url"&gt; &lt;url&gt; &lt;string&gt;about:blank&lt;/string&gt; &lt;/url&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;widget class="QWidget" name="tab_2"&gt; &lt;attribute name="title"&gt; &lt;string&gt;Tab 2&lt;/string&gt; &lt;/attribute&gt; &lt;layout class="QVBoxLayout" name="verticalLayout_3"&gt; &lt;property name="margin"&gt; &lt;number&gt;0&lt;/number&gt; &lt;/property&gt; &lt;item&gt; &lt;widget class="QPlainTextEdit" name="plainTextEdit"&gt; &lt;property name="frameShape"&gt; &lt;enum&gt;QFrame::NoFrame&lt;/enum&gt; &lt;/property&gt; &lt;property name="readOnly"&gt; &lt;bool&gt;true&lt;/bool&gt; &lt;/property&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; &lt;/widget&gt; &lt;/item&gt; &lt;/layout&gt; &lt;/widget&gt; ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload