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. [SOLVED] Determining coordinates for Custom Completer
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Determining coordinates for Custom Completer

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.3k 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.
  • R Offline
    R Offline
    ranger0
    wrote on last edited by
    #1

    Hi,

    I´m trying to develop my own completer using QListView.

    In order get it positioned near my combobox I tryed to get it´s coordinates through geometry() function.

    This combobox is inside a QGridLayout.

    The function geometry is retrieving "0" as the position of the combobox, which isn´t true.

    Does anyone know how to get this information?

    Thanks.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      can you give us a sample screenshot of your gui?

      AFAIK, geometry returns QRect containing x,y,height,width. which is i think always correct (unless you show us an image)

      There are other convenient functions that you can use:
      pos();
      x();
      y();
      height();
      width();

      The output of these functions can verify the output of your geometry().

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ranger0
        wrote on last edited by
        #3

        Hi,

        Problem solved...

        It seems that if you call these functions before show() these values aren´t defined yet.

        I just moved this code out from the constructor and it works!

        Thanks!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DerManu
          wrote on last edited by
          #4

          You should retrieve the combobox position every time the completer shall pop up and update the list view's coordinates accordingly. Taking and setting the position once in the combobox or mainwindow show() isn't enough. The combobox might change its position (think of rearranging, resizing,...)

          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