Layered Widgets and ColorDialog Signals?
-
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 Slotvoid 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 :)
-
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 Slotvoid 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 :)
@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_Patrick said in Layered Widgets and ColorDialog Signals?:
No such slot Dialog_ProgramSettings::recolorPreview()
recolorPreview(QColor col) != recolorPreview()
BTW: Your signal has a parameter.
@jsulm That worked, thanks.. Now, jst Prob 1 is remaining..
-
@jsulm That worked, thanks.. Now, jst Prob 1 is remaining..
@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_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?@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.. -
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. -
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.@SGaist No.. I mean on top of each other..
as if you build a tower of widgets..like a Tilemap with layers..
-
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 ?
-
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 ?
@SGaist
This one is a good example:
and the TilED Mapeditor as well..
where the Tilemap has multiple layers, directly above each other. -
It makes me think about the graphics view framework.
But what kind of widget do you want to put by layers ?
-
It makes me think about the graphics view framework.
But what kind of widget do you want to put by layers ?
@SGaist the Tilemap just as example..
as for now, I need buttons and labels hovering the view below freely. -
@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..@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