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. QgsProjectionSelectionWidget select no projection issue in PyQt5

QgsProjectionSelectionWidget select no projection issue in PyQt5

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 978 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.
  • A Offline
    A Offline
    ashu6397
    wrote on last edited by
    #1

    I am trying to override the original (invalid projection) value in the mqgsprojectionselectionwidget to no projection selected, but I don't know what functions would be needed! I am using pyqt5 to display plugin in QGIS 3.0

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      I think its better to ask in QGIS forum.
      QGIS is not part of Qt so you have to have huge luck that someone knows the answer here.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        ashu6397
        wrote on last edited by
        #3

        Okay, thanks for the reply

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ashu6397
          wrote on last edited by ashu6397
          #4

          So I managed to figure it out using the c++ source file for QgsProjectionSelectionWidget(https://qgis.org/api/qgsprojectionselectionwidget_8cpp_source.html)

          mQgsProjectionSelectionWidget.setOptionVisible(mQgsProjectionSelectionWidget.CrsNotSet,True)

          #Sets whether a predefined CRS option should be shown in the widget.

          mQgsProjectionSelectionWidget.setNotSetText('Use default projection')

          #Sets the text to show for the not set option. Note that this option is not shown by default and must be set visible by calling setOptionVisible().

          1 Reply Last reply
          2
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Thank you for reporting back.

            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