Is it possible to duplicate tabWidget in ui and sync settings from duplicated to original and trigger signals on original?
For example: one tabWidget on tab 2 other on tab 5 , both synced and same widget duplicated and signals get sent to tab 1.
Its not possible to clone QObject/widgets. You can create a new one and
copy selected properties from the source but you cannot really duplicate it.
So to have 2 Tabs that have same widgets, you will have to
Add/remove from both to keep them in sync.
All signals would go to the shared slots so that part will work.
Can u explain the use case?
maybe it gives hints to real goals and we might come up with better solution.
Example. Its possible to reuse an UI file on multiple tabs so changing it visually would
update both. (promotion)
But its Designer thing. Not from code.
Program is with hunderds of settings , settings are spreaded between tabs in tabWidget.
Right now it has 7 tabs and under each tab plenty of settings and some sub tabWidgets with extra content.
It would be good/easy solution if it possible to increase ammount of tabWidgets and acess different tabs on each ,so no constant switching on single tabWidget.
The way tabWidget can pack up lot of settings is good and simplifies ui.
The idea of duplicating tabs seems dumb, because i wont need multiple instances of the settings.
Other Idea i had was to make each tabs content seperated, and implement switcher similar to windows taskbar in app to select what to show.
For example tabWidget 500x300 pixel , to show 2, 3 or 4 of the dif tab content at same time would be good.
Right now not all tabWidgets tabs are in seperate ui files as i started the project before knowing how to simplify and group the ui files well.
Best if the solution would require least re-coding for old content.
Easyest way i see is to put all content to seperate frames and hide , show , move the frames around in window.
Maybe there is easyer ways to implement even better solution using qt libs.
Hmm, many ways to do this yes.
I made one with a TreeWidget on the left and a stackedwidet on the right
So user navigates in the tree and the stacked page is shown on selection.
So at any time only 1 page is shown for the current selected settings group.
Alternatively you can also use a scrolling area and have all settings as a
long "page" and let user scroll or jump to "sections"
StackedWidget is similar to tabWidget , and it displays one page at a time ,if i get it right
Id like to have list of images or text to select the page or pages to display.
And show single page or grid containing 2 / 3 / 4 etc.
Also the placement could be draggable to other positions in grid and invisible pages from list dragged upon visible to replace.
One way for implementing would be to move the frames around in app with algo.
All the pages can be same size so its easy for creating grid.
The app could be started with 1 page and if drag from list to sides of first page then create new pages to the direction of the side, or if drag to center of the page then repalce the page.
Hopefully the description makes sense.
Im wondering if there is premade lib for similar purposes or it needs to be custom made lib?
your description sounds more like a dashboard style overview than a
settings screen. Its easy to make the drag and drop in Qt but move with mouse and
the grid layout will take some custom code.
It is for about 200 settings and often need to adjust settings from multiple pages.
So far idea is to make list of pages and implement the pages by using frames for each page and display/hide/move the frames around to grids.
Maybe there are better solutions?
If new page dragged on previous page it should draw something transparent and similar to this image on the page to select what direction to create new page.
The black lines could be seperating the sectors for selecting direction for new page and the white area where it gets dragged could select.
How to implement the visual part easyest and output correct areas depending on mouse position?