Results 1 to 7 of 7

Thread: [SOLVED: Thanks Jacek] setParent on object just makes it disapear.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [SOLVED: Thanks Jacek] setParent on object just makes it disapear.

    Hello people,

    i'm new to this forum, i don't know how much active it is.
    So let me explain what i'm doing first:
    - I want to achieve a very simple text editor (Tab based) like GEdit is.
    - I want it to be light (Because it is part of a much bigger project i have).

    So for this
    - In the first tab i have a QTextEdit item.
    - i have created a simple QT Window, with in it a tabContainer.
    - In this tab container, i have created two test tabs (tabFile_New1 and tabFile_New2).
    - The signal fom the tab container: currentChanged(QWidget*) is handled in my main Window code, and it pretty much does something like this:
    Qt Code:
    1. void CWndMainImpl::EditorTabChanged (QWidget* pWidget) {
    2. QTabWidget* pSelectedTab = (QTabWidget*)pWidget;
    3. pTextViewer->setParent(pSelectedTab);
    4. }
    To copy to clipboard, switch view to plain text mode 

    So as you understood, the goal is to only have one single text edit box which travels from one tab to another, just changing it's content in a transparent way to the end user...

    The problem is that when i run the app and then switch from the default tab (Where there is actually the text edit) to the other tab, it doesn't switches. And then when i go back to the original tab, my text edit isn't there anymore...

    I have tried very much variants and i don't finally understand what i am doing wrong.

    Thanks for your time!
    Pierre.

    [EDIT:] Sorry for my bad english
    Last edited by hickscorp; 6th December 2006 at 21:49.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.