* 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 <extdef.h>
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
-const float Ruler::RulerHeight = 2.5f; // x Text Height
+const float Ruler::RulerHeight = 2.5f; // x Text Height
const int Ruler::MinorTickSubdivision = 4;
-const float Ruler::HoverArrowSize = 0.5f; // x Text Height
+const float Ruler::HoverArrowSize = 0.5f; // x Text Height
Ruler::Ruler(View &parent) :
MarginWidget(parent)
void Ruler::paintEvent(QPaintEvent*)
{
if (!tick_position_cache_) {
- auto ffunc = [this](const pv::util::Timestamp& t)
- {
+ auto ffunc = [this](const pv::util::Timestamp& t) {
return format_time_with_distance(
this->view_.tick_period(),
t,
this->view_.tick_precision());
};
- tick_position_cache_.emplace(calculate_tick_positions(
+ tick_position_cache_ = calculate_tick_positions(
view_.tick_period(),
view_.offset(),
view_.scale(),
width(),
- ffunc));
+ ffunc);
}
const int ValueMargin = 3;
return tp;
}
-void Ruler::mouseDoubleClickEvent(QMouseEvent *e)
+void Ruler::mouseDoubleClickEvent(QMouseEvent *event)
{
- view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
+ view_.add_flag(view_.offset() + ((double)event->x() + 0.5) * view_.scale());
}
void Ruler::draw_hover_mark(QPainter &p, int text_height)
invalidate_tick_position_cache();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv