Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Layered Widgets and ColorDialog Signals?
Forum Updated to NodeBB v4.3 + New Features

Layered Widgets and ColorDialog Signals?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 775 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • BDC_PatrickB Offline
    BDC_PatrickB Offline
    BDC_Patrick
    wrote on last edited by
    #1

    Hi there..

    I´m relatively new to QT and started with the Designer for a basic Layout and add additional, detailed Stuff via CPP.

    Now i got two Questions:

    1.)
    I want to have a View, where i can add Widgets that are layered above each other. Like a Map with different layers.
    This view should be put into a ScrollArea to be able to scroll, obviously.

    2.)
    I added a QColorDialog to a Dialog, that is shown, whenever a Button is clicked. Beside the Button is an empty Frame, that changes its Background Color via setStyleSheet.
    I now want to let a SIGNAL from ColorDialog trigger the Slot

    void Dialog_ProgramSettings::recolorPreview(QColor col)
    

    i tried:

    connect(dialogColor, SIGNAL(colorSelected()),this, SLOT(recolorPreview()));
    

    But always get the Output

    No such slot Dialog_ProgramSettings::recolorPreview()
    

    recolorPreview(QColor col) is inside the private slots of the Header file... so.. definitly there.. tried building with qmake, too..

    Can someone push me into the right Direction here, pls :)

    jsulmJ 1 Reply Last reply
    0
    • BDC_PatrickB BDC_Patrick

      Hi there..

      I´m relatively new to QT and started with the Designer for a basic Layout and add additional, detailed Stuff via CPP.

      Now i got two Questions:

      1.)
      I want to have a View, where i can add Widgets that are layered above each other. Like a Map with different layers.
      This view should be put into a ScrollArea to be able to scroll, obviously.

      2.)
      I added a QColorDialog to a Dialog, that is shown, whenever a Button is clicked. Beside the Button is an empty Frame, that changes its Background Color via setStyleSheet.
      I now want to let a SIGNAL from ColorDialog trigger the Slot

      void Dialog_ProgramSettings::recolorPreview(QColor col)
      

      i tried:

      connect(dialogColor, SIGNAL(colorSelected()),this, SLOT(recolorPreview()));
      

      But always get the Output

      No such slot Dialog_ProgramSettings::recolorPreview()
      

      recolorPreview(QColor col) is inside the private slots of the Header file... so.. definitly there.. tried building with qmake, too..

      Can someone push me into the right Direction here, pls :)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @BDC_Patrick said in Layered Widgets and ColorDialog Signals?:

      No such slot Dialog_ProgramSettings::recolorPreview()

      recolorPreview(QColor col) != recolorPreview()

      BTW: Your signal has a parameter.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      BDC_PatrickB 1 Reply Last reply
      2
      • jsulmJ jsulm

        @BDC_Patrick said in Layered Widgets and ColorDialog Signals?:

        No such slot Dialog_ProgramSettings::recolorPreview()

        recolorPreview(QColor col) != recolorPreview()

        BTW: Your signal has a parameter.

        BDC_PatrickB Offline
        BDC_PatrickB Offline
        BDC_Patrick
        wrote on last edited by
        #3

        @jsulm That worked, thanks.. Now, jst Prob 1 is remaining..

        jsulmJ 1 Reply Last reply
        0
        • BDC_PatrickB BDC_Patrick

          @jsulm That worked, thanks.. Now, jst Prob 1 is remaining..

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @BDC_Patrick said in Layered Widgets and ColorDialog Signals?:

          Now, jst Prob 1 is remaining

          What exactly is the problem? How to use scroll view? How to put widgets over each other?
          Wouldn't it be better to use https://doc.qt.io/qt-5/qstackedwidget.html instead of putting widgets manually over each other?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          BDC_PatrickB 1 Reply Last reply
          0
          • jsulmJ jsulm

            @BDC_Patrick said in Layered Widgets and ColorDialog Signals?:

            Now, jst Prob 1 is remaining

            What exactly is the problem? How to use scroll view? How to put widgets over each other?
            Wouldn't it be better to use https://doc.qt.io/qt-5/qstackedwidget.html instead of putting widgets manually over each other?

            BDC_PatrickB Offline
            BDC_PatrickB Offline
            BDC_Patrick
            wrote on last edited by
            #5

            @jsulm But, a Stacked Widget puts the children into different pages, the user needs to switch between them..
            I want to make all Children visible above each other..

            jsulmJ 1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Do you mean vertically aligned ?
              QScrollArea -> set a widget on it if not already provided by designer -> apply a vertical layout (QVBoxLayout) -> add your other widgets to that layout.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              BDC_PatrickB 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Do you mean vertically aligned ?
                QScrollArea -> set a widget on it if not already provided by designer -> apply a vertical layout (QVBoxLayout) -> add your other widgets to that layout.

                BDC_PatrickB Offline
                BDC_PatrickB Offline
                BDC_Patrick
                wrote on last edited by
                #7

                @SGaist No.. I mean on top of each other..
                as if you build a tower of widgets..

                like a Tilemap with layers..

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I am not sure I see how you are going to implement user interaction with that.

                  Can you provide a picture of the UI you want to achieve ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  BDC_PatrickB 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    I am not sure I see how you are going to implement user interaction with that.

                    Can you provide a picture of the UI you want to achieve ?

                    BDC_PatrickB Offline
                    BDC_PatrickB Offline
                    BDC_Patrick
                    wrote on last edited by
                    #9

                    @SGaist
                    This one is a good example:
                    alt text

                    and the TilED Mapeditor as well..
                    where the Tilemap has multiple layers, directly above each other.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      It makes me think about the graphics view framework.

                      But what kind of widget do you want to put by layers ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      BDC_PatrickB 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        It makes me think about the graphics view framework.

                        But what kind of widget do you want to put by layers ?

                        BDC_PatrickB Offline
                        BDC_PatrickB Offline
                        BDC_Patrick
                        wrote on last edited by
                        #11

                        @SGaist the Tilemap just as example..
                        as for now, I need buttons and labels hovering the view below freely.

                        1 Reply Last reply
                        0
                        • BDC_PatrickB BDC_Patrick

                          @jsulm But, a Stacked Widget puts the children into different pages, the user needs to switch between them..
                          I want to make all Children visible above each other..

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @BDC_Patrick said in Layered Widgets and ColorDialog Signals?:

                          But, a Stacked Widget puts the children into different pages, the user needs to switch between them

                          No, that's the case for QTabWidget

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved