* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "timemarker.hpp"
#include <QLineEdit>
#include <QMenu>
-#include <libsigrok/libsigrok.hpp>
+#include <libsigrokcxx/libsigrokcxx.hpp>
#include <pv/widgets/popup.hpp>
using std::shared_ptr;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor Flag::FillColour(0x73, 0xD2, 0x16);
-Flag::Flag(View &view, double time, const QString &text) :
+Flag::Flag(View &view, const pv::util::Timestamp& time, const QString &text) :
TimeMarker(view, FillColour, time),
text_(text)
{
Flag::Flag(const Flag &flag) :
TimeMarker(flag.view_, FillColour, flag.time_),
- std::enable_shared_from_this<pv::view::Flag>(flag)
+ std::enable_shared_from_this<Flag>(flag)
{
}
pv::widgets::Popup* Flag::create_popup(QWidget *parent)
{
- pv::widgets::Popup *const popup = TimeMarker::create_popup(parent);
+ using pv::widgets::Popup;
+
+ Popup *const popup = TimeMarker::create_popup(parent);
+ popup->set_position(parent->mapToGlobal(
+ point(parent->rect())), Popup::Bottom);
+
QFormLayout *const form = (QFormLayout*)popup->layout();
QLineEdit *const text_edit = new QLineEdit(popup);
view_.time_item_appearance_changed(true, false);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv