LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2006, 09:11 AM   #1
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Qt3 QTextEdit operation mode


This isn't really a programming question as such but this is the closest forum I could pick.

I use SQLitebrowser to manage a couple of SQLite databases for my web site which is great but the editor wants to edit it rich text mode and I'd rather edit the HTML by hand. I thought I might be able to hack away at the sources but all the UI stuff is in XML files and the only Qt references I can find online are for C.

This is the reference I found which is very helpful but I'm not sure how to translate that to the XML UI file, sample section here:
Code:
            <widget class="QWidget">
                <property name="name">
                    <cstring>WStackPage</cstring>
                </property>
                <attribute name="id">
                    <number>0</number>
                </attribute>
                <grid>
                    <property name="name">
                        <cstring>unnamed</cstring>
                    </property>
                    <widget class="QTextEdit" row="0" column="0">
                        <property name="name">
                            <cstring>textEditor</cstring>
                        </property>
                    </widget>
                </grid>
            </widget>
Basically I need to setTextFormat(PlainText), if anyone knows what they're doing here, any help would be much appreciated
 
Old 07-03-2006, 03:38 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
My guess would be to add the following:
Code:
                        <property name="textFormat">
                            <cstring>PlainText</cstring>
                        </property>
As shown below
Code:
<widget class="QWidget">
                <property name="name">
                    <cstring>WStackPage</cstring>
                </property>
                <attribute name="id">
                    <number>0</number>
                </attribute>
                <grid>
                    <property name="name">
                        <cstring>unnamed</cstring>
                    </property>
                    <widget class="QTextEdit" row="0" column="0">
                        <property name="name">
                            <cstring>textEditor</cstring>
                        </property>
                        <property name="textFormat">
                            <cstring>PlainText</cstring>
                        </property>
                    </widget>
                </grid>
            </widget>
I would then image you will need to recompile it to pick up the changes.
 
Old 07-03-2006, 05:12 AM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Original Poster
Rep: Reputation: 57
Some creative Googling with filetype:ui got me an answer!
Code:
                    <widget class="QTextEdit" row="0" column="0">
                        <property name="name">
                            <cstring>textEditor</cstring>
                        </property>
                        <property name="textFormat">
                            <enum>PlainText</enum>
                        </property>
                    </widget>
Thanks for the suggestion, it put me on the right trail
 
Old 07-03-2006, 05:27 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Yes enum rather than cstring, makes sense (now that I think about it) By the way I just went to the documents at trolltech. I suspect that you could also open it in the designer and then do the change you want, and check the change that it made to the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the mode of operation of the LAN Card? duffmckagan *BSD 4 10-17-2005 03:13 PM
How do I change the mode of Operation of the LAN Card? duffmckagan Linux - Networking 3 10-17-2005 11:36 AM
QTextEdit IO-problem/bug (Qt 3.3.3) bastl Programming 0 03-19-2005 09:16 AM
How can I change display mode from character mode to graph mode wuzhong Linux - Hardware 1 08-08-2004 09:36 AM
Help Qt3 Zion Linux - General 15 07-22-2002 06:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration