Unable to visualize QBoxlayout nor QTable
See original GitHub issueHi!
I have been testing the new version of napari and magicgui and was able to get the button example working.
On the other hand when I tried to include additional qt widgets, I notice that this ones where not showing on the napari window. When I remove the @magicgui, and call the functions directly this problem was solved, but I am unable to adjust properly the window specs of, for example, the QBoxLayout.
Cloud you provide some guidance on how to improve this code?
import os
os.environ["DLClight"]="True"
import napari
import math
from enum import Enum
from magicgui import magicgui
import deeplabcut as dlc
from skimage import data
from magicgui import register_type
from qtpy.QtWidgets import (QTableWidget, QWidget, QBoxLayout, QPushButton,
QTableWidgetItem, QLabel, QLineEdit)
from qtpy import QtCore
with napari.gui_qt():
viewer = napari.view_image(data.astronaut(), rgb=True)
table_roi = QTableWidget()
table_roi.setFixedWidth(300)
table_roi.setColumnCount(1)
table_roi.setRowCount(15)
table_roi.setItem(0, 0, QTableWidgetItem(cfg['Task']))
table_roi.setItem(0, 1, QTableWidgetItem("Cell (1,2)"))
table_roi.setItem(1, 0, QTableWidgetItem("Cell (2,1)"))
table_roi.setItem(1, 1, QTableWidgetItem("Cell (2,2)"))
viewer.window.add_dock_widget(table_roi, area='bottom')
@magicgui(label_selection={'widget_type': QBoxLayout})
def label_selection():
lbl1 = QLabel()
lbl1.move(15, 1)
lbl1.setText('test')
box1 = QLineEdit()
box1.move(1, 2)
label_gui = label_selection.Gui(show=True)
viewer.window.add_dock_widget(label_gui, area='right')
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Qtableview in qvboxlayout - Stack Overflow
I answer myself and found basic statement I did not understand about PyQt: There are 2 steps to using the layout system in...
Read more >Thread: Unable to hide QTableWidget in QVBoxLayout
But it happens like QTableWidget always visible on the layout and not getting hidden. Qt Code: Switch view. // I need to hide...
Read more >QTableview not fitting the entire dockwidget window - Qt Forum
This code generates a tableview for a docked window as shown in image 1 but I want a tableview as shown in image...
Read more >PySimpleGUIQt does not import inside QGIS, DLL not found
I can't get it to work, a DLL is not found. Configuration. Win10 64b, QGIS 3.16 (Python 3.7). Steps to reproduce the error....
Read more >PyQt Layouts: Create Professional-Looking GUI Applications
That's because widgets can have only other widgets, not layouts, ... Here's a PyQt application that shows how to create and use a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry about that, I got distracted and never sent the response. I updated the framework so there is no additional creation of points per layers. At first I didn’t understood that the same object creates additional rows for each new layer, but now is simpler. Thanks for the tip!
gonna close this, but feel free to open again if you need help