将QLCDNumber文本向右对齐

时间:2018-11-17 19:20:12

标签: python pyqt qlcdnumber

我有QGridLayout,其中我插入QLCDNumber如下:

self.mainLayout.addWidget(display, 0, 0, 1 , 5)

一切都很好,但是在缩放窗口时,数字(默认为0)从中心向右“移动”。有人可以给我一个提示,如何防止QLCDNumber缩放,并使其中的文本向右对齐?

1 个答案:

答案 0 :(得分:0)

尝试一下:

// insert
String sql = "INSERT INTO matches (id, status, home_team_id, away_team_id, home_goals, away_goals) VALUES (?, ?, ?, ?, ?, ?)";

System.out.println( match.getId() ); // 233028
System.out.println( match.getStatus() ); // FINISHED
System.out.println( match.getHomeTeam().getId() ); // 66
System.out.println( match.getAwayTeam().getId() ); // 338
System.out.println( match.getHomeGoals() ); // 2 
System.out.println( match.getAwayGoals() ); // 1

jdbcTemplate.update(
    sql, 
    match.getId(),
    match.getStatus(),
    match.getHomeTeam().getId(),
    match.getAwayTeam().getId(),
    match.getHomeGoals(),
    match.getAwayGoals()
);

enter image description here