Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
850 Topics 3.3k Posts
  • PySide2 contextMenuEvent and mouseMoveEvent clash

    Moved Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    jsulmJ

    @Goffer Well, without code it is hard to help...

  • How can I create a process in C++ or Qt?

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    SGaistS

    Hi,

    This looks like it could be a job for QtConcurrent::run.

  • What is the current state of Jambi ?

    Unsolved
    3
    0 Votes
    3 Posts
    952 Views
    H

    Hello, @Chris-Kawa !

    Thanks for your link and advice.

  • Multiline support using QTranslate

    Unsolved
    2
    0 Votes
    2 Posts
    806 Views
    sierdzioS

    Yes it does.

    How can we translate the string which contains \n during the string translation also.

    Just include \n in the translated text :-) If it is needed in other language, of course.

  • PyQt5 QMediaPlayer ResourceError with seemingly valid QUrl

    Unsolved
    4
    0 Votes
    4 Posts
    3k Views
    SGaistS

    Did you try with a file from another container/format ?

  • 0 Votes
    1 Posts
    445 Views
    No one has replied
  • Close or hide window ? Which the best ?

    Moved Unsolved
    3
    0 Votes
    3 Posts
    3k Views
    ?

    Hello @Wieland,

    In my case, I am integrating my interface as a plugin in QGIS. So, when closing all the windows and launching from QGIS, the main window is displayed. I don't really know If I need to destroy in this case.
    Thanks for your reply.

  • 0 Votes
    8 Posts
    4k Views
    SGaistS

    Tricky one !

    Thanks for sharing :)

  • PySide2 is stable like PyQt5?

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi,

    Well, the best thing to do IMHO is to run a test/benchmark to see it it fills your need.

  • PySide2 Windows build error

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    N

    I tried your suggestion. No change.

  • PyQTGraph - X axis updating with minutes

    Unsolved
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • PyQT5- Question mark button

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    SGaistS

    Hi and welcome to devnet,

    Take a look at the QWhatsThis class.

  • Implementing QThread into code

    Moved Solved
    5
    0 Votes
    5 Posts
    2k Views
    C

    Problem solved with mooving to PyQtGraph. Thanks for help.
    Vlado

    import pyqtgraph as pg OUT_Buffer_Time = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26] # 26 spominskih mest OUT_Buffer_Zg = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # 26 spominskih mest OUT_Buffer_Sp = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # 26 spominskih mest def simple_graph(): H = pg.plot(OUT_Buffer_Time, OUT_Buffer_Zg, pen='b') H.plot(OUT_Buffer_Time, OUT_Buffer_Zg, pen=(255, 0, 0)) H.plot(OUT_Buffer_Time, OUT_Buffer_Sp, pen=(0, 255, 200))
  • 0 Votes
    3 Posts
    904 Views
    ?

    Hello @mrjj :

    In my main window, I call to launch my pop-up window :

    def show(self): self.project.load() if self.project.tranus_project: self.tranus_folder.setText(self.project.tranus_project.path) self.activate_launch_button() self.launch_options_TRANUS() super(OptionsTRANUSDialog, self).show() ...... def launch_options_TRANUS(self): self.get_checked_list() if self.checked_list != [] : dialog = launch_tranus_dialog.LaunchTRANUSDialog(self.checked_list,self.folder,self.tranus_binaries,parent=self) dialog.show() result = dialog.exec_() self.reinitialise_checked_list()

    The class of my pop-up window is defined as :

    class LaunchTRANUSDialog(QtGui.QDialog, FORM_CLASS): def __init__(self,checked_list,project_directory,tranus_bin_path,parent=None): """Constructor.""" super(LaunchTRANUSDialog, self).__init__(parent) self.setupUi(self) self.project = parent.project self.proj = QgsProject.instance() self.tranus_bin_path = tranus_bin_path self.project_directory = project_directory self.project = parent.project self.checked_list = checked_list self.is_all_checked = False self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget') self.proj = QgsProject.instance() #control actions self.tabs.blockSignals(True) self.tabs.currentChanged.connect(self.onChange) self.tabs.blockSignals(False) def show(self): self.put_tabs() super(LaunchTRANUSDialog, self).show()
  • 0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi and welcome to devnet,

    Do you mean that you want to sort your QTableWidget by the date string ?

  • Strange errors with an access violation

    Solved
    11
    0 Votes
    11 Posts
    7k Views
    A

    On the way to work it came to my mind that I use the pointer and probably do not create the object.
    In work I use C# and forget that i must create object ;]

    Hehe now everything work fine.

    Thanks for help ;]

  • 0 Votes
    9 Posts
    3k Views
    ?

    Hello again,

    Finally, I found a solution : putting actions when creating tabs. Here is my code :

    def add_new_tab(self,index,text): new_tab = InterfaceTemplateDialog() self.tabs.addTab(new_tab,text) self.tabs.setTabText(index,text) new_tab.generate_btn.clicked.connect(self.launch) new_tab.run_tranus_btn.clicked.connect(self.run_tranus) new_tab.check_all_btn.clicked.connect(self.check_all) def onChange(self): index = self.tabs.currentIndex() tab_title = self.tabs.tabText(index) tab = self.tabs.currentWidget() if tab_title != "All checked scenarios": scenario = tab_title.split('-')[1] else : scenario ="ALL" return [tab,scenario] def run_tranus(self): tab = self.onChange()[0] scenario = self.onChange()[1] tab.console.append("Beginning of execution of basic TRANUS programs for scenario "+scenario) tab.console.append("Executing loop TRANUS for "+ `tab.spin_box.value()` +" iterations")
  • 0 Votes
    2 Posts
    900 Views
    SGaistS

    Hi,

    QSignalMapper might be what you are looking for.

  • 0 Votes
    4 Posts
    4k Views
    ?

    Hello,

    It was an other problem that causes this problem. So, I solved and now it works.

    Thanks .

  • 0 Votes
    8 Posts
    3k Views
    ?

    Final solution, it works very well. Thanks to @SGaist and @VRonin :

    def activate_launch_button(self): model = self.scenarios.model() model.itemChanged.connect(self.check_configure) def check_configure(self,item): model = self.scenarios.model() index = model.indexFromItem(item) if index.data(QtCore.Qt.CheckStateRole) != index.data(QtCore.Qt.UserRole + QtCore.Qt.CheckStateRole): if index.data(QtCore.Qt.CheckStateRole)!= QtCore.Qt.Unchecked : self.count_check+=1 model.setData(index,index.data(QtCore.Qt.CheckStateRole),QtCore.Qt.UserRole + QtCore.Qt.CheckStateRole) else : self.count_check-=1 model.setData(index,index.data(QtCore.Qt.CheckStateRole),QtCore.Qt.UserRole + QtCore.Qt.CheckStateRole) print self.count_check self.launch_btn.setEnabled(self.count_check>0)