discostu
18th November 2007, 07:23
I have my own subclass of QTextEdit (called Editor) for which I want to allow the user to set the tab width (ideally in number of spaces, but it looks like pixels is the only option). Anyway, using the setTabStopWidth member function doesn't do anything. I tried explicitly setting it to 200 pixels right after I declare it but, that doesn't seem to do anything. I didn't overload that function.
class Editor : public QTextEdit {
Q_OBJECT
public :
Editor( QWidget* parent = 0 );
~Editor();
...
}
...
mCommandEdit = new Editor;
mCommandEdit->setTabChangesFocus(false);
mCommandEdit->setTabStopWidth ( 200 );
I can post more complete code if necessary, but I just want to find out if this should work like I am thinking.
Thanks.
class Editor : public QTextEdit {
Q_OBJECT
public :
Editor( QWidget* parent = 0 );
~Editor();
...
}
...
mCommandEdit = new Editor;
mCommandEdit->setTabChangesFocus(false);
mCommandEdit->setTabStopWidth ( 200 );
I can post more complete code if necessary, but I just want to find out if this should work like I am thinking.
Thanks.