Results 1 to 3 of 3

Thread: Highlighting on Click and call a Function on Double Click for Q*BoxLayout

  1. #1
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Highlighting on Click and call a Function on Double Click for Q*BoxLayout

    Hello everyone,
    I would like to implement something like what i am mentionning in the title of this thread !
    I have a QFrame that contains an Image and a QLabel that contains some text...
    These two are in a Vertical Layout. So here comes my question !

    Can i make this vertical layout selectable for the user meaning on click to become highlighted (Like when you select a file in a file manager) ? Also how can i make it so that if the user double clicks on it to call for a funcation (i wanna show another widget actually)

    If this is not possible with the way that i have it implemented my stuff i am more than happy to change it so i can achieve this functionality that i want. I have been reading the documentation for layout and qwidget but i could not find anything about select on click or double click etc so i need your help to point me to the correct direction.

    Thank you in advance !

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

    Default Re: Highlighting on Click and call a Function on Double Click for Q*BoxLayout

    A layout is not a widget - it is not "visible", so you can't "paint" it. Maybe what you want is QListWidget?

  3. #3
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Highlighting on Click and call a Function on Double Click for Q*BoxLayout

    List Widget was indeed something that i have thought but i was wondering if it was possible to do something like what i said

    Thank you for your answer though i appreciate it !
    Now something more. Is there a way to make QList Widget have always lets say 2 lines of Text ? Cause if you have 1 and put no wrap of text its to small i think but with 2 and no wrap its all i need i think. So i was wondering if there is a way to do this.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.