Results 1 to 9 of 9

Thread: QToolBox and signal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QToolBox and signal

    Hello, i have a problem with QToolBox.
    I read the QToolBox can contain some tabs and they are QWidget's items.
    When i select a page(tab) the signal currentChanged() is emitted, but when i jump in the slot connected to currentChanged() the page is already changed, i'd like to do some control before to change the page and i have not found any signal to do this.
    Is there a signal called before currentChanged() at the page rise?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QToolBox and signal

    Unfortunately, there doesn't seem to be any method for that. You can send a feature request at Task-Tracker.
    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolBox and signal

    Ok, i'll do it, do you know any work-around to performe this?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QToolBox and signal

    What would you like to do? You could for example reimplement QWidget::setVisible() of page widgets.
    J-P Nurmi

  5. #5
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolBox and signal

    When i click on a QWidgets in my QToolBox i want to check some parameter befor to load/rise the QWidget clicked, if the parameter checked is true i'd like to load/rise the QWidget clicked otherwise i want to stay on my old QWidget.
    This is the behavoir that i want to get.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QToolBox and signal

    Sorry, I don't understand the problem. Could you rephrase, please? Pay special attention to terms "click" and "check". Remember that we don't know what do the page widgets look like. When "clicking widgets" and "checking widgets" do you mean changing the current item of the tool box?
    J-P Nurmi

  7. #7
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolBox and signal

    When i click on a QWidgets in my QToolBox i want to check some parameter befor to load/rise the QWidget clicked, if the parameter checked is true i'd like to load/rise the QWidget clicked otherwise i want to stay on my old QWidget.
    This is the behavoir that i want to get.
    click = action that allow to change the current item of the tool box
    check = action that i want to perform before the "click"
    load/rise = the result of "click" action

    thx for your patience

  8. #8
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolBox and signal

    Maybe i can reimplement "event ( QEvent * event )" and check when the mouse is clicked on my QToolBox, is it possibile?
    Last edited by mattia; 27th December 2007 at 16:05.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QToolBox and signal

    The simplest solution is to revert back to the previous widget if the check fails after the new widget has been shown from within the slot mentioned in the first post of this thread. There shouldn't even be any flicker as you'll be doing it before events are processed.

Similar Threads

  1. QListWidget SIGNAL Problem
    By skuda in forum Qt Programming
    Replies: 19
    Last Post: 28th October 2009, 14:42

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.